From acccf8a6aab49208a43fda862487aebcaa2cdb73 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期一, 05 八月 2024 15:31:03 +0800
Subject: [PATCH] 1. 从未开过阀的取水口; 2. 指定时间段内开阀次数超过指定值的取水口; 3. 指定时间段内开阀次数低于指定值的取水口; 4.获取开关阀报(历史)完善接口

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

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
index c9e3b05..5133da8 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
@@ -2,10 +2,13 @@
 
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.daoRm.RmOnHourReportHistoryMapper;
+import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveHistoryMapper;
 import com.dy.pipIrrGlobal.voSt.VoCumulativeFlow;
 import com.dy.pipIrrGlobal.voSt.VoIntake;
+import com.dy.pipIrrGlobal.voSt.VoIntakeOpenCount;
 import com.dy.pipIrrStatistics.intake.qo.CumulativeFlowQO;
 import com.dy.pipIrrStatistics.intake.qo.IntakeQO;
+import com.dy.pipIrrStatistics.intake.qo.IntakeValueQO;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.common.utils.PojoUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +32,8 @@
 public class IntakeSv {
     @Autowired
     private RmOnHourReportHistoryMapper rmOnHourReportHistoryMapper;
+    @Autowired
+    private RmOpenCloseValveHistoryMapper rmOpenCloseValveHistoryMapper;
 
     /**
      * 鑾峰彇鎸囧畾鏃堕棿娈靛唴鏈笂绾跨殑鍙栨按鍙�
@@ -112,4 +117,117 @@
         rsVo.obj = rmOnHourReportHistoryMapper.getSmallFlowIntakes(params);
         return rsVo ;
     }
+
+    /**
+     * 鑾峰彇浠庢湭寮�杩囬榾鐨勫彇姘村彛
+     * @return
+     */
+    public QueryResultVo<List<VoIntake>> getNeverOpenValveIntakes(IntakeQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+        if(timeStart != null) {
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDate.now() + " 00:00:00";
+        }
+        qo.setTimeStart(timeStart);
+        if(timeStop != null) {
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDate.now() + " 23:59:59";
+        }
+        qo.setTimeStop(timeStop);
+
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoIntake>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmOpenCloseValveHistoryMapper.getNeverOpenValveIntakes(params);
+        return rsVo ;
+    }
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟瓒呰繃鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param qo
+     * @return
+     */
+    public QueryResultVo<List<VoIntakeOpenCount>> getOpenValveGtIntakes(IntakeValueQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+        if(timeStart != null) {
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDate.now() + " 00:00:00";
+        }
+        qo.setTimeStart(timeStart);
+        if(timeStop != null) {
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDate.now() + " 23:59:59";
+        }
+        qo.setTimeStop(timeStop);
+
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getOpenValveGtIntakesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmOpenCloseValveHistoryMapper.getOpenValveGtIntakes(params);
+        return rsVo ;
+    }
+
+    /**
+     * 鑾峰彇鎸囧畾鏃堕棿娈靛唴寮�闃�娆℃暟浣庝簬鎸囧畾鍊肩殑鍙栨按鍙�
+     * @param qo
+     * @return
+     */
+    public QueryResultVo<List<VoIntakeOpenCount>> getOpenValveLtIntakes(IntakeValueQO qo) {
+
+        String timeStart = qo.getTimeStart();
+        String timeStop = qo.getTimeStop();
+        if(timeStart != null) {
+            timeStart = timeStart + " 00:00:00";
+        }else {
+            timeStart = LocalDate.now() + " 00:00:00";
+        }
+        qo.setTimeStart(timeStart);
+        if(timeStop != null) {
+            timeStop = timeStop + " 23:59:59";
+        }else {
+            timeStop = LocalDate.now() + " 23:59:59";
+        }
+        qo.setTimeStop(timeStop);
+
+        // 鐢熸垚鏌ヨ鍙傛暟
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ;
+
+        // 鑾峰彇绗﹀悎鏉′欢鐨勮褰曟暟
+        Long itemTotal = Optional.ofNullable(rmOpenCloseValveHistoryMapper.getOpenValveLtIntakesCount(params)).orElse(0L);
+
+        QueryResultVo<List<VoIntakeOpenCount>> rsVo = new QueryResultVo<>() ;
+
+        rsVo.pageSize = qo.pageSize ;
+        rsVo.pageCurr = qo.pageCurr ;
+
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = rmOpenCloseValveHistoryMapper.getOpenValveLtIntakes(params);
+        return rsVo ;
+    }
 }

--
Gitblit v1.8.0