From cb46d99ac8c302334e8c39600de0d9a4ffbf5533 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 29 十月 2024 09:39:48 +0800 Subject: [PATCH] 1、删除global模块中Contant中的一些无用代码; 2、删除global模块中一些无用的备份; 3、一些有继承关系并注解有@Data的类中增加注解@EqualsAndHashCode(callSuper=false),防止编译时警告 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/MonitorSv.java | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/MonitorSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/MonitorSv.java index 6684947..a85672a 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/MonitorSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/MonitorSv.java @@ -77,15 +77,15 @@ Command com = this.createInnerCommand(CodeLocal.onLinePart); com.setParam(rtuAddrs) ; String comSendUrl = this.getToMwUrl(this.env) ; - BaseResponse<Command> res = sendCom2Mw(restTemplate, comSendUrl, com) ; + BaseResponse res = sendCom2Mw(restTemplate, comSendUrl, com) ; if(res != null){ if(res.isSuccess()){ - Command reCom = res.getContent() ; - CommandBackParam bakParam = JSON.parseObject(((JSONObject)reCom.param).toJSONString(), CommandBackParam.class) ; + Command reCom = JSON.parseObject(res.getContent() == null ? null : JSON.toJSONString(res.getContent()), Command.class) ; + CommandBackParam bakParam = JSON.parseObject((reCom== null || reCom.param == null) ? null : JSON.toJSONString(reCom.param), CommandBackParam.class) ; if(bakParam != null){ if(bakParam.getSuccess().booleanValue()){ //閫氫俊涓棿浠舵垚鍔熻繑鍥炲懡浠ょ粨鏋� - HashMap<String, Boolean> onLineMap = JSON.parseObject(((JSONObject)reCom.getAttachment()).toJSONString(), HashMap.class); + HashMap<String, Boolean> onLineMap = JSON.parseObject(JSON.toJSONString(reCom.getAttachment()), HashMap.class); for(VoOnLineIntake rVo : rsVo.obj){ if(onLineMap.containsKey(rVo.getRtuAddr())) { rVo.setIsOnLine(onLineMap.get(rVo.getRtuAddr())); @@ -115,15 +115,15 @@ //鍚戦�氫俊涓棿浠跺彂鍏冲懡浠わ紝鏌ヨ閮ㄥ垎RTU鍦ㄧ嚎鎯呭喌 Command com = this.createInnerCommand(CodeLocal.onLineAll); String comSendUrl = this.getToMwUrl(this.env) ; - BaseResponse<Command> res = sendCom2Mw(restTemplate, comSendUrl, com) ; + BaseResponse res = sendCom2Mw(restTemplate, comSendUrl, com) ; if(res != null){ if(res.isSuccess()){ - Command reCom = res.getContent() ; - CommandBackParam bakParam = JSON.parseObject(((JSONObject)reCom.param).toJSONString(), CommandBackParam.class) ; + Command reCom = JSON.parseObject(res.getContent() == null ? null : JSON.toJSONString(res.getContent()), Command.class) ; + CommandBackParam bakParam = JSON.parseObject((reCom== null || reCom.param == null) ? null : JSON.toJSONString(reCom.param), CommandBackParam.class) ; if(bakParam != null){ if(bakParam.getSuccess().booleanValue()){ //閫氫俊涓棿浠舵垚鍔熻繑鍥炲懡浠ょ粨鏋� - HashMap<String, Boolean> onLineMap = JSON.parseObject(((JSONObject)reCom.getAttachment()).toJSONString(), HashMap.class); + HashMap<String, Boolean> onLineMap = JSON.parseObject(JSON.toJSONString(reCom.getAttachment()), HashMap.class); JSONArray jsonArray = new JSONArray(); for (Map.Entry<String, Boolean> entry : onLineMap.entrySet()) { JSONObject jsonObject = new JSONObject(); -- Gitblit v1.8.0