From 2a64b537e8e3bce9ce030585a3da17d48379c0ad Mon Sep 17 00:00:00 2001 From: sfd <sun.sunshine@163.com> Date: 星期一, 26 五月 2025 15:04:45 +0800 Subject: [PATCH] 修改json类型转换错误 --- aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsGasPipelineCapacityPlanServiceImpl.java | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 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 0f16f88..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 @@ -101,7 +101,7 @@ @SneakyThrows @Override @Transactional(rollbackFor = Exception.class) - public void copyPlan(String date, String factory, String toStart, String toEnd) { + public void copyPlan(String date, String factory, String major, String toStart, String toEnd) { String[] dtSrc = date.split("-"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); @@ -116,24 +116,32 @@ plan.setYear(Integer.valueOf(dtSrc[0]).toString()); plan.setMonth(Integer.valueOf(dtSrc[1]).toString()); 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) + ""; apsGasPipelineCapacityPlanMapper.deleteByDateAndFactory( year, month, - factory + factory, + major ); templatePlans.forEach(p -> { + 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