From 3d24cd1458df38d6556c33f9b513b8f4df976626 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 01 十一月 2024 17:09:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
index 984a48e..5661ba5 100644
--- a/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
+++ b/ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TAccountingStrategyController.java
@@ -164,7 +164,10 @@
                 dto.setAuditStatus(1);
                 accountingStrategyService.updateById(dto);
                 // 添加明细
-                dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId()));
+                dto.getAccountingStrategyDetails().forEach(detail -> {
+                    detail.setAccountingStrategyId(dto.getId());
+                    detail.setId(null);
+                });
                 accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails());
             }else {
                 Long userId = SecurityUtils.getLoginUser().getUserid();
@@ -188,7 +191,10 @@
             dto.setAuditStatus(1);
             accountingStrategyService.updateById(dto);
             // 添加明细
-            dto.getAccountingStrategyDetails().forEach(detail -> detail.setAccountingStrategyId(dto.getId()));
+            dto.getAccountingStrategyDetails().forEach(detail -> {
+                detail.setAccountingStrategyId(dto.getId());
+                detail.setId(null);
+            });
             accountingStrategyDetailService.saveBatch(dto.getAccountingStrategyDetails());
         }
         

--
Gitblit v1.7.1