From c19de84fa332a00c651f28e3a52292fd14f143a1 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 23 九月 2025 17:30:07 +0800
Subject: [PATCH] 陆常丽反应软件系统财务对账时而数据不准确,分析源码,找到bug原因是,财务对账统计只有用户点击后才会触发统计功能,把历史上及当天进行了统计,如果当天统计时未下班,例如是中午触发统计了,而下午又进行了充值售水,但下班后未再点击触发对账统计,那么今天的对账统计完成了但数据不对。编写自动任务,在下半夜进行对账统计。
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 107 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java
new file mode 100644
index 0000000..066894a
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/stClient/StClientCtrl.java
@@ -0,0 +1,107 @@
+package com.dy.pipIrrStatistics.stClient;
+
+import com.dy.common.aop.SsoAop;
+import com.dy.common.util.DateTime;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.common.webUtil.QueryResultVo;
+import com.dy.pipIrrGlobal.voSt.VoStClientAmountDay;
+import com.dy.pipIrrGlobal.voSt.VoStClientAmountMonth;
+import com.dy.pipIrrGlobal.voSt.VoStClientAmountYear;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/30 15:22
+ * @Description
+ */
+@Slf4j
+@RestController
+@RequestMapping(path="stClient")
+@RequiredArgsConstructor
+public class StClientCtrl {
+
+ private static final int startYear4YearStatistics = 2024 ;
+
+ private StClientSv sv ;
+
+ @Autowired
+ private void setSv(StClientSv sv){
+ this.sv = sv ;
+ }
+
+ /**
+ * 鏌ヨ鎸囧畾骞存湀鍐滄埛鍚勬棩鐢ㄦ按閲�
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "/amountOfDay")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoStClientAmountDay>>> amountOfDay(StClientQo qo) throws Exception {
+ String yearMonth = qo.getYearMonth();
+ if(yearMonth == null || yearMonth.trim().equals("")) {
+ return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞存湀涓嶈兘涓虹┖");
+ }
+ int[] ymd = DateTime.yyyy_MM_ymdGroup(yearMonth) ;
+ qo.year = ymd[0] ;
+ qo.month = ymd[1] ;
+ return BaseResponseUtils.buildSuccess(this.sv.selectStClientAmountDay(qo));
+ }
+
+
+ /**
+ * 鏌ヨ鎸囧畾骞村啘鎴峰悇鏈堢敤姘撮噺
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "/amountOfMonth")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoStClientAmountMonth>>> amountOfMonth(StClientQo qo) throws Exception {
+ if(qo.year == null) {
+ return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞村害涓嶈兘涓虹┖");
+ }
+ return BaseResponseUtils.buildSuccess(this.sv.selectStClientAmountMonth(qo));
+ }
+
+
+
+ /**
+ * 鏌ヨ鎸囧畾骞村啘鎴峰悇骞寸敤姘撮噺
+ * @param qo
+ * @return
+ */
+ @GetMapping(path = "/amountOfYear")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoStClientAmountYear>>> amountOfYear(StClientQo qo) throws Exception {
+ List<Integer> yearGrp = new ArrayList<Integer>();
+ int nowYear = Integer.parseInt(DateTime.yyyy()) ;
+ if(qo.year == null) {
+ int startYear = nowYear - 4 ;//鏌�5骞寸殑
+ if(startYear < startYear4YearStatistics){
+ startYear = startYear4YearStatistics ;
+ }
+ for(int i = startYear; i <= nowYear; i++) {
+ yearGrp.add(i) ;
+ }
+ }else{
+ /*
+ if(qo.year > nowYear){
+ qo.year = nowYear;
+ }
+ if(qo.year < startYear4YearStatistics){
+ qo.year = startYear4YearStatistics;
+ }
+ */
+ yearGrp.add(qo.year) ;
+ }
+ return BaseResponseUtils.buildSuccess(this.sv.selectStClientAmountYear(qo, yearGrp));
+ }
+}
--
Gitblit v1.8.0