From 478e0a193282daa67bdd70a5e3ed23576eb23cec Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 19 十一月 2024 10:29:46 +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 |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 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 e0b3d13..77e5baf 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
@@ -76,7 +76,7 @@
         if(taskVo.softStartAddr == null || taskVo.softStartAddr.trim().length() != 8){
             throw new Exception("绋嬪簭瑕嗙洊璧峰鍦板潃涓嶅悎娉曪紝蹇呴』鏄�8瀛楃锛堝崄鍏繘鍒讹級鐨勫瓧绗︿覆") ;
         }
-        if(taskVo.softFileData == null || taskVo.softFileData.length <= 0){
+        if(taskVo.softFileData64 == null || taskVo.softFileData64.trim().length() == 0){
             throw new Exception("鍗囩骇绋嬪簭鍐呭蹇呴』鎻愪緵") ;
         }
         if(taskVo.softBytesCalculate == null){
@@ -96,12 +96,13 @@
         this.taskVo = taskVo ;
 
         this.upgradeRtus = new HashMap<>();
-        if(taskVo.softFileData != null && taskVo.softFileData.length >0){
+        if(taskVo.softFileData64 != null && taskVo.softFileData64.trim().equals("")){
+            taskVo.softFileData = Base64.getDecoder().decode(taskVo.softFileData64);
             List<byte[]> listBytes = new HexFileParse().splitBytesByUnit512(taskVo.softFileData);
             this.softFileDataGrp = listBytes.toArray(new byte[0][]);
             for(String rtuAddr : this.taskVo.rtuAddrList){
                 //姝ゆ椂鐘舵�佽缃垚绂荤嚎鐘舵��
-                UpgradeRtuDev ugRtu = new UpgradeRtuDev(this, rtuAddr, this.taskVo.softFileData.length, UpgradeRtuDev.STATE_OFFLINE) ;
+                UpgradeRtuDev ugRtu = new UpgradeRtuDev(this, rtuAddr, this.softFileDataGrp.length, UpgradeRtuDev.STATE_OFFLINE) ;
                 this.upgradeRtus.put(rtuAddr, ugRtu) ;
             }
         }
@@ -174,11 +175,13 @@
      * 寮哄埗缁撴潫鍗囩骇浠诲姟
      */
     public void forceOver(){
-        this.taskIsOver = true ;//寮哄埗璁剧疆浠诲姟瀹屾垚
-        this.taskOverType = TaskOverType_Force ;//浠诲姟瀹屾垚鏂瑰紡锛堣嚜鐒讹紝寮哄埗锛�
-        this.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//浠诲姟瀹屾垚鏃堕棿(yyyy-mm-dd HH:MM:SS)
-        //this.taskVo.rtuAddrList.clear();
-        //this.upgradeState.clear();
+        if(!this.taskIsOver){
+            this.taskIsOver = true ;//寮哄埗璁剧疆浠诲姟瀹屾垚
+            this.taskOverType = TaskOverType_Force ;//浠诲姟瀹屾垚鏂瑰紡锛堣嚜鐒讹紝寮哄埗锛�
+            this.taskOverDt = DateTime.yyyy_MM_dd_HH_mm_ss() ;//浠诲姟瀹屾垚鏃堕棿(yyyy-mm-dd HH:MM:SS)
+            //this.taskVo.rtuAddrList.clear();
+            //this.upgradeState.clear();
+        }
     }
 
     /**
@@ -192,18 +195,18 @@
             if(this.upgradeRtus != null && this.upgradeRtus.size() > 0){
                 Collection<UpgradeRtu> col = this.upgradeRtus.values() ;
                 for(UpgradeRtu info : col){
-                    if(info.state == UpgradeRtuDev.STATE_OFFLINE){
+                    if(info.state == UpgradeRtu.STATE_OFFLINE){
                         state.offLineTotal ++ ;
-                    }else if(info.state == UpgradeRtuDev.STATE_UNSTART){
+                    }else if(info.state == UpgradeRtu.STATE_UNSTART){
                         state.unStartTotal ++ ;
-                    }else if(info.state == UpgradeRtuDev.STATE_RUNNING){
+                    }else if(info.state == UpgradeRtu.STATE_RUNNING){
                         state.runningTotal ++ ;
-                    }else if(info.state == UpgradeRtuDev.STATE_SUCCESS) {
+                    }else if(info.state == UpgradeRtu.STATE_SUCCESS) {
                         state.successTotal++;
-                    }else if(info.state == UpgradeRtuDev.STATE_FAILONE) {
+                    }else if(info.state == UpgradeRtu.STATE_FAILONE) {
                         state.failOneTotal++;
                         state.failTotal++;
-                    }else if(info.state == UpgradeRtuDev.STATE_FAIL) {
+                    }else if(info.state == UpgradeRtu.STATE_FAIL) {
                         state.failTotal++;
                     }
                     if(info.isOver){

--
Gitblit v1.8.0