From e29ff6ff2de584854531e443ed4d8da0347e08bd Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 16 十二月 2024 10:40:59 +0800
Subject: [PATCH] 优化接口 小程序下的获得全部取水口接口与项目管理下的获得全部取水口接口同步
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClientSv.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/StClientSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClientSv.java
index e453ab8..000b497 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClientSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClientSv.java
@@ -37,12 +37,19 @@
List<VoClientAmountStatistics> list = rmClientAmountDayDao.statisticsByClient(statisticsStartId, statisticsEndId) ;
if(list != null && list.size() > 0){
for(VoClientAmountStatistics vo : list){
- StClientAmountMonth po = new StClientAmountMonth() ;
+ StClientAmountMonth po = stClientAmountMonthDao.selectByClientIdAndYearAndMonth(vo.clientId, statisticsYear, statisticsMonth) ;
+ if(po == null) {
+ po = new StClientAmountMonth();
+ }
po.clientId = vo.clientId ;
po.year = statisticsYear ;
po.month = statisticsMonth ;
po.amount = vo.amount;
- stClientAmountMonthDao.insert(po) ;
+ if(po.id == null) {
+ stClientAmountMonthDao.insert(po);
+ }else{
+ stClientAmountMonthDao.updateByPrimaryKey(po) ;
+ }
}
}
}
@@ -55,11 +62,18 @@
List<VoClientAmountStatistics> list = stClientAmountMonthDao.statisticsByClient(statisticsYear) ;
if(list != null && list.size() > 0){
for(VoClientAmountStatistics vo : list){
- StClientAmountYear po = new StClientAmountYear() ;
+ StClientAmountYear po = stClientAmountYearDao.selectByClientIdAndYear(vo.clientId, statisticsYear) ;
+ if(po == null) {
+ po = new StClientAmountYear();
+ }
po.clientId = vo.clientId ;
po.year = statisticsYear ;
po.amount = vo.amount;
- stClientAmountYearDao.insert(po) ;
+ if(po.id == null) {
+ stClientAmountYearDao.insert(po);
+ }else{
+ stClientAmountYearDao.updateByPrimaryKey(po) ;
+ }
}
}
}
--
Gitblit v1.8.0