From c9fe1b65bf3b2cf2a935edeb3370f73a55f0ce67 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 10 五月 2025 08:58:19 +0800
Subject: [PATCH] 修改《打包发布配置修改》文档
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StConsumeByIcSv.java | 320 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 320 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StConsumeByIcSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StConsumeByIcSv.java
new file mode 100644
index 0000000..d5e055a
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StConsumeByIcSv.java
@@ -0,0 +1,320 @@
+package com.dy.pipIrrStatistics.statistics;
+
+import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper;
+import com.dy.pipIrrGlobal.daoSt.StConsumeIcDayMapper;
+import com.dy.pipIrrGlobal.daoSt.StConsumeIcMonthMapper;
+import com.dy.pipIrrGlobal.daoSt.StConsumeIcYearMapper;
+import com.dy.pipIrrGlobal.pojoSt.StConsumeIcDay;
+import com.dy.pipIrrGlobal.pojoSt.StConsumeIcMonth;
+import com.dy.pipIrrGlobal.pojoSt.StConsumeIcYear;
+import com.dy.pipIrrGlobal.voSt.VoIcConsumeStatistics;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/25 16:31
+ * @Description
+ */
+@Component
+public class StConsumeByIcSv {
+
+ @Autowired
+ protected RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
+
+ @Autowired
+ protected StConsumeIcDayMapper stConsumeIcDayMapper;
+
+ @Autowired
+ protected StConsumeIcMonthMapper stConsumeIcMonthMapper;
+
+ @Autowired
+ protected StConsumeIcYearMapper stConsumeIcYearMapper;
+
+
+ /**
+ * 鏃ョ粺璁�
+ */
+ @Transactional
+ protected void statisticsDay(Integer statisticsYear, Integer statisticsMonth, Integer statisticsDay, Date statisticsStartDt, Date statisticsEndDt){
+ //浠ョ敤姘存埛鍜孖C涓哄崟浣嶇粺璁℃煇涓�鏃ョ殑鎵�鏈夊厖鍊艰褰�
+ List<VoIcConsumeStatistics> list = rmOpenCloseValveHistoryMapper.statisticsByIc(statisticsStartDt, statisticsEndDt) ;
+ if(list != null && list.size() > 0){
+ for(VoIcConsumeStatistics vo : list){
+ List<StConsumeIcDay> listOfDay = this.stConsumeIcDayMapper.selectByClientAndCardAndYearAndMonth(vo.clientId, vo.cardId, statisticsYear, statisticsMonth) ;
+ StConsumeIcDay po = null ;
+ if(listOfDay != null && listOfDay.size() > 0){
+ //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞�
+ po = listOfDay.get(0) ;
+ }
+ if(po == null){
+ po = new StConsumeIcDay() ;
+ po.clientId = vo.clientId ;
+ po.cardId = vo.cardId ;
+ po.year = statisticsYear ;
+ po.month = statisticsMonth ;
+ }
+ this.setValueOfDayOfMonth(statisticsDay, vo, po);
+ if(po.id == null) {
+ stConsumeIcDayMapper.insert(po);
+ }else{
+ stConsumeIcDayMapper.updateByPrimaryKeySelective(po) ;
+ }
+ }
+ }
+ }
+
+ /**
+ * 鏈堢粺璁�
+ */
+ @Transactional
+ protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth){
+ //浠ョ敤姘存埛鍜孖C涓哄崟浣嶇粺璁℃煇涓�鏈堢殑鎵�鏈夊厖鍊艰褰�
+ List<VoIcConsumeStatistics> list = stConsumeIcDayMapper.statisticsByIc(statisticsYear, statisticsMonth) ;
+ if(list != null && list.size() > 0){
+ for(VoIcConsumeStatistics vo : list){
+ List<StConsumeIcMonth> listOfMonth = this.stConsumeIcMonthMapper.selectByClientAndCardAndYear(vo.clientId, vo.cardId, statisticsYear) ;
+ StConsumeIcMonth po = null ;
+ if(listOfMonth != null && listOfMonth.size() > 0){
+ //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞�
+ po = listOfMonth.get(0) ;
+ }
+ if(po == null){
+ po = new StConsumeIcMonth() ;
+ po.clientId = vo.clientId ;
+ po.cardId = vo.cardId ;
+ po.year = statisticsYear ;
+ }
+ this.setValueOfMonthOfYear(statisticsMonth, vo, po);
+ if(po.id == null) {
+ stConsumeIcMonthMapper.insert(po);
+ }else{
+ stConsumeIcMonthMapper.updateByPrimaryKeySelective(po) ;
+ }
+ }
+ }
+ }
+
+ /**
+ * 骞寸粺璁�
+ */
+ @Transactional
+ protected void statisticsYear(Integer statisticsYear){
+ //浠ョ敤姘存埛鍜孖C涓哄崟浣嶇粺璁℃煇涓�骞寸殑鎵�鏈夊厖鍊艰褰�
+ List<VoIcConsumeStatistics> list = stConsumeIcMonthMapper.statisticsByIc(statisticsYear) ;
+ if(list != null && list.size() > 0){
+ for(VoIcConsumeStatistics vo : list){
+ List<StConsumeIcYear> listOfYear = this.stConsumeIcYearMapper.selectByClientAndCardAndYear(vo.clientId, vo.cardId, statisticsYear) ;
+ StConsumeIcYear po = null ;
+ if(listOfYear != null && listOfYear.size() > 0){
+ //绋嬪簭閫昏緫鎺у埗涓婏紝闆嗗悎涓彧鏈変竴涓璞�
+ po = listOfYear.get(0) ;
+ }
+ if(po == null){
+ po = new StConsumeIcYear() ;
+ po.clientId = vo.clientId ;
+ po.cardId = vo.cardId ;
+ po.year = statisticsYear ;
+ }
+ this.setValueOfYear(vo, po);
+ if(po.id == null) {
+ stConsumeIcYearMapper.insert(po);
+ }else{
+ stConsumeIcYearMapper.updateByPrimaryKeySelective(po) ;
+ }
+ }
+ }
+ }
+
+ private void setValueOfDayOfMonth(Integer statisticsDay, VoIcConsumeStatistics vo, StConsumeIcDay po){
+ switch (statisticsDay) {
+ case 1:
+ po.amount1 = vo.amount;
+ po.times1 = vo.times;
+ break;
+ case 2:
+ po.amount2 = vo.amount;
+ po.times2 = vo.times;
+ break;
+ case 3:
+ po.amount3 = vo.amount;
+ po.times3 = vo.times;
+ break;
+ case 4:
+ po.amount4 = vo.amount;
+ po.times4 = vo.times;
+ break;
+ case 5:
+ po.amount5 = vo.amount;
+ po.times5 = vo.times;
+ break;
+ case 6:
+ po.amount6 = vo.amount;
+ po.times6 = vo.times;
+ break;
+ case 7:
+ po.amount7 = vo.amount;
+ po.times7 = vo.times;
+ break;
+ case 8:
+ po.amount8 = vo.amount;
+ po.times8 = vo.times;
+ break;
+ case 9:
+ po.amount9 = vo.amount;
+ po.times9 = vo.times;
+ break;
+ case 10:
+ po.amount10 = vo.amount;
+ po.times10 = vo.times;
+ break;
+ case 11:
+ po.amount11 = vo.amount;
+ po.times11 = vo.times;
+ break;
+ case 12:
+ po.amount12 = vo.amount;
+ po.times12 = vo.times;
+ break;
+ case 13:
+ po.amount13 = vo.amount;
+ po.times13 = vo.times;
+ break;
+ case 14:
+ po.amount14 = vo.amount;
+ po.times14 = vo.times;
+ break;
+ case 15:
+ po.amount15 = vo.amount;
+ po.times15 = vo.times;
+ break;
+ case 16:
+ po.amount16 = vo.amount;
+ po.times16 = vo.times;
+ break;
+ case 17:
+ po.amount17 = vo.amount;
+ po.times17 = vo.times;
+ break;
+ case 18:
+ po.amount18 = vo.amount;
+ po.times18 = vo.times;
+ break;
+ case 19:
+ po.amount19 = vo.amount;
+ po.times19 = vo.times;
+ break;
+ case 20:
+ po.amount20 = vo.amount;
+ po.times20 = vo.times;
+ break;
+ case 21:
+ po.amount21 = vo.amount;
+ po.times21 = vo.times;
+ break;
+ case 22:
+ po.amount22 = vo.amount;
+ po.times22 = vo.times;
+ break;
+ case 23:
+ po.amount23 = vo.amount;
+ po.times23 = vo.times;
+ break;
+ case 24:
+ po.amount24 = vo.amount;
+ po.times24 = vo.times;
+ break;
+ case 25:
+ po.amount25 = vo.amount;
+ po.times25 = vo.times;
+ break;
+ case 26:
+ po.amount26 = vo.amount;
+ po.times26 = vo.times;
+ break;
+ case 27:
+ po.amount27 = vo.amount;
+ po.times27 = vo.times;
+ break;
+ case 28:
+ po.amount28 = vo.amount;
+ po.times28 = vo.times;
+ break;
+ case 29:
+ po.amount29 = vo.amount;
+ po.times29 = vo.times;
+ break;
+ case 30:
+ po.amount30 = vo.amount;
+ po.times30 = vo.times;
+ break;
+ case 31:
+ po.amount31 = vo.amount;
+ po.times31 = vo.times;
+ break;
+ }
+ }
+
+ private void setValueOfMonthOfYear(Integer statisticsMonth, VoIcConsumeStatistics vo, StConsumeIcMonth po){
+ switch (statisticsMonth) {
+ case 1:
+ po.amount1 = vo.amount;
+ po.times1 = vo.times;
+ break;
+ case 2:
+ po.amount2 = vo.amount;
+ po.times2 = vo.times;
+ break;
+ case 3:
+ po.amount3 = vo.amount;
+ po.times3 = vo.times;
+ break;
+ case 4:
+ po.amount4 = vo.amount;
+ po.times4 = vo.times;
+ break;
+ case 5:
+ po.amount5 = vo.amount;
+ po.times5 = vo.times;
+ break;
+ case 6:
+ po.amount6 = vo.amount;
+ po.times6 = vo.times;
+ break;
+ case 7:
+ po.amount7 = vo.amount;
+ po.times7 = vo.times;
+ break;
+ case 8:
+ po.amount8 = vo.amount;
+ po.times8 = vo.times;
+ break;
+ case 9:
+ po.amount9 = vo.amount;
+ po.times9 = vo.times;
+ break;
+ case 10:
+ po.amount10 = vo.amount;
+ po.times10 = vo.times;
+ break;
+ case 11:
+ po.amount11 = vo.amount;
+ po.times11 = vo.times;
+ break;
+ case 12:
+ po.amount12 = vo.amount;
+ po.times12 = vo.times;
+ break;
+ }
+ }
+
+ private void setValueOfYear(VoIcConsumeStatistics vo, StConsumeIcYear po){
+ po.amount = vo.amount;
+ po.times = vo.times;
+ }
+}
--
Gitblit v1.8.0