Helius
2020-05-28 d775bb5dacca4c6ff33c65a0cb891f5992cc1bed
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
@@ -5,6 +5,7 @@
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;
@@ -13,7 +14,6 @@
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;
@@ -27,7 +27,7 @@
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;
@@ -39,7 +39,7 @@
   //@Resource
   //SymbolsService symbolsService;
   @Resource
   CnyUsdtExchangeDao cnyUsdtExchangeDao;
    PlatformCnyUsdtExchangeDao cnyUsdtExchangeDao;
   @Resource
   MemberWalletCoinDao memberWalletCoinDao;
   @Resource
@@ -54,7 +54,7 @@
   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;
@@ -125,7 +125,8 @@
            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);
         }
   }
@@ -141,7 +142,7 @@
         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());
            
@@ -163,7 +164,7 @@
         //获取用户ID
         Long memberId = LoginUserUtils.getAppLoginUser().getId();
         
         CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
        PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
         BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
         
         String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
@@ -500,7 +501,7 @@
      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);