From 77547e85cac1f2e9a02e770fb8dfb603d236c67a Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 11 十二月 2024 11:50:36 +0800
Subject: [PATCH] 1、取水口年月水量统计、农户年月用水量统计、取水口漏损年月统计存在bug,进行了修改; 2、生成新的pipIrr-web-temp临时任务模块,执行一些临时任务,例如删除数据库中一些出错的数据。

---
 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java
index aecf2fa..0fa3e7e 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java
@@ -39,12 +39,19 @@
         List<VoIntakeAmountStatistics> list = rmIntakeAmountDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ;
         if(list != null && list.size() > 0){
             for(VoIntakeAmountStatistics vo : list){
-                StIntakeAmountMonth po = new StIntakeAmountMonth() ;
+                StIntakeAmountMonth po = this.stIntakeAmountMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ;
+                if(po == null){
+                    po = new StIntakeAmountMonth() ;
+                }
                 po.intakeId = vo.intakeId ;
                 po.year = statisticsYear ;
                 po.month = statisticsMonth ;
                 po.amount = vo.amount;
-                stIntakeAmountMonthDao.insert(po) ;
+                if(po.id == null) {
+                    stIntakeAmountMonthDao.insert(po);
+                }else{
+                    stIntakeAmountMonthDao.updateByPrimaryKey(po) ;
+                }
             }
         }
     }
@@ -57,11 +64,18 @@
         List<VoIntakeAmountStatistics> list = stIntakeAmountMonthDao.statisticsByIntake(statisticsYear) ;
         if(list != null && list.size() > 0){
             for(VoIntakeAmountStatistics vo : list){
-                StIntakeAmountYear po = new StIntakeAmountYear() ;
+                StIntakeAmountYear po = stIntakeAmountYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ;
+                if(po == null){
+                    po = new StIntakeAmountYear() ;
+                }
                 po.intakeId = vo.intakeId ;
                 po.year = statisticsYear ;
                 po.amount = vo.amount;
-                stIntakeAmountYearDao.insert(po) ;
+                if(po.id == null){
+                    stIntakeAmountYearDao.insert(po) ;
+                }else{
+                    stIntakeAmountYearDao.updateByPrimaryKey(po) ;
+                }
             }
         }
     }

--
Gitblit v1.8.0