From 7b38f4ec223e9480c4de2824782fe3695a25d848 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 06 十二月 2024 11:19:16 +0800
Subject: [PATCH] 修改升级过程逻辑,RTU上报数据后触发升级过程中,首先判断是否因为阀门是开启状态而不能升级

---
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
index bd52b71..021c224 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeManager.java
@@ -25,13 +25,15 @@
 
     private static final UpgradeManager INSTANCE = new UpgradeManager();
 
+    private Boolean openNoUpgrade ;//闃�寮�锛堟车寮�锛変笉鎵ц鍗囩骇
+    private Integer lastOpenMaxGoOn ;//闃�寮�锛堟车寮�锛夌姸鎬佽缃互鏉ユ寔缁渶闀挎椂闂达紙绉掗挓锛夛紝瓒呰繃杩欎釜鏃堕棿璁や负鐘舵�佹棤鏁堬紙杩欎釜鏃堕暱鍙栧喅浜庡伐浣滄姤闂撮殧锛�
     private Integer failTryTimes ;//鍗囩骇澶辫触鍚庯紝閲嶆柊鍋胯瘯鍗囩骇娆℃暟锛�0琛ㄧず涓嶉噸鏂板伩璇曞崌绾�
     private Integer ugMaxRtuSameTime ;//鍚屾椂鍗囩骇RTU鏈�澶т釜鏁�
     private Integer notifyTimesAfterOver; //鍗囩骇缁撴潫鍚庯紝鍐嶅悜web鏈嶅姟绯荤粺閫氱煡鐘舵�佺殑娆℃暟
     private int nowNotifyTimesAfterOver; //鍗囩骇缁撴潫鍚庯紝鍐嶅悜web鏈嶅姟绯荤粺閫氱煡鐘舵�佺殑娆℃暟
 
     private UpgradeTask task ;//鍗囩骇浠诲姟
-    private boolean monitorFirst = true ;//鏄惁鏄涓�娆$洃瑙�
+    private boolean monitorFirst ;//鏄惁鏄涓�娆$洃瑙�
 
     private UpgradeManager(){
         monitorFirst = true ;
@@ -45,6 +47,8 @@
      *  鍒濆鍖栭厤缃俊鎭�
      */
     public void initOption(UpgradeUnitConfigVo configVo) {
+        this.openNoUpgrade = configVo.openNoUpgrade;
+        this.lastOpenMaxGoOn = configVo.lastOpenMaxGoOn;
         this.failTryTimes = configVo.failTryTimes;
         this.ugMaxRtuSameTime = configVo.ugMaxRtuAtOnce;
         this.notifyTimesAfterOver = configVo.notifyTimesAfterOver;
@@ -65,9 +69,10 @@
                     this.task.forceOver();
                 }
                 this.task = new UpgradeTask();
-                this.task.initOption(this.failTryTimes, this.ugMaxRtuSameTime);
+                this.task.initOption(this.openNoUpgrade, this.lastOpenMaxGoOn, this.failTryTimes, this.ugMaxRtuSameTime);
                 this.task.setTask(vo);
                 this.nowNotifyTimesAfterOver = 0 ;
+                this.monitorFirst = true ;
                 log.info("======================================================") ;
                 log.info("=                                                    =") ;
                 log.info("=璁剧疆浜嗗崌绾т换鍔★紝娑夊強RTU" + vo.rtuAddrList.size() + "鍙�                            =") ;
@@ -195,6 +200,12 @@
             this.stop() ;
         }else{
             if(!this.task.taskIsOver){
+                if(this.openNoUpgrade != null
+                        && this.openNoUpgrade.booleanValue()
+                        && this.monitorFirst){
+                    //绗竴娆¤繘鍏ワ紝杩涜闃�寮�涓嶅崌绾у鐞�
+                    this.task.openNoUpgrade() ;
+                }
                 this.nowNotifyTimesAfterOver = 0 ;
                 //鍗囩骇浠诲姟鏈畬鎴�
                 //宸ヤ綔1锛氬垽鏂槸鍚︽棤浠讳綍涓�涓猂TU杩涜杩囧崌绾э紝骞朵笖杈惧埌鏃堕檺锛屽垯璁や负褰撳墠鍗囩骇浠诲姟瀹屾垚
@@ -309,6 +320,7 @@
         return true ;
     }
 
+
     /**
      * 鍗囩骇鐘舵�侀�氱煡
      */

--
Gitblit v1.8.0