| | |
| | | import java.util.List;
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.xcong.excoin.modules.platform.entity.PlatformCnyUsdtExchangeEntity;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
| | |
| | | import com.xcong.excoin.common.enumerates.MemberWalletCoinEnum;
|
| | | import com.xcong.excoin.common.response.Result;
|
| | | import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao;
|
| | | import com.xcong.excoin.modules.coin.entity.CnyUsdtExchange;
|
| | | import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange;
|
| | | import com.xcong.excoin.modules.coin.parameter.vo.MemberAccountMoneyChangeInfoVo;
|
| | | import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletAgentInfoVo;
|
| | |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity;
|
| | | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
|
| | | import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
|
| | | import com.xcong.excoin.modules.platform.dao.CnyUsdtExchangeDao;
|
| | | import com.xcong.excoin.modules.platform.dao.PlatformCnyUsdtExchangeDao;
|
| | | import com.xcong.excoin.utils.MessageSourceUtils;
|
| | | import cn.hutool.core.collection.CollUtil;
|
| | | import cn.hutool.core.util.ObjectUtil;
|
| | |
| | | //@Resource
|
| | | //SymbolsService symbolsService;
|
| | | @Resource
|
| | | CnyUsdtExchangeDao cnyUsdtExchangeDao;
|
| | | PlatformCnyUsdtExchangeDao cnyUsdtExchangeDao;
|
| | | @Resource
|
| | | MemberWalletCoinDao memberWalletCoinDao;
|
| | | @Resource
|
| | |
| | | public Result getWalletCoin() {
|
| | | //获取用户ID
|
| | | Long memberId = LoginUserUtils.getAppLoginUser().getId();
|
| | | CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
|
| | |
|
| | | BigDecimal totalUsdts = BigDecimal.ZERO;
|
| | |
| | | MemberWalletCoinVo memberWalletCoinVo = new MemberWalletCoinVo();
|
| | | memberWalletCoinVo.setTotalUsdt(totalUsdts.setScale(4, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinVo.setTotalCny(totalUsdts.multiply(cnyUsdt).setScale(4, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinVo.setMemberWalletCoinInfoVo(memberWalletCoinlist);;
|
| | | memberWalletCoinVo.setMemberWalletCoinInfoVo(memberWalletCoinlist);
|
| | | ;
|
| | | return Result.ok(memberWalletCoinVo);
|
| | | }
|
| | | }
|
| | |
| | | memberWalletCoinInfoVo.setMemberId(memberId);
|
| | | memberWalletCoinInfoVo.setWalletCode(symbol);
|
| | | if(!StrUtil.isEmpty(memberId.toString())) {
|
| | | CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
|
| | | BigDecimal total = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
|
| | |
|
| | |
| | | //获取用户ID
|
| | | Long memberId = LoginUserUtils.getAppLoginUser().getId();
|
| | |
|
| | | CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
|
| | |
|
| | | String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
|
| | |
| | | MemberWalletAgentEntity walletAgent = memberWalletAgentDao.selectWalletAgentBymIdAndCode(memberId, walletCode);
|
| | | BigDecimal availableBalance = walletAgent.getAvailableBalance();
|
| | |
|
| | | CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
|
| | | BigDecimal multiply = availableBalance.multiply(cnyUsdt);
|
| | |
|