From 02d9502caf71d1b40fdec03c19d63f58c7b593ec Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 23 十一月 2024 11:57:01 +0800
Subject: [PATCH] 改一下

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeStateReceiverCtrl.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 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 7654ce3..abfdc1b 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
@@ -65,20 +65,20 @@
             }
         }
         if(cache == null){
+            cache = info;
             //姝ゆ椂涓嶅仛浠诲姟鎿嶄綔锛屽彧淇濋殰cache涓嶄负绌猴紝 绛夊緟涓嬫鍙戞潵鏁版嵁
             if(info.ugRtuStateList != null && info.ugRtuStateList.size() > 0){
                 List<UpgradeRtu> overList = info.ugRtuStateList.stream().filter(itemVo -> itemVo.isOver).collect(Collectors.toList()) ;
                 if(overList != null && overList.size() > 0){
-                    cache = info;
                     this.save2Db(info.ugTaskId, overList);
                 }
             }
         }else{
+            cache = info;
             //褰揷ache涓湁鍊兼椂锛岃繘琛屾瘮瀵瑰瓨鍌紝瀵规瘮鐩殑鏄槻姝㈤噸澶嶆搷浣滄暟鎹簱
             if(info.ugRtuStateList != null && info.ugRtuStateList.size() > 0){
                 //姝ゆ椂淇濊瘉涓や釜闆嗗悎閮戒笉涓簄ull
                 this.save2Db(info.ugTaskId, info.ugRtuStateList, cache.ugRtuStateList);
-                cache = info;
             }
         }
         return null;
@@ -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 ;
@@ -296,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){
@@ -307,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){
@@ -317,6 +319,15 @@
         if(!hasRunning){
             cache.ugOverallState.allOver = true ;
         }
+        if(cache.ugOverallState.allOver){
+            cache.ugOverallState.overTotal = 0;
+            if(cache.ugRtuStateList != null && cache.ugRtuStateList.size() > 0){
+                for(UpgradeRtu rtu : cache.ugRtuStateList){
+                    rtu.isOver = true ;
+                    cache.ugOverallState.overTotal++;
+                }
+            }
+        }
         return hasRunning ;
     }
 }

--
Gitblit v1.8.0