From 44180ee779c038ad628fcd847a0b8e2ca9b6f4ee Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期五, 22 十一月 2024 10:46:17 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
index 68d6305..9c606ec 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/upgrade/UpgradeTask.java
@@ -202,8 +202,7 @@
         if(this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0){
             state.rtuTotal = this.taskVo.rtuAddrList.size() ;
             if(this.upgradeRtus != null && this.upgradeRtus.size() > 0){
-                Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
-                for(UpgradeRtu info : col){
+                this.upgradeRtus.values().stream().forEach(info ->{
                     if(info.state == UpgradeRtu.STATE_OFFLINE){
                         state.offLineTotal ++ ;
                     }else if(info.state == UpgradeRtu.STATE_UNSTART){
@@ -212,16 +211,19 @@
                         state.runningTotal ++ ;
                     }else if(info.state == UpgradeRtu.STATE_SUCCESS) {
                         state.successTotal++;
+                    }else if(info.state == UpgradeRtu.STATE_FAIL) {
+                        state.failTotal++;
                     }else if(info.state == UpgradeRtu.STATE_FAILONE) {
                         state.failOneTotal++;
                         state.failTotal++;
-                    }else if(info.state == UpgradeRtu.STATE_FAIL) {
+                    }else if(info.state == UpgradeRtu.STATE_FAILOFFLINE) {
                         state.failTotal++;
+                        state.failOffTotal++;
                     }
                     if(info.isOver){
                         state.overTotal++;
                     }
-                }
+                });
             }
         }
         return state ;
@@ -271,7 +273,7 @@
      * 鍒ゆ柇鏄惁娌$敤浠讳綍涓�涓猂TU杩涜杩囧崌绾э紝鑰屼笖瓒呰繃浜嗘椂闄�
      * @return -1:鏃犱竴RTU鍗囩骇涓旇秴鏃讹紝0锛氭棤RTU鍗囩骇浣嗘湭瓒呮椂绛夊緟锛�1鏈塕TU鍗囩骇姝e父鎵ц
      */
-    protected int countNoOneRtuUpgrade(){
+    protected int countNoOneRtuUpgradeInDuration(){
         if(this.upgradeRtus == null || upgradeRtus.size() == 0){
             //褰撳墠娌℃湁浠讳綍涓�涓澶囪繘琛岃繃鍗囩骇
             Long now = System.currentTimeMillis() ;
@@ -297,7 +299,7 @@
     /**
      * 缁熻褰撳墠姝e湪鍗囩骇鐨凴TU鏁伴噺锛屼负鍚屾椂鍗囩骇鏁伴噺闄愬埗鍋氬噯澶�
      */
-    protected void statisticsRunningRtuCount(){
+    protected void countRunningRtuCount(){
         int runningTotal = 0 ;
         Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
         for(UpgradeRtu info : col){
@@ -309,9 +311,9 @@
     }
 
     /**
-     * 缁熻闇�瑕佸崌绾т絾褰撳墠绂荤嚎RTU鐨勬儏鍐�
+     * 缁熻闇�瑕佸崌绾т絾褰撳墠绂荤嚎RTU鐨勬儏鍐碉紝瓒呰繃鏃堕檺鐨勮澶囦负鍗囩骇瀹屾垚
      */
-    protected void statisticsOffRtuCountAndSet() {
+    protected void countOffRtuAndSetIfOver() {
         Long now = System.currentTimeMillis() ;
         if(now - this.setupDtLong > UpgradeUnit.confVo.rtuOffLineWaitDuration){
             //rtu绂荤嚎锛岀瓑寰呭叾鍗囩骇鐨勬椂闀�(姣)锛岃秴杩囬厤缃殑鏈�澶ф椂闀匡紝璁剧疆鍏跺崌绾уけ璐ワ紝涓旇缃崌绾т换鍔″畬鎴�
@@ -330,7 +332,7 @@
     /**
      * 缁熻鏄惁鍗囩骇鍏ㄩ儴缁撴潫
      */
-    protected boolean statisticsIsAllOver() {
+    protected boolean countIsAllOver() {
         if (this.taskVo.rtuAddrList != null && this.taskVo.rtuAddrList.size() > 0) {
             Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
             for(UpgradeRtu info : col){

--
Gitblit v1.8.0