From b63eef2cfb054b1ead234ab93e05a2aa28775d91 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 17 四月 2025 14:54:26 +0800 Subject: [PATCH] 优化灌溉计划发布前判断条件 --- pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/ResConfigVo.java | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 114 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/ResConfigVo.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/ResConfigVo.java new file mode 100644 index 0000000..065e784 --- /dev/null +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-client/src/main/java/com/dy/testClient/rmiClient/ResConfigVo.java @@ -0,0 +1,114 @@ +package com.dy.testClient.rmiClient; + +import com.alibaba.fastjson2.JSON; + +public class ResConfigVo { + //妯℃嫙瀹㈡埛鐨凴tuAddr璧峰鍙� + public Long rtuAddrStart = 0L ; + //妯℃嫙瀹㈡埛鐨処MEI鍙锋埅姝㈠彿 + public Long rtuAddrEnd = 0L ; + //鏈嶅姟绔疘P + public String tcpServerIp = "" ; + //鏈嶅姟绔笂涓嬫枃 + public Integer tcpServerPort = 0 ; + //鍙戦�佹暟鎹棿闅� + public Integer sendInterval = 2 ;//绉� + //姣忎竴杞鍙戦�佹暟鎹紝鍏朵腑鍖呮嫭蹇冭烦鍙戦�佹鏁� + public Integer heartbeatTimes = 3 ; + //鍙戦�佹暟鎹鏁� + public Integer sendTimes = 0 ; + //鍙戦�佸畬鏁版嵁鍚庯紝鏄惁鍏抽棴TCP杩炴帴锛�1鏄紝0鍚� + public Integer sendOverThenCloseConnect = 0 ; + + /** + * 瀵硅薄杞垚json + * @return 瀵硅薄json + * @throws Exception 寮傚父 + */ + public String toJson()throws Exception{ + try{ + return JSON.toJSONString(this) ; + //return new JSONSerializer().exclude(new String[]{"class", "*.class"}).deepSerialize(this); + }catch(Exception e){ + throw new Exception(e.getMessage() , e ) ; + } + } + /** + * json杞垚瀵硅薄 + * @param json json + * @return 瀵硅薄 + * @throws Exception 寮傚父 + */ + public static ResConfigVo jsonToObject(String json)throws Exception{ + try{ + return JSON.parseObject(json, ResConfigVo.class) ; + //return new JSONDeserializer<ResConfigVo>().deserialize(json, ResConfigVo.class) ; + }catch(Exception e){ + throw new Exception(e.getMessage() , e ) ; + } + } + + public Long getRtuAddrStart() { + return rtuAddrStart; + } + + public void setRtuAddrStart(Long rtuAddrStart) { + this.rtuAddrStart = rtuAddrStart; + } + + public Long getRtuAddrEnd() { + return rtuAddrEnd; + } + + public void setRtuAddrEnd(Long rtuAddrEnd) { + this.rtuAddrEnd = rtuAddrEnd; + } + + public String getTcpServerIp() { + return tcpServerIp; + } + + public void setTcpServerIp(String tcpServerIp) { + this.tcpServerIp = tcpServerIp; + } + + public Integer getTcpServerPort() { + return tcpServerPort; + } + + public void setTcpServerPort(Integer tcpServerPort) { + this.tcpServerPort = tcpServerPort; + } + + public Integer getSendInterval() { + return sendInterval; + } + + public void setSendInterval(Integer sendInterval) { + this.sendInterval = sendInterval; + } + + public Integer getHeartbeatTimes() { + return heartbeatTimes; + } + + public void setHeartbeatTimes(Integer heartbeatTimes) { + this.heartbeatTimes = heartbeatTimes; + } + + public Integer getSendTimes() { + return sendTimes; + } + + public void setSendTimes(Integer sendTimes) { + this.sendTimes = sendTimes; + } + + public Integer getSendOverThenCloseConnect() { + return sendOverThenCloseConnect; + } + + public void setSendOverThenCloseConnect(Integer sendOverThenCloseConnect) { + this.sendOverThenCloseConnect = sendOverThenCloseConnect; + } +} -- Gitblit v1.8.0