fix
Helius
2022-08-28 daa26405c4ada3e9cc2c234bcfedd1c996bdcbb9
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -171,7 +171,11 @@
    public BigDecimal calPrice(PriceDto priceDto) {
        String priceStr = redisUtils.getString(AppContants.REDIS_KEY_TFC_NEW_PRICE);
        return priceDto.getAmount().multiply(new BigDecimal("0.1")).divide(new BigDecimal(priceStr), 2, RoundingMode.HALF_UP);
        BigDecimal amount = priceDto.getAmount();
        if (priceDto.getAmount() == null) {
            amount = BigDecimal.ZERO;
        }
        return amount.multiply(new BigDecimal("0.1")).divide(new BigDecimal(priceStr), 2, RoundingMode.HALF_UP);
    }
    @Override
@@ -183,6 +187,11 @@
            throw new FebsException("Balance Not Enough");
        }
        DappWalletMineEntity walletMine = dappWalletMineDao.selectByMemberId(member.getId());
        if (walletMine.getAvailableAmount().compareTo(withdrawDto.getFee()) < 0) {
            throw new FebsException("TFC Not Enough");
        }
        updateWalletCoinWithLock(withdrawDto.getAmount().negate(), member.getId());
        updateWalletMineWithLock(withdrawDto.getFee().negate(), member.getId());