From 6625b519858f9e92a2bd67d40b101b97869593a6 Mon Sep 17 00:00:00 2001
From: sfd <sun.sunshine@163.com>
Date: 星期四, 22 五月 2025 12:07:39 +0800
Subject: [PATCH] 修改自增ID问题

---
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java
index 543cd6f..49a8da2 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java
@@ -118,6 +118,14 @@
         plan.setOrgCode(factory);
         plan.setMajor(major);
         List<ApsGasPipelineCapacityPlan> templatePlans = apsGasPipelineCapacityPlanMapper.selectApsGasPipelineCapacityPlanList(plan);
+        templatePlans.forEach(p -> {
+            p.setCreateBy(SecurityUtils.getUsername());
+            p.setCreateTime(new Date());
+            p.setUpdateBy(null);
+            p.setUpdateTime(null);
+//                apsGasPipelineCapacityPlanMapper.insertApsGasPipelineCapacityPlan(p);
+        });
+
         while (dtStart.before(dtEnd)) {
             String year = dtStart.get(Calendar.YEAR) + "";
             String month = (dtStart.get(Calendar.MONTH) + 1) + "";
@@ -131,12 +139,9 @@
                 p.setId(null);
                 p.setYear(year);
                 p.setMonth(month);
-                p.setCreateBy(SecurityUtils.getUsername());
-                p.setCreateTime(new Date());
-                p.setUpdateBy(null);
-                p.setUpdateTime(null);
-                apsGasPipelineCapacityPlanMapper.insertApsGasPipelineCapacityPlan(p);
+//                apsGasPipelineCapacityPlanMapper.insertApsGasPipelineCapacityPlan(p);
             });
+            apsGasPipelineCapacityPlanMapper.insert(templatePlans);
 
             dtStart.add(Calendar.MONTH, 1);
         }

--
Gitblit v1.9.3