luofl
2025-02-20 e4eaabefaaa2ca95f809c47a11712c3bee56e1b5
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
@@ -78,9 +78,22 @@
        List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList1(balanceChangeRecord);
        List<WalletStatisticsDetail> walletStatisticsDetailList = new ArrayList<>();
        BigDecimal totalWithdraw = BigDecimal.ZERO;
        for (BalanceChangeRecord changeRecord : balanceChangeRecordList) {
            WalletStatisticsDetail walletStatisticsDetail = new WalletStatisticsDetail();
            BeanUtils.copyBeanProp(walletStatisticsDetail, changeRecord);
            BigDecimal beforeAmount = changeRecord.getBeforeAmount();
            BigDecimal afterAmount = changeRecord.getAfterAmount();
            if (beforeAmount.compareTo(afterAmount) < 0 && changeRecord.getChangeType().equals(2)){
                BigDecimal changeAmount = changeRecord.getChangeAmount();
                totalWithdraw = totalWithdraw.add(changeAmount);
                walletStatisticsDetail.setFlag(2);
            }else {
                walletStatisticsDetail.setFlag(1);
            }
            walletStatisticsDetailList.add(walletStatisticsDetail);
        }
        // 按时间排序(倒序)
@@ -113,12 +126,12 @@
                ));
        BigDecimal totalRecharge = shopCommissionMap.get(1);
        BigDecimal totalWithdraw = shopCommissionMap.get(2);
        BigDecimal totalShopWithdraw = shopCommissionMap.get(7);
        List<WalletStatisticsDetail> walletStatisticsDetailList2 = walletStatisticsDetailList.subList(fromIndex, toIndex);
        for (WalletStatisticsDetail changeRecord : walletStatisticsDetailList2) {
            if (changeRecord.getChangeType().equals(1) || changeRecord.getChangeType().equals(3) || changeRecord.getChangeType().equals(4) || changeRecord.getChangeType().equals(6)) {
            Integer flag = changeRecord.getFlag();
            if (flag.equals(1)){
                changeRecord.setChangeAmountString("+¥" + changeRecord.getChangeAmount());
            } else {
                changeRecord.setChangeAmountString("-¥" + changeRecord.getChangeAmount());