From 7fd3f90c2055d82d2e5fe96a4b0454e0c2cc9892 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 22 十一月 2024 17:23:43 +0800
Subject: [PATCH] 远程升级优化

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java
index d47b86f..78e473b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java
@@ -154,7 +154,7 @@
                                 @Override
                                 public Object execute() throws Exception {
                                     while(!this.stop){
-                                        if(!runDemo()){
+                                        if(!runInDemo()){
                                             this.stop = true ;
                                         }else{
                                             try {
@@ -188,7 +188,7 @@
             }
         }
     }
-    private boolean runDemo(){
+    private boolean runInDemo(){
         for(UpgradeRtu rtu : cache.ugRtuStateList){
             this.rtuUpgrade(rtu) ;
         }
@@ -244,7 +244,7 @@
         }
 
         int n = Integer.parseInt(new CreateRandom().create(3)) ;
-        if(n == 540 || n == 541 || n == 542 || n == 543 || n == 544 || n == 545){
+        if(n == 540 || n == 541 || n == 542 || n == 543 || n == 544 || n == 545 || n == 546 || n == 547 || n == 548 || n == 549 ){
             if(rtu.currentPackage == 1){
                 //1鍖呮
                 rtu.state = UpgradeRtu.STATE_FAILONE ;
@@ -279,7 +279,6 @@
             rtu.currentPackage += 1 ;
             rtu.currentRamAddr = 0x00 + UpgradeRtu.RAMADDRADD ;
             rtu.lastDownDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;
-            rtu.reTryTimes = 0 ;
             rtu.isOver = false ;
         }
 
@@ -297,6 +296,7 @@
             for(UpgradeRtu rtu : cache.ugRtuStateList){
                 if(rtu.state == UpgradeRtu.STATE_OFFLINE){
                     cache.ugOverallState.offLineTotal ++ ;
+                    cache.ugOverallState.failTotal++;
                 }else if(rtu.state == UpgradeRtu.STATE_UNSTART){
                     cache.ugOverallState.unStartTotal ++ ;
                 }else if(rtu.state == UpgradeRtu.STATE_RUNNING){
@@ -308,6 +308,7 @@
                     cache.ugOverallState.failOneTotal++;
                     cache.ugOverallState.failTotal++;
                 }else if(rtu.state == UpgradeRtu.STATE_FAIL) {
+                    cache.ugOverallState.failMultiTotal++;
                     cache.ugOverallState.failTotal++;
                 }
                 if(rtu.isOver){
@@ -318,6 +319,13 @@
         if(!hasRunning){
             cache.ugOverallState.allOver = true ;
         }
+        if(cache.ugOverallState.allOver){
+            if(cache.ugRtuStateList != null && cache.ugRtuStateList.size() > 0){
+                for(UpgradeRtu rtu : cache.ugRtuStateList){
+                    rtu.isOver = true ;
+                }
+            }
+        }
         return hasRunning ;
     }
 }

--
Gitblit v1.8.0