From 251f61887e8c26db51df7f8d0c3b5464dc1fa6e3 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 03 十二月 2024 16:59:34 +0800
Subject: [PATCH] (1)升级过程中死掉的RTU经过可配置的一段时间后设置成升级失败; (2)升级状态向Remote模块通知时,当升级任务结束后,仍要向remote模块通知可配置的次数;

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

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
index 96d08ce..146c7c0 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtuUpgrage/RtuUpgradeCtrl.java
@@ -106,7 +106,7 @@
         vo.callbackWebUrl = ugCallbackUrl_rm ;
 
         String rqUrl = this.get2MwRequestUrl(this.env, ContextUgTaskSend) ;
-        BaseResponse res = sendRequest2Mw(restTemplate, rqUrl, vo) ;
+        BaseResponse res = sendPostRequest2Mw(restTemplate, rqUrl, vo) ;
         if(res != null){
             if(res.isSuccess()){
                 this.sv.setUpgradeTaskExecuted(id);
@@ -116,8 +116,8 @@
                 if(msg == null){
                     msg = res.getMsg() ;
                 }
-                log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝崌绾т换鍔″け璐�" + msg) ;
-                return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽け璐�" + msg) ;
+                log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝崌绾т换鍔″け璐ワ紝" + msg) ;
+                return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽け璐ワ紝" + msg) ;
             }
         }else{
             log.error("閫氫俊涓棿浠惰繑鍥炵粨鏋滀负null") ;
@@ -125,10 +125,10 @@
         }
     }
     /**
-     * 涓嬪彂寮哄埗鍋滄褰撳墠rtu杩滅▼鍗囩骇浠诲姟
+     * 涓嬪彂寮哄埗缁撴潫褰撳墠rtu杩滅▼鍗囩骇浠诲姟
      * @return 鎿嶄綔缁撴灉
      */
-    @Operation(summary = "涓嬪彂寮哄埗鍋滄褰撳墠rtu杩滅▼鍗囩骇浠诲姟", description = "涓嬪彂寮哄埗鍋滄褰撳墠rtu杩滅▼鍗囩骇浠诲姟")
+    @Operation(summary = "涓嬪彂寮哄埗缁撴潫褰撳墠rtu杩滅▼鍗囩骇浠诲姟", description = "涓嬪彂寮哄埗缁撴潫褰撳墠rtu杩滅▼鍗囩骇浠诲姟")
     @ApiResponses(value = {
             @ApiResponse(
                     responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
@@ -137,21 +137,26 @@
                             schema = @Schema(implementation = String.class))}
             )
     })
-    @GetMapping(path = "/forceStop")
+    @GetMapping(path = "/forceOver")
     @SsoAop()
-    public BaseResponse<String> forceStop() {
-        String rqUrl = this.get2MwRequestUrl(this.env, ContextUgForceStop) ;
-        BaseResponse res = sendRequest2Mw(restTemplate, rqUrl, null) ;
+    public BaseResponse<String> forceOver() {
+        String rqUrl = this.get2MwRequestUrl(this.env, ContextUgForceOver) ;
+        BaseResponse res = sendGetRequest2Mw(restTemplate, rqUrl) ;
         if(res != null){
             if(res.isSuccess()){
-                return BaseResponseUtils.buildSuccess(true) ;
+                RtuUpgradeStateReceiverCtrl.afterMwForceOverCurUgTask();
+                String msg = res.getContent()==null?null:(String)res.getContent() ;
+                if(msg == null){
+                    msg = res.getMsg() ;
+                }
+                return BaseResponseUtils.buildResult(ResultCodeMsg.RsCode.SUCCESS_CODE, msg, msg) ;
             }else{
                 String msg = res.getContent()==null?null:(String)res.getContent() ;
                 if(msg == null){
                     msg = res.getMsg() ;
                 }
-                log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝己鍒跺仠姝㈠綋鍓峳tu杩滅▼鍗囩骇浠诲姟澶辫触锛�" + msg) ;
-                return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽己鍒跺仠姝㈠綋鍓峳tu杩滅▼鍗囩骇浠诲姟澶辫触锛�" + msg) ;
+                log.error("閫氫俊涓棿浠舵墽琛屼笅鍙戝己鍒剁粨鏉熷綋鍓峳tu杩滅▼鍗囩骇浠诲姟澶辫触锛�" + msg) ;
+                return BaseResponseUtils.buildErrorMsg("閫氫俊涓棿浠舵墽琛屽己鍒剁粨鏉熷綋鍓峳tu杩滅▼鍗囩骇浠诲姟澶辫触锛�" + msg) ;
             }
         }else{
             log.error("閫氫俊涓棿浠惰繑鍥炵粨鏋滀负null") ;
@@ -159,6 +164,7 @@
         }
     }
 
+
     private void valueFromPo(UpgradeTaskVo vo, UgRtuTask tpo, UgRtuProgram ppo){
         vo.id = "" + tpo.id ;
         vo.softFileName = ppo.hexFileName ;

--
Gitblit v1.8.0