fix
Helius
2022-08-28 5a26ae55ee250050543db0948a6f22616d520d45
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -171,13 +171,18 @@
    public BigDecimal calPrice(PriceDto priceDto) {
        String priceStr = redisUtils.getString(AppContants.REDIS_KEY_TFC_NEW_PRICE);
        return priceDto.getAmount().multiply(new BigDecimal("0.1")).multiply(new BigDecimal(priceStr));
        return priceDto.getAmount().multiply(new BigDecimal("0.1")).divide(new BigDecimal(priceStr), 2, RoundingMode.HALF_UP);
    }
    @Override
    public void withdraw(WithdrawDto withdrawDto) {
        DappMemberEntity member = LoginUserUtil.getAppUser();
        DappWalletCoinEntity walletCoin = dappWalletCoinDao.selectByMemberId(member.getId());
        if (walletCoin.getAvailableAmount().compareTo(withdrawDto.getAmount()) < 0) {
            throw new FebsException("Balance Not Enough");
        }
        updateWalletCoinWithLock(withdrawDto.getAmount().negate(), member.getId());
        updateWalletMineWithLock(withdrawDto.getFee().negate(), member.getId());