From e1534c601e1310575264a0ddc5266bdd2c47750b Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 09 七月 2025 09:48:34 +0800
Subject: [PATCH] 萤石云视频监控,增加livePc模式

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 102 insertions(+), 4 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
index 122a62b..e3e2cb6 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
@@ -1,10 +1,12 @@
 package com.dy.pipIrrRemote.mqttSd1.soil;
 
 import com.dy.common.aop.SsoAop;
+import com.dy.common.util.NumUtil;
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.voRm.VoSoil;
+import com.dy.pipIrrGlobal.voRm.VoSoilDay;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -35,6 +37,96 @@
     }
 
     /**
+     * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯鏌愪竴鏃ヨ褰�
+     * @param soilId
+     * @param yyyy_MM_dd
+     * @return
+     */
+    @GetMapping(path = "oneDay")
+    @SsoAop()
+    public BaseResponse<VoSoilDay> oneDay(Long soilId, String yyyy_MM_dd){
+        try {
+            if(soilId == null){
+                return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+            }
+            if(yyyy_MM_dd == null || yyyy_MM_dd.trim().equals("")){
+                return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡涓嶈兘涓虹┖") ;
+            }
+            String ymdStr = yyyy_MM_dd.replaceAll("-", "") ;
+            if(!NumUtil.isPlusIntNumber(ymdStr)){
+                return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡鏍煎紡涓嶆纭紝鏍煎紡瑙勫畾涓簓yyy-MM-dd") ;
+            }
+            return BaseResponseUtils.buildSuccess(sv.oneDay(soilId, Integer.parseInt(ymdStr)));
+        } catch (Exception e) {
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
+
+    /**
+     * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯鏌愪竴鏃ヨ褰�
+     * @param soilId
+     * @param yyyy_MM
+     * @return
+     */
+    @GetMapping(path = "oneDayByMonth")
+    @SsoAop()
+    public BaseResponse<List<VoSoilDay>> oneDayByMonth(Long soilId, String yyyy_MM){
+        try {
+            if(soilId == null){
+                return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+            }
+            if(yyyy_MM == null || yyyy_MM.trim().equals("")){
+                return BaseResponseUtils.buildFail("鏌ヨ鏈堜唤涓嶈兘涓虹┖") ;
+            }
+            String ymdStr = yyyy_MM.replaceAll("-", "") ;
+            if(!NumUtil.isPlusIntNumber(ymdStr)){
+                return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡鏍煎紡涓嶆纭紝鏍煎紡瑙勫畾涓簓yyy-MM-dd") ;
+            }
+            Integer ymStart = Integer.parseInt(ymdStr) * 100;
+            Integer ymEnd = Integer.parseInt(ymdStr) * 100 + 31;
+            return BaseResponseUtils.buildSuccess(sv.oneDayByMonth(soilId, ymStart, ymEnd));
+        } catch (Exception e) {
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
+
+
+
+    /**
+     * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯涓�浜涙棩璁板綍
+     * @param qo
+     * @return
+     */
+    @GetMapping(path = "oneSomeDay")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoSoilDay>>> oneSomeDay(SoilQo qo){
+        try {
+            if(qo.soilId == null){
+                return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+            }
+            qo.completionTime();
+            return BaseResponseUtils.buildSuccess(sv.someDay(qo));
+        } catch (Exception e) {
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
+
+    /**
+     * 鏍规嵁鎸囧畾鏉′欢鏌ヨ涓�浜涙皵璞$珯鏃ヨ褰�
+     * @param qo
+     * @return
+     */
+    @GetMapping(path = "someDay")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoSoilDay>>> someDay(SoilQo qo){
+        try {
+            return BaseResponseUtils.buildSuccess(sv.someDay(qo));
+        } catch (Exception e) {
+            return BaseResponseUtils.buildException(e.getMessage()) ;
+        }
+    }
+
+    /**
      * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏈�鏂拌褰�
      * @param soilId
      * @return
@@ -51,19 +143,23 @@
 
     /**
      * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍
-     * @param soilId
+     * @param qo
      * @return
      */
     @GetMapping(path = "oneHistory")
     @SsoAop()
-    public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(Long soilId){
+    public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(SoilQo qo){
         try {
-
-            return BaseResponseUtils.buildSuccess(sv.oneHistory(soilId));
+            if(qo.soilId == null){
+                return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+            }
+            qo.completionTime();
+            return BaseResponseUtils.buildSuccess(sv.oneHistory(qo));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;
         }
     }
+
 
     /**
      * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏈�鏂拌褰�
@@ -74,6 +170,7 @@
     @SsoAop()
     public BaseResponse<QueryResultVo<List<VoSoil>>> someLast(SoilQo qo){
         try {
+            qo.completionTime();
             return BaseResponseUtils.buildSuccess(sv.someLast(qo));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;
@@ -89,6 +186,7 @@
     @SsoAop()
     public BaseResponse<QueryResultVo<List<VoSoil>>> someHistory(SoilQo qo){
         try {
+            qo.completionTime();
             return BaseResponseUtils.buildSuccess(sv.someHistory(qo));
         } catch (Exception e) {
             return BaseResponseUtils.buildException(e.getMessage()) ;

--
Gitblit v1.8.0