From cbf2486983b77a27af9968bbb362cb8d43789115 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 26 三月 2025 15:30:53 +0800
Subject: [PATCH] 修改统计bug和部分功能修改

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
index 4d56027..8fb928f 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopBalanceStatementController.java
@@ -226,7 +226,15 @@
                 .eq(ShopBalanceStatementCopy::getObjectId, orderId));
         return R.ok();
     }
-
+    
+    
+    
+    @DeleteMapping("/deleteShopBalanceStatementCopyByIds")
+    public R<Boolean> deleteShopBalanceStatementCopyByIds(@RequestParam("ids") List<Long> ids){
+        shopBalanceStatementCopyMapper.deleteBatchIds(ids);
+        return R.ok();
+    }
+    
 
     @PostMapping("/getShopBalanceStatementCopy")
     public R<List<ShopBalanceStatementCopy>> getShopBalanceStatementCopy(@RequestParam("orderId") Long orderId, @RequestParam("type") List<Integer> type) {
@@ -259,6 +267,13 @@
                 .between(ShopBalanceStatement::getCreateTime, date.with(LocalTime.MIN), date.with(LocalTime.MAX));
         if (null != shopId && 0 != shopId) {
             queryWrapper.eq(ShopBalanceStatement::getShopId, shopId);
+        }else{
+            List<Integer> shipIds = shopService.list(new LambdaQueryWrapper<Shop>().eq(Shop::getDelFlag, 0)).stream().map(Shop::getId).collect(Collectors.toList());
+            if(shipIds.size() > 0){
+                queryWrapper.in(ShopBalanceStatement::getShopId, shipIds);
+            }else{
+                queryWrapper.eq(ShopBalanceStatement::getShopId, -1);
+            }
         }
         List<ShopBalanceStatement> list = shopBalanceStatementService.list(queryWrapper);
         return R.ok(list);
@@ -372,9 +387,7 @@
             detail.setTime(copy.getCreateTime());
             detail.setAmount(copy.getVariableAmount());
 
-            BigDecimal beforeAmount = copy.getHistoricalBalance();
-            BigDecimal afterAmount = copy.getBalance();
-            if (beforeAmount.compareTo(afterAmount) > 0) {
+            if (copy.getChangeDirection() == -1) {
                 detail.setType(2);
             } else {
                 detail.setType(1);
@@ -388,9 +401,7 @@
             detail.setTime(statement.getCreateTime());
             detail.setAmount(statement.getVariableAmount());
 
-            BigDecimal beforeAmount = statement.getHistoricalBalance();
-            BigDecimal afterAmount = statement.getBalance();
-            if (beforeAmount.compareTo(afterAmount) > 0) {
+            if (statement.getChangeDirection() == -1) {
                 detail.setType(2);
             } else {
                 detail.setType(1);

--
Gitblit v1.7.1