From b1c77065389922bbdefb9f9869779ef99b6d6791 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 22 十一月 2024 09:54:38 +0800
Subject: [PATCH] 升级演示程序bug修改,增加失败重次逻辑
---
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java
index 3541104..46ad9d1 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java
@@ -1,5 +1,6 @@
package com.dy.rtuMw.web.com;
+import com.dy.common.softUpgrade.state.UpgradeTaskVo;
import com.dy.rtuMw.resource.ResourceUnit;
import com.dy.rtuMw.server.ServerProperties;
import com.dy.rtuMw.server.forTcp.TcpSessionCache;
@@ -11,6 +12,7 @@
import com.dy.common.mw.protocol.CommandType;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.rtuMw.server.upgrade.UpgradeUnit;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -142,6 +144,23 @@
}
}
/**
+ * 鎺ユ敹web绯荤粺鍙戞潵鍗囩骇浠诲姟
+ * @param vo
+ * @return
+ */
+ @PostMapping(path = "upgradeRtu", consumes = MediaType.APPLICATION_JSON_VALUE)
+ public BaseResponse<Boolean> upgradeRtu(@RequestBody UpgradeTaskVo vo) {
+ log.info("鏀跺埌RTU鍗囩骇浠诲姟锛歕n" + vo.toString()) ;
+ try{
+ UpgradeUnit.getInstance().setUpgradeTask(vo);
+ }catch (Exception e){
+ log.error("璁剧疆RTU鍗囩骇浠诲姟鏃跺彂鐢熷紓甯�", e);
+ return BaseResponseUtils.buildError("璁剧疆RTU鍗囩骇浠诲姟鏃跺彂鐢熷紓甯�" + (e.getMessage() == null?"":("锛�" + e.getMessage())));
+ }
+ return BaseResponseUtils.buildSuccess(true);
+ }
+
+ /**
* 鎺ユ敹web绯荤粺鍙戞潵鐨勫懡浠�
* @param com
* @return
--
Gitblit v1.8.0