From 8f992e29ea429cd5c35eea7a376c565bfed7fc8d Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期一, 13 一月 2025 20:19:33 +0800
Subject: [PATCH] 12.18

---
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
index 8f9ef27..1d369a8 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
@@ -82,13 +82,15 @@
         int fromIndex = (int) ((current - 1) * size);
         int toIndex = (int) Math.min(fromIndex + size, walletStatisticsDetailList.size());
 
+
+        Page<WalletStatisticsDetail> walletStatisticsDetailPage = new Page<>();
+        WalletStatistics walletStatistics = new WalletStatistics();
         if (fromIndex >= walletStatisticsDetailList.size()) {
-            throw new ServiceException("页面参数无效");
+            walletStatistics.setPage(walletStatisticsDetailPage);
+            return walletStatistics;
         }
 
-        List<WalletStatisticsDetail> walletStatisticsDetailList2 = walletStatisticsDetailList.subList(fromIndex, toIndex);
-
-        Map<Integer, BigDecimal> shopCommissionMap = walletStatisticsDetailList2.stream()
+        Map<Integer, BigDecimal> shopCommissionMap = walletStatisticsDetailList.stream()
                 .collect(Collectors.groupingBy(
                         WalletStatisticsDetail::getChangeType,
                         Collectors.reducing(
@@ -102,11 +104,11 @@
         BigDecimal totalWithdraw = shopCommissionMap.get(2);
         BigDecimal totalShopWithdraw = shopCommissionMap.get(7);
 
+        List<WalletStatisticsDetail> walletStatisticsDetailList2 = walletStatisticsDetailList.subList(fromIndex, toIndex);
 
-        WalletStatistics walletStatistics = new WalletStatistics();
-        Page<WalletStatisticsDetail> walletStatisticsDetailPage = new Page<>();
         walletStatisticsDetailPage.setCurrent(current);
         walletStatisticsDetailPage.setSize(size);
+        walletStatisticsDetailPage.setTotal(walletStatisticsDetailList.size());
         walletStatisticsDetailPage.setRecords(walletStatisticsDetailList2);
         walletStatistics.setPage(walletStatisticsDetailPage);
         walletStatistics.setTotalRecharge(totalRecharge);

--
Gitblit v1.7.1