From bc765225b2283e05b64d0c5bf5894753c71b922b Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 27 十二月 2024 11:32:43 +0800 Subject: [PATCH] 农户用水月年统计遗漏了金额赋值 --- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 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 0fa3e7e..3d6e9c7 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 @@ -5,9 +5,7 @@ import com.dy.pipIrrGlobal.daoSt.StIntakeAmountYearMapper; import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth; import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear; -import com.dy.pipIrrGlobal.pojoSt.StLossYear; import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics; -import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -32,14 +30,19 @@ protected StIntakeAmountYearMapper stIntakeAmountYearDao ; /** - * 鏈堢粺璁�---婕忔崯 + * 鏈堢粺璁�---鍙栨按鍙g敤姘撮噺 */ @Transactional protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){ List<VoIntakeAmountStatistics> list = rmIntakeAmountDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ; if(list != null && list.size() > 0){ for(VoIntakeAmountStatistics vo : list){ - StIntakeAmountMonth po = this.stIntakeAmountMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ; + List<StIntakeAmountMonth> listOfMonth = this.stIntakeAmountMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ; + StIntakeAmountMonth po = null ; + if(listOfMonth != null && listOfMonth.size() > 0) { + //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞� + po = listOfMonth.get(0); + } if(po == null){ po = new StIntakeAmountMonth() ; } @@ -57,14 +60,19 @@ } /** - * 骞寸粺璁�---婕忔崯 + * 骞寸粺璁�---鍙栨按鍙g敤姘撮噺 */ @Transactional protected void statisticsYear(Integer statisticsYear){ List<VoIntakeAmountStatistics> list = stIntakeAmountMonthDao.statisticsByIntake(statisticsYear) ; if(list != null && list.size() > 0){ for(VoIntakeAmountStatistics vo : list){ - StIntakeAmountYear po = stIntakeAmountYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ; + List<StIntakeAmountYear> listOfYear = stIntakeAmountYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ; + StIntakeAmountYear po = null ; + if(listOfYear != null && listOfYear.size() > 0) { + //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞� + po = listOfYear.get(0); + } if(po == null){ po = new StIntakeAmountYear() ; } -- Gitblit v1.8.0