无关风月
2025-01-14 11177239df4553870efee599fb8cd0d6baa4213f
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WalletServiceImpl.java
@@ -43,17 +43,15 @@
        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;
    }