| | |
| | | |
| | | DappMemberEntity memberEntity = dappMemberDao.selectById(member.getId()); |
| | | BigDecimal usdtBalance = memberEntity.getUsdtBalance(); |
| | | if(BigDecimal.ZERO.compareTo(usdtBalance) >= 0){ |
| | | throw new FebsException("额度不足"); |
| | | } |
| | | if(1 != memberEntity.getNodeType()){ |
| | | if(BigDecimal.ZERO.compareTo(usdtBalance) >= 0){ |
| | | throw new FebsException("额度不足"); |
| | | } |
| | | |
| | | if(BigDecimal.ZERO.compareTo(withdrawDto.getAmount()) >= 0){ |
| | | throw new FebsException("请输入正确的数量"); |
| | | if(BigDecimal.ZERO.compareTo(withdrawDto.getAmount()) >= 0){ |
| | | throw new FebsException("请输入正确的数量"); |
| | | } |
| | | if(withdrawDto.getAmount().compareTo(usdtBalance) > 0){ |
| | | throw new FebsException("额度不足"); |
| | | } |
| | | }else{ |
| | | if(BigDecimal.ZERO.compareTo(withdrawDto.getAmount()) >= 0){ |
| | | throw new FebsException("请输入正确的数量"); |
| | | } |
| | | } |
| | | if(withdrawDto.getAmount().compareTo(usdtBalance) > 0){ |
| | | throw new FebsException("额度不足"); |
| | | } |
| | | |
| | | // List<MemberCoinWithdrawEntity> memberCoinWithdrawEntities = memberCoinWithdrawDao.selectListByDate(member.getId(),new Date()); |
| | | // if(CollUtil.isNotEmpty(memberCoinWithdrawEntities)){ |
| | | // throw new FebsException("今日已提现"); |
| | |
| | | BigDecimal feeAmount = withdrawDto.getAmount().multiply(withdrawPercent).setScale(2, BigDecimal.ROUND_DOWN); |
| | | |
| | | updateWalletCoinWithLock(withdrawDto.getAmount(), member.getId(), 2); |
| | | |
| | | memberEntity.setUsdtBalance(usdtBalance.subtract(withdrawDto.getAmount()).setScale(2,BigDecimal.ROUND_DOWN)); |
| | | dappMemberDao.updateById(memberEntity); |
| | | if(1 != memberEntity.getNodeType()){ |
| | | memberEntity.setUsdtBalance(usdtBalance.subtract(withdrawDto.getAmount()).setScale(2,BigDecimal.ROUND_DOWN)); |
| | | dappMemberDao.updateById(memberEntity); |
| | | } |
| | | |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity( |
| | | member.getId(), |