From 4b067b4db5c1f2a068d6e27cc138118810785e2d Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 07 五月 2025 10:47:13 +0800
Subject: [PATCH] 1、创建命令生成器模块,实现部分命令数据生成,还需继续实现其他命令; 2、完善代码。

---
 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/loss/LossCtrl.java |   73 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/loss/LossCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/loss/LossCtrl.java
new file mode 100644
index 0000000..2e84f53
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/loss/LossCtrl.java
@@ -0,0 +1,73 @@
+package com.dy.pipIrrStatistics.loss;
+
+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.VoDayLoss;
+import com.dy.pipIrrGlobal.voSt.VoMonthAmount;
+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.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/12 8:33
+ * @Description 鏈夊叧婕忔崯鐨勭粺璁�
+ */
+@Slf4j
+@RestController
+@RequestMapping(path="loss")
+@RequiredArgsConstructor
+public class LossCtrl {
+
+    private LossSv sv;
+
+    @Autowired
+    public void setSv(LossSv sv){
+        this.sv = sv ;
+    }
+
+    /**
+     * 鏌ヨ鎸囧畾鏈堜唤鍚勬棩婕忔崯閲�
+     * @param qo
+     * @return
+     */
+    @GetMapping(path = "/lossAmountOfDay")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoDayLoss>>> lossAmountOfDay(LossQo qo) throws Exception {
+        String yearMonth = qo.getYearMonth();
+        if(yearMonth == null || yearMonth.trim().equals("")) {
+            return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞存湀涓嶈兘涓虹┖");
+        }
+        qo.startDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-01");
+        qo.endDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-31");
+
+        int[] ymd = DateTime.yyyy_MM_ymdGroup(yearMonth) ;
+        qo.year = ymd[0] ;
+        qo.month = ymd[1] ;
+
+        return BaseResponseUtils.buildSuccess(this.sv.lossAmountOfDay(qo));
+    }
+
+    /**
+     * 鏌ヨ鎸囧畾鏈堜唤鍚勬棩婕忔崯閲�
+     * @param qo
+     * @return
+     */
+    @GetMapping(path = "/lossAmountOfMonth")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoMonthAmount>>> lossAmountOfMonth(LossQo qo) throws Exception {
+        if(qo.getYear() == null) {
+            return BaseResponseUtils.buildErrorMsg("鏌ヨ鏉′欢骞村害涓嶈兘涓虹┖");
+        }
+        return BaseResponseUtils.buildSuccess(this.sv.lossAmountOfMonth(qo));
+    }
+
+}

--
Gitblit v1.8.0