| | |
| | | List<WithdrawalRequests> waitAuditList = withdrawalRequestsService.list(new LambdaQueryWrapper<WithdrawalRequests>() |
| | | .eq(WithdrawalRequests::getAppUserId, userId) |
| | | .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT)); |
| | | |
| | | BigDecimal reduce = waitAuditList.stream().map(WithdrawalRequests::getWithdrawalAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | WalletVO walletVO = new WalletVO(); |
| | | walletVO.setWithdrawalAmount(appUser.getWithdrawableAmount()); |
| | | walletVO.setWithdrawnAmount(appUser.getWithdrawnAmount()); |
| | | walletVO.setWithdrawnAmount(appUser.getWithdrawnAmount().subtract(reduce)); |
| | | walletVO.setVipWithdrawalMinAmount(data.getVipWithdrawalMinAmount()); |
| | | walletVO.setTotalRechargeAmount(appUser.getTotalRechargeAmount()); |
| | | walletVO.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount()); |
| | | walletVO.setTotalDistributionAmount(appUser.getTotalDistributionAmount()); |
| | | walletVO.setAuditAmount(waitAuditList.stream() |
| | | .map(WithdrawalRequests::getWithdrawalAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | walletVO.setAuditAmount(reduce); |
| | | walletVO.setBalance(appUser.getBalance()); |
| | | return walletVO; |
| | | } |