From 43a19a4424f67c379934ed0d70e0d1b3512cd769 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 27 三月 2025 09:31:44 +0800 Subject: [PATCH] 灌溉计划表中增加项目ID字段,计划列表返回值中增加项目名称,项目状态改为整数表示 --- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 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 42d67bf..f50db60 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 @@ -7,6 +7,7 @@ import com.dy.rtuMw.server.forTcp.TcpSessionCache; import com.dy.rtuMw.server.local.CommandInnerDeaLer; import com.dy.rtuMw.server.local.ReturnCommand; +import com.dy.rtuMw.server.msCenter.MsCenterUnit; import com.dy.rtuMw.server.tasks.WebDownComTask; import com.dy.common.mw.core.CoreUnit; import com.dy.common.mw.protocol.Command; @@ -144,6 +145,24 @@ return BaseResponseUtils.buildSuccess(list); } } + + + /** + * 娉ㄥ唽娑堟伅鎺ユ敹鑰� + * @param msReceiverWebUrl 娑堟伅鎺ユ敹鑰厀eb http post url + * @return + */ + @GetMapping("/registerMsReceiverWebUrl") + public BaseResponse<Boolean> registerMsReceiverWebUrl(String msReceiverWebUrl){ + try{ + MsCenterUnit.getInstance().registerMsReceiver(msReceiverWebUrl); + }catch (Exception e){ + log.error("娉ㄥ唽娑堟伅鎺ユ敹鑰呮椂鍙戠敓寮傚父", e); + return BaseResponseUtils.buildError("娉ㄥ唽娑堟伅鎺ユ敹鑰呮椂鍙戠敓寮傚父" + (e.getMessage() == null?"":("锛�" + e.getMessage()))); + } + return BaseResponseUtils.buildSuccess(true); + } + /** * 鎺ユ敹web绯荤粺鍙戞潵鍗囩骇浠诲姟 * @param vo @@ -209,24 +228,10 @@ //閫氫俊涓棿浠跺唴閮ㄥ懡浠わ紝渚嬪鏌ヨ鐩戞帶涓棿浠舵椂閽燂紝鏌ヨRTU鍦ㄧ嚎鎯呭喌绛� try{ Command reCom = new CommandInnerDeaLer().deal(com) ; - /* - boolean error = false ; - if(reCom.param != null && reCom.param != null){ - CommandBackParam cbp = (CommandBackParam)reCom.param ; - if(cbp.getSuccess() != null && !cbp.getSuccess().booleanValue()){ - error = true ; - return BaseResponseUtils.buildError(ReturnCommand.errored(cbp.getMessage(), com.getId(), null)); - } - } - if(!error){ - return BaseResponseUtils.buildError(ReturnCommand.errored(cbp.getMessage(), com.getId(), null)); - } - */ return BaseResponseUtils.buildSuccess(reCom); }catch(Exception e){ return BaseResponseUtils.buildError(ReturnCommand.errored("澶勭悊鍐呴儴鍛戒护鍑洪敊" + (e.getMessage() == null?"":("锛�" + e.getMessage())), com.getId(), com.getCode()) ); } - }else if(commandType.equals(CommandType.outerCommand)){ //鍙戝悜RTU鐨勫閮ㄥ懡浠わ紝寮傛澶勭悊锛寃eb绔痡roups鎴愬憳鍚屾寰楀埌鍛戒护澶勭悊缁撴灉锛屼絾鏋勯�犲懡浠ゅ強涓嬪彂鍛戒护鍜屽懡浠ょ粨鏋滄帴鏀惰寮傛寰楀埌 try{ -- Gitblit v1.8.0