From d3e9a09cb54017a8063e5bfe3ace5012f66f3130 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 25 三月 2025 18:34:34 +0800
Subject: [PATCH] 修改统计bug

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java
index 873101a..b5ab210 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java
@@ -131,11 +131,26 @@
         LoginUser loginUser = tokenService.getLoginUser();
         SysUser sysUser = sysUserClient.getSysUser(loginUser.getUserid()).getData();
         Shop byId = shopService.getById(sysUser.getObjectId());
-        List<ShopWithdraw> list = shopWithdrawService.lambdaQuery().eq(ShopWithdraw::getShopId, sysUser.getObjectId())
-                .eq(ShopWithdraw::getAuditStatus, 0).list();
+        List<ShopWithdraw> list = shopWithdrawService.lambdaQuery()
+                .eq(ShopWithdraw::getShopId, sysUser.getObjectId())
+                .list();
+
+
         if (!list.isEmpty()){
-            BigDecimal bigDecimal = list.stream().map(ShopWithdraw::getMoney).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
+            // 待审核列表
+            List<ShopWithdraw> toBeReviewList = list.stream()
+                    .filter(s -> s.getAuditStatus() == 0)
+                    .collect(Collectors.toList());
+            // 审核通过列表
+            List<ShopWithdraw> passedReviewList = list.stream()
+                    .filter(s -> s.getAuditStatus() == 1)
+                    .collect(Collectors.toList());
+
+            BigDecimal bigDecimal = toBeReviewList.stream().map(ShopWithdraw::getMoney).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
             byId.setWithdrawAuditMoney(bigDecimal);
+
+            BigDecimal bigDecimal1 = passedReviewList.stream().map(ShopWithdraw::getMoney).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
+            byId.setWithdrawMoney(bigDecimal1);
         }else {
             byId.setWithdrawAuditMoney(BigDecimal.ZERO);
         }

--
Gitblit v1.7.1