From 2b4fc2b16efdc887b71855b0b4d5b5680453d088 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 29 十一月 2024 11:15:52 +0800 Subject: [PATCH] 1、实现强制停止RTU远程升级任务功能; 2、业务系统与通信中间件web通信模块优化,使变得更通用与简单。 --- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java | 21 +++++++++++++++++++++ 1 files changed, 21 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 46ad9d1..142a879 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,6 +1,7 @@ package com.dy.rtuMw.web.com; import com.dy.common.softUpgrade.state.UpgradeTaskVo; +import com.dy.common.webUtil.ResultCodeMsg; import com.dy.rtuMw.resource.ResourceUnit; import com.dy.rtuMw.server.ServerProperties; import com.dy.rtuMw.server.forTcp.TcpSessionCache; @@ -161,6 +162,26 @@ } /** + * 鎺ユ敹web绯荤粺鍙戞潵鍋滄鍗囩骇浠诲姟 + * @return + */ + @PostMapping(path = "ugForceStop", consumes = MediaType.APPLICATION_JSON_VALUE) + public BaseResponse<String> ugForceStop() { + log.info("鏀跺埌鍋滄RTU鍗囩骇浠诲姟鍛戒护") ; + try{ + String mes = UpgradeUnit.getInstance().overUpgradeTask(); + if(mes == null){ + mes = "鍋滄鍗囩骇浠诲姟鎴愬姛" ; + } + return BaseResponseUtils.buildResult(ResultCodeMsg.RsCode.SUCCESS_CODE, mes, mes); + }catch (Exception e){ + log.error("鍋滄RTU鍗囩骇浠诲姟鏃跺彂鐢熷紓甯�", e); + return BaseResponseUtils.buildError("鍋滄RTU鍗囩骇浠诲姟鏃跺彂鐢熷紓甯�" + (e.getMessage() == null?"":("锛�" + e.getMessage()))); + } + } + + + /** * 鎺ユ敹web绯荤粺鍙戞潵鐨勫懡浠� * @param com * @return -- Gitblit v1.8.0