From 203223860baa19deb6860eb2ba3181910d662980 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 17 四月 2025 14:22:59 +0800
Subject: [PATCH] 1. 轮灌组被终止时灌溉时长为实际数值。2. 计划历史表按照创建时间倒排序。3. 发布计划时判断是否同项目下未完成计划,是否其他项目下使用了本计划的轮灌组且计划未完成。4. 根据计划ID获取计划最新状态。

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

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java
index 09d573f..e1a279a 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/largeScreen/Ls4StatisticsSv.java
@@ -5,6 +5,7 @@
 import com.dy.common.mw.protocol.Command;
 import com.dy.common.mw.protocol.CommandBackParam;
 import com.dy.common.util.DateTime;
+import com.dy.common.util.IDLongGenerator;
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.pipIrrGlobal.daoLargeScreen.Ls4StatisticsMapper;
 import com.dy.pipIrrGlobal.rtuMw.CodeLocal;
@@ -12,6 +13,8 @@
 import com.dy.pipIrrGlobal.voLargeScreen.VoBaseInfo;
 import com.dy.pipIrrGlobal.voLargeScreen.VoCurrentInfo;
 import com.dy.pipIrrGlobal.voLargeScreen.VoMonitorInfo;
+import com.dy.pipIrrGlobal.voSpecial.VoTopXClient;
+import com.dy.pipIrrGlobal.voSpecial.VoTopXIntake;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -19,6 +22,7 @@
 import org.springframework.web.client.RestTemplate;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Author: liurunyu
@@ -74,14 +78,17 @@
         Integer[] result = this.queryMwOnAndOffLine() ;
         vo.cTotalCountOfOnLine = result[0] ;
         vo.cTotalCountOfOffLine = totalCountOfIntake - vo.cTotalCountOfOnLine;
+        vo.cTotalCountOfOffLine = vo.cTotalCountOfOffLine < 0 ? 0 : vo.cTotalCountOfOffLine ;
 
         vo.cTotalCountOfOpenValve = this.dao.totalCountOfOpenValve(dtAtXHourBefore) ;
         vo.cTotalCountOfCloseValve = this.dao.totalCountOfCloseValve(dtAtXHourBefore) ;
         vo.cTotalCountOfUnknownValve = totalCountOfIntake - vo.cTotalCountOfOpenValve - vo.cTotalCountOfCloseValve;
+        vo.cTotalCountOfUnknownValve = vo.cTotalCountOfUnknownValve < 0 ? 0 : vo.cTotalCountOfUnknownValve ;
 
         vo.cTotalCountOfAlarm = this.dao.totalCountOfAlarm(dtAtXHourBefore) ;
         vo.cTotalCountOfNoAlarm = this.dao.totalCountOfNoAlarm(dtAtXHourBefore) ;
         vo.cTotalCountOfUnknownAlarm = totalCountOfIntake - vo.cTotalCountOfAlarm - vo.cTotalCountOfNoAlarm;
+        vo.cTotalCountOfUnknownAlarm = vo.cTotalCountOfUnknownAlarm < 0 ? 0 : vo.cTotalCountOfUnknownAlarm ;
         return vo ;
     }
 
@@ -138,4 +145,29 @@
         }
         return result ;
     }
+
+
+
+    /**
+     * 鏄ㄦ棩鍐滄埛鐢ㄦ按鍓�5鍚嶇粺璁�
+     * @return 鏁版嵁闆嗗悎
+     */
+    public List<VoTopXClient> top5ClientYesterday() {
+        int[] yesterday = DateTime.yyyy_MM_dd_2_ymdGroup(DateTime.lastXDay_yyyy_MM_dd(1)) ;
+        Long idStart = IDLongGenerator.generateOneDayStartId(yesterday[0], yesterday[1], yesterday[2]) ;
+        Long idEnd = IDLongGenerator.generateOneDayEndId(yesterday[0], yesterday[1], yesterday[2]) ;
+        return this.dao.topXClientAtCertainDay(idStart, idEnd, 5) ;
+    }
+
+    /**
+     * 鏄ㄦ棩鍙栨按鍙g敤姘村墠5鍚嶇粺璁�
+     * @return 鏁版嵁闆嗗悎
+     */
+    public List<VoTopXIntake> top5IntakeYesterday() {
+        int[] yesterday = DateTime.yyyy_MM_dd_2_ymdGroup(DateTime.lastXDay_yyyy_MM_dd(1)) ;
+        Long idStart = IDLongGenerator.generateOneDayStartId(yesterday[0], yesterday[1], yesterday[2]) ;
+        Long idEnd = IDLongGenerator.generateOneDayEndId(yesterday[0], yesterday[1], yesterday[2]) ;
+        return this.dao.topXIntakeAtCertainDay(idStart, idEnd, 5) ;
+    }
+
 }

--
Gitblit v1.8.0