| | |
| | | public Result getWalletCoin() {
|
| | | //获取用户ID
|
| | | Long memberId = LoginUserUtils.getAppLoginUser().getId();
|
| | | // Long memberId = 444L;
|
| | | PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
|
| | |
|
| | |
| | | for (MemberWalletCoinEntity memberWalletCoinEntity : memberWalletCoinlist) {
|
| | | if ("USDT".equals(memberWalletCoinEntity.getWalletCode()) || "XCH".equals(memberWalletCoinEntity.getWalletCode())) {
|
| | | MemberWalletCoinInfoVo memberWalletCoinInfoVo = new MemberWalletCoinInfoVo();
|
| | | memberWalletCoinInfoVo.setAvailableBalance(memberWalletCoinEntity.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinInfoVo.setFrozenBalance(memberWalletCoinEntity.getFrozenBalance().setScale(4, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinInfoVo.setAvailableBalance(memberWalletCoinEntity.getAvailableBalance().setScale(8, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinInfoVo.setFrozenBalance(memberWalletCoinEntity.getFrozenBalance().setScale(8, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinInfoVo.setMemberId(memberWalletCoinEntity.getMemberId());
|
| | | memberWalletCoinInfoVo.setTotalBalance(memberWalletCoinEntity.getTotalBalance().setScale(4, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinInfoVo.setTotalBalance(memberWalletCoinEntity.getTotalBalance().setScale(8, BigDecimal.ROUND_DOWN));
|
| | | memberWalletCoinInfoVo.setWalletCode(memberWalletCoinEntity.getWalletCode());
|
| | | memberWalletCoinInfoVolist.add(memberWalletCoinInfoVo);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | if ("XCH".equals(walletCoin.getWalletCode())) {
|
| | | BigDecimal xch = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
|
| | | String xchNewPrice = redisUtils.getString("XCH_NEW_PRICE");
|
| | | BigDecimal totalUsdt = xch.add(new BigDecimal(xchNewPrice));
|
| | | BigDecimal totalCny = totalUsdt.multiply(cnyUsdt);
|
| | | walletCoin.setTotalBalance(totalCny);
|
| | | // BigDecimal xch = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
|
| | | // String xchNewPrice = redisUtils.getString("XCH_NEW_PRICE");
|
| | | // BigDecimal totalUsdt = xch.add(new BigDecimal(xchNewPrice));
|
| | | // BigDecimal totalCny = totalUsdt.multiply(cnyUsdt);
|
| | | // walletCoin.setTotalBalance(totalCny);
|
| | |
|
| | | BigDecimal amount = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
|
| | | // 获取最新价
|
| | | BigDecimal closePrice = new BigDecimal(redisUtils.getString("XCH_NEW_PRICE"));
|
| | | BigDecimal totalUsdt = BigDecimal.ZERO;
|
| | | totalUsdt = totalUsdt.add(amount.multiply(closePrice));
|
| | | totalUsdts = totalUsdts.add(totalUsdt);
|
| | | walletCoin.setTotalBalance(totalUsdt.multiply(cnyUsdt));
|
| | | }
|
| | | // else {
|
| | | // BigDecimal amount = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
|
| | |
| | | public Result getAllWalletCoin() {
|
| | | //获取【币币】
|
| | | Long memberId = LoginUserUtils.getAppLoginUser().getId();
|
| | | // Long memberId =446L;
|
| | | PlatformCnyUsdtExchangeEntity cnyUsdtExchange = cnyUsdtExchangeDao.getCNYAndUSDTOne();
|
| | | BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
|
| | | AllWalletCoinVo allWalletCoinVo = new AllWalletCoinVo();
|
| | |
| | | for(MemberCoinChargeEntity memberCoinChargeEntitys : records) {
|
| | | CoinInListVo coinInListVo = new CoinInListVo();
|
| | | coinInListVo.setSymbol(memberCoinChargeEntitys.getSymbol());
|
| | | coinInListVo.setAmount(memberCoinChargeEntitys.getAmount());
|
| | | coinInListVo.setAmount(memberCoinChargeEntitys.getAmount().toPlainString());
|
| | | coinInListVo.setContent("充币");
|
| | | coinInListVo.setStatus(memberCoinChargeEntitys.getStatus());
|
| | | coinInListVo.setUpdateTime(memberCoinChargeEntitys.getUpdateTime());
|
| | |
| | | for(MemberCoinWithdrawEntity memberCoinWithdrawEntitys : records) {
|
| | | CoinInListVo coinInListVo = new CoinInListVo();
|
| | | coinInListVo.setSymbol(memberCoinWithdrawEntitys.getSymbol());
|
| | | coinInListVo.setAmount(memberCoinWithdrawEntitys.getAmount());
|
| | | coinInListVo.setAmount(memberCoinWithdrawEntitys.getAmount().toPlainString());
|
| | | coinInListVo.setContent("提币");
|
| | | int status = memberCoinWithdrawEntitys.getStatus();
|
| | | int statusOut = 0;
|
| | |
| | | for(MemberAccountMoneyChange memberAccountMoneyChanges : records) {
|
| | | CoinInListVo coinInListVo = new CoinInListVo();
|
| | | coinInListVo.setSymbol(memberAccountMoneyChanges.getSymbol());
|
| | | coinInListVo.setAmount(memberAccountMoneyChanges.getAmount());
|
| | | coinInListVo.setAmount(memberAccountMoneyChanges.getAmount().toPlainString());
|
| | | coinInListVo.setContent(memberAccountMoneyChanges.getContent());
|
| | | coinInListVo.setStatus(memberAccountMoneyChanges.getStatus());
|
| | | coinInListVo.setUpdateTime(memberAccountMoneyChanges.getUpdateTime());
|
| | |
| | | for(MemberAccountMoneyChange memberAccountMoneyChanges : records) {
|
| | | CoinInListVo coinInListVo = new CoinInListVo();
|
| | | coinInListVo.setSymbol(memberAccountMoneyChanges.getSymbol());
|
| | | coinInListVo.setAmount(memberAccountMoneyChanges.getAmount());
|
| | | coinInListVo.setAmount(memberAccountMoneyChanges.getAmount().toPlainString());
|
| | | coinInListVo.setContent(memberAccountMoneyChanges.getContent());
|
| | | coinInListVo.setStatus(memberAccountMoneyChanges.getStatus());
|
| | | coinInListVo.setUpdateTime(memberAccountMoneyChanges.getUpdateTime());
|