From d730e2a289b38356e28a04b35a0cb2e7b4c6c282 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 03 七月 2025 10:27:56 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd38Vo.java | 23
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdSv.java | 25
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherLastMapper.java | 6
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_37_Down.java | 267 +++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureLastMapper.java | 5
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd35Vo.java | 16
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd36Vo.java | 16
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilLastMapper.xml | 17
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd37Vo.java | 23
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdDto.java | 30
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/CodeV202404.java | 15
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_36_37_38Up.java | 92 +
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdSv.java | 15
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdSv.java | 19
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdSv.java | 38
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd21/CdDto.java | 3
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdSv.java | 80 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml | 2
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdDto.java | 33
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java | 2
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_36_Down.java | 225 +++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml | 15
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd92_A2Vo.java | 2
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml | 15
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties | 6
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java | 7
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdCtrl.java | 130 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilDayMapper.xml | 36
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdDto.java | 17
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java | 30
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/rtuLog/RtuLogManager.java | 4
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java | 1
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdCtrl.java | 57
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdCtrl.java | 22
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoilDay.java | 8
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureHistoryMapper.xml | 19
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdParam.java | 33
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdSv.java | 80 +
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_93_A3_Up.java | 7
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java | 7
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdDto.java | 21
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdParam.java | 26
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdParam.java | 33
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdParam.java | 22
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/CommandSv.java | 2
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilDayMapper.java | 12
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoWeather.java | 10
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdParam.java | 26
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_Down.java | 225 +++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml | 2
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilHistoryMapper.java | 6
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdCtrl.java | 57
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdCtrl.java | 23
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoManure.java | 10
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilSv.java | 4
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdDto.java | 33
pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/console/Command.java | 4
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdSv.java | 80 +
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd9DVo.java | 12
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_9D_Down.java | 120 +
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdDto.java | 30
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandOpen.java | 82 +
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdParam.java | 21
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilLastMapper.java | 6
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdCtrl.java | 225 +++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandOpenMapper.xml | 181 ++
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdCtrl.java | 225 +++
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdCtrl.java | 232 +++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml | 2
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureHistoryMapper.java | 5
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilHistoryMapper.xml | 15
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdSv.java | 17
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_9D_A3Vo.java | 6
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_38_Down.java | 266 +++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmCommandOpenMapper.java | 31
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdSv.java | 25
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdCtrl.java | 232 +++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoil.java | 8
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdCtrl.java | 150 ++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherHistoryMapper.java | 6
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd35_36Vo.java | 114 +
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java | 7
pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdSv.java | 80 +
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml | 16
84 files changed, 4,091 insertions(+), 67 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/CodeV202404.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/CodeV202404.java
index 3bce602..9cd3273 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/CodeV202404.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/CodeV202404.java
@@ -41,6 +41,12 @@
public static final String cd_9B = "9B" ; //娓呴櫎璁惧缁堢娉ㄥ唽鍙�
public static final String cd_9C = "9C" ; //榛戝悕鍗曡繙绋嬪己鍒跺叧闂按娉�/闃�闂�
public static final String cd_C2 = "C2" ; //寮�鍏虫按娉�/闃�闂ㄦ垚鍔�/澶辫触涓婃姤
+ public static final String cd_9D = "9D" ; //姝e父杩滅▼鍏抽棴姘存车/闃�闂�
+
+ public static final String cd_35 = "35" ; //APP绔繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�
+ public static final String cd_36 = "36" ; //APP绔繙绋嬪畾閲忓紑鍚按娉�/闃�闂�
+ public static final String cd_37 = "37" ; //APP绔鍒掕繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�
+ public static final String cd_38 = "38" ; //APP绔繙绋嬭鍒掑畾閲忓紑鍚按娉�/闃�闂�
public static final String cd_1600 = "1600" ;//鍗囩骇澶嶄綅
public static final String cd_1601 = "1601" ;//鍗囩骇閰嶇疆
@@ -90,6 +96,13 @@
(code.equals(cd_9B) ? "娓呴櫎璁惧缁堢娉ㄥ唽鍙�" :
(code.equals(cd_9C) ? "榛戝悕鍗曡繙绋嬪己鍒跺叧闂按娉�/闃�闂�" :
(code.equals(cd_C2) ? "寮�鍏虫按娉�/闃�闂ㄧ粨鏋滀笂鎶�" :
+ (code.equals(cd_9D) ? "姝e父杩滅▼鍏抽棴姘存车/闃�闂�" :
+
+ (code.equals(cd_35) ? "APP绔繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�" :
+ (code.equals(cd_36) ? "APP绔繙绋嬪畾閲忓紑鍚按娉�/闃�闂�" :
+ (code.equals(cd_37) ? "APP绔鍒掕繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�" :
+ (code.equals(cd_38) ? "APP绔繙绋嬭鍒掑畾閲忓紑鍚按娉�/闃�闂�" :
+
(code.equals(cd_1600) ? "鍗囩骇澶嶄綅" :
(code.equals(cd_1601) ? "鍗囩骇閰嶇疆" :
(code.equals(cd_1602) ? "鍗囩骇鏁版嵁" :
@@ -97,7 +110,7 @@
(code.equals(cd_9601) ? "鍗囩骇閰嶇疆" :
(code.equals(cd_9602) ? "鍗囩骇鏁版嵁" :
(code.equals(cd_9603) ? "鍗囩骇鏍¢獙" :
- "")))))))))))))))))))))))))))))))))))))))))))))) ;
+ ""))))))))))))))))))))))))))))))))))))))))))))))))))) ;
if(name == null || name.equals("")){
name = code ;
}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd35Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd35Vo.java
new file mode 100644
index 0000000..5110913
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd35Vo.java
@@ -0,0 +1,16 @@
+package com.dy.common.mw.protocol.p206V202404.downVos;
+
+import lombok.Data;
+
+@Data
+public class ComCd35Vo {
+ public String controllerType;//鎺у埗鍣ㄧ被鍨� 01锛�0x01锛�:娴嬫帶涓�浣撻榾锛�02锛�0x02锛�:琛ㄩ榾涓�浣撴満锛�57(0x57):浜曠數鎺у埗鍣�
+ public Integer projectNo ;//椤圭洰缂栧彿
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd36Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd36Vo.java
new file mode 100644
index 0000000..8d99591
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd36Vo.java
@@ -0,0 +1,16 @@
+package com.dy.common.mw.protocol.p206V202404.downVos;
+
+import lombok.Data;
+
+@Data
+public class ComCd36Vo {
+ public String controllerType;//鎺у埗鍣ㄧ被鍨� 01锛�0x01锛�:娴嬫帶涓�浣撻榾锛�02锛�0x02锛�:琛ㄩ榾涓�浣撴満锛�57(0x57):浜曠數鎺у埗鍣�
+ public Integer projectNo ;//椤圭洰缂栧彿
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛�
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd37Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd37Vo.java
new file mode 100644
index 0000000..2b300ff
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd37Vo.java
@@ -0,0 +1,23 @@
+package com.dy.common.mw.protocol.p206V202404.downVos;
+
+import lombok.Data;
+
+@Data
+public class ComCd37Vo {
+ public String controllerType;//鎺у埗鍣ㄧ被鍨� 01锛�0x01锛�:娴嬫帶涓�浣撻榾锛�02锛�0x02锛�:琛ㄩ榾涓�浣撴満锛�57(0x57):浜曠數鎺у埗鍣�
+ public Integer projectNo ;//椤圭洰缂栧彿
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+
+ public Integer year ; //璁″垝寮�闃�鏃堕棿---骞�
+ public Integer month ;//璁″垝寮�闃�鏃堕棿---鏈�
+ public Integer day ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer hour ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer minute ;//璁″垝寮�闃�鏃堕棿---鍒�
+
+ public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd38Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd38Vo.java
new file mode 100644
index 0000000..959630d
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd38Vo.java
@@ -0,0 +1,23 @@
+package com.dy.common.mw.protocol.p206V202404.downVos;
+
+import lombok.Data;
+
+@Data
+public class ComCd38Vo {
+ public String controllerType;//鎺у埗鍣ㄧ被鍨� 01锛�0x01锛�:娴嬫帶涓�浣撻榾锛�02锛�0x02锛�:琛ㄩ榾涓�浣撴満锛�57(0x57):浜曠數鎺у埗鍣�
+ public Integer projectNo ;//椤圭洰缂栧彿
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+
+ public Integer year ; //璁″垝寮�闃�鏃堕棿---骞�
+ public Integer month ;//璁″垝寮�闃�鏃堕棿---鏈�
+ public Integer day ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer hour ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer minute ;//璁″垝寮�闃�鏃堕棿---鍒�
+
+ public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛�
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd9DVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd9DVo.java
new file mode 100644
index 0000000..a0ddac9
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/downVos/ComCd9DVo.java
@@ -0,0 +1,12 @@
+package com.dy.common.mw.protocol.p206V202404.downVos;
+
+import lombok.Data;
+
+@Data
+public class ComCd9DVo {
+ public String controllerType;//鎺у埗鍣ㄧ被鍨� 01锛�0x01锛�:娴嬫帶涓�浣撻榾锛�02锛�0x02锛�:琛ㄩ榾涓�浣撴満锛�57(0x57):浜曠數鎺у埗鍣�
+ public Integer projectNo ;//椤圭洰缂栧彿
+ public String icCardAddr ;//鐢ㄦ埛鍗″湴鍧�锛夛紙4瀛楄妭HEX锛�
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_36_37_38Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_36_37_38Up.java
new file mode 100644
index 0000000..a87a415
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_36_37_38Up.java
@@ -0,0 +1,92 @@
+package com.dy.common.mw.protocol.p206V202404.parse;
+
+
+import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V202404.*;
+import com.dy.common.mw.protocol.p206V202404.parse.global.GlParse;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd35_36Vo;
+import com.dy.common.mw.protocol.rtuState.ValveStateInfo;
+import com.dy.common.util.ByteUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+@AnnotationCodeUp(ifAny={
+ CodeV202404.cd_35,
+ CodeV202404.cd_36,
+ CodeV202404.cd_37,
+ CodeV202404.cd_38
+})
+@SuppressWarnings("unused")
+public class Cd_35_36_37_38Up implements CodeParse{
+
+ private static final Logger log = LogManager.getLogger(Cd_35_36_37_38Up.class);
+
+ /**
+ * 鍒嗘瀽涓婅鏁版嵁
+ */
+ @Override
+ public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception {
+ ParseParamsForUpV202404 para = (ParseParamsForUpV202404)params ;
+ int bsLen = new CommonV202404().parseDataLen4P202404(para.upBuffer) ;
+ if(bsLen > 0){
+ this.doParse(para.upBuffer,
+ bsLen,
+ para.upCode,
+ para.data) ;
+ }
+ log.info("\n鍒嗘瀽鍛戒护搴旂瓟鏁版嵁<" + CodeV202404.getCodeName(para.upCode) + " RTU鍦板潃=" + para.rtuAddr + ">:\n" + para.data.toString());
+
+ MidResultFromRtu midRs = new MidResultFromRtu() ;
+ midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+ midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙�
+ midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
+ midRs.upCode = para.upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮�
+ midRs.upHex = para.upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡
+ midRs.upBuffer = para.upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍
+ midRs.data = para.data ;//瑙f瀽鍚庣殑鏁版嵁
+
+ midRs.reportOrResponse_trueOrFalse = false ;
+
+ callback.callback(midRs.reportOrResponse_trueOrFalse, para.data.subData==null?null:((DataV202404)(para.data.subData)).subData);
+ if(para.data != null && para.data.getSubData() != null){
+ DataCd35_36Vo subData = (DataCd35_36Vo)((DataV202404)para.data.getSubData()).subData ;
+ //opResult ;//寮�鍚车/闃�缁撴灉: 0x00:鎴愬姛 0x81:澶辫触
+ callback.notify(new ValveStateInfo(subData.opResult.byteValue() == 0 ? true:false));
+ }
+ return new MidResult[]{midRs} ;
+ }
+ /**
+ * 鎵ц鍒嗘瀽
+ * @param bs 瀛楄妭鏁扮粍
+ * @param bsLen 瀛楄妭闀垮害锛堟�诲寘闀匡紝鍖呮嫭鍖呭ご鍜屽寘灏撅級
+ * @param dataCode 鍔熻兘鐮�
+ * @param data 鏁版嵁
+ * @throws Exception 寮傚父
+ */
+ protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
+ DataV202404 dV202404 = (DataV202404)data.getSubData() ;
+ DataCd35_36Vo cdData = new DataCd35_36Vo(CodeV202404.getCodeName(dataCode)) ;
+ dV202404.subData = cdData ;
+ int index = ProtocolConstantV206V202404.dataIndex ;
+ cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ;
+
+ index++ ;
+ cdData.projectNo = (int)bs[index];
+
+ index++ ;
+ cdData.icCardNo = GlParse.parseIcCardNo(bs, index, 6, 2) ;
+
+ index += 8 ;
+ cdData.orderNo = ByteUtil.BCD2String_BE(bs, index, index + 7) ;
+
+ //index += 8 ;
+ //cdData.opDt = GlParse.parseRtuDt(bs, index) ;
+
+ index += 6 ;
+ cdData.opType = bs[index];
+
+ index ++ ;
+ cdData.opResult = bs[index];
+ }
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_Down.java
new file mode 100644
index 0000000..5da03c8
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_35_Down.java
@@ -0,0 +1,225 @@
+package com.dy.common.mw.protocol.p206V202404.parse;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V202404.CodeV202404;
+import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd35Vo;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd92_A2Vo;
+import com.dy.common.mw.protocol.p206V202404.parse.global.GlCreate;
+import com.dy.common.util.ByteUtil;
+import com.dy.common.util.NumUtil;
+
+@AnnotationCodeDown(ifAny={
+ CodeV202404.cd_35
+})
+public class Cd_35_Down implements CodeParse {
+
+ @Override
+ public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
+ ParseParamsForDownV202404 para = (ParseParamsForDownV202404) params ;
+ byte[] bs = this.doParse(para) ;
+
+ MidResultToRtu midRs = new MidResultToRtu() ;
+ midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+ midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙�
+ midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
+ midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
+ midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉
+ midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�;
+ midRs.downCodeName = CodeV202404.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�;
+ midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁
+ midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡
+ midRs.hasResponse = true ;//鏄惁鏈夊簲绛�
+ midRs.maxSendTimes = null ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆
+ midRs.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨锛屼綆鍔熻�楁椂涓簍rue
+
+ midRs.isSendFirst = false ;//鍛戒护搴旂瓟锛岄鍏堝彂閫侊紝闃叉RTU閲嶆柊涓婃姤
+ if(isLowPower != null && isLowPower.booleanValue()){
+ //浣庡姛鑰楁椂锛屽敖蹇彂閫�
+ midRs.isQuickSend = true ;
+ }
+
+ return new MidResult[]{midRs} ;
+ }
+ /**
+ * 鏋勯�犱笅琛屾暟鎹�
+ * @param para 鍙傛暟
+ * @return 瀛楄妭鏁扮粍
+ * @throws Exception 寮傚父
+ */
+ public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
+ byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
+ if(para.param != null){
+ JSONObject obj = (JSONObject)para.param;
+ String json = obj.toJSONString();
+ ComCd35Vo cvo = JSON.parseObject(json, ComCd35Vo.class) ;
+ if(cvo == null){
+ throw new Exception("json杞珻omCd35Vo涓簄ull") ;
+ }
+ if(cvo.waterRemain != null){
+ if(cvo.waterRemain < 0 || cvo.waterRemain > 99999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑姘撮噺蹇呴』鏄�0~99999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.moneyRemain != null){
+ if(cvo.moneyRemain < 0 || cvo.moneyRemain > 999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑閲戦蹇呴』鏄�0~999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.waterPrice != null){
+ if(cvo.waterPrice < 0 || cvo.waterPrice > 99.99){
+ throw new Exception("姘撮噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.elePrice != null){
+ if(cvo.elePrice < 0 || cvo.elePrice > 99.99){
+ throw new Exception("鐢甸噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(!NumUtil.isPlusIntNumber(cvo.orderNo)){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.orderNo.length() != 16){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.minutes == null || cvo.minutes == 0.0){
+ throw new Exception("鐢ㄦ按鏃堕暱涓嶈兘涓虹┖鎴栦负0") ;
+ }
+ if(cvo.minutes < 0 || cvo.minutes > 9999){
+ throw new Exception("鐢ㄦ按鏃堕暱鍙栧�艰寖鍥存槸0~9999鍒嗛挓") ;
+ }
+
+ byte[] bs = new byte[47] ;
+ int index = 0 ;
+ bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
+
+ index ++ ;
+ bs[index] = cvo.projectNo.byteValue() ;
+
+ index ++ ;
+ GlCreate.createValveOrPump(cvo.controllerType, bs, index) ;
+
+ index ++ ;
+ GlCreate.createIcCardNo(cvo.icCardNo, bs, index);
+
+ index += 8 ;
+ if(cvo.waterRemain == null){
+ cvo.waterRemain = 0.0 ;
+ }
+ String strTemp = "" + Double.valueOf(cvo.waterRemain * 100).intValue() ;
+ byte[] bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ int bTempLen = bTemp.length ;
+ int count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 5){
+ break ;
+ }
+ }
+ for(; count < 5; count++){
+ bs[index++] = 0 ;
+ }
+
+ if(cvo.moneyRemain == null){
+ cvo.moneyRemain = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.moneyRemain * 10000)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 4){
+ break ;
+ }
+ }
+ for(; count < 4; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.waterPrice == null){
+ cvo.waterPrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.waterPrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.elePrice == null){
+ cvo.elePrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.elePrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ ByteUtil.string2BCD_BE(bs, cvo.orderNo, index) ;
+
+ index += 8 ;
+ GlCreate.createDt(bs, index);
+
+ index += 6 ;
+ bTemp = ByteUtil.int2BCD_LE(cvo.minutes) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+ GlCreate.createPw(bs, index);
+
+ index += 2 ;
+ GlCreate.createS2D(bs, index) ;
+
+ index += 4 ;
+ bs[index] = 0 ; //鏃跺欢
+
+ bytes = ByteUtil.bytesMerge(bytes, bs) ;
+ }else{
+ throw new Exception("涓嬭鍛戒护鍙傛暟鎹负null") ;
+ }
+ GlCreate.createLen(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑
+
+ byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC鍜屽熬
+
+ bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
+
+ return bytes ;
+ }
+
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_36_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_36_Down.java
new file mode 100644
index 0000000..56af443
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_36_Down.java
@@ -0,0 +1,225 @@
+package com.dy.common.mw.protocol.p206V202404.parse;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V202404.CodeV202404;
+import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd35Vo;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd36Vo;
+import com.dy.common.mw.protocol.p206V202404.parse.global.GlCreate;
+import com.dy.common.util.ByteUtil;
+import com.dy.common.util.NumUtil;
+
+@AnnotationCodeDown(ifAny={
+ CodeV202404.cd_36
+})
+public class Cd_36_Down implements CodeParse {
+
+ @Override
+ public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
+ ParseParamsForDownV202404 para = (ParseParamsForDownV202404) params ;
+ byte[] bs = this.doParse(para) ;
+
+ MidResultToRtu midRs = new MidResultToRtu() ;
+ midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+ midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙�
+ midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
+ midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
+ midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉
+ midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�;
+ midRs.downCodeName = CodeV202404.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�;
+ midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁
+ midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡
+ midRs.hasResponse = true ;//鏄惁鏈夊簲绛�
+ midRs.maxSendTimes = null ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆
+ midRs.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨锛屼綆鍔熻�楁椂涓簍rue
+
+ midRs.isSendFirst = false ;//鍛戒护搴旂瓟锛岄鍏堝彂閫侊紝闃叉RTU閲嶆柊涓婃姤
+ if(isLowPower != null && isLowPower.booleanValue()){
+ //浣庡姛鑰楁椂锛屽敖蹇彂閫�
+ midRs.isQuickSend = true ;
+ }
+
+ return new MidResult[]{midRs} ;
+ }
+ /**
+ * 鏋勯�犱笅琛屾暟鎹�
+ * @param para 鍙傛暟
+ * @return 瀛楄妭鏁扮粍
+ * @throws Exception 寮傚父
+ */
+ public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
+ byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
+ if(para.param != null){
+ JSONObject obj = (JSONObject)para.param;
+ String json = obj.toJSONString();
+ ComCd36Vo cvo = JSON.parseObject(json, ComCd36Vo.class) ;
+ if(cvo == null){
+ throw new Exception("json杞珻omCd35Vo涓簄ull") ;
+ }
+ if(cvo.waterRemain != null){
+ if(cvo.waterRemain < 0 || cvo.waterRemain > 99999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑姘撮噺蹇呴』鏄�0~99999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.moneyRemain != null){
+ if(cvo.moneyRemain < 0 || cvo.moneyRemain > 999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑閲戦蹇呴』鏄�0~999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.waterPrice != null){
+ if(cvo.waterPrice < 0 || cvo.waterPrice > 99.99){
+ throw new Exception("姘撮噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.elePrice != null){
+ if(cvo.elePrice < 0 || cvo.elePrice > 99.99){
+ throw new Exception("鐢甸噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(!NumUtil.isPlusIntNumber(cvo.orderNo)){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.orderNo.length() != 16){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.waterAmount == null || cvo.waterAmount == 0.0){
+ throw new Exception("棰勭敤姘撮噺涓嶈兘涓虹┖鎴栦负0") ;
+ }
+ if(cvo.waterAmount < 0 || cvo.waterAmount > 9999){
+ throw new Exception("棰勭敤姘撮噺鍙栧�艰寖鍥存槸0~9999m3") ;
+ }
+
+ byte[] bs = new byte[47] ;
+ int index = 0 ;
+ bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
+
+ index ++ ;
+ bs[index] = cvo.projectNo.byteValue() ;
+
+ index ++ ;
+ GlCreate.createValveOrPump(cvo.controllerType, bs, index) ;
+
+ index ++ ;
+ GlCreate.createIcCardNo(cvo.icCardNo, bs, index);
+
+ index += 8 ;
+ if(cvo.waterRemain == null){
+ cvo.waterRemain = 0.0 ;
+ }
+ String strTemp = "" + Double.valueOf(cvo.waterRemain * 100).intValue() ;
+ byte[] bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ int bTempLen = bTemp.length ;
+ int count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 5){
+ break ;
+ }
+ }
+ for(; count < 5; count++){
+ bs[index++] = 0 ;
+ }
+
+ if(cvo.moneyRemain == null){
+ cvo.moneyRemain = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.moneyRemain * 10000)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 4){
+ break ;
+ }
+ }
+ for(; count < 4; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.waterPrice == null){
+ cvo.waterPrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.waterPrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.elePrice == null){
+ cvo.elePrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.elePrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ ByteUtil.string2BCD_BE(bs, cvo.orderNo, index) ;
+
+ index += 8 ;
+ GlCreate.createDt(bs, index);
+
+ index += 6 ;
+ bTemp = ByteUtil.int2BCD_LE(cvo.waterAmount) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+ GlCreate.createPw(bs, index);
+
+ index += 2 ;
+ GlCreate.createS2D(bs, index) ;
+
+ index += 4 ;
+ bs[index] = 0 ; //鏃跺欢
+
+ bytes = ByteUtil.bytesMerge(bytes, bs) ;
+ }else{
+ throw new Exception("涓嬭鍛戒护鍙傛暟鎹负null") ;
+ }
+ GlCreate.createLen(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑
+
+ byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC鍜屽熬
+
+ bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
+
+ return bytes ;
+ }
+
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_37_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_37_Down.java
new file mode 100644
index 0000000..735b656
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_37_Down.java
@@ -0,0 +1,267 @@
+package com.dy.common.mw.protocol.p206V202404.parse;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V202404.CodeV202404;
+import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd35Vo;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd37Vo;
+import com.dy.common.mw.protocol.p206V202404.parse.global.GlCreate;
+import com.dy.common.util.ByteUtil;
+import com.dy.common.util.NumUtil;
+
+@AnnotationCodeDown(ifAny={
+ CodeV202404.cd_37
+})
+public class Cd_37_Down implements CodeParse {
+
+ @Override
+ public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
+ ParseParamsForDownV202404 para = (ParseParamsForDownV202404) params ;
+ byte[] bs = this.doParse(para) ;
+
+ MidResultToRtu midRs = new MidResultToRtu() ;
+ midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+ midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙�
+ midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
+ midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
+ midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉
+ midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�;
+ midRs.downCodeName = CodeV202404.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�;
+ midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁
+ midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡
+ midRs.hasResponse = true ;//鏄惁鏈夊簲绛�
+ midRs.maxSendTimes = null ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆
+ midRs.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨锛屼綆鍔熻�楁椂涓簍rue
+
+ midRs.isSendFirst = false ;//鍛戒护搴旂瓟锛岄鍏堝彂閫侊紝闃叉RTU閲嶆柊涓婃姤
+ if(isLowPower != null && isLowPower.booleanValue()){
+ //浣庡姛鑰楁椂锛屽敖蹇彂閫�
+ midRs.isQuickSend = true ;
+ }
+
+ return new MidResult[]{midRs} ;
+ }
+ /**
+ * 鏋勯�犱笅琛屾暟鎹�
+ * @param para 鍙傛暟
+ * @return 瀛楄妭鏁扮粍
+ * @throws Exception 寮傚父
+ */
+ public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
+ byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
+ if(para.param != null){
+ JSONObject obj = (JSONObject)para.param;
+ String json = obj.toJSONString();
+ ComCd37Vo cvo = JSON.parseObject(json, ComCd37Vo.class) ;
+ if(cvo == null){
+ throw new Exception("json杞珻omCd37Vo涓簄ull") ;
+ }
+ if(cvo.waterRemain != null){
+ if(cvo.waterRemain < 0 || cvo.waterRemain > 99999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑姘撮噺蹇呴』鏄�0~99999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.moneyRemain != null){
+ if(cvo.moneyRemain < 0 || cvo.moneyRemain > 999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑閲戦蹇呴』鏄�0~999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.waterPrice != null){
+ if(cvo.waterPrice < 0 || cvo.waterPrice > 99.99){
+ throw new Exception("姘撮噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.elePrice != null){
+ if(cvo.elePrice < 0 || cvo.elePrice > 99.99){
+ throw new Exception("鐢甸噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(!NumUtil.isPlusIntNumber(cvo.orderNo)){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.orderNo.length() != 16){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+
+ if(cvo.year == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉鑳戒负绌�") ;
+ }
+ if(cvo.year < 24 || cvo.year > 9999){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
+ }
+ if(cvo.year > 99 && cvo.year < 2024){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
+ }
+ if(cvo.month == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏈堜笉鑳戒负绌�") ;
+ }
+ if(cvo.month < 1 || cvo.month > 12){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏈堜笉姝g‘") ;
+ }
+ if(cvo.day == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃ヤ笉鑳戒负绌�") ;
+ }
+ if(cvo.day < 1 || cvo.day > 31){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃ヤ笉姝g‘") ;
+ }
+ if(cvo.hour == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃朵笉鑳戒负绌�") ;
+ }
+ if(cvo.hour < 0 || cvo.hour > 23){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃朵笉姝g‘") ;
+ }
+ if(cvo.minute == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃朵笉鑳戒负绌�") ;
+ }
+ if(cvo.minute < 0 || cvo.minute > 59){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鍒嗕笉姝g‘") ;
+ }
+
+ if(cvo.minutes == null || cvo.minutes == 0.0){
+ throw new Exception("鐢ㄦ按鏃堕暱涓嶈兘涓虹┖鎴栦负0") ;
+ }
+ if(cvo.minutes < 0 || cvo.minutes > 9999){
+ throw new Exception("鐢ㄦ按鏃堕暱鍙栧�艰寖鍥存槸0~9999鍒嗛挓") ;
+ }
+
+ byte[] bs = new byte[53] ;
+ int index = 0 ;
+ bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
+
+ index ++ ;
+ bs[index] = cvo.projectNo.byteValue() ;
+
+ index ++ ;
+ GlCreate.createValveOrPump(cvo.controllerType, bs, index) ;
+
+ index ++ ;
+ GlCreate.createIcCardNo(cvo.icCardNo, bs, index);
+
+ index += 8 ;
+ if(cvo.waterRemain == null){
+ cvo.waterRemain = 0.0 ;
+ }
+ String strTemp = "" + Double.valueOf(cvo.waterRemain * 100).intValue() ;
+ byte[] bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ int bTempLen = bTemp.length ;
+ int count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 5){
+ break ;
+ }
+ }
+ for(; count < 5; count++){
+ bs[index++] = 0 ;
+ }
+
+ if(cvo.moneyRemain == null){
+ cvo.moneyRemain = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.moneyRemain * 10000)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 4){
+ break ;
+ }
+ }
+ for(; count < 4; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.waterPrice == null){
+ cvo.waterPrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.waterPrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.elePrice == null){
+ cvo.elePrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.elePrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ ByteUtil.string2BCD_BE(bs, cvo.orderNo, index) ;
+
+ index += 8 ;
+ GlCreate.createDt(bs, index);
+
+ index += 6 ;
+ bs[index++] = 0 ;//绉�
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.minute)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.hour)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.day)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.month)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.year)[0] ;
+
+ bTemp = ByteUtil.int2BCD_LE(cvo.minutes) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+ GlCreate.createPw(bs, index);
+
+ index += 2 ;
+ GlCreate.createS2D(bs, index) ;
+
+ index += 4 ;
+ bs[index] = 0 ; //鏃跺欢
+
+ bytes = ByteUtil.bytesMerge(bytes, bs) ;
+ }else{
+ throw new Exception("涓嬭鍛戒护鍙傛暟鎹负null") ;
+ }
+ GlCreate.createLen(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑
+
+ byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC鍜屽熬
+
+ bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
+
+ return bytes ;
+ }
+
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_38_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_38_Down.java
new file mode 100644
index 0000000..56e7852
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_38_Down.java
@@ -0,0 +1,266 @@
+package com.dy.common.mw.protocol.p206V202404.parse;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V202404.CodeV202404;
+import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd38Vo;
+import com.dy.common.mw.protocol.p206V202404.parse.global.GlCreate;
+import com.dy.common.util.ByteUtil;
+import com.dy.common.util.NumUtil;
+
+@AnnotationCodeDown(ifAny={
+ CodeV202404.cd_38
+})
+public class Cd_38_Down implements CodeParse {
+
+ @Override
+ public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
+ ParseParamsForDownV202404 para = (ParseParamsForDownV202404) params ;
+ byte[] bs = this.doParse(para) ;
+
+ MidResultToRtu midRs = new MidResultToRtu() ;
+ midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+ midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙�
+ midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
+ midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
+ midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉
+ midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�;
+ midRs.downCodeName = CodeV202404.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�;
+ midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁
+ midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡
+ midRs.hasResponse = true ;//鏄惁鏈夊簲绛�
+ midRs.maxSendTimes = null ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆
+ midRs.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨锛屼綆鍔熻�楁椂涓簍rue
+
+ midRs.isSendFirst = false ;//鍛戒护搴旂瓟锛岄鍏堝彂閫侊紝闃叉RTU閲嶆柊涓婃姤
+ if(isLowPower != null && isLowPower.booleanValue()){
+ //浣庡姛鑰楁椂锛屽敖蹇彂閫�
+ midRs.isQuickSend = true ;
+ }
+
+ return new MidResult[]{midRs} ;
+ }
+ /**
+ * 鏋勯�犱笅琛屾暟鎹�
+ * @param para 鍙傛暟
+ * @return 瀛楄妭鏁扮粍
+ * @throws Exception 寮傚父
+ */
+ public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
+ byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
+ if(para.param != null){
+ JSONObject obj = (JSONObject)para.param;
+ String json = obj.toJSONString();
+ ComCd38Vo cvo = JSON.parseObject(json, ComCd38Vo.class) ;
+ if(cvo == null){
+ throw new Exception("json杞珻omCd35Vo涓簄ull") ;
+ }
+ if(cvo.waterRemain != null){
+ if(cvo.waterRemain < 0 || cvo.waterRemain > 99999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑姘撮噺蹇呴』鏄�0~99999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.moneyRemain != null){
+ if(cvo.moneyRemain < 0 || cvo.moneyRemain > 999999.99){
+ throw new Exception("鐢ㄦ埛鍓╀綑閲戦蹇呴』鏄�0~999999.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.waterPrice != null){
+ if(cvo.waterPrice < 0 || cvo.waterPrice > 99.99){
+ throw new Exception("姘撮噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(cvo.elePrice != null){
+ if(cvo.elePrice < 0 || cvo.elePrice > 99.99){
+ throw new Exception("鐢甸噺鍗曚环蹇呴』鏄�0~99.99鑼冨洿鍐呯殑鏁版嵁") ;
+ }
+ }
+ if(!NumUtil.isPlusIntNumber(cvo.orderNo)){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.orderNo.length() != 16){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+
+ if(cvo.year == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉鑳戒负绌�") ;
+ }
+ if(cvo.year < 24 || cvo.year > 9999){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
+ }
+ if(cvo.year > 99 && cvo.year < 2024){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---骞翠笉姝g‘") ;
+ }
+ if(cvo.month == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏈堜笉鑳戒负绌�") ;
+ }
+ if(cvo.month < 1 || cvo.month > 12){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏈堜笉姝g‘") ;
+ }
+ if(cvo.day == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃ヤ笉鑳戒负绌�") ;
+ }
+ if(cvo.day < 1 || cvo.day > 31){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃ヤ笉姝g‘") ;
+ }
+ if(cvo.hour == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃朵笉鑳戒负绌�") ;
+ }
+ if(cvo.hour < 0 || cvo.hour > 23){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃朵笉姝g‘") ;
+ }
+ if(cvo.minute == null){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鏃朵笉鑳戒负绌�") ;
+ }
+ if(cvo.minute < 0 || cvo.minute > 59){
+ throw new Exception("璁″垝寮�闃�鏃堕棿---鍒嗕笉姝g‘") ;
+ }
+
+ if(cvo.waterAmount == null || cvo.waterAmount == 0.0){
+ throw new Exception("棰勭敤姘撮噺涓嶈兘涓虹┖鎴栦负0") ;
+ }
+ if(cvo.waterAmount < 0 || cvo.waterAmount > 9999){
+ throw new Exception("棰勭敤姘撮噺鍙栧�艰寖鍥存槸0~9999m3") ;
+ }
+
+ byte[] bs = new byte[53] ;
+ int index = 0 ;
+ bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
+
+ index ++ ;
+ bs[index] = cvo.projectNo.byteValue() ;
+
+ index ++ ;
+ GlCreate.createValveOrPump(cvo.controllerType, bs, index) ;
+
+ index ++ ;
+ GlCreate.createIcCardNo(cvo.icCardNo, bs, index);
+
+ index += 8 ;
+ if(cvo.waterRemain == null){
+ cvo.waterRemain = 0.0 ;
+ }
+ String strTemp = "" + Double.valueOf(cvo.waterRemain * 100).intValue() ;
+ byte[] bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ int bTempLen = bTemp.length ;
+ int count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 5){
+ break ;
+ }
+ }
+ for(; count < 5; count++){
+ bs[index++] = 0 ;
+ }
+
+ if(cvo.moneyRemain == null){
+ cvo.moneyRemain = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.moneyRemain * 10000)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 4){
+ break ;
+ }
+ }
+ for(; count < 4; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.waterPrice == null){
+ cvo.waterPrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.waterPrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ if(cvo.elePrice == null){
+ cvo.elePrice = 0.0 ;
+ }
+ strTemp = "" + (Double.valueOf(cvo.elePrice * 100)).intValue() ;
+ bTemp = ByteUtil.string2BCD_LE(strTemp) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+
+ ByteUtil.string2BCD_BE(bs, cvo.orderNo, index) ;
+
+ index += 8 ;
+ GlCreate.createDt(bs, index);
+
+ index += 6 ;
+ bs[index++] = 0 ;//绉�
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.minute)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.hour)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.day)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.month)[0] ;
+ bs[index++] = ByteUtil.int2BCD_LE(cvo.year)[0] ;
+
+ bTemp = ByteUtil.int2BCD_LE(cvo.waterAmount) ;
+ bTempLen = bTemp.length ;
+ count = 0 ;
+ for(int i = 0 ; i < bTempLen; i++){
+ bs[index++] = bTemp[i] ;
+ count ++ ;
+ if(count >= 2){
+ break ;
+ }
+ }
+ for(; count < 2; count++){
+ bs[index++] = 0 ;
+ }
+
+ GlCreate.createPw(bs, index);
+
+ index += 2 ;
+ GlCreate.createS2D(bs, index) ;
+
+ index += 4 ;
+ bs[index] = 0 ; //鏃跺欢
+
+ bytes = ByteUtil.bytesMerge(bytes, bs) ;
+ }else{
+ throw new Exception("涓嬭鍛戒护鍙傛暟鎹负null") ;
+ }
+ GlCreate.createLen(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑
+
+ byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC鍜屽熬
+
+ bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
+
+ return bytes ;
+ }
+
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_93_A3_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_93_A3_Up.java
index ae7d890..66a3ae9 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_93_A3_Up.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_93_A3_Up.java
@@ -4,13 +4,14 @@
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V202404.*;
import com.dy.common.mw.protocol.p206V202404.parse.global.GlParse;
-import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_A3Vo;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_9D_A3Vo;
import com.dy.common.mw.protocol.rtuState.ValveStateInfo;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@AnnotationCodeUp(ifAny={
CodeV202404.cd_93,
+ CodeV202404.cd_9D,
CodeV202404.cd_A3
})
@SuppressWarnings("unused")
@@ -46,7 +47,7 @@
callback.callback(midRs.reportOrResponse_trueOrFalse, para.data.subData==null?null:((DataV202404)(para.data.subData)).subData);
if(para.data != null && para.data.getSubData() != null){
- DataCd93_A3Vo subData = (DataCd93_A3Vo)((DataV202404)para.data.getSubData()).subData ;
+ DataCd93_9D_A3Vo subData = (DataCd93_9D_A3Vo)((DataV202404)para.data.getSubData()).subData ;
//opResult ;//鍏虫车/闃�缁撴灉: 0x00:鎴愬姛 0x81:澶辫触
callback.notify(new ValveStateInfo(subData.clResult.byteValue()==0?false:true));
}
@@ -63,7 +64,7 @@
*/
protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception {
DataV202404 dV202404 = (DataV202404)data.getSubData() ;
- DataCd93_A3Vo cdData = new DataCd93_A3Vo(CodeV202404.getCodeName(dataCode)) ;
+ DataCd93_9D_A3Vo cdData = new DataCd93_9D_A3Vo(CodeV202404.getCodeName(dataCode)) ;
dV202404.subData = cdData ;
GlParse.parseCd93A3(bs, cdData) ;
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_9D_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_9D_Down.java
new file mode 100644
index 0000000..83b1d94
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_9D_Down.java
@@ -0,0 +1,120 @@
+package com.dy.common.mw.protocol.p206V202404.parse;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.mw.protocol.*;
+import com.dy.common.mw.protocol.p206V202404.CodeV202404;
+import com.dy.common.mw.protocol.p206V202404.ParseParamsForDownV202404;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd92_A2Vo;
+import com.dy.common.mw.protocol.p206V202404.downVos.ComCd9DVo;
+import com.dy.common.mw.protocol.p206V202404.parse.global.GlCreate;
+import com.dy.common.util.ByteUtil;
+import com.dy.common.util.NumUtil;
+
+@AnnotationCodeDown(ifAny={
+ CodeV202404.cd_9D
+})
+public class Cd_9D_Down implements CodeParse {
+
+ @Override
+ public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback) throws Exception {
+ ParseParamsForDownV202404 para = (ParseParamsForDownV202404) params ;
+ byte[] bs = this.doParse(para) ;
+
+ MidResultToRtu midRs = new MidResultToRtu() ;
+ midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О
+ midRs.protocolVersion = para.protocolVersion ;//鍗忚鐗堟湰鍙�
+ midRs.rtuResultSendWebUrl = para.rtuResultSendWebUrl ;
+ midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃
+ midRs.commandId = para.commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉
+ midRs.downCode = para.commandCode ;//涓嬭鍛戒护鍔熻兘鐮�;
+ midRs.downCodeName = CodeV202404.getCodeName(para.commandCode) ;//涓嬭鍛戒护鍔熻兘鐮佸悕绉�;
+ midRs.downBuffer = bs ;//涓嬭鍛戒护鏁版嵁
+ midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡
+ midRs.hasResponse = true ;//鏄惁鏈夊簲绛�
+ midRs.maxSendTimes = null ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆
+ midRs.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨锛屼綆鍔熻�楁椂涓簍rue
+
+ midRs.isSendFirst = false ;//鍛戒护搴旂瓟锛岄鍏堝彂閫侊紝闃叉RTU閲嶆柊涓婃姤
+ if(isLowPower != null && isLowPower.booleanValue()){
+ //浣庡姛鑰楁椂锛屽敖蹇彂閫�
+ midRs.isQuickSend = true ;
+ }
+
+ return new MidResult[]{midRs} ;
+ }
+ /**
+ * 鏋勯�犱笅琛屾暟鎹�
+ * @param para 鍙傛暟
+ * @return 瀛楄妭鏁扮粍
+ * @throws Exception 寮傚父
+ */
+ public byte[] doParse(ParseParamsForDownV202404 para) throws Exception {
+ byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode);
+ if(para.param != null){
+ JSONObject obj = (JSONObject)para.param;
+ String json = obj.toJSONString();
+ ComCd9DVo cvo = JSON.parseObject(json, ComCd9DVo.class) ;
+ if(cvo == null){
+ throw new Exception("json杞珻omCd9DVo涓簄ull") ;
+ }
+ if(cvo.icCardAddr == null || cvo.icCardAddr.trim().equals("")){
+ throw new Exception("鐢ㄦ埛IC鍗″湴鍧�蹇呴』鎻愪緵") ;
+ }
+ if(cvo.icCardNo == null || cvo.icCardNo.trim().equals("")){
+ throw new Exception("鐢ㄦ埛IC鍗″彿蹇呴』鎻愪緵") ;
+ }
+ if(cvo.orderNo == null || cvo.orderNo.trim().equals("")){
+ throw new Exception("璁㈠崟鍙峰繀椤绘彁渚�") ;
+ }
+ if(!NumUtil.isPlusIntNumber(cvo.orderNo)){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+ if(cvo.orderNo.length() != 16){
+ throw new Exception("璁㈠崟鍙峰繀椤绘槸16浣嶆暟瀛�") ;
+ }
+
+
+ byte[] bs = new byte[29] ;
+ int index = 0 ;
+ bs[index] = (byte)(Integer.parseInt(cvo.controllerType, 16));
+
+ index ++ ;
+ bs[index] = cvo.projectNo.byteValue() ;
+
+ index ++ ;
+ GlCreate.createValveOrPump(cvo.controllerType, bs, index) ;
+
+ index ++ ;
+ GlCreate.createIcCardAddr(cvo.icCardAddr, bs, index) ;
+
+ index += 4 ;
+ GlCreate.createIcCardNo(cvo.icCardNo, bs, index);
+
+ index += 8 ;
+ ByteUtil.string2BCD_BE(bs, cvo.orderNo, index) ;
+
+ index += 8 ;
+ GlCreate.createPw(bs, index);
+
+ index += 2 ;
+ GlCreate.createS2D(bs, index) ;
+
+ index += 4 ;
+ bs[index] = 0 ; //鏃跺欢
+
+ bytes = ByteUtil.bytesMerge(bytes, bs) ;
+ }else{
+ throw new Exception("涓嬭鍛戒护鍙傛暟鎹负null") ;
+ }
+ GlCreate.createLen(bytes);//闀垮害鏀惧瓧鑺傛暟缁勪腑
+
+ byte[] bsTail = GlCreate.createCrcTail(bytes) ;//CRC鍜屽熬
+
+ bytes = ByteUtil.bytesMerge(bytes, bsTail) ;
+
+ return bytes ;
+ }
+
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java
index df54556..66ca03c 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java
@@ -306,7 +306,7 @@
* @param cdData
* @throws Exception
*/
- public static void parseCd93A3(byte[] bs, DataCd93_A3Vo cdData) throws Exception {
+ public static void parseCd93A3(byte[] bs, DataCd93_9D_A3Vo cdData) throws Exception {
int index = ProtocolConstantV206V202404.dataIndex ;
cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ;
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd35_36Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd35_36Vo.java
new file mode 100644
index 0000000..e9d12f2
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd35_36Vo.java
@@ -0,0 +1,114 @@
+package com.dy.common.mw.protocol.p206V202404.upVos;
+
+import com.dy.common.mw.protocol.UpComResVo;
+import com.dy.common.mw.protocol.p206V202404.CodeV202404;
+import com.dy.common.mw.protocol.p206V202404.CommonV202404;
+import lombok.Data;
+
+//APP绔繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�
+@Data
+public class DataCd35_36Vo implements UpComResVo {
+
+ public String controllerType;//鎺у埗鍣ㄧ被鍨�
+ public Integer projectNo ;//椤圭洰缂栧彿
+ public String icCardNo ;//IC鍗$紪鍙凤紙17浣嶆暟瀛楋級
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ //public String opDt ;//寮�娉�/闃�鏃堕棿锛坹yyy-mm-dd HH:MM:SS锛�
+ public Byte opType ;//寮�闃�绫诲瀷
+ public Byte opResult ;//寮�鍚车/闃�缁撴灉: 0x01:鎴愬姛 0x81:澶辫触
+
+ public String comName ;//鍛戒护鍚嶇О
+
+ //鏃犲弬鏋勯�犲嚱鏁帮紝璁剧疆鍛戒护鍚嶇О
+ public DataCd35_36Vo(){
+ this.comName = CodeV202404.getCodeName(CodeV202404.cd_35) ;
+ }
+ //鏈夊弬鏋勯�犲嚱鏁帮紝璁剧疆鍛戒护鍚嶇О
+ public DataCd35_36Vo(String comName){
+ this.comName = comName ;
+ }
+
+ //閲嶅啓toString鏂规硶锛岃繑鍥濪ataCd35Vo瀵硅薄鐨勫瓧绗︿覆琛ㄧず
+ public String toString(){
+ StringBuffer sb = new StringBuffer() ;
+ sb.append(" " + comName + " : \n") ;
+ sb.append(" 鎺у埗鍣ㄧ被鍨� : ") ;
+ sb.append(CommonV202404.ctrlDevType(controllerType)) ;
+ sb.append("\n") ;
+ sb.append(" 椤圭洰缂栧彿 : ") ;
+ sb.append(projectNo == null?"鏈煡":projectNo) ;
+ sb.append("\n") ;
+ sb.append(" IC鍗$紪鍙� : ") ;
+ sb.append(icCardNo == null?"鏈煡":icCardNo) ;
+ sb.append("\n") ;
+ sb.append(" 璁㈠崟鍙� : ") ;
+ sb.append(orderNo == null?"鏈煡":orderNo) ;
+ sb.append("\n") ;
+
+ /*
+ sb.append(" 寮�娉�/闃�鏃堕棿 : ") ;
+ sb.append(opDt == null?"鏈煡":opDt) ;
+ sb.append("\n") ;
+ */
+
+ sb.append(" 寮�鍚车/闃�绫诲瀷 : ") ;
+ sb.append(opType == null?"鏈煡":(opType.byteValue() == 0x02 ? "骞冲彴":"鐢ㄦ埛")) ;
+ sb.append("\n") ;
+ sb.append(" 寮�鍚车/闃�缁撴灉 : ") ;
+ sb.append(opResult == null?"鏈煡":(opResult.byteValue() == 0x01 ? "鎴愬姛":"澶辫触")) ;
+ sb.append("\n") ;
+ return sb.toString() ;
+ }
+
+ //閲嶅啓toStr鏂规硶锛岃繑鍥濪ataCd35Vo瀵硅薄鐨勫瓧绗︿覆琛ㄧず锛屾牴鎹畇howBase鍙傛暟鍐冲畾鏄惁鏄剧ず鍩虹淇℃伅
+ public String toStr(boolean showBase){
+ StringBuffer sb = new StringBuffer() ;
+ if(showBase){
+ sb.append(comName + " : \n") ;
+ sb.append("鎺у埗鍣ㄧ被鍨� : ") ;
+ sb.append(CommonV202404.ctrlDevType(controllerType)) ;
+ sb.append("\n") ;
+ sb.append("椤圭洰缂栧彿 : ") ;
+ sb.append(projectNo == null?"鏈煡":projectNo) ;
+ sb.append("\n") ;
+ }
+ sb.append("IC鍗$紪鍙� : ") ;
+ sb.append(icCardNo == null?"鏈煡":icCardNo) ;
+ sb.append("\n") ;
+ sb.append("璁㈠崟鍙� : ") ;
+ sb.append(orderNo == null?"鏈煡":orderNo) ;
+ sb.append("\n") ;
+
+ /*
+ sb.append("寮�娉�/闃�鏃堕棿 : ") ;
+ sb.append(opDt == null?"鏈煡":opDt) ;
+ sb.append("\n") ;
+ */
+
+ sb.append("寮�鍚车/闃�绫诲瀷 : ") ;
+ sb.append(opType == null?"鏈煡":(opType.byteValue() == 0x02 ? "骞冲彴":"鐢ㄦ埛")) ;
+ sb.append("\n") ;
+ sb.append("寮�鍚车/闃�缁撴灉 : ") ;
+ sb.append(opResult == null?"鏈煡":(opResult.byteValue() == 0x01 ? "鎴愬姛":"澶辫触")) ;
+ sb.append("\n") ;
+ return sb.toString() ;
+ }
+
+
+ //閲嶅啓comLog鏂规硶锛岃繑鍥濪ataCd35Vo瀵硅薄鐨勫瓧绗︿覆琛ㄧず锛岀敤浜庤褰曟棩蹇�
+ public String comLog(){
+ StringBuilder sb = new StringBuilder() ;
+ sb.append("杩滅▼寮�闃�鍛戒护鍥炲:\n");
+ sb.append(opResult == null?"鏈煡":(opResult.byteValue() == 0x01 ? "鎴愬姛":"澶辫触"));
+ sb.append("\n");
+
+ return sb.toString() ;
+ }
+
+ //閲嶅啓comLog鏂规硶锛屾牴鎹甤ode鍙傛暟杩斿洖DataCd35Vo瀵硅薄鐨勫瓧绗︿覆琛ㄧず锛岀敤浜庤褰曟棩蹇�
+ @Override
+ public String comLog(String code) {
+ return null;
+ }
+
+}
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd92_A2Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd92_A2Vo.java
index 222f6d7..7e57276 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd92_A2Vo.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd92_A2Vo.java
@@ -16,7 +16,7 @@
//2025-05-13姹熸捣鍙垹闄�
//public String opDt ;//寮�娉�/闃�鏃堕棿锛坹yyy-mm-dd HH:MM:SS锛�
public Byte opType ;//寮�闃�绫诲瀷
- public Byte opResult ;//寮�鍚车/闃�缁撴灉: 0x00:鎴愬姛 0x81:澶辫触
+ public Byte opResult ;//寮�鍚车/闃�缁撴灉: 0x01:鎴愬姛 0x81:澶辫触
public String comName ;//鍛戒护鍚嶇О
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_A3Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_9D_A3Vo.java
similarity index 97%
rename from pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_A3Vo.java
rename to pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_9D_A3Vo.java
index 5ac8543..0fa457e 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_A3Vo.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd93_9D_A3Vo.java
@@ -9,7 +9,7 @@
//骞冲彴/APP杩滅▼鍏抽棴姘存车/闃�闂� + 鍒峰崱鍏虫车/闃�涓婃姤
@Data
@EqualsAndHashCode(callSuper=false)
-public class DataCd93_A3Vo extends AlarmVo implements UpComResVo {
+public class DataCd93_9D_A3Vo extends AlarmVo implements UpComResVo {
public String controllerType;//鎺у埗鍣ㄧ被鍨�
public Integer projectNo ;//椤圭洰缂栧彿
@@ -30,10 +30,10 @@
public Integer thisDuration;//鏈浣跨敤鏃堕棿闀�, 鍗曚綅锛氬垎閽�
public String comName ;//鍛戒护鍚嶇О
- public DataCd93_A3Vo(){
+ public DataCd93_9D_A3Vo(){
this.comName = CodeV202404.getCodeName(CodeV202404.cd_93) ;
}
- public DataCd93_A3Vo(String comName){
+ public DataCd93_9D_A3Vo(String comName){
this.comName = comName ;
}
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/CommandSv.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/CommandSv.java
index a862c21..9bc0238 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/CommandSv.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/CommandSv.java
@@ -16,6 +16,7 @@
import com.dy.pipIrrGlobal.pojoPr.PrController;
import com.dy.pipIrrGlobal.pojoRm.RmCommandHistory;
import com.dy.pipIrrGlobal.rtuMw.Web2RtuMw;
+import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
@@ -81,6 +82,7 @@
* @param operator
* @return
*/
+ @Transactional(rollbackFor = Exception.class)
public RmCommandHistory saveComHistoryPo(RmCommandHistoryMapper rmCommandHistoryDao,
Long comId,
String protocol,
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmCommandOpenMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmCommandOpenMapper.java
new file mode 100644
index 0000000..b0f63a4
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmCommandOpenMapper.java
@@ -0,0 +1,31 @@
+package com.dy.pipIrrGlobal.daoRm;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/27 10:31
+ * @Description
+ */
+@Mapper
+public interface RmCommandOpenMapper extends BaseMapper<RmCommandOpen> {
+
+ int deleteByPrimaryKey(Long id);
+
+ int insert(RmCommandOpen record);
+
+ int insertSelective(RmCommandOpen record);
+
+ RmCommandOpen selectByPrimaryKey(Long id);
+
+ List<RmCommandOpen> selectByIntakeId(Long intakeId);
+
+ int updateByPrimaryKeySelective(RmCommandOpen record);
+
+ int updateByPrimaryKey(RmCommandOpen record);
+
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureHistoryMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureHistoryMapper.java
index c4f3aa0..cd6f693 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureHistoryMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureHistoryMapper.java
@@ -1,7 +1,9 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmManureHistory;
import com.dy.pipIrrGlobal.voRm.VoManure;
+import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@@ -11,7 +13,8 @@
* @Date: 2025/6/25 10:03
* @Description
*/
-public interface RmManureHistoryMapper {
+@Mapper
+public interface RmManureHistoryMapper extends BaseMapper<RmManureHistory> {
int deleteByPrimaryKey(Long id);
int insert(RmManureHistory record);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureLastMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureLastMapper.java
index 1fa5b88..6eb883e 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureLastMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmManureLastMapper.java
@@ -1,7 +1,9 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmManureLast;
import com.dy.pipIrrGlobal.voRm.VoManure;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -12,7 +14,8 @@
* @Date: 2025/6/25 10:03
* @Description
*/
-public interface RmManureLastMapper {
+@Mapper
+public interface RmManureLastMapper extends BaseMapper<RmManureLast> {
int deleteByPrimaryKey(Long id);
int insert(RmManureLast record);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilDayMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilDayMapper.java
index 4310755..23fc86a 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilDayMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilDayMapper.java
@@ -1,9 +1,12 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmManureLast;
import com.dy.pipIrrGlobal.pojoRm.RmSoilDay;
import com.dy.pipIrrGlobal.pojoRm.RmSoilLast;
import com.dy.pipIrrGlobal.voRm.VoSoil;
import com.dy.pipIrrGlobal.voRm.VoSoilDay;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -14,7 +17,8 @@
* @Date: 2025/6/25 10:04
* @Description
*/
-public interface RmSoilDayMapper {
+@Mapper
+public interface RmSoilDayMapper extends BaseMapper<RmSoilDay> {
int deleteByPrimaryKey(Long id);
int insert(RmSoilDay record);
@@ -30,6 +34,12 @@
* @return
*/
List<VoSoilDay> selectOneBySoilId(@Param("soilId") Long soilId, @Param("ymd") Integer ymd);
+ /**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍
+ * @param soilId
+ * @return
+ */
+ List<VoSoilDay> selectOneMonthBySoilId(@Param("soilId") Long soilId, @Param("ymdStart") Integer ymdStart, @Param("ymdEnd") Integer ymdEnd);
/**
* 鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍鏁伴噺
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilHistoryMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilHistoryMapper.java
index 9d07be9..9dcfa07 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilHistoryMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilHistoryMapper.java
@@ -1,7 +1,10 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmSoilDay;
import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory;
import com.dy.pipIrrGlobal.voRm.VoSoil;
+import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@@ -11,7 +14,8 @@
* @Date: 2025/6/25 10:04
* @Description
*/
-public interface RmSoilHistoryMapper {
+@Mapper
+public interface RmSoilHistoryMapper extends BaseMapper<RmSoilHistory> {
int deleteByPrimaryKey(Long id);
int insert(RmSoilHistory record);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilLastMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilLastMapper.java
index f2f5382..117a542 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilLastMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmSoilLastMapper.java
@@ -1,7 +1,10 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmSoilHistory;
import com.dy.pipIrrGlobal.pojoRm.RmSoilLast;
import com.dy.pipIrrGlobal.voRm.VoSoil;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -12,7 +15,8 @@
* @Date: 2025/6/25 10:04
* @Description
*/
-public interface RmSoilLastMapper {
+@Mapper
+public interface RmSoilLastMapper extends BaseMapper<RmSoilLast> {
int deleteByPrimaryKey(Long id);
int insert(RmSoilLast record);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherHistoryMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherHistoryMapper.java
index 10ae489..ffa0532 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherHistoryMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherHistoryMapper.java
@@ -1,7 +1,10 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmSoilLast;
import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory;
import com.dy.pipIrrGlobal.voRm.VoWeather;
+import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@@ -11,7 +14,8 @@
* @Date: 2025/6/25 10:39
* @Description
*/
-public interface RmWeatherHistoryMapper {
+@Mapper
+public interface RmWeatherHistoryMapper extends BaseMapper<RmWeatherHistory> {
int deleteByPrimaryKey(Long id);
int insert(RmWeatherHistory record);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherLastMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherLastMapper.java
index d5e33d1..3c7c4fa 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherLastMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmWeatherLastMapper.java
@@ -1,7 +1,10 @@
package com.dy.pipIrrGlobal.daoRm;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmWeatherHistory;
import com.dy.pipIrrGlobal.pojoRm.RmWeatherLast;
import com.dy.pipIrrGlobal.voRm.VoWeather;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -12,7 +15,8 @@
* @Date: 2025/6/25 10:39
* @Description
*/
-public interface RmWeatherLastMapper {
+@Mapper
+public interface RmWeatherLastMapper extends BaseMapper<RmWeatherLast> {
int deleteByPrimaryKey(Long id);
int insert(RmWeatherLast record);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandOpen.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandOpen.java
new file mode 100644
index 0000000..f6325b7
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmCommandOpen.java
@@ -0,0 +1,82 @@
+package com.dy.pipIrrGlobal.pojoRm;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dy.common.po.BaseEntity;
+import lombok.*;
+
+import java.util.Date;
+
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/27 10:31
+ * @Description
+ */
+@TableName(value = "rm_command_open", autoResultMap = true)
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+public class RmCommandOpen implements BaseEntity {
+
+ public static final long serialVersionUID = 202506271017001L;
+ /**
+ * 涓婚敭
+ */
+ @TableId(type = IdType.INPUT)
+ public Long id;
+
+ /**
+ * 鍛戒护id
+ */
+ public Long comId;
+
+ /**
+ * 鍔熻兘鐮�
+ */
+ public String commandCode;
+
+ /**
+ * 鍔熻兘鍛戒护鍚嶇О
+ */
+ public String commandName;
+
+ /**
+ * 鍙栨按鍙d
+ */
+ public Long intakeId;
+
+ /**
+ * 鎺у埗鍣ㄥ湴鍧�
+ */
+ public String rtuAddr;
+
+ /**
+ * 鍗忚鍚嶇О
+ */
+ public String protocol;
+
+ /**
+ * 铏氭嫙鍗″彿
+ */
+ public Long vcNum;
+
+ /**
+ * 璁㈠崟鍙�
+ */
+ public String orderNo;
+
+ /**
+ * 鍛戒护鍙戦�佹椂闂�
+ */
+ public Date sendTime;
+
+ /**
+ * 鎿嶄綔浜猴紙鐢ㄦ埛锛�
+ */
+ public Long operator;
+
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoManure.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoManure.java
index ceaac69..cf0fcc0 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoManure.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoManure.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -14,6 +15,13 @@
* @Description
*/
@Data
+@JsonPropertyOrder({
+ "id", "manureId", "manureName", "dt", "alarm",
+ "stirRunning1", "stirRunning2", "stirRunning3", "stirRunning4",
+ "injectRunning", "irrRunning",
+ "manureFlow", "manureTime", "stirTime",
+ "stirDuration", "injectDuration"
+})
public class VoManure {
public static final long serialVersionUID = 202506251634001L;
@@ -34,7 +42,7 @@
* 姘磋偉鏈哄悕绉�
*/
@Schema(description = "姘磋偉鏈哄悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- public Long manureName;
+ public String manureName;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoil.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoil.java
index db2a3ff..a2312f4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoil.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoil.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -14,6 +15,11 @@
* @Description
*/
@Data
+@JsonPropertyOrder({
+ "id", "soilId", "soilName", "dt",
+ "soilHumidity1", "soilHumidity2", "soilHumidity3", "soilHumidity4", "soilHumidity5",
+ "soilTemperature1", "soilTemperature2", "soilTemperature3", "soilTemperature4", "soilTemperature5"
+})
public class VoSoil {
public static final long serialVersionUID = 202506260903001L;
@@ -34,7 +40,7 @@
* 澧掓儏绔欏悕绉�
*/
@Schema(description = "澧掓儏绔欏悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- public Long soilName;
+ public String soilName;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoilDay.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoilDay.java
index e7bceca..f38ecd6 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoilDay.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoSoilDay.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -14,6 +15,11 @@
* @Description
*/
@Data
+@JsonPropertyOrder({
+ "id", "soilId", "soilName", "dt",
+ "soilHumidity1", "soilHumidity2", "soilHumidity3", "soilHumidity4", "soilHumidity5",
+ "soilTemperature1", "soilTemperature2", "soilTemperature3", "soilTemperature4", "soilTemperature5"
+})
public class VoSoilDay {
public static final long serialVersionUID = 202506261020001L;
@@ -34,7 +40,7 @@
* 澧掓儏绔欏悕绉�
*/
@Schema(description = "澧掓儏绔欏悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- public Long soilName;
+ public String soilName;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoWeather.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoWeather.java
index 2b16a61..c6ec18d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoWeather.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoWeather.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -14,6 +15,13 @@
* @Description
*/
@Data
+@JsonPropertyOrder({
+ "id", "weatherId", "weatherName", "dt",
+ "airTemperature", "airHumidity",
+ "ultraviolet", "lightIntensity",
+ "rainfall", "windSpeed",
+ "windDirection", "windDirectionStr"
+})
public class VoWeather {
public static final long serialVersionUID = 202506260903001L;
@@ -34,7 +42,7 @@
* 姘旇薄绔欏悕绉�
*/
@Schema(description = "姘旇薄绔欏悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
- public Long weatherName;
+ public String weatherName;
/**
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml
index 210b2c3..2ab36d6 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml
@@ -93,7 +93,7 @@
select
<include refid="part_Column_List" />
FROM pr_st_manure
- WHERE deleted = 0 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{fbox_id,jdbcType=INTEGER}
+ WHERE deleted != 1 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{no,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml
index 6d8fdd8..5bfd5d1 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml
@@ -92,7 +92,7 @@
select
<include refid="part_Column_List" />
FROM pr_st_soil
- WHERE deleted = 0 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{fbox_id,jdbcType=INTEGER}
+ WHERE deleted != 1 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{no,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml
index cbf0c66..5426cbd 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml
@@ -86,7 +86,7 @@
select
<include refid="part_Column_List" />
FROM pr_st_weather
- WHERE deleted = 0 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{fbox_id,jdbcType=INTEGER}
+ WHERE deleted != 1 AND fbox_id=#{fbox_id,jdbcType=VARCHAR} AND no=#{no,jdbcType=INTEGER}
</select>
<select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple">
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandOpenMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandOpenMapper.xml
new file mode 100644
index 0000000..7e39e26
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandOpenMapper.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper">
+ <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmCommandOpen">
+ <!--@mbg.generated-->
+ <!--@Table rm_command_open-->
+ <id column="id" jdbcType="BIGINT" property="id" />
+ <result column="com_id" jdbcType="BIGINT" property="comId" />
+ <result column="command_code" jdbcType="VARCHAR" property="commandCode" />
+ <result column="command_name" jdbcType="VARCHAR" property="commandName" />
+ <result column="intake_id" jdbcType="BIGINT" property="intakeId" />
+ <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" />
+ <result column="protocol" jdbcType="VARCHAR" property="protocol" />
+ <result column="vc_num" jdbcType="BIGINT" property="vcNum" />
+ <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
+ <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
+ <result column="operator" jdbcType="BIGINT" property="operator" />
+ </resultMap>
+ <sql id="Base_Column_List">
+ <!--@mbg.generated-->
+ id, com_id, command_code, command_name, intake_id, rtu_addr, protocol, vc_num, order_no,
+ send_time, `operator`
+ </sql>
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List" />
+ from rm_command_open
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+ <select id="selectByIntakeId" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List" />
+ from rm_command_open
+ where intake_id = #{intakeId,jdbcType=BIGINT}
+ order by id DESC
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ delete from rm_command_open
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandOpen">
+ <!--@mbg.generated-->
+ insert into rm_command_open (id, com_id, command_code,
+ command_name, intake_id, rtu_addr,
+ protocol, vc_num, order_no,
+ send_time, `operator`)
+ values (#{id,jdbcType=BIGINT}, #{comId,jdbcType=BIGINT}, #{commandCode,jdbcType=VARCHAR},
+ #{commandName,jdbcType=VARCHAR}, #{intakeId,jdbcType=BIGINT}, #{rtuAddr,jdbcType=VARCHAR},
+ #{protocol,jdbcType=VARCHAR}, #{vcNum,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR},
+ #{sendTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=BIGINT})
+ </insert>
+ <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandOpen">
+ <!--@mbg.generated-->
+ insert into rm_command_open
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="comId != null">
+ com_id,
+ </if>
+ <if test="commandCode != null">
+ command_code,
+ </if>
+ <if test="commandName != null">
+ command_name,
+ </if>
+ <if test="intakeId != null">
+ intake_id,
+ </if>
+ <if test="rtuAddr != null">
+ rtu_addr,
+ </if>
+ <if test="protocol != null">
+ protocol,
+ </if>
+ <if test="vcNum != null">
+ vc_num,
+ </if>
+ <if test="orderNo != null">
+ order_no,
+ </if>
+ <if test="sendTime != null">
+ send_time,
+ </if>
+ <if test="operator != null">
+ `operator`,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
+ <if test="comId != null">
+ #{comId,jdbcType=BIGINT},
+ </if>
+ <if test="commandCode != null">
+ #{commandCode,jdbcType=VARCHAR},
+ </if>
+ <if test="commandName != null">
+ #{commandName,jdbcType=VARCHAR},
+ </if>
+ <if test="intakeId != null">
+ #{intakeId,jdbcType=BIGINT},
+ </if>
+ <if test="rtuAddr != null">
+ #{rtuAddr,jdbcType=VARCHAR},
+ </if>
+ <if test="protocol != null">
+ #{protocol,jdbcType=VARCHAR},
+ </if>
+ <if test="vcNum != null">
+ #{vcNum,jdbcType=BIGINT},
+ </if>
+ <if test="orderNo != null">
+ #{orderNo,jdbcType=VARCHAR},
+ </if>
+ <if test="sendTime != null">
+ #{sendTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="operator != null">
+ #{operator,jdbcType=BIGINT},
+ </if>
+ </trim>
+ </insert>
+ <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandOpen">
+ <!--@mbg.generated-->
+ update rm_command_open
+ <set>
+ <if test="comId != null">
+ com_id = #{comId,jdbcType=BIGINT},
+ </if>
+ <if test="commandCode != null">
+ command_code = #{commandCode,jdbcType=VARCHAR},
+ </if>
+ <if test="commandName != null">
+ command_name = #{commandName,jdbcType=VARCHAR},
+ </if>
+ <if test="intakeId != null">
+ intake_id = #{intakeId,jdbcType=BIGINT},
+ </if>
+ <if test="rtuAddr != null">
+ rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
+ </if>
+ <if test="protocol != null">
+ protocol = #{protocol,jdbcType=VARCHAR},
+ </if>
+ <if test="vcNum != null">
+ vc_num = #{vcNum,jdbcType=BIGINT},
+ </if>
+ <if test="orderNo != null">
+ order_no = #{orderNo,jdbcType=VARCHAR},
+ </if>
+ <if test="sendTime != null">
+ send_time = #{sendTime,jdbcType=TIMESTAMP},
+ </if>
+ <if test="operator != null">
+ `operator` = #{operator,jdbcType=BIGINT},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmCommandOpen">
+ <!--@mbg.generated-->
+ update rm_command_open
+ set com_id = #{comId,jdbcType=BIGINT},
+ command_code = #{commandCode,jdbcType=VARCHAR},
+ command_name = #{commandName,jdbcType=VARCHAR},
+ intake_id = #{intakeId,jdbcType=BIGINT},
+ rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
+ protocol = #{protocol,jdbcType=VARCHAR},
+ vc_num = #{vcNum,jdbcType=BIGINT},
+ order_no = #{orderNo,jdbcType=VARCHAR},
+ send_time = #{sendTime,jdbcType=TIMESTAMP},
+ `operator` = #{operator,jdbcType=BIGINT}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+</mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureHistoryMapper.xml
index c94dc1e..c65c2ea 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureHistoryMapper.xml
@@ -25,6 +25,17 @@
id, manure_id, dt, stir_running1, stir_running2, stir_running3, stir_running4, inject_running,
irr_running, alarm, manure_flow, manure_time, stir_time, stir_duration, inject_duration
</sql>
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.manure_id, ${alias}.dt,
+ ${alias}.stir_running1, ${alias}.stir_running2,
+ ${alias}.stir_running3, ${alias}.stir_running4,
+ ${alias}.inject_running, ${alias}.irr_running,
+ ${alias}.alarm, ${alias}.manure_flow,
+ ${alias}.manure_time, ${alias}.stir_time,
+ ${alias}.stir_duration, ${alias}.inject_duration
+ </sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -48,7 +59,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -57,7 +68,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoManure">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="htb"/>
+ </include>,
mtb.`name` AS manureName
FROM rm_manure_history htb
INNER JOIN pr_st_manure mtb ON mtb.id = htb.manure_id
@@ -71,7 +84,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml
index a620094..9526f67 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmManureLastMapper.xml
@@ -27,6 +27,14 @@
stir_running4, inject_running, irr_running, alarm, manure_flow, manure_time, stir_time,
stir_duration, inject_duration
</sql>
+
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.last_history_id, ${alias}.manure_id, ${alias}.dt, ${alias}.stir_running1, ${alias}.stir_running2, ${alias}.stir_running3,
+ ${alias}.stir_running4, ${alias}.inject_running, ${alias}.irr_running, ${alias}.alarm, ${alias}.manure_flow, ${alias}.manure_time, ${alias}.stir_time,
+ ${alias}.stir_duration, ${alias}.inject_duration
+ </sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -65,7 +73,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -74,7 +82,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoManure">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="ltb"/>
+ </include>,
mtb.`name` AS manureName
FROM rm_manure_last ltb
INNER JOIN pr_st_manure mtb ON mtb.id = ltb.manure_id
@@ -88,7 +98,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilDayMapper.xml
index a63c315..f454600 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilDayMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilDayMapper.xml
@@ -38,6 +38,15 @@
soil_sum_humidity4, soil_sum_humidity5, soil_sum_temperature1, soil_sum_temperature2,
soil_sum_temperature3, soil_sum_temperature4, soil_sum_temperature5
</sql>
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.soil_id, ${alias}.dt, ${alias}.ymd,
+ ${alias}.soil_humidity1, ${alias}.soil_humidity2, ${alias}.soil_humidity3, ${alias}.soil_humidity4, ${alias}.soil_humidity5,
+ ${alias}.soil_temperature1, ${alias}.soil_temperature2, ${alias}.soil_temperature3, ${alias}.soil_temperature4, ${alias}.soil_temperature5,
+ ${alias}.times,
+ ${alias}.soil_sum_humidity1, ${alias}.soil_sum_humidity2, ${alias}.soil_sum_humidity3, ${alias}.soil_sum_humidity4, ${alias}.soil_sum_humidity5,
+ ${alias}.soil_sum_temperature1, ${alias}.soil_sum_temperature2, ${alias}.soil_sum_temperature3, ${alias}.soil_sum_temperature4, ${alias}.soil_sum_temperature5
+ </sql>
<sql id="Part_Column_List">
<!--@mbg.generated-->
id, soil_id, dt, ymd, soil_humidity1, soil_humidity2, soil_humidity3, soil_humidity4,
@@ -68,7 +77,6 @@
limit 0,1
</select>
-
<!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
<select id="selectOneBySoilId" resultType="com.dy.pipIrrGlobal.voRm.VoSoilDay">
select
@@ -85,7 +93,23 @@
limit 0,1
</select>
-
+ <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍-->
+ <select id="selectOneMonthBySoilId" resultType="com.dy.pipIrrGlobal.voRm.VoSoilDay">
+ select
+ <include refid="Part_Column_List" />
+ from rm_soil_day
+ <where>
+ <if test="soilId != null">
+ and soil_id = #{soilId}
+ </if>
+ <if test="ymdStart != null">
+ and ymd >= #{ymdStart}
+ </if>
+ <if test="ymdEnd != null">
+ and ymd <= #{ymdEnd}
+ </if>
+ </where>
+ </select>
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍鏁伴噺-->
<select id="selectCount" resultType="java.lang.Long">
@@ -103,7 +127,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -112,7 +136,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoSoilDay">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="ltb"/>
+ </include>,
mtb.`name` AS soilName
FROM rm_soil_day ltb
INNER JOIN pr_st_soil mtb ON mtb.id = ltb.soil_id
@@ -126,7 +152,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilHistoryMapper.xml
index b05d596..3e9eec7 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilHistoryMapper.xml
@@ -24,6 +24,13 @@
soil_humidity5, soil_temperature1, soil_temperature2, soil_temperature3, soil_temperature4,
soil_temperature5
</sql>
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.soil_id, ${alias}.dt, ${alias}.soil_humidity1,
+ ${alias}.soil_humidity2, ${alias}.soil_humidity3, ${alias}.soil_humidity4,
+ ${alias}.soil_humidity5, ${alias}.soil_temperature1, ${alias}.soil_temperature2,
+ ${alias}.soil_temperature3, ${alias}.soil_temperature4, ${alias}.soil_temperature5
+ </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -47,7 +54,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -56,7 +63,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoSoil">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="htb"/>
+ </include>,
mtb.`name` AS soilName
FROM rm_soil_history htb
INNER JOIN pr_st_soil mtb ON mtb.id = htb.soil_id
@@ -70,7 +79,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilLastMapper.xml
index 478e8e1..eb042e1 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmSoilLastMapper.xml
@@ -25,6 +25,15 @@
soil_humidity4, soil_humidity5, soil_temperature1, soil_temperature2, soil_temperature3,
soil_temperature4, soil_temperature5
</sql>
+
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.last_history_id, ${alias}.soil_id, ${alias}.dt, ${alias}.soil_humidity1,
+ ${alias}.soil_humidity2, ${alias}.soil_humidity3, ${alias}.soil_humidity4,
+ ${alias}.soil_humidity5, ${alias}.soil_temperature1, ${alias}.soil_temperature2,
+ ${alias}.soil_temperature3, ${alias}.soil_temperature4, ${alias}.soil_temperature5
+ </sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -64,7 +73,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -73,7 +82,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoSoil">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="ltb"/>
+ </include>,
mtb.`name` AS soilName
FROM rm_soil_last ltb
INNER JOIN pr_st_soil mtb ON mtb.id = ltb.soil_id
@@ -87,7 +98,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml
index 3019090..77909d1 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherHistoryMapper.xml
@@ -20,6 +20,13 @@
id, weather_id, dt, air_temperature, air_humidity, ultraviolet, light_intensity,
rainfall, wind_speed, wind_direction
</sql>
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.weather_id, ${alias}.dt, ${alias}.air_temperature,
+ ${alias}.air_humidity, ${alias}.ultraviolet, ${alias}.light_intensity,
+ ${alias}.rainfall, ${alias}.wind_speed, ${alias}.wind_direction
+ </sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -43,7 +50,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -52,7 +59,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ鍘嗗彶璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoWeather">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="htb"/>
+ </include>,
mtb.`name` AS weatherName
FROM rm_weather_history htb
INNER JOIN pr_st_weather mtb ON mtb.id = htb.weather_id
@@ -66,7 +75,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND htb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml
index 9be0f00..157e5a8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWeatherLastMapper.xml
@@ -21,6 +21,13 @@
id, last_history_id, weather_id, dt, air_temperature, air_humidity, ultraviolet,
light_intensity, rainfall, wind_speed, wind_direction
</sql>
+ <sql id="Base_Column_List_with_alias">
+ <!--@mbg.generated-->
+ ${alias}.id, ${alias}.last_history_id, ${alias}.weather_id, ${alias}.dt, ${alias}.air_temperature,
+ ${alias}.air_humidity, ${alias}.ultraviolet, ${alias}.light_intensity,
+ ${alias}.rainfall, ${alias}.wind_speed, ${alias}.wind_direction
+ </sql>
+
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
@@ -60,7 +67,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
@@ -69,7 +76,9 @@
<!--鏍规嵁鎸囧畾鏉′欢鏌ヨ璁板綍-->
<select id="selectSome" resultType="com.dy.pipIrrGlobal.voRm.VoWeather">
SELECT
- <include refid="Base_Column_List" />,
+ <include refid="Base_Column_List_with_alias" >
+ <property name="alias" value="ltb"/>
+ </include>,
mtb.`name` AS weatherName
FROM rm_weather_last ltb
INNER JOIN pr_st_weather mtb ON mtb.id = ltb.weather_id
@@ -83,7 +92,7 @@
<if test = "name != null and name !=''">
AND mtb.name LIKE CONCAT('%',#{name},'%')
</if>
- <if test = "timeStart != null and timeStop != null">
+ <if test = "timeStart != null and timeStart !='' and timeStop != null and timeStop != ''">
AND ltb.dt BETWEEN #{timeStart} AND #{timeStop}
</if>
</where>
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/rtuLog/RtuLogManager.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/rtuLog/RtuLogManager.java
index ae3b050..d0dff48 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/rtuLog/RtuLogManager.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/resource/rtuLog/RtuLogManager.java
@@ -172,7 +172,9 @@
return new Object[]{null, 3} ;
}
if(!oldLog.delete()){
- return new Object[]{null, 4} ;
+ //2025-06-28 瀵逛簬姘磋偉鏈篎Box涓婃姤鏁版嵁姣旇緝棰戠箒锛屽疄娴嬭�佹枃浠跺父鏈夊垹闄や笉浜嗙殑鎯呭喌鍙戠敓锛�
+ //涓�娆″垹闄や笉浜嗭紝涓嬫鍐嶅彲鍒犻櫎锛屾墍浠ヤ笅闈eturn鍘婚櫎
+ //return new Object[]{null, 4} ;
}
}
}
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties
index 6b48b8c..42235ec 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties
@@ -41,13 +41,13 @@
# 娴嬭瘯锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
# 姊呮睙锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
# 121鏈嶅姟鍣細
-# 姘戝嫟锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1
+# 姘戝嫟锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1
# 寤跺簡锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
# 榛戦緳姹燂細 mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
# 鐢樺窞锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
# 鍑夊窞锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos=
-# 閲戝窛锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1
-# 鍢夊唱鍏筹細 mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1
+# 閲戝窛锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1
+# 鍢夊唱鍏筹細 mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1
mqtt.enable=false
mqtt.ip=127.0.0.1
mqtt.port=1883
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/console/Command.java b/pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/console/Command.java
index ae2242f..a8799d7 100644
--- a/pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/console/Command.java
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-param-set/src/main/java/com/dy/pipIrrParamSet/console/Command.java
@@ -21,8 +21,8 @@
static{
commands = new String[]{
"config 鏌ョ湅閰嶇疆淇℃伅",
- "mw 121 [tag] 鍛戒护鍚箟锛氶�氫俊涓棿浠跺湪浜戞湇鍔″櫒锛�121.199.41.121锛変笂鐨刐tag](鍏冭皨ym,娌欑洏sp娴嬭瘯test锛屾姹焟j锛屾皯鍕q锛屽欢搴唝q锛岄粦榫欐睙hlj锛岀敇宸瀏z锛屽噳宸瀕z锛岄噾宸漥c锛屽槈宄叧jyg)绯荤粺閰嶇疆",
- "mw 233 [tag] 鍛戒护鍚箟锛氶�氫俊涓棿浠跺湪浜戞湇鍔″櫒锛�8.130.130.233锛変笂鐨刐tag](鍏冭皨ym,娌欑洏sp娴嬭瘯test锛屾姹焟j锛屾皯鍕q锛屽欢搴唝q锛岄粦榫欐睙hlj锛岀敇宸瀏z锛屽噳宸瀕z锛岄噾宸漥c锛屽槈宄叧jyg)绯荤粺閰嶇疆",
+ "mw 121 [tag] 鍛戒护鍚箟锛氶�氫俊涓棿浠跺湪浜戞湇鍔″櫒锛�121.199.41.121锛変笂鐨刐tag](姘戝嫟mq锛屽欢搴唝q锛岄粦榫欐睙hlj锛岀敇宸瀏z锛屽噳宸瀕z锛岄噾宸漥c锛屽槈宄叧jyg)绯荤粺閰嶇疆",
+ "mw 233 [tag] 鍛戒护鍚箟锛氶�氫俊涓棿浠跺湪浜戞湇鍔″櫒锛�8.130.130.233锛変笂鐨刐tag](鍏冭皨ym锛屾矙鐩榮p锛屾祴璇晅est锛屾姹焟j)绯荤粺閰嶇疆",
"web 121 鍛戒护鍚箟锛歸eb妯″潡鍦ㄤ簯鏈嶅姟鍣紙121.199.41.121锛変笂鐨勯厤缃�",
"web 233 鍛戒护鍚箟锛歸eb妯″潡鍦ㄤ簯鏈嶅姟鍣紙8.130.130.233锛変笂鐨勯厤缃�",
"exit 閫�鍑�",
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java
index 077cd46..3293151 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java
@@ -21,6 +21,12 @@
public String id;
/**
+ * 姘磋偉鏈篎Box搴忓垪鍙�
+ */
+ @NotEmpty(message = "姘磋偉鏈篎Box搴忓垪鍙�") //涓嶈兘涓虹┖涔熶笉鑳戒负null
+ public String fboxId;
+
+ /**
* 姘磋偉鏈哄悕绉�
*/
@NotEmpty(message = "姘磋偉鏈哄悕绉颁笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null
@@ -49,6 +55,7 @@
public PrStManure toNewPo(){
PrStManure po = new PrStManure();
+ po.fboxId = this.fboxId;
po.name = this.name;
po.no = this.no;
po.lng = this.lng;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java
index 83e5511..40d822b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java
@@ -21,6 +21,12 @@
public String id;
/**
+ * 澧掓儏绔橣Box搴忓垪鍙�
+ */
+ @NotEmpty(message = "澧掓儏绔橣Box搴忓垪鍙�") //涓嶈兘涓虹┖涔熶笉鑳戒负null
+ public String fboxId;
+
+ /**
* 澧掓儏绔欏悕绉�
*/
@NotEmpty(message = "澧掓儏绔欏悕绉颁笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null
@@ -49,6 +55,7 @@
public PrStSoil toNewPo(){
PrStSoil po = new PrStSoil();
+ po.fboxId = this.fboxId;
po.name = this.name;
po.no = this.no;
po.lng = this.lng;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java
index 9a142f2..1b2cf81 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java
@@ -21,6 +21,12 @@
public String id;
/**
+ * 姘旇薄绔橣Box搴忓垪鍙�
+ */
+ @NotEmpty(message = "姘旇薄绔橣Box搴忓垪鍙�") //涓嶈兘涓虹┖涔熶笉鑳戒负null
+ public String fboxId;
+
+ /**
* 姘旇薄绔欏悕绉�
*/
@NotEmpty(message = "姘旇薄绔欏悕绉颁笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null
@@ -49,6 +55,7 @@
public PrStWeather toNewPo(){
PrStWeather po = new PrStWeather();
+ po.fboxId = this.fboxId;
po.name = this.name;
po.no = this.no;
po.lng = this.lng;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java
index b2e5864..27131f2 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/common/ComSv.java
@@ -62,6 +62,7 @@
* @param intakeId
* @return
*/
+ @Transactional(rollbackFor = Exception.class)
public PrCommonIntakes addOrUpdateOftenUseIntake(Long operatorId, Long intakeId) {
PrCommonIntakes po = prCommonIntakesDao.selectByOperatorAndIntake(operatorId, intakeId);
if(po == null) {
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdCtrl.java
new file mode 100644
index 0000000..75d04c1
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdCtrl.java
@@ -0,0 +1,130 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd10;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.aop.SsoAop;
+import com.dy.common.mw.protocol.Command;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCdXyVo;
+import com.dy.common.util.Callback;
+import com.dy.common.util.IPUtils;
+import com.dy.common.util.NumUtil;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/15 10:42
+ * @Description
+ */
+@Slf4j
+@Tag(name = "杩滅▼鍛戒护", description = "璁剧疆璁惧缁堢鍦板潃")
+@RestController("p202404V201Cd10Ctrl")
+@RequestMapping(path = "p202404V201/cd10")
+@RequiredArgsConstructor
+@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞�
+public class CdCtrl extends ComCtrl {
+
+ private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
+
+ private static final String ComCode = "10" ;
+
+ @Autowired
+ private CdSv sv ;
+ /**
+ * 鍚戣澶囷紙鎺у埗鍣級鍙戦�佸懡浠�
+ * @param dto 鍓嶇鍙戞潵鐨勫�煎璞�
+ * @param bindingResult 瀵筪to楠岃瘉鐨勭粨鏋�
+ * @return 杩斿洖鍓嶇
+ */
+ @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @SsoAop()
+ public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) {
+ BaseResponse<Object> res ;
+ //鍙戦�佸懡浠ゅ墠-1锛氶獙璇�
+ res = super.pre1(sv, ComCode, dto, bindingResult);
+ if(res == null) {
+ //鍙戦�佸懡浠ゅ墠-2锛氳幏寰楁暟鎹�
+ res = super.pre2(sv, ComCode, dto, bindingResult);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .rtuNewAddr(dto.rtuNewAddr)//鎺у埗鍣ㄦ柊鍦板潃
+ .build();
+ res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-4锛氬噯澶嘑eature
+ super.pre4();
+ try {
+ //鍒涘缓澶栭儴鍛戒护锛堝彂缁欐帶鍒跺櫒锛�
+ Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode);
+ com.rtuResultSendWebUrl = rtuResultSendWebUrl;
+ com.param = comParam ;
+ //鍙戦�佸懡浠�
+ res = super.doSend(sv, com);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ悗
+ res = super.after(ComCode, null);
+ }
+ } catch (Exception e) {
+ res = BaseResponseUtils.buildFail("鏈嶅姟绔瀯閫犲苟鍚戦�氫俊涓棿浠跺彂閫佽姹傛椂寮傚父" + (e.getMessage() == null ? "" : e.getMessage()));
+ } finally {
+ //鏈�缁�
+ super.end();
+ }
+ }
+ }
+ }
+ return res ;
+ }
+
+ @Override
+ protected String checkDto(DtoBase dto) {
+ if(dto != null){
+ CdDto myo = (CdDto) dto ;
+ //鍦板潃绀轰緥 37142501020100013
+ if(!NumUtil.isPlusIntNumber(myo.rtuNewAddr)){
+ return "鎺у埗鍣ㄦ柊鍦板潃涓嶆纭�" ;
+ }
+ if(myo.rtuNewAddr.length() != 17 || myo.rtuNewAddr.startsWith("0")){
+ return "鎺у埗鍣ㄦ柊鍦板潃涓嶆纭�" ;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected String dealComResult(String code, JSONObject resultData, Callback callback){
+ String msg;
+ if(resultData != null){
+ JSONObject codeData = resultData.getJSONObject("data") ;
+ if(codeData == null){
+ msg = RtuSuccessMsg ;
+ }else {
+ String json = codeData.toJSONString();
+ DataCdXyVo cvo = JSON.parseObject(json, DataCdXyVo.class) ;
+ if(cvo != null){
+ msg = cvo.toStr(false) ;
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ }
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ return msg;
+ }
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdDto.java
new file mode 100644
index 0000000..325e1e3
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdDto.java
@@ -0,0 +1,21 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd10;
+
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/15 10:42
+ * @Description
+ */
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class CdDto extends DtoBase {
+ public static final long serialVersionUID = 202505151042001L;
+ @NotEmpty(message = "鎺у埗鍣ㄦ柊鍦板潃涓嶈兘涓虹┖")
+ public String rtuNewAddr ;//鎺у埗鍣ㄦ柊鍦板潃
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdParam.java
new file mode 100644
index 0000000..91521ba
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdParam.java
@@ -0,0 +1,21 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd10;
+
+import com.dy.pipIrrRemote.monitor.common.CdParameter;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/15 10:42
+ * @Description
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@SuperBuilder
+public class CdParam extends CdParameter {
+ public Integer channel ;//IP閫氶亾鍙�(鍙栧�艰寖鍥� 1銆�2).
+ public String rtuNewAddr ;//鎺у埗鍣ㄦ柊鍦板潃
+ }
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdSv.java
new file mode 100644
index 0000000..ebc5670
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd10/CdSv.java
@@ -0,0 +1,15 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd10;
+
+import com.dy.pipIrrRemote.monitor.common.ComSv;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/15 10:42
+ * @Description
+ */
+@Slf4j
+@Service("cd10Sv")
+public class CdSv extends ComSv {
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd21/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd21/CdDto.java
index cf0da7a..345ff18 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd21/CdDto.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd21/CdDto.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrRemote.monitor.p202404V201.cd21;
import com.dy.pipIrrRemote.common.dto.DtoBase;
+import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -17,7 +18,7 @@
public static final long serialVersionUID = 202505151042001L;
@NotNull(message = "IP閫氶亾鍙蜂笉鑳戒负绌�")
public Integer channel ;//IP閫氶亾鍙�(鍙栧�艰寖鍥� 1銆�2).
- @NotNull(message = "IP涓嶈兘涓虹┖")
+ @NotEmpty(message = "IP涓嶈兘涓虹┖")
public String ip ;//IP锛堜緥濡� 125.235.35.89锛�
@NotNull(message = "绔彛鍙蜂笉鑳戒负绌�")
public Integer port ;//绔彛鍙凤紙0~65536锛�
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdCtrl.java
new file mode 100644
index 0000000..101e22d
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdCtrl.java
@@ -0,0 +1,225 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd35;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.aop.SsoAop;
+import com.dy.common.mw.protocol.Command;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd92_A2Vo;
+import com.dy.common.util.Callback;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 08:30
+ * @Description
+ */
+@Slf4j
+@Tag(name = "杩滅▼鍛戒护", description = "APP绔繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�")
+@RestController("p202404V201Cd35Ctrl")
+@RequestMapping(path = "p202404V201/cd35")
+@RequiredArgsConstructor
+@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞�
+public class CdCtrl extends ComCtrl {
+
+ private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
+
+ private static final String ComCode = "35" ;
+
+ private static final Double MaxRemainMoney = com.dy.pipIrrRemote.monitor.p202404V201.cd92.CdCtrl.MaxRemainMoney;//鍗忚鏀寔鐨勫墿浣欓噾棰濇渶澶у��
+
+ @Autowired
+ private CdSv sv ;
+ /**
+ * 鍚戣澶囷紙鎺у埗鍣級鍙戦�佸懡浠�
+ * @param dto 鍓嶇鍙戞潵鐨勫�煎璞�
+ * @param bindingResult 瀵筪to楠岃瘉鐨勭粨鏋�
+ * @return 杩斿洖鍓嶇
+ */
+ @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @SsoAop()
+ public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) {
+ BaseResponse<Object> res ;
+ //鍙戦�佸懡浠ゅ墠-1锛氶獙璇�
+ res = super.pre1(sv, ComCode, dto, bindingResult);
+ if(res == null) {
+ //鍙戦�佸懡浠ゅ墠-2锛氳幏寰楁暟鎹�
+ res = super.pre2(sv, ComCode, dto, bindingResult);
+ if (res == null) {
+ if(dto.vtCardId == null || "".equals(dto.vtCardId.trim())){
+ Long vtId = sv.selectVcIdByIntakeId(dto.getIntakeId()) ;
+ if(vtId == null) {
+ return BaseResponseUtils.buildErrorMsg("璇烽�夋嫨涓�寮犺櫄鎷熷崱");
+ }else{
+ dto.vtCardId = vtId.toString() ;
+ }
+ }
+ VoVirtualCard vcPo = sv.selectClientVtCardById(Long.parseLong(dto.vtCardId.trim())) ;
+ if(vcPo == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒板啘鎴疯櫄鎷熷崱") ;
+ }
+ if(vcPo.getInUse().booleanValue()){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱宸茬粡琚崰鐢紝涓嶈兘鍐嶅簲鐢ㄥ叾寮�闃�") ;
+ }
+ if(vcPo.getMoney() <= 0.0){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濅负0锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ if(vcPo.getMoney() >= MaxRemainMoney){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濆ぇ浜庡崗璁敮鎸佺殑鏈�澶у��" + MaxRemainMoney + "锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ Double waterPrice = sv.selectWaterPrice() ;
+ if(waterPrice == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒版按浠�") ;
+ }
+ String orderNo = RandomStringUtils.randomNumeric(16) ;
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardNo("" + vcPo.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ .waterRemain(0.0)//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .moneyRemain(vcPo.getMoney())//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .waterPrice(waterPrice)//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .elePrice(0.0)//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .orderNo(orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .minutes(dto.minutes)//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+ .build();
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-4锛氬噯澶嘑eature
+ super.pre4();
+ try {
+ //鍒涘缓澶栭儴鍛戒护锛堝彂缁欐帶鍒跺櫒锛�
+ Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode);
+ com.rtuResultSendWebUrl = rtuResultSendWebUrl;
+ com.param = comParam;
+ //鍙戦�佸懡浠�
+ res = super.doSend(sv, com);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ悗
+ res = super.after(ComCode, new Callback() {
+ @Override
+ public void call(Object obj) {
+ Boolean success = (Boolean) obj;
+ if(success){
+ // 娣诲姞甯哥敤鍙栨按鍙f垨鏇存柊浣跨敤淇℃伅
+ sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ;
+ //寮�闃�鎴愬姛锛岃櫄鎷熷崱璁板綍涓婃爣璁板凡琚崰鐢�
+ sv.setVcUsed(vcPo.getId(), dto.getIntakeId());
+ //璁板綍寮�闃�鍛戒护锛屼互澶囪繙绋嬪叧闃�
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId());
+ if(comOpen == null){
+ RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.saveCommandOpen(po);
+ }else{
+ setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.updateCommandOpen(comOpen);
+ }
+ }
+ }
+ @Override
+ public void call(Object... objs) {
+ }
+ @Override
+ public void exception(Exception e) {
+ }
+ });
+ }
+ } catch (Exception e) {
+ res = BaseResponseUtils.buildFail("鏈嶅姟绔瀯閫犲苟鍚戦�氫俊涓棿浠跺彂閫佽姹傛椂寮傚父" + (e.getMessage() == null ? "" : e.getMessage()));
+ } finally {
+ //鏈�缁�
+ super.end();
+ }
+ }
+ }
+ }
+ return res ;
+ }
+
+ @Override
+ protected String checkDto(DtoBase dto) {
+ return null;
+ }
+
+ @Override
+ protected String dealComResult(String code, JSONObject resultData, Callback callback){
+ String msg;
+ if(resultData != null){
+ JSONObject codeData = resultData.getJSONObject("data") ;
+ if(codeData == null){
+ msg = RtuSuccessMsg ;
+ }else {
+ String json = codeData.toJSONString();
+ DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ;
+ if(cvo != null){
+ if(callback != null){
+ if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)1){
+ callback.call(true);//寮�闃�鎴愬姛
+ }else{
+ callback.call(false);//寮�闃�澶辫触
+ }
+ }
+ msg = cvo.toStr(false) ;
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ }
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ return msg;
+ }
+
+ private RmCommandOpen newRmCommandOpen(Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ RmCommandOpen po = new RmCommandOpen() ;
+ this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator);
+ return po ;
+ }
+ private void setRmCommandOpen(RmCommandOpen po,
+ Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ po.comId = comId ;
+ po.protocol = protocol ;
+ po.commandCode = comCode ;
+ po.commandName = comName ;
+ po.intakeId = intakeId ;
+ po.rtuAddr = rtuAddr ;
+ po.vcNum = vcNum ;
+ po.orderNo = orderNo ;
+ po.operator = operator ;
+ po.sendTime = new Date() ;
+ }
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdDto.java
new file mode 100644
index 0000000..95e4eb3
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdDto.java
@@ -0,0 +1,30 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd35;
+
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 08:30
+ * @Description
+ */
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class CdDto extends DtoBase {
+
+ public static final long serialVersionUID = 202505130833001L;
+
+ @NotEmpty(message = "鐢ㄦ埛铏氭嫙鍗′笉鑳戒负绌�")
+ public String vtCardId ;//鐢ㄦ埛鍗�(铏氭嫙鍗�)搴忓垪鍙凤紙17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+
+ @NotNull(message = "鐢ㄦ按鏃堕暱涓嶈兘涓虹┖")
+ @Min(value = 1, message = "鐢ㄦ按鏃堕暱涓嶈兘灏忎簬1")
+ @Max(value = 9999, message = "鐢ㄦ按鏃堕暱涓嶈兘澶т簬9999")
+ public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdParam.java
new file mode 100644
index 0000000..db66565
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdParam.java
@@ -0,0 +1,26 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd35;
+
+import com.dy.pipIrrRemote.monitor.common.CdParameter;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 08:30
+ * @Description
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@SuperBuilder
+public class CdParam extends CdParameter {
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdSv.java
new file mode 100644
index 0000000..32bbf49
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd35/CdSv.java
@@ -0,0 +1,80 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd35;
+
+import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
+import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.monitor.common.ComSv;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 08:30
+ * @Description
+ */
+@Slf4j
+@Service("cd35Sv")
+public class CdSv extends ComSv {
+ @Autowired
+ protected SeVirtualCardMapper seVirtualCardDao ;
+ @Autowired
+ protected PrWaterPriceMapper prWaterPriceDao ;
+ @Autowired
+ protected PrIntakeVcMapper prIntakeVcDao ;
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
+
+ public VoVirtualCard selectClientVtCardById(Long id){
+ return seVirtualCardDao.getVcById(id) ;
+ }
+ public Double selectWaterPrice(){
+ return prWaterPriceDao.getPrice() ;
+ }
+ /**
+ * 鏍规嵁鍙栨按鍙D鑾峰彇涓庝箣缁戝畾铏氭嫙鍗D
+ * @param intakeId
+ * @return
+ */
+ public Long selectVcIdByIntakeId(Long intakeId) {
+ return prIntakeVcDao.getVcIdByIntakeId(intakeId);
+ }
+ /**
+ * 璁剧疆铏氭嫙鍗¤鍗犵敤
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void setVcUsed(Long id, Long intakeId){
+ SeVirtualCard po = new SeVirtualCard() ;
+ po.setId(id);
+ po.setIntakeId(intakeId);
+ po.setInUse((byte)1);
+ po.setOpenTime(new Date());
+ seVirtualCardDao.updateByPrimaryKeySelective(po);
+ }
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void saveCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.insert(po) ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.updateByPrimaryKeySelective(po) ;
+ }
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdCtrl.java
new file mode 100644
index 0000000..7073b2e
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdCtrl.java
@@ -0,0 +1,225 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd36;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.aop.SsoAop;
+import com.dy.common.mw.protocol.Command;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd92_A2Vo;
+import com.dy.common.util.Callback;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:01
+ * @Description
+ */
+@Slf4j
+@Tag(name = "杩滅▼鍛戒护", description = "APP绔繙绋嬪畾閲忓紑鍚按娉�/闃�闂�")
+@RestController("p202404V201Cd36Ctrl")
+@RequestMapping(path = "p202404V201/cd36")
+@RequiredArgsConstructor
+@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞�
+public class CdCtrl extends ComCtrl {
+
+ private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
+
+ private static final String ComCode = "36" ;
+
+ private static final Double MaxRemainMoney = com.dy.pipIrrRemote.monitor.p202404V201.cd92.CdCtrl.MaxRemainMoney;//鍗忚鏀寔鐨勫墿浣欓噾棰濇渶澶у��
+
+ @Autowired
+ private CdSv sv ;
+ /**
+ * 鍚戣澶囷紙鎺у埗鍣級鍙戦�佸懡浠�
+ * @param dto 鍓嶇鍙戞潵鐨勫�煎璞�
+ * @param bindingResult 瀵筪to楠岃瘉鐨勭粨鏋�
+ * @return 杩斿洖鍓嶇
+ */
+ @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @SsoAop()
+ public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) {
+ BaseResponse<Object> res ;
+ //鍙戦�佸懡浠ゅ墠-1锛氶獙璇�
+ res = super.pre1(sv, ComCode, dto, bindingResult);
+ if(res == null) {
+ //鍙戦�佸懡浠ゅ墠-2锛氳幏寰楁暟鎹�
+ res = super.pre2(sv, ComCode, dto, bindingResult);
+ if (res == null) {
+ if(dto.vtCardId == null || "".equals(dto.vtCardId.trim())){
+ Long vtId = sv.selectVcIdByIntakeId(dto.getIntakeId()) ;
+ if(vtId == null) {
+ return BaseResponseUtils.buildErrorMsg("璇烽�夋嫨涓�寮犺櫄鎷熷崱");
+ }else{
+ dto.vtCardId = vtId.toString() ;
+ }
+ }
+ VoVirtualCard vcPo = sv.selectClientVtCardById(Long.parseLong(dto.vtCardId.trim())) ;
+ if(vcPo == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒板啘鎴疯櫄鎷熷崱") ;
+ }
+ if(vcPo.getInUse().booleanValue()){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱宸茬粡琚崰鐢紝涓嶈兘鍐嶅簲鐢ㄥ叾寮�闃�") ;
+ }
+ if(vcPo.getMoney() <= 0.0){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濅负0锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ if(vcPo.getMoney() >= MaxRemainMoney){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濆ぇ浜庡崗璁敮鎸佺殑鏈�澶у��" + MaxRemainMoney + "锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ Double waterPrice = sv.selectWaterPrice() ;
+ if(waterPrice == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒版按浠�") ;
+ }
+ String orderNo = RandomStringUtils.randomNumeric(16) ;
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardNo("" + vcPo.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ .waterRemain(0.0)//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .moneyRemain(vcPo.getMoney())//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .waterPrice(waterPrice)//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .elePrice(0.0)//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .orderNo(orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .waterAmount(dto.waterAmount)//棰勭敤姘撮噺锛�0~9999 m3锛�
+ .build();
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-4锛氬噯澶嘑eature
+ super.pre4();
+ try {
+ //鍒涘缓澶栭儴鍛戒护锛堝彂缁欐帶鍒跺櫒锛�
+ Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode);
+ com.rtuResultSendWebUrl = rtuResultSendWebUrl;
+ com.param = comParam;
+ //鍙戦�佸懡浠�
+ res = super.doSend(sv, com);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ悗
+ res = super.after(ComCode, new Callback() {
+ @Override
+ public void call(Object obj) {
+ Boolean success = (Boolean) obj;
+ if(success){
+ // 娣诲姞甯哥敤鍙栨按鍙f垨鏇存柊浣跨敤淇℃伅
+ sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ;
+ //寮�闃�鎴愬姛锛岃櫄鎷熷崱璁板綍涓婃爣璁板凡琚崰鐢�
+ sv.setVcUsed(vcPo.getId(), dto.getIntakeId());
+ //璁板綍寮�闃�鍛戒护锛屼互澶囪繙绋嬪叧闃�
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId());
+ if(comOpen == null){
+ RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.saveCommandOpen(po);
+ }else{
+ setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.updateCommandOpen(comOpen);
+ }
+ }
+ }
+ @Override
+ public void call(Object... objs) {
+ }
+ @Override
+ public void exception(Exception e) {
+ }
+ });
+ }
+ } catch (Exception e) {
+ res = BaseResponseUtils.buildFail("鏈嶅姟绔瀯閫犲苟鍚戦�氫俊涓棿浠跺彂閫佽姹傛椂寮傚父" + (e.getMessage() == null ? "" : e.getMessage()));
+ } finally {
+ //鏈�缁�
+ super.end();
+ }
+ }
+ }
+ }
+ return res ;
+ }
+
+ @Override
+ protected String checkDto(DtoBase dto) {
+ return null;
+ }
+
+ @Override
+ protected String dealComResult(String code, JSONObject resultData, Callback callback){
+ String msg;
+ if(resultData != null){
+ JSONObject codeData = resultData.getJSONObject("data") ;
+ if(codeData == null){
+ msg = RtuSuccessMsg ;
+ }else {
+ String json = codeData.toJSONString();
+ DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ;
+ if(cvo != null){
+ if(callback != null){
+ if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)1){
+ callback.call(true);//寮�闃�鎴愬姛
+ }else{
+ callback.call(false);//寮�闃�澶辫触
+ }
+ }
+ msg = cvo.toStr(false) ;
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ }
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ return msg;
+ }
+
+ private RmCommandOpen newRmCommandOpen(Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ RmCommandOpen po = new RmCommandOpen() ;
+ this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator);
+ return po ;
+ }
+ private void setRmCommandOpen(RmCommandOpen po,
+ Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ po.comId = comId ;
+ po.protocol = protocol ;
+ po.commandCode = comCode ;
+ po.commandName = comName ;
+ po.intakeId = intakeId ;
+ po.rtuAddr = rtuAddr ;
+ po.vcNum = vcNum ;
+ po.orderNo = orderNo ;
+ po.operator = operator ;
+ po.sendTime = new Date() ;
+ }
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdDto.java
new file mode 100644
index 0000000..92fd113
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdDto.java
@@ -0,0 +1,30 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd36;
+
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:01
+ * @Description
+ */
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class CdDto extends DtoBase {
+
+ public static final long serialVersionUID = 202505130833001L;
+
+ @NotEmpty(message = "鐢ㄦ埛铏氭嫙鍗′笉鑳戒负绌�")
+ public String vtCardId ;//鐢ㄦ埛鍗�(铏氭嫙鍗�)搴忓垪鍙凤紙17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+
+ @NotNull(message = "鐢ㄦ按閲忎笉鑳戒负绌�")
+ @Min(value = 1, message = "鐢ㄦ按閲忎笉鑳藉皬浜�1")
+ @Max(value = 9999, message = "鐢ㄦ按閲忎笉鑳藉ぇ浜�9999")
+ public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdParam.java
new file mode 100644
index 0000000..7fb5b22
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdParam.java
@@ -0,0 +1,26 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd36;
+
+import com.dy.pipIrrRemote.monitor.common.CdParameter;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:01
+ * @Description
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@SuperBuilder
+public class CdParam extends CdParameter {
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdSv.java
new file mode 100644
index 0000000..d8f2c3f
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd36/CdSv.java
@@ -0,0 +1,80 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd36;
+
+import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
+import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.monitor.common.ComSv;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:01
+ * @Description
+ */
+@Slf4j
+@Service("cd36Sv")
+public class CdSv extends ComSv {
+ @Autowired
+ protected SeVirtualCardMapper seVirtualCardDao ;
+ @Autowired
+ protected PrWaterPriceMapper prWaterPriceDao ;
+ @Autowired
+ protected PrIntakeVcMapper prIntakeVcDao ;
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
+
+ public VoVirtualCard selectClientVtCardById(Long id){
+ return seVirtualCardDao.getVcById(id) ;
+ }
+ public Double selectWaterPrice(){
+ return prWaterPriceDao.getPrice() ;
+ }
+ /**
+ * 鏍规嵁鍙栨按鍙D鑾峰彇涓庝箣缁戝畾铏氭嫙鍗D
+ * @param intakeId
+ * @return
+ */
+ public Long selectVcIdByIntakeId(Long intakeId) {
+ return prIntakeVcDao.getVcIdByIntakeId(intakeId);
+ }
+ /**
+ * 璁剧疆铏氭嫙鍗¤鍗犵敤
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void setVcUsed(Long id, Long intakeId){
+ SeVirtualCard po = new SeVirtualCard() ;
+ po.setId(id);
+ po.setIntakeId(intakeId);
+ po.setInUse((byte)1);
+ po.setOpenTime(new Date());
+ seVirtualCardDao.updateByPrimaryKeySelective(po);
+ }
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void saveCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.insert(po) ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.updateByPrimaryKeySelective(po) ;
+ }
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdCtrl.java
new file mode 100644
index 0000000..c282baf
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdCtrl.java
@@ -0,0 +1,232 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd37;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.aop.SsoAop;
+import com.dy.common.mw.protocol.Command;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd92_A2Vo;
+import com.dy.common.util.Callback;
+import com.dy.common.util.DateTime;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:30
+ * @Description
+ */
+@Slf4j
+@Tag(name = "杩滅▼鍛戒护", description = "APP绔鍒掕繙绋嬪畾鏃跺紑鍚按娉�/闃�闂�")
+@RestController("p202404V201Cd37Ctrl")
+@RequestMapping(path = "p202404V201/cd37")
+@RequiredArgsConstructor
+@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞�
+public class CdCtrl extends ComCtrl {
+
+ private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
+
+ private static final String ComCode = "37" ;
+
+ private static final Double MaxRemainMoney = com.dy.pipIrrRemote.monitor.p202404V201.cd92.CdCtrl.MaxRemainMoney;//鍗忚鏀寔鐨勫墿浣欓噾棰濇渶澶у��
+
+ @Autowired
+ private CdSv sv ;
+ /**
+ * 鍚戣澶囷紙鎺у埗鍣級鍙戦�佸懡浠�
+ * @param dto 鍓嶇鍙戞潵鐨勫�煎璞�
+ * @param bindingResult 瀵筪to楠岃瘉鐨勭粨鏋�
+ * @return 杩斿洖鍓嶇
+ */
+ @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @SsoAop()
+ public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) {
+ BaseResponse<Object> res ;
+ //鍙戦�佸懡浠ゅ墠-1锛氶獙璇�
+ res = super.pre1(sv, ComCode, dto, bindingResult);
+ if(res == null) {
+ //鍙戦�佸懡浠ゅ墠-2锛氳幏寰楁暟鎹�
+ res = super.pre2(sv, ComCode, dto, bindingResult);
+ if (res == null) {
+ if(dto.vtCardId == null || "".equals(dto.vtCardId.trim())){
+ Long vtId = sv.selectVcIdByIntakeId(dto.getIntakeId()) ;
+ if(vtId == null) {
+ return BaseResponseUtils.buildErrorMsg("璇烽�夋嫨涓�寮犺櫄鎷熷崱");
+ }else{
+ dto.vtCardId = vtId.toString() ;
+ }
+ }
+ VoVirtualCard vcPo = sv.selectClientVtCardById(Long.parseLong(dto.vtCardId.trim())) ;
+ if(vcPo == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒板啘鎴疯櫄鎷熷崱") ;
+ }
+ if(vcPo.getInUse().booleanValue()){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱宸茬粡琚崰鐢紝涓嶈兘鍐嶅簲鐢ㄥ叾寮�闃�") ;
+ }
+ if(vcPo.getMoney() <= 0.0){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濅负0锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ if(vcPo.getMoney() >= MaxRemainMoney){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濆ぇ浜庡崗璁敮鎸佺殑鏈�澶у��" + MaxRemainMoney + "锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ Double waterPrice = sv.selectWaterPrice() ;
+ if(waterPrice == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒版按浠�") ;
+ }
+ String orderNo = RandomStringUtils.randomNumeric(16) ;
+ int[] ymdHms = DateTime.yyyy_MM_dd_HH_MM_SS_2_ymdhmsGroup(dto.ymdHms) ;
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardNo("" + vcPo.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ .waterRemain(0.0)//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .moneyRemain(vcPo.getMoney())//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .waterPrice(waterPrice)//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .elePrice(0.0)//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .orderNo(orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .year(ymdHms[0])//骞�
+ .month(ymdHms[1])//鏈�
+ .day(ymdHms[2])//鏃�
+ .hour(ymdHms[3])//鏃�
+ .minute(ymdHms[4])//鍒�
+ .minutes(dto.minutes)//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+ .build();
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-4锛氬噯澶嘑eature
+ super.pre4();
+ try {
+ //鍒涘缓澶栭儴鍛戒护锛堝彂缁欐帶鍒跺櫒锛�
+ Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode);
+ com.rtuResultSendWebUrl = rtuResultSendWebUrl;
+ com.param = comParam;
+ //鍙戦�佸懡浠�
+ res = super.doSend(sv, com);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ悗
+ res = super.after(ComCode, new Callback() {
+ @Override
+ public void call(Object obj) {
+ Boolean success = (Boolean) obj;
+ if(success){
+ // 娣诲姞甯哥敤鍙栨按鍙f垨鏇存柊浣跨敤淇℃伅
+ sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ;
+ //寮�闃�鎴愬姛锛岃櫄鎷熷崱璁板綍涓婃爣璁板凡琚崰鐢�
+ sv.setVcUsed(vcPo.getId(), dto.getIntakeId());
+ //璁板綍寮�闃�鍛戒护锛屼互澶囪繙绋嬪叧闃�
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId());
+ if(comOpen == null){
+ RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.saveCommandOpen(po);
+ }else{
+ setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.updateCommandOpen(comOpen);
+ }
+ }
+ }
+ @Override
+ public void call(Object... objs) {
+ }
+ @Override
+ public void exception(Exception e) {
+ }
+ });
+ }
+ } catch (Exception e) {
+ res = BaseResponseUtils.buildFail("鏈嶅姟绔瀯閫犲苟鍚戦�氫俊涓棿浠跺彂閫佽姹傛椂寮傚父" + (e.getMessage() == null ? "" : e.getMessage()));
+ } finally {
+ //鏈�缁�
+ super.end();
+ }
+ }
+ }
+ }
+ return res ;
+ }
+
+ @Override
+ protected String checkDto(DtoBase dto) {
+ return null;
+ }
+
+ @Override
+ protected String dealComResult(String code, JSONObject resultData, Callback callback){
+ String msg;
+ if(resultData != null){
+ JSONObject codeData = resultData.getJSONObject("data") ;
+ if(codeData == null){
+ msg = RtuSuccessMsg ;
+ }else {
+ String json = codeData.toJSONString();
+ DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ;
+ if(cvo != null){
+ if(callback != null){
+ if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)1){
+ callback.call(true);//寮�闃�鎴愬姛
+ }else{
+ callback.call(false);//寮�闃�澶辫触
+ }
+ }
+ msg = cvo.toStr(false) ;
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ }
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ return msg;
+ }
+
+ private RmCommandOpen newRmCommandOpen(Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ RmCommandOpen po = new RmCommandOpen() ;
+ this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator);
+ return po ;
+ }
+ private void setRmCommandOpen(RmCommandOpen po,
+ Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ po.comId = comId ;
+ po.protocol = protocol ;
+ po.commandCode = comCode ;
+ po.commandName = comName ;
+ po.intakeId = intakeId ;
+ po.rtuAddr = rtuAddr ;
+ po.vcNum = vcNum ;
+ po.orderNo = orderNo ;
+ po.operator = operator ;
+ po.sendTime = new Date() ;
+ }
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdDto.java
new file mode 100644
index 0000000..568c6ee
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdDto.java
@@ -0,0 +1,33 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd37;
+
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:30
+ * @Description
+ */
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class CdDto extends DtoBase {
+
+ public static final long serialVersionUID = 202505130833001L;
+
+ @NotEmpty(message = "鐢ㄦ埛铏氭嫙鍗′笉鑳戒负绌�")
+ public String vtCardId ;//鐢ㄦ埛鍗�(铏氭嫙鍗�)搴忓垪鍙凤紙17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+
+ @NotEmpty(message = "璁″垝寮�闃�鏃堕棿涓嶈兘涓虹┖")
+ public String ymdHms ;//骞存湀鏃ユ椂鍒嗙锛堟牸寮弝yyy-MM-dd HH:mm:SS锛�
+
+ @NotNull(message = "鐢ㄦ按鏃堕暱涓嶈兘涓虹┖")
+ @Min(value = 1, message = "鐢ㄦ按鏃堕暱涓嶈兘灏忎簬1")
+ @Max(value = 9999, message = "鐢ㄦ按鏃堕暱涓嶈兘澶т簬9999")
+ public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdParam.java
new file mode 100644
index 0000000..b5ba5dd
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdParam.java
@@ -0,0 +1,33 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd37;
+
+import com.dy.pipIrrRemote.monitor.common.CdParameter;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:30
+ * @Description
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@SuperBuilder
+public class CdParam extends CdParameter {
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+
+ public Integer year ; //璁″垝寮�闃�鏃堕棿---骞�
+ public Integer month ;//璁″垝寮�闃�鏃堕棿---鏈�
+ public Integer day ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer hour ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer minute ;//璁″垝寮�闃�鏃堕棿---鍒�
+
+ public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdSv.java
new file mode 100644
index 0000000..ed7db47
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd37/CdSv.java
@@ -0,0 +1,80 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd37;
+
+import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
+import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.monitor.common.ComSv;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:30
+ * @Description
+ */
+@Slf4j
+@Service("cd37Sv")
+public class CdSv extends ComSv {
+ @Autowired
+ protected SeVirtualCardMapper seVirtualCardDao ;
+ @Autowired
+ protected PrWaterPriceMapper prWaterPriceDao ;
+ @Autowired
+ protected PrIntakeVcMapper prIntakeVcDao ;
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
+
+ public VoVirtualCard selectClientVtCardById(Long id){
+ return seVirtualCardDao.getVcById(id) ;
+ }
+ public Double selectWaterPrice(){
+ return prWaterPriceDao.getPrice() ;
+ }
+ /**
+ * 鏍规嵁鍙栨按鍙D鑾峰彇涓庝箣缁戝畾铏氭嫙鍗D
+ * @param intakeId
+ * @return
+ */
+ public Long selectVcIdByIntakeId(Long intakeId) {
+ return prIntakeVcDao.getVcIdByIntakeId(intakeId);
+ }
+ /**
+ * 璁剧疆铏氭嫙鍗¤鍗犵敤
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void setVcUsed(Long id, Long intakeId){
+ SeVirtualCard po = new SeVirtualCard() ;
+ po.setId(id);
+ po.setIntakeId(intakeId);
+ po.setInUse((byte)1);
+ po.setOpenTime(new Date());
+ seVirtualCardDao.updateByPrimaryKeySelective(po);
+ }
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void saveCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.insert(po) ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.updateByPrimaryKeySelective(po) ;
+ }
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdCtrl.java
new file mode 100644
index 0000000..a900eca
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdCtrl.java
@@ -0,0 +1,232 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd38;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.aop.SsoAop;
+import com.dy.common.mw.protocol.Command;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd92_A2Vo;
+import com.dy.common.util.Callback;
+import com.dy.common.util.DateTime;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:47
+ * @Description
+ */
+@Slf4j
+@Tag(name = "杩滅▼鍛戒护", description = "APP绔繙绋嬭鍒掑畾閲忓紑鍚按娉�/闃�闂�")
+@RestController("p202404V201Cd38Ctrl")
+@RequestMapping(path = "p202404V201/cd38")
+@RequiredArgsConstructor
+@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞�
+public class CdCtrl extends ComCtrl {
+
+ private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
+
+ private static final String ComCode = "38" ;
+
+ private static final Double MaxRemainMoney = com.dy.pipIrrRemote.monitor.p202404V201.cd92.CdCtrl.MaxRemainMoney;//鍗忚鏀寔鐨勫墿浣欓噾棰濇渶澶у��
+
+ @Autowired
+ private CdSv sv ;
+ /**
+ * 鍚戣澶囷紙鎺у埗鍣級鍙戦�佸懡浠�
+ * @param dto 鍓嶇鍙戞潵鐨勫�煎璞�
+ * @param bindingResult 瀵筪to楠岃瘉鐨勭粨鏋�
+ * @return 杩斿洖鍓嶇
+ */
+ @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @SsoAop()
+ public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) {
+ BaseResponse<Object> res ;
+ //鍙戦�佸懡浠ゅ墠-1锛氶獙璇�
+ res = super.pre1(sv, ComCode, dto, bindingResult);
+ if(res == null) {
+ //鍙戦�佸懡浠ゅ墠-2锛氳幏寰楁暟鎹�
+ res = super.pre2(sv, ComCode, dto, bindingResult);
+ if (res == null) {
+ if(dto.vtCardId == null || "".equals(dto.vtCardId.trim())){
+ Long vtId = sv.selectVcIdByIntakeId(dto.getIntakeId()) ;
+ if(vtId == null) {
+ return BaseResponseUtils.buildErrorMsg("璇烽�夋嫨涓�寮犺櫄鎷熷崱");
+ }else{
+ dto.vtCardId = vtId.toString() ;
+ }
+ }
+ VoVirtualCard vcPo = sv.selectClientVtCardById(Long.parseLong(dto.vtCardId.trim())) ;
+ if(vcPo == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒板啘鎴疯櫄鎷熷崱") ;
+ }
+ if(vcPo.getInUse().booleanValue()){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱宸茬粡琚崰鐢紝涓嶈兘鍐嶅簲鐢ㄥ叾寮�闃�") ;
+ }
+ if(vcPo.getMoney() <= 0.0){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濅负0锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ if(vcPo.getMoney() >= MaxRemainMoney){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濆ぇ浜庡崗璁敮鎸佺殑鏈�澶у��" + MaxRemainMoney + "锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
+ Double waterPrice = sv.selectWaterPrice() ;
+ if(waterPrice == null){
+ return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒版按浠�") ;
+ }
+ String orderNo = RandomStringUtils.randomNumeric(16) ;
+ int[] ymdHms = DateTime.yyyy_MM_dd_HH_MM_SS_2_ymdhmsGroup(dto.ymdHms) ;
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardNo("" + vcPo.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ .waterRemain(0.0)//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .moneyRemain(vcPo.getMoney())//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ .waterPrice(waterPrice)//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .elePrice(0.0)//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ .orderNo(orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .year(ymdHms[0])//骞�
+ .month(ymdHms[1])//鏈�
+ .day(ymdHms[2])//鏃�
+ .hour(ymdHms[3])//鏃�
+ .minute(ymdHms[4])//鍒�
+ .waterAmount(dto.waterAmount)//棰勭敤姘撮噺锛�0~9999 m3锛�
+ .build();
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-4锛氬噯澶嘑eature
+ super.pre4();
+ try {
+ //鍒涘缓澶栭儴鍛戒护锛堝彂缁欐帶鍒跺櫒锛�
+ Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode);
+ com.rtuResultSendWebUrl = rtuResultSendWebUrl;
+ com.param = comParam;
+ //鍙戦�佸懡浠�
+ res = super.doSend(sv, com);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ悗
+ res = super.after(ComCode, new Callback() {
+ @Override
+ public void call(Object obj) {
+ Boolean success = (Boolean) obj;
+ if(success){
+ // 娣诲姞甯哥敤鍙栨按鍙f垨鏇存柊浣跨敤淇℃伅
+ sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ;
+ //寮�闃�鎴愬姛锛岃櫄鎷熷崱璁板綍涓婃爣璁板凡琚崰鐢�
+ sv.setVcUsed(vcPo.getId(), dto.getIntakeId());
+ //璁板綍寮�闃�鍛戒护锛屼互澶囪繙绋嬪叧闃�
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId());
+ if(comOpen == null){
+ RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.saveCommandOpen(po);
+ }else{
+ setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.updateCommandOpen(comOpen);
+ }
+ }
+ }
+ @Override
+ public void call(Object... objs) {
+ }
+ @Override
+ public void exception(Exception e) {
+ }
+ });
+ }
+ } catch (Exception e) {
+ res = BaseResponseUtils.buildFail("鏈嶅姟绔瀯閫犲苟鍚戦�氫俊涓棿浠跺彂閫佽姹傛椂寮傚父" + (e.getMessage() == null ? "" : e.getMessage()));
+ } finally {
+ //鏈�缁�
+ super.end();
+ }
+ }
+ }
+ }
+ return res ;
+ }
+
+ @Override
+ protected String checkDto(DtoBase dto) {
+ return null;
+ }
+
+ @Override
+ protected String dealComResult(String code, JSONObject resultData, Callback callback){
+ String msg;
+ if(resultData != null){
+ JSONObject codeData = resultData.getJSONObject("data") ;
+ if(codeData == null){
+ msg = RtuSuccessMsg ;
+ }else {
+ String json = codeData.toJSONString();
+ DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ;
+ if(cvo != null){
+ if(callback != null){
+ if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)1){
+ callback.call(true);//寮�闃�鎴愬姛
+ }else{
+ callback.call(false);//寮�闃�澶辫触
+ }
+ }
+ msg = cvo.toStr(false) ;
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ }
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ return msg;
+ }
+
+ private RmCommandOpen newRmCommandOpen(Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ RmCommandOpen po = new RmCommandOpen() ;
+ this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator);
+ return po ;
+ }
+ private void setRmCommandOpen(RmCommandOpen po,
+ Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ po.comId = comId ;
+ po.protocol = protocol ;
+ po.commandCode = comCode ;
+ po.commandName = comName ;
+ po.intakeId = intakeId ;
+ po.rtuAddr = rtuAddr ;
+ po.vcNum = vcNum ;
+ po.orderNo = orderNo ;
+ po.operator = operator ;
+ po.sendTime = new Date() ;
+ }
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdDto.java
new file mode 100644
index 0000000..67027c3
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdDto.java
@@ -0,0 +1,33 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd38;
+
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:47
+ * @Description
+ */
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class CdDto extends DtoBase {
+
+ public static final long serialVersionUID = 202505130833001L;
+
+ @NotEmpty(message = "鐢ㄦ埛铏氭嫙鍗′笉鑳戒负绌�")
+ public String vtCardId ;//鐢ㄦ埛鍗�(铏氭嫙鍗�)搴忓垪鍙凤紙17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+
+ @NotEmpty(message = "璁″垝寮�闃�鏃堕棿涓嶈兘涓虹┖")
+ public String ymdHms ;//骞存湀鏃ユ椂鍒嗙锛堟牸寮弝yyy-MM-dd HH:mm:SS锛�
+
+ @NotNull(message = "鐢ㄦ按閲忎笉鑳戒负绌�")
+ @Min(value = 1, message = "鐢ㄦ按閲忎笉鑳藉皬浜�1")
+ @Max(value = 9999, message = "鐢ㄦ按閲忎笉鑳藉ぇ浜�9999")
+ public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdParam.java
new file mode 100644
index 0000000..f96de36
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdParam.java
@@ -0,0 +1,33 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd38;
+
+import com.dy.pipIrrRemote.monitor.common.CdParameter;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:47
+ * @Description
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@SuperBuilder
+public class CdParam extends CdParameter {
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public Double waterRemain ;//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
+ public Double moneyRemain ;//鐢ㄦ埛鍓╀綑閲戦, 涓や釜灏忔暟鐐�, 鍗曚綅鍏�, 0~999999.99
+ public Double waterPrice ;//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public Double elePrice ;//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+
+ public Integer year ; //璁″垝寮�闃�鏃堕棿---骞�
+ public Integer month ;//璁″垝寮�闃�鏃堕棿---鏈�
+ public Integer day ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer hour ;//璁″垝寮�闃�鏃堕棿---鏃�
+ public Integer minute ;//璁″垝寮�闃�鏃堕棿---鍒�
+
+ public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛�
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdSv.java
new file mode 100644
index 0000000..281338b
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd38/CdSv.java
@@ -0,0 +1,80 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd38;
+
+import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
+import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
+import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
+import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
+import com.dy.pipIrrRemote.monitor.common.ComSv;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/6/30 9:47
+ * @Description
+ */
+@Slf4j
+@Service("cd38Sv")
+public class CdSv extends ComSv {
+ @Autowired
+ protected SeVirtualCardMapper seVirtualCardDao ;
+ @Autowired
+ protected PrWaterPriceMapper prWaterPriceDao ;
+ @Autowired
+ protected PrIntakeVcMapper prIntakeVcDao ;
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
+
+ public VoVirtualCard selectClientVtCardById(Long id){
+ return seVirtualCardDao.getVcById(id) ;
+ }
+ public Double selectWaterPrice(){
+ return prWaterPriceDao.getPrice() ;
+ }
+ /**
+ * 鏍规嵁鍙栨按鍙D鑾峰彇涓庝箣缁戝畾铏氭嫙鍗D
+ * @param intakeId
+ * @return
+ */
+ public Long selectVcIdByIntakeId(Long intakeId) {
+ return prIntakeVcDao.getVcIdByIntakeId(intakeId);
+ }
+ /**
+ * 璁剧疆铏氭嫙鍗¤鍗犵敤
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void setVcUsed(Long id, Long intakeId){
+ SeVirtualCard po = new SeVirtualCard() ;
+ po.setId(id);
+ po.setIntakeId(intakeId);
+ po.setInUse((byte)1);
+ po.setOpenTime(new Date());
+ seVirtualCardDao.updateByPrimaryKeySelective(po);
+ }
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void saveCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.insert(po) ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.updateByPrimaryKeySelective(po) ;
+ }
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdCtrl.java
index 4d3ff38..bcb00a2 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdCtrl.java
@@ -8,6 +8,7 @@
import com.dy.common.util.Callback;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.common.dto.DtoBase;
import com.dy.pipIrrRemote.monitor.common.ComCtrl;
@@ -25,6 +26,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.util.Date;
+
/**
* @Author: liurunyu
* @Date: 2025/5/13 08:33
@@ -41,6 +44,8 @@
private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
private static final String ComCode = "92" ;
+
+ public static final Double MaxRemainMoney = 9999.9999D ;//鍗忚鏀寔鐨勫墿浣欓噾棰濇渶澶у��
@Autowired
private CdSv sv ;
@@ -78,17 +83,21 @@
if(vcPo.getMoney() <= 0.0){
return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濅负0锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
}
+ if(vcPo.getMoney() >= MaxRemainMoney){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濆ぇ浜庡崗璁敮鎸佺殑鏈�澶у��" + MaxRemainMoney + "锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
Double waterPrice = sv.selectWaterPrice() ;
if(waterPrice == null){
return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒版按浠�") ;
}
+ String orderNo = RandomStringUtils.randomNumeric(16) ;
CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
.icCardNo("" + vcPo.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
.waterRemain(0.0)//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
.moneyRemain(vcPo.getMoney())//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
.waterPrice(waterPrice)//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
.elePrice(0.0)//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
- .orderNo(RandomStringUtils.randomNumeric(16))//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .orderNo(orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
.build();
//鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
@@ -113,6 +122,15 @@
sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ;
//寮�闃�鎴愬姛锛岃櫄鎷熷崱璁板綍涓婃爣璁板凡琚崰鐢�
sv.setVcUsed(vcPo.getId(), dto.getIntakeId());
+ //璁板綍寮�闃�鍛戒护锛屼互澶囪繙绋嬪叧闃�
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId());
+ if(comOpen == null){
+ RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.saveCommandOpen(po);
+ }else{
+ setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.updateCommandOpen(comOpen);
+ }
}
}
@Override
@@ -152,7 +170,7 @@
DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ;
if(cvo != null){
if(callback != null){
- if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)0){
+ if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)1){
callback.call(true);//寮�闃�鎴愬姛
}else{
callback.call(false);//寮�闃�澶辫触
@@ -168,4 +186,39 @@
}
return msg;
}
+
+ private RmCommandOpen newRmCommandOpen(Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ RmCommandOpen po = new RmCommandOpen() ;
+ this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator);
+ return po ;
+ }
+ private void setRmCommandOpen(RmCommandOpen po,
+ Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ po.comId = comId ;
+ po.protocol = protocol ;
+ po.commandCode = comCode ;
+ po.commandName = comName ;
+ po.intakeId = intakeId ;
+ po.rtuAddr = rtuAddr ;
+ po.vcNum = vcNum ;
+ po.orderNo = orderNo ;
+ po.operator = operator ;
+ po.sendTime = new Date() ;
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdSv.java
index afd477b..9328b6b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd92/CdSv.java
@@ -2,15 +2,19 @@
import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.monitor.common.ComSv;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
+import java.util.List;
/**
* @Author: liurunyu
@@ -26,6 +30,8 @@
protected PrWaterPriceMapper prWaterPriceDao ;
@Autowired
protected PrIntakeVcMapper prIntakeVcDao ;
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
public VoVirtualCard selectClientVtCardById(Long id){
return seVirtualCardDao.getVcById(id) ;
@@ -44,6 +50,7 @@
/**
* 璁剧疆铏氭嫙鍗¤鍗犵敤
*/
+ @Transactional(rollbackFor = Exception.class)
public void setVcUsed(Long id, Long intakeId){
SeVirtualCard po = new SeVirtualCard() ;
po.setId(id);
@@ -52,4 +59,22 @@
po.setOpenTime(new Date());
seVirtualCardDao.updateByPrimaryKeySelective(po);
}
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void saveCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.insert(po) ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.updateByPrimaryKeySelective(po) ;
+ }
}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdCtrl.java
index 4755282..241f9c1 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdCtrl.java
@@ -4,11 +4,11 @@
import com.alibaba.fastjson2.JSONObject;
import com.dy.common.aop.SsoAop;
import com.dy.common.mw.protocol.Command;
-import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_A3Vo;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_9D_A3Vo;
import com.dy.common.util.Callback;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
-import com.dy.pipIrrGlobal.voRm.VoUnclosedParam;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrRemote.common.dto.DtoBase;
import com.dy.pipIrrRemote.monitor.common.ComCtrl;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -60,6 +60,8 @@
res = super.pre2(sv, ComCode, dto, bindingResult);
if (res == null) {
//鑾峰彇寮�闃�鍛戒护鍙傛暟
+ /*
+ 2025-06-27鍘熸潵鐨勫疄鐜帮紝鍘熸潵娌℃湁璁捐RmCommandOpen瀵硅薄鍙婂叾瀵瑰簲鐨勬暟鎹簱琛�
VoUnclosedParam opPa = sv.selectUncloseParam(dto.getIntakeId(), ctrlPo.getRtuAddr());
if(opPa == null) {
return BaseResponseUtils.buildFail("璇ュ彇姘村彛涓婃棤鎮ㄦ渶杩戠殑寮�闃�鎿嶄綔");
@@ -72,6 +74,20 @@
CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
.icCardNo(opPa.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
.orderNo(opPa.getOrderNo())//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .build();
+ */
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId()) ;
+ if(comOpen == null) {
+ return BaseResponseUtils.buildFail("璇ュ彇姘村彛涓婃棤鎮ㄦ渶杩戠殑寮�闃�鎿嶄綔");
+ }
+ Long vcId = sv.getVcIdByNum("" + comOpen.vcNum) ;
+ if(vcId == null) {
+ return BaseResponseUtils.buildFail("鏈嶅姟绔嚭閿欙紝鏈緱鍒拌櫄鎷熷崱ID");
+ }
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardNo("" + comOpen.vcNum)//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ .orderNo(comOpen.orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
.build();
res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
if (res == null) {
@@ -129,7 +145,7 @@
msg = RtuSuccessMsg ;
}else {
String json = codeData.toJSONString();
- DataCd93_A3Vo cvo = JSON.parseObject(json, DataCd93_A3Vo.class) ;
+ DataCd93_9D_A3Vo cvo = JSON.parseObject(json, DataCd93_9D_A3Vo.class) ;
if(cvo != null){
if(callback != null){
if(cvo.clResult != null && cvo.clResult == 0){
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdSv.java
index fa1a23a..6b64a55 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd93/CdSv.java
@@ -1,13 +1,18 @@
package com.dy.pipIrrRemote.monitor.p202404V201.cd93;
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.monitor.common.ComSv;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
/**
* @Author: liurunyu
@@ -20,13 +25,14 @@
@Autowired
protected SeVirtualCardMapper seVirtualCardDao ;
-
@Autowired
protected PrWaterPriceMapper prWaterPriceDao ;
-
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
/**
* 瑙i櫎铏氭嫙鍗¤鍗犵敤
*/
+ @Transactional(rollbackFor = Exception.class)
public void setVcNoUsed(Long id){
SeVirtualCard po = new SeVirtualCard() ;
po.setId(id);
@@ -44,4 +50,13 @@
public Long getVcIdByNum(String vcNum){
return seVirtualCardDao.getVcIdByNum(vcNum) ;
}
+
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdCtrl.java
new file mode 100644
index 0000000..4d63e92
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdCtrl.java
@@ -0,0 +1,150 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd9D;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.dy.common.aop.SsoAop;
+import com.dy.common.mw.protocol.Command;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_9D_A3Vo;
+import com.dy.common.util.Callback;
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveLast;
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.validation.Valid;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/28 11:30
+ * @Description
+ */
+@Slf4j
+@Tag(name = "杩滅▼鍛戒护", description = "骞冲彴杩滅▼鍏抽榾")
+@RestController("p202404V201Cd9DCtrl")
+@RequestMapping(path = "p202404V201/cd9D")
+@RequiredArgsConstructor
+@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞�
+public class CdCtrl extends ComCtrl {
+
+ private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
+
+ private static final String ComCode = "9D" ;
+
+ @Autowired
+ private CdSv sv ;
+ /**
+ * 鍚戣澶囷紙鎺у埗鍣級鍙戦�佸懡浠�
+ * @param dto 鍓嶇鍙戞潵鐨勫�煎璞�
+ * @param bindingResult 瀵筪to楠岃瘉鐨勭粨鏋�
+ * @return 杩斿洖鍓嶇
+ */
+ @PostMapping(path = "send", consumes = MediaType.APPLICATION_JSON_VALUE)
+ @SsoAop()
+ public BaseResponse<Object> send(@RequestBody @Valid CdDto dto, BindingResult bindingResult) {
+ BaseResponse<Object> res ;
+ //鍙戦�佸懡浠ゅ墠-1锛氶獙璇�
+ res = super.pre1(sv, ComCode, dto, bindingResult);
+ if(res == null) {
+ //鍙戦�佸懡浠ゅ墠-2锛氳幏寰楁暟鎹�
+ res = super.pre2(sv, ComCode, dto, bindingResult);
+ if (res == null) {
+ //鑾峰彇寮�闃�鍛戒护鍙傛暟
+ RmOpenCloseValveLast lastOpPo = sv.getLastOpenValve(dto.getIntakeId()) ;
+ if(lastOpPo == null || lastOpPo.opType == null) {
+ return BaseResponseUtils.buildFail("璇ュ彇姘村彛涓婃棤鏈�杩戠殑寮�闃�鎿嶄綔");
+ }
+ if(lastOpPo.clType != null) {
+ return BaseResponseUtils.buildFail("璇ュ彇姘村彛涓婃棤鏈�杩戠殑寮�闃�鎿嶄綔");
+ }
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardAddr(lastOpPo.opIcCardAddr)//寮�闃�ic鍗″湴鍧�
+ .icCardNo(lastOpPo.opIcCardNo)//寮�闃�IC鍗$紪鍙�
+ .orderNo(lastOpPo.opOrderNo)//璁㈠崟鍙�
+ .build();
+ res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ墠-4锛氬噯澶嘑eature
+ super.pre4();
+ try {
+ //鍒涘缓澶栭儴鍛戒护锛堝彂缁欐帶鍒跺櫒锛�
+ Command com = sv.createOuterCommand(ctrlPo.getRtuAddr(), "" + comId, ComCode);
+ com.rtuResultSendWebUrl = rtuResultSendWebUrl;
+ com.param = comParam;
+ //鍙戦�佸懡浠�
+ res = super.doSend(sv, com);
+ if (res == null) {
+ //鍙戦�佸懡浠ゅ悗
+ res = super.after(ComCode, new Callback() {
+ @Override
+ public void call(Object obj) {
+ //Boolean success = (Boolean) obj;
+ //if(success){
+ // //鍏抽榾鎴愬姛
+ //}
+ }
+ @Override
+ public void call(Object... objs) {
+ }
+ @Override
+ public void exception(Exception e) {
+ }
+ });
+ }
+ } catch (Exception e) {
+ res = BaseResponseUtils.buildFail("鏈嶅姟绔瀯閫犲苟鍚戦�氫俊涓棿浠跺彂閫佽姹傛椂寮傚父" + (e.getMessage() == null ? "" : e.getMessage()));
+ } finally {
+ //鏈�缁�
+ super.end();
+ }
+ }
+ }
+ }
+ return res ;
+ }
+
+ @Override
+ protected String checkDto(DtoBase dto) {
+ return null;
+ }
+
+ @Override
+ protected String dealComResult(String code, JSONObject resultData, Callback callback){
+ String msg;
+ if(resultData != null){
+ JSONObject codeData = resultData.getJSONObject("data") ;
+ if(codeData == null){
+ msg = RtuSuccessMsg ;
+ }else {
+ String json = codeData.toJSONString();
+ DataCd93_9D_A3Vo cvo = JSON.parseObject(json, DataCd93_9D_A3Vo.class) ;
+ if(cvo != null){
+ if(callback != null){
+ if(cvo.clResult != null && cvo.clResult == 0){
+ callback.call(true);//鍏抽榾鎴愬姛
+ }else{
+ callback.call(false);//鍏抽榾澶辫触
+ }
+ }
+ msg = cvo.toStr(false) ;
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ }
+ }else{
+ msg = RtuSuccessMsg ;
+ }
+ return msg;
+ }
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdDto.java
new file mode 100644
index 0000000..276d441
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdDto.java
@@ -0,0 +1,17 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd9D;
+
+import com.dy.pipIrrRemote.common.dto.DtoBase;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/28 11:30
+ * @Description
+ */
+
+@Data
+@EqualsAndHashCode(callSuper=true)
+public class CdDto extends DtoBase {
+ public static final long serialVersionUID = 202506281131001L;
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdParam.java
new file mode 100644
index 0000000..033b495
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdParam.java
@@ -0,0 +1,22 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd9D;
+
+import com.dy.pipIrrRemote.monitor.common.CdParameter;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import lombok.experimental.SuperBuilder;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/28 11:30
+ * @Description
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@SuperBuilder
+public class CdParam extends CdParameter {
+ public String icCardAddr ;//鐢ㄦ埛鍗″湴鍧�锛�4瀛楄妭HEX锛�
+ public String icCardNo ;//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdSv.java
new file mode 100644
index 0000000..ea3c60c
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cd9D/CdSv.java
@@ -0,0 +1,38 @@
+package com.dy.pipIrrRemote.monitor.p202404V201.cd9D;
+
+import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmOpenCloseValveLastMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmOpenCloseValveLast;
+import com.dy.pipIrrRemote.monitor.common.ComSv;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/5/28 11:30
+ * @Description
+ */
+@Slf4j
+@Service("cd9DSv")
+public class CdSv extends ComSv {
+
+ @Autowired
+ protected SeVirtualCardMapper seVirtualCardDao ;
+ @Autowired
+ protected PrWaterPriceMapper prWaterPriceDao ;
+ @Autowired
+ protected RmOpenCloseValveLastMapper rmOpenCloseValveLastDao ;
+
+
+ public RmOpenCloseValveLast getLastOpenValve(Long intakeId){
+ List<RmOpenCloseValveLast> list = rmOpenCloseValveLastDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdCtrl.java
index 9b0e809..e1acabb 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdCtrl.java
@@ -8,6 +8,7 @@
import com.dy.common.util.Callback;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.common.dto.DtoBase;
import com.dy.pipIrrRemote.monitor.common.ComCtrl;
@@ -25,6 +26,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.util.Date;
+
/**
* @Author: liurunyu
* @Date: 2025/5/15 09:21
@@ -41,6 +44,8 @@
private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁";
private static final String ComCode = "A2" ;
+
+ private static final Double MaxRemainMoney = com.dy.pipIrrRemote.monitor.p202404V201.cd92.CdCtrl.MaxRemainMoney;//鍗忚鏀寔鐨勫墿浣欓噾棰濇渶澶у��
@Autowired
private CdSv sv ;
@@ -78,17 +83,21 @@
if(vcPo.getMoney() <= 0.0){
return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濅负0锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
}
+ if(vcPo.getMoney() >= MaxRemainMoney){
+ return BaseResponseUtils.buildErrorMsg("鍐滄埛璇ヨ櫄鎷熷崱涓墿浣欓噾棰濆ぇ浜庡崗璁敮鎸佺殑鏈�澶у��" + MaxRemainMoney + "锛屼笉鑳藉啀搴旂敤鍏跺紑闃�") ;
+ }
Double waterPrice = sv.selectWaterPrice() ;
if(waterPrice == null){
return BaseResponseUtils.buildErrorMsg("鏈嶅姟绔嚭閿欙紝鏈緱鍒版按浠�") ;
}
+ String orderNo = RandomStringUtils.randomNumeric(16) ;
CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
.icCardNo("" + vcPo.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
.waterRemain(0.0)//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
.moneyRemain(vcPo.getMoney())//鐢ㄦ埛鍓╀綑姘撮噺, 涓や釜灏忔暟鐐�, 鍗曚綅m3, 0~99999999.99
.waterPrice(waterPrice)//姘撮噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
.elePrice(0.0)//鐢甸噺鍗曚环 鍗曚綅:鍏�, 2涓皬鏁扮偣
- .orderNo(RandomStringUtils.randomNumeric(16))//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .orderNo(orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
.build();
//鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
@@ -113,6 +122,15 @@
sv.addOrUpdateOftenUseIntake(dto.getOperator(), dto.getIntakeId()) ;
//寮�闃�鎴愬姛锛岃櫄鎷熷崱璁板綍涓婃爣璁板凡琚崰鐢�
sv.setVcUsed(vcPo.getId(), dto.getIntakeId());
+ //璁板綍寮�闃�鍛戒护锛屼互澶囪繙绋嬪叧闃�
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId());
+ if(comOpen == null){
+ RmCommandOpen po = newRmCommandOpen(comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.saveCommandOpen(po);
+ }else{
+ setRmCommandOpen(comOpen, comId, ctrlPo.getProtocol(), ComCode, comName, dto.getIntakeId(), ctrlPo.getRtuAddr(), vcPo.getVcNum(), orderNo, dto.getOperator()) ;
+ sv.updateCommandOpen(comOpen);
+ }
}
}
@Override
@@ -152,7 +170,7 @@
DataCd92_A2Vo cvo = JSON.parseObject(json, DataCd92_A2Vo.class) ;
if(cvo != null){
if(callback != null){
- if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)0){
+ if(cvo.opResult != null && cvo.opResult.byteValue() == (byte)1){
callback.call(true);//寮�闃�鎴愬姛
}else{
callback.call(false);//寮�闃�澶辫触
@@ -168,4 +186,39 @@
}
return msg;
}
+
+ private RmCommandOpen newRmCommandOpen(Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ RmCommandOpen po = new RmCommandOpen() ;
+ this.setRmCommandOpen(po, comId, protocol, comCode, comName, intakeId, rtuAddr, vcNum, orderNo, operator);
+ return po ;
+ }
+ private void setRmCommandOpen(RmCommandOpen po,
+ Long comId,
+ String protocol,
+ String comCode,
+ String comName,
+ Long intakeId,
+ String rtuAddr,
+ Long vcNum,
+ String orderNo,
+ Long operator){
+ po.comId = comId ;
+ po.protocol = protocol ;
+ po.commandCode = comCode ;
+ po.commandName = comName ;
+ po.intakeId = intakeId ;
+ po.rtuAddr = rtuAddr ;
+ po.vcNum = vcNum ;
+ po.orderNo = orderNo ;
+ po.operator = operator ;
+ po.sendTime = new Date() ;
+ }
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdSv.java
index 0a1fad3..4b2c04c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA2/CdSv.java
@@ -2,15 +2,19 @@
import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper;
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.monitor.common.ComSv;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
+import java.util.List;
/**
* @Author: liurunyu
@@ -26,6 +30,8 @@
protected PrWaterPriceMapper prWaterPriceDao ;
@Autowired
protected PrIntakeVcMapper prIntakeVcDao ;
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
public VoVirtualCard selectClientVtCardById(Long id){
return seVirtualCardDao.getVcById(id) ;
@@ -52,4 +58,23 @@
po.setOpenTime(new Date());
seVirtualCardDao.updateByPrimaryKeySelective(po);
}
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void saveCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.insert(po) ;
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommandOpen(RmCommandOpen po){
+ rmCommandOpenDao.updateByPrimaryKeySelective(po) ;
+ }
+
}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdCtrl.java
index 2c5626f..a2a4553 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdCtrl.java
@@ -4,13 +4,14 @@
import com.alibaba.fastjson2.JSONObject;
import com.dy.common.aop.SsoAop;
import com.dy.common.mw.protocol.Command;
-import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_A3Vo;
+import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_9D_A3Vo;
import com.dy.common.util.Callback;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
-import com.dy.pipIrrGlobal.voRm.VoUnclosedParam;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrRemote.common.dto.DtoBase;
import com.dy.pipIrrRemote.monitor.common.ComCtrl;
+import com.dy.pipIrrRemote.monitor.p202404V201.cd93.CdParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
@@ -60,6 +61,8 @@
res = super.pre2(sv, ComCode, dto, bindingResult);
if (res == null) {
//鑾峰彇寮�闃�鍛戒护鍙傛暟
+ /*
+ 2025-06-27鍘熸潵鐨勫疄鐜帮紝鍘熸潵娌℃湁璁捐RmCommandOpen瀵硅薄鍙婂叾瀵瑰簲鐨勬暟鎹簱琛�
VoUnclosedParam opPa = sv.selectUncloseParam(dto.getIntakeId(), ctrlPo.getRtuAddr());
if(opPa == null) {
return BaseResponseUtils.buildFail("璇ュ彇姘村彛涓婃棤鎮ㄦ渶杩戠殑寮�闃�鎿嶄綔");
@@ -72,6 +75,20 @@
CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
.icCardNo(opPa.getVcNum())//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
.orderNo(opPa.getOrderNo())//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
+ .build();
+ */
+ RmCommandOpen comOpen = sv.getCommandOpen(dto.getIntakeId()) ;
+ if(comOpen == null) {
+ return BaseResponseUtils.buildFail("璇ュ彇姘村彛涓婃棤鎮ㄦ渶杩戠殑寮�闃�鎿嶄綔");
+ }
+ Long vcId = sv.getVcIdByNum("" + comOpen.vcNum) ;
+ if(vcId == null) {
+ return BaseResponseUtils.buildFail("鏈嶅姟绔嚭閿欙紝鏈緱鍒拌櫄鎷熷崱ID");
+ }
+ //鍙戦�佸懡浠ゅ墠-3锛氫繚瀛樺懡浠ゆ棩蹇�
+ com.dy.pipIrrRemote.monitor.p202404V201.cd93.CdParam comParam = CdParam.builder().commandCode(ComCode).projectNo(projectNo).controllerType(controllerType)
+ .icCardNo("" + comOpen.vcNum)//鐢ㄦ埛鍗″簭鍒楀彿锛�17浣嶆暟瀛楋級锛�6瀛楄妭BCD锛�2瀛楄妭HEX锛�
+ .orderNo(comOpen.orderNo)//璁㈠崟鍙凤紙16浣嶆暟瀛楋級
.build();
res = super.pre3(sv, dto.getIntakeId(), dto.getOperator(), ComCode, comParam);
if (res == null) {
@@ -129,7 +146,7 @@
msg = RtuSuccessMsg ;
}else {
String json = codeData.toJSONString();
- DataCd93_A3Vo cvo = JSON.parseObject(json, DataCd93_A3Vo.class) ;
+ DataCd93_9D_A3Vo cvo = JSON.parseObject(json, DataCd93_9D_A3Vo.class) ;
if(cvo != null){
if(callback != null){
if(cvo.clResult != null && cvo.clResult == 0){
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdSv.java
index 7c37b0d..a4304df 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/p202404V201/cdA3/CdSv.java
@@ -1,13 +1,17 @@
package com.dy.pipIrrRemote.monitor.p202404V201.cdA3;
import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper;
+import com.dy.pipIrrGlobal.daoRm.RmCommandOpenMapper;
import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
+import com.dy.pipIrrGlobal.pojoRm.RmCommandOpen;
import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
import com.dy.pipIrrRemote.monitor.common.ComSv;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+
+import java.util.List;
/**
* @Author: liurunyu
@@ -20,10 +24,10 @@
@Autowired
protected SeVirtualCardMapper seVirtualCardDao ;
-
@Autowired
protected PrWaterPriceMapper prWaterPriceDao ;
-
+ @Autowired
+ protected RmCommandOpenMapper rmCommandOpenDao ;
/**
* 瑙i櫎铏氭嫙鍗¤鍗犵敤
*/
@@ -44,4 +48,13 @@
public Long getVcIdByNum(String vcNum){
return seVirtualCardDao.getVcIdByNum(vcNum) ;
}
+
+
+ public RmCommandOpen getCommandOpen(Long intakeId){
+ List<RmCommandOpen> list = rmCommandOpenDao.selectByIntakeId(intakeId) ;
+ if(list != null && list.size() > 0){
+ return list.get(0) ;
+ }
+ return null ;
+ }
}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
index 90468c2..0877929 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilCtrl.java
@@ -63,6 +63,36 @@
}
/**
+ * 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯鏌愪竴鏃ヨ褰�
+ * @param soilId
+ * @param yyyy_MM
+ * @return
+ */
+ @GetMapping(path = "oneDayByMonth")
+ @SsoAop()
+ public BaseResponse<List<VoSoilDay>> oneDayByMonth(Long soilId, String yyyy_MM){
+ try {
+ if(soilId == null){
+ return BaseResponseUtils.buildFail("澧掓儏绔檌d涓嶈兘涓虹┖") ;
+ }
+ if(yyyy_MM == null || yyyy_MM.trim().equals("")){
+ return BaseResponseUtils.buildFail("鏌ヨ鏈堜唤涓嶈兘涓虹┖") ;
+ }
+ String ymdStr = yyyy_MM.replaceAll("-", "") ;
+ if(!NumUtil.isPlusIntNumber(ymdStr)){
+ return BaseResponseUtils.buildFail("鏌ヨ鏃ユ湡鏍煎紡涓嶆纭紝鏍煎紡瑙勫畾涓簓yyy-MM-dd") ;
+ }
+ Integer ymStart = Integer.parseInt(ymdStr) * 100;
+ Integer ymEnd = Integer.parseInt(ymdStr) * 100 + 31;
+ return BaseResponseUtils.buildSuccess(sv.oneDayByMonth(soilId, ymStart, ymEnd));
+ } catch (Exception e) {
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+
+
+ /**
* 鏍规嵁鎸囧畾鏉′欢鏌ヨ鏌愭皵璞$珯涓�浜涙棩璁板綍
* @param qo
* @return
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilSv.java
index f25ca0f..ece240c 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/mqttSd1/soil/SoilSv.java
@@ -41,6 +41,10 @@
return null ;
}
+ public List<VoSoilDay> oneDayByMonth(Long soilId, Integer yyyyMMddStart, Integer yyyyMMddEnd) {
+ return this.rmSoilDayDao.selectOneMonthBySoilId(soilId, yyyyMMddStart, yyyyMMddEnd) ;
+ }
+
public QueryResultVo<List<VoSoilDay>> someDay(SoilQo qo) {
Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
--
Gitblit v1.8.0