From 0280bccdb8d09940ec72b8eaa218057df67912c4 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 23 十月 2024 17:27:14 +0800
Subject: [PATCH] 修改类型转换bug

---
 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/MonitorSv.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 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..a59a207 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
@@ -5,6 +5,7 @@
 import com.alibaba.fastjson2.JSONObject;
 import com.dy.common.mw.protocol.Command;
 import com.dy.common.mw.protocol.CommandBackParam;
+import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com99Vo;
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.daoPr.PrIntakeMapper;
@@ -77,11 +78,11 @@
             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 : ((JSONObject)res.getContent()).toJSONString(), Command.class) ;
+                    CommandBackParam bakParam = JSON.parseObject((reCom== null || reCom.param == null) ? null : ((JSONObject)reCom.param).toJSONString(), CommandBackParam.class) ;
                     if(bakParam != null){
                         if(bakParam.getSuccess().booleanValue()){
                             //閫氫俊涓棿浠舵垚鍔熻繑鍥炲懡浠ょ粨鏋�
@@ -115,11 +116,11 @@
         //鍚戦�氫俊涓棿浠跺彂鍏冲懡浠わ紝鏌ヨ閮ㄥ垎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 : ((JSONObject)res.getContent()).toJSONString(), Command.class) ;
+                CommandBackParam bakParam = JSON.parseObject((reCom== null || reCom.param == null) ? null : ((JSONObject)reCom.param).toJSONString(), CommandBackParam.class) ;
                 if(bakParam != null){
                     if(bakParam.getSuccess().booleanValue()){
                         //閫氫俊涓棿浠舵垚鍔熻繑鍥炲懡浠ょ粨鏋�

--
Gitblit v1.8.0