From 880273d6b3687ea601ddb6d46acb9b660a9f76de Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 10 十月 2024 16:50:41 +0800
Subject: [PATCH] 1、发送钉钉的报警消息中去除漏损报警; 2、漏损报警消息产生与发送放于定时报中,漏损量大于配置值时才报警,并把漏损量一并发送出去。

---
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealLoss.java |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealLoss.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealLoss.java
index 1dc4192..fbefd1c 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealLoss.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1_0_0/TkDealLoss.java
@@ -1,5 +1,7 @@
 package com.dy.rtuMw.server.rtuData.p206V1_0_0;
 
+import com.dy.pipIrrGlobal.pojoRm.RmLossDay;
+import com.dy.pipIrrGlobal.pojoRm.RmLossDayLast;
 import com.dy.rtuMw.server.rtuData.TaskSurpport;
 import com.dy.rtuMw.server.rtuData.dbSv.DbSv;
 import com.dy.common.mw.protocol.Data;
@@ -7,8 +9,6 @@
 import com.dy.common.mw.protocol.p206V1_0_0.DataV1_0_1;
 import com.dy.common.util.DateTime;
 import com.dy.pipIrrGlobal.pojoPr.PrController;
-import com.dy.pipIrrGlobal.pojoRm.RmLossHistory;
-import com.dy.pipIrrGlobal.pojoRm.RmLossLast;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -16,7 +16,7 @@
  * @Author liurunyu
  * @Date 2024/2/28 16:31
  * @LastEditTime 2024/2/28 16:31
- * @Description 鎺у埗鍣ㄦ紡鎹熺粺璁�
+ * @Description 鍙栨按鍙f紡鎹熺粺璁�
  */
 public class TkDealLoss extends TaskSurpport {
 
@@ -42,7 +42,7 @@
             try{
                 this.doDeal(sv, controller, d.getRtuAddr(), dV1_0_1, (DataCdC0Vo)cdObj);
             }catch (Exception e){
-                log.error("淇濆瓨閬ユ祴绔欒嚜鎶ュ疄鏃舵暟鎹腑鐨勬紡鎹熸暟鎹椂鍙戠敓寮傚父", e);
+                log.error("淇濆瓨鍙栨按鍙f紡鎹熺粺璁℃暟鎹椂鍙戠敓寮傚父", e);
             }
         }
     }
@@ -56,9 +56,9 @@
      * @param dataCdC0Vo 寮�闃�涓婃姤鏁版嵁瀵硅薄
      */
     private void doDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo) throws Exception {
-        RmLossLast poLast = sv.getRmLossLast(controller.getIntakeId());
+        RmLossDayLast poLast = sv.getRmLossLast(controller.getIntakeId());
         if (poLast == null) {
-            //鏁版嵁搴撲腑涓嶅瓨鍦ㄨ鎺у埗鍣ㄧ殑婕忔崯鏁版嵁
+            //鏁版嵁搴撲腑涓嶅瓨鍦ㄨ鍙栨按鍙g殑婕忔崯鏁版嵁
             //棣栧厛鐢熸垚鏈�鏂版暟鎹強鍘嗗彶鏁版嵁锛屽苟鍏堜繚瀛�
             poLast = this.newRmLossLast(controller, rtuAddr, dV1_0_1, dataCdC0Vo);
             this.newAndSaveHistoryDataDeal(sv, controller, rtuAddr, dV1_0_1, dataCdC0Vo, poLast);
@@ -67,7 +67,7 @@
             if(DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dataCdC0Vo.rtuDt).equals(poLast.dtRtu)){
                 //鏃堕棿涓�鑷达紝閲嶅涓婃姤鏁版嵁锛屼笉杩涜浠讳綍澶勭悊
             }else{
-                RmLossHistory poHistory = null ;
+                RmLossDay poHistory = null ;
                 if(poLast.lastHistoryId != null){
                     poHistory = sv.getRmLossHistory(poLast.lastHistoryId) ;
                 }
@@ -94,6 +94,7 @@
                     //杩欑鎯呭喌涓嶅瓨鍦紙RTU鏃堕挓鏃╀簬鏈湴璁板綍涓殑RTU鏃堕挓锛圧TU绌胯秺鍥炶繃鍘讳簡锛屽彲鑳芥椂閽熼噸缃簡锛夛紝姝ょ鎯呭喌涓嶅鐞嗭級
                 }
             }
+            sv.updateRmLossLast(poLast);
         }
     }
 
@@ -106,8 +107,8 @@
      * @return
      * @throws Exception
      */
-    private RmLossLast newRmLossLast(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception {
-        RmLossLast po = new RmLossLast() ;
+    private RmLossDayLast newRmLossLast(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception {
+        RmLossDayLast po = new RmLossDayLast() ;
         po.controllerId = controller==null?null:controller.getId();
         po.intakeId = controller==null?null:controller.getIntakeId();
         po.rtuAddr = rtuAddr;
@@ -124,8 +125,8 @@
      * @return
      * @throws Exception
      */
-    private RmLossHistory newRmLossHistory(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception {
-        RmLossHistory po = new RmLossHistory() ;
+    private RmLossDay newRmLossHistory(PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo cdData)throws Exception {
+        RmLossDay po = new RmLossDay() ;
         po.controllerId = controller==null?null:controller.getId();
         po.intakeId = controller==null?null:controller.getIntakeId();
         po.rtuAddr = rtuAddr;
@@ -145,8 +146,8 @@
      * @throws Exception
      * @return RmLossHistory
      */
-    private RmLossHistory newAndSaveHistoryDataDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo, RmLossLast poLast)throws Exception {
-        RmLossHistory poHistory = this.newRmLossHistory(controller, rtuAddr, dV1_0_1, dataCdC0Vo) ;
+    private RmLossDay newAndSaveHistoryDataDeal(DbSv sv, PrController controller, String rtuAddr, DataV1_0_1 dV1_0_1, DataCdC0Vo dataCdC0Vo, RmLossDayLast poLast)throws Exception {
+        RmLossDay poHistory = this.newRmLossHistory(controller, rtuAddr, dV1_0_1, dataCdC0Vo) ;
         sv.saveRmLossHistory(poHistory);
         //鐢辨渶鏂版暟鎹寔鏈夊巻鍙叉暟鎹腑鐨勬渶鏂拌褰旾D锛屼互鏂逛究蹇�熸煡璇�
         poLast.lastHistoryId = poHistory == null ? null: poHistory.id ;

--
Gitblit v1.8.0