From 2b6cd5a6e64e00b365707468d600085259d2f069 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 27 十二月 2024 16:13:29 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClientSv.java | 38 ++++++++++++++++++++++++++++++++------
1 files changed, 32 insertions(+), 6 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..2cf0dc1 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
@@ -30,36 +30,62 @@
protected StClientAmountYearMapper stClientAmountYearDao ;
/**
- * 鏈堢粺璁�---婕忔崯
+ * 鏈堢粺璁�---鍐滄埛鐢ㄦ按閲忓強閲戦
*/
@Transactional
protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){
List<VoClientAmountStatistics> list = rmClientAmountDayDao.statisticsByClient(statisticsStartId, statisticsEndId) ;
if(list != null && list.size() > 0){
for(VoClientAmountStatistics vo : list){
- StClientAmountMonth po = new StClientAmountMonth() ;
+ List<StClientAmountMonth> listOfMonth = stClientAmountMonthDao.selectByClientIdAndYearAndMonth(vo.clientId, statisticsYear, statisticsMonth) ;
+ StClientAmountMonth po = null ;
+ if(listOfMonth != null && listOfMonth.size() > 0){
+ //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞�
+ po = listOfMonth.get(0) ;
+ }
+ if(po == null) {
+ po = new StClientAmountMonth();
+ }
po.clientId = vo.clientId ;
po.year = statisticsYear ;
po.month = statisticsMonth ;
po.amount = vo.amount;
- stClientAmountMonthDao.insert(po) ;
+ po.money = vo.money ;
+ if(po.id == null) {
+ stClientAmountMonthDao.insert(po);
+ }else{
+ stClientAmountMonthDao.updateByPrimaryKey(po) ;
+ }
}
}
}
/**
- * 骞寸粺璁�---婕忔崯
+ * 骞寸粺璁�---鍐滄埛鐢ㄦ按閲忓強閲戦
*/
@Transactional
protected void statisticsYear(Integer statisticsYear){
List<VoClientAmountStatistics> list = stClientAmountMonthDao.statisticsByClient(statisticsYear) ;
if(list != null && list.size() > 0){
for(VoClientAmountStatistics vo : list){
- StClientAmountYear po = new StClientAmountYear() ;
+ List<StClientAmountYear> listOfYear = stClientAmountYearDao.selectByClientIdAndYear(vo.clientId, statisticsYear) ;
+ StClientAmountYear po = null ;
+ if(listOfYear != null && listOfYear.size() > 0){
+ //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞�
+ po = listOfYear.get(0) ;
+ }
+ if(po == null) {
+ po = new StClientAmountYear();
+ }
po.clientId = vo.clientId ;
po.year = statisticsYear ;
po.amount = vo.amount;
- stClientAmountYearDao.insert(po) ;
+ po.money = vo.money ;
+ if(po.id == null) {
+ stClientAmountYearDao.insert(po);
+ }else{
+ stClientAmountYearDao.updateByPrimaryKey(po) ;
+ }
}
}
}
--
Gitblit v1.8.0