pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java
@@ -3,6 +3,7 @@
import java.io.Serializable;
import com.alibaba.fastjson2.JSON ;
import com.alibaba.fastjson2.JSONObject;
public class Command implements Serializable{
@@ -50,6 +51,11 @@
   public Boolean noRtMwDealRes ;
   /**
    * rtu返回命令结果 发向目的地web URL
    */
   public String rtuResultSendWebUrl ;
   /**
    * 具体参数数据
    */
   public Object param ;
@@ -63,9 +69,9 @@
      String s = "命令id=" + id + "\n" ;
      s += (protocol == null ? "" : ("协议=" + protocol + "\n"));
      s += (rtuAddr == null ? "" : ("Rtu地址=" + rtuAddr + "\n"));
      s += "命令类型=" + (type.equals(CommandType.innerCommand)?"内部命令":"终端命令") + "\n" ;
      s += "命令类型=" + (type.equals(CommandType.innerCommand)?"内部命令":"RTU命令") + "\n" ;
      s += (code == null ? "" : ("功能码=" + code + "\n")) ;
      s += "返回中间件对命令处理结果=" + (noRtMwDealRes == null?"返回":(noRtMwDealRes?"不返回":"返回") + "\n") ;
      s += "是否返回中间件对命令处理结果=" + (noRtMwDealRes == null?"是":(noRtMwDealRes?"是":"否") + "\n") ;
      if(param != null){
         s += "参数:" + param  ;
      }
@@ -82,7 +88,8 @@
   @SuppressWarnings("unused")
   public String toJson()throws Exception{
      try{
         return JSON.toJSONString(this) ;
         String json = JSON.toJSONString(this) ;
         return json ;
      }catch(Exception e){
         throw new Exception(e.getMessage() , e ) ;
      }
@@ -96,7 +103,10 @@
   @SuppressWarnings("unused")
   public static Command jsonToObject(String json)throws Exception{
      try{
         return JSON.parseObject(json, Command.class) ;
         JSONObject jsonObject = JSON.parseObject(json);
         Command command = jsonObject.to(Command.class) ;
         //command.param = jsonObject.getObject("param", class);
         return command ;
      }catch(Exception e){
         throw new Exception(e.getMessage() , e ) ;
      }
@@ -168,6 +178,14 @@
      return this ;
   }
   
   public String getRtuResultSendWebUrl() {
      return rtuResultSendWebUrl;
   }
   public void setRtuResultSendWebUrl(String rtuResultSendWebUrl) {
      this.rtuResultSendWebUrl = rtuResultSendWebUrl;
   }
   public String getProtocol() {
      return protocol;
   }