From dfe65c30a3fa372af98e8341ea46b1c4bf7cc725 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 13 十二月 2024 11:35:55 +0800
Subject: [PATCH] 增补属性的json中的顺序
---
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