From 33af27ee7a189b538452fc9adb63e0784324e009 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期三, 24 七月 2024 10:49:37 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/application-database.yml | 4 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsSv.java | 121 +++ pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java | 194 ++++ pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java | 181 ++++ pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml | 49 + pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/RtuCtrl.java | 28 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoControllerAlarmState.java | 93 ++ pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java | 2 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml | 143 +++ pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/Com99Vo.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/AutomaticClose.java | 43 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateHistoryMapper.java | 18 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java | 17 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoClientAmountDay.java | 62 + pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/MidResultActionError.java | 17 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/ComA0Vo.java | 2 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java | 39 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java | 44 + pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java | 153 ++++ pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/AutomaticClose.java | 44 + pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml | 768 ++++++++++++-------- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java | 38 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateLastMapper.java | 18 pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml | 49 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java | 17 pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml | 10 pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandResultCtrl.java | 25 27 files changed, 1,779 insertions(+), 402 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/Com99Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/Com99Vo.java index af014d5..e9c3c09 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/Com99Vo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/Com99Vo.java @@ -10,7 +10,7 @@ @Data public class Com99Vo { public String icCardNo ;//17浣嶈櫄鎷烮C鍗$紪鍙�(鍗忚鏄�10浣嶆暟瀛�) - public Integer moneyRemain;//鍓╀綑閲戦(鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏�) + public Double moneyRemain;//鍓╀綑閲戦(鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏�) public Double waterPrice;//姘翠环(鍙栧�艰寖鍥�0.00~99.99鍏�/m3) public Integer minutes ;//鐢ㄦ按鏃堕暱锛�0~9999鍒嗛挓锛� public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級 diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/ComA0Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/ComA0Vo.java index 9f78660..ee1645f 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/ComA0Vo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/downVos/ComA0Vo.java @@ -10,7 +10,7 @@ @Data public class ComA0Vo { public String icCardNo ;//17浣嶈櫄鎷烮C鍗$紪鍙�(鍗忚鏄�10浣嶆暟瀛�) - public Integer moneyRemain;//鍓╀綑閲戦(鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏�) + public Double moneyRemain;//鍓╀綑閲戦(鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏�) public Double waterPrice;//姘翠环(鍙栧�艰寖鍥�0.00~99.99鍏�/m3) public Integer waterAmount ;//棰勭敤姘撮噺锛�0~9999 m3锛� public String orderNo ;//璁㈠崟鍙凤紙16浣嶆暟瀛楋級 diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java index 95daca2..8413b02 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/command/ComSupport.java @@ -19,6 +19,7 @@ import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; import jakarta.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -48,13 +49,20 @@ //@Value("${mw.comSendUrl}") protected String comSendUrl; - protected static String controllerType = null; - protected static Integer projectNo = null; + //protected static String controllerType = null; + //protected static Integer projectNo = null; + + @Value("${project.projectNo}") + protected Integer projectNo; + + @Value("${project.controllerType}") + protected String controllerType; + protected String commandTypeOuter = CommandType.outerCommand; // 瀛樺偍瀹炰緥鍖栫殑 CompletableFuture<Data> 瀵硅薄 protected static Map<Long, Object> features = new HashMap<>(); - protected static Boolean setuped = false; + //protected static Boolean setuped = false; @Autowired private RestTemplate restTemplate; @@ -89,11 +97,11 @@ /** * 鑾峰彇绯荤粺閰嶇疆鍙傛暟 */ - public void setUp() { - controllerType = comSupport.baSettingsMapper.getItemValue("controllerType"); - projectNo = Integer.parseInt(comSupport.baSettingsMapper.getItemValue("projectNo")); - setuped = true; - } + //public void setUp() { + // controllerType = comSupport.baSettingsMapper.getItemValue("controllerType"); + // projectNo = Integer.parseInt(comSupport.baSettingsMapper.getItemValue("projectNo")); + // setuped = true; + //} /** * 鐢熸垚璁㈠崟鍙� @@ -322,6 +330,21 @@ seVirtualCardMapper.updateByPrimaryKeySelective(virtualCard); } + // 濡傛灉鏄紑鍙戝懡浠わ紙92-骞冲彴寮�闃�锛�91-灏忕▼搴忓紑闃�锛夛紝杩斿洖缁撴灉涓坊鍔犻榾鎺у櫒鍦板潃銆佽櫄鎷熷崱缂栧彿銆佽鍗曞彿 + if(commandCode.equals("92") || commandCode.equals("97")) { + JSONObject job_response = (JSONObject) JSON.toJSON(response_CallBack); + JSONObject job_param = (JSONObject) JSON.toJSON(param); + + JSONObject job_data = job_response.getJSONObject("content").getJSONObject("data"); + job_data.remove("success"); + job_data.put("intakeId", intakeId); + job_data.put("rtuAddr", rtuAddr); + job_data.put("vcNum", job_param.getString("icCardNo")); + job_data.put("orderNo", job_param.getString("orderNo")); + + response_CallBack = JSON.parseObject(job_response.toJSONString(), BaseResponse.class); + } + // 鍥炶皟杩斿洖鐨勫唴瀹癸紝鍥炶皟缁撴灉鍐欏叆鍛戒护鏃ュ織琛ㄧ殑浠诲姟鐢变腑闂翠欢瀹屾垚 return response_CallBack; diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateHistoryMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateHistoryMapper.java index bb0bf4c..b3bf500 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateHistoryMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateHistoryMapper.java @@ -2,7 +2,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory; +import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; /** * @Author: liurunyu @@ -58,4 +62,18 @@ * @return update count */ int updateByPrimaryKey(RmAlarmStateHistory record); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟 + * @param params + * @return + */ + Long getRecordCount(Map<?, ?> params); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍 + * @param params + * @return + */ + List<VoControllerAlarmState> getControllerAlarmStateHistory(Map<?, ?> params); } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateLastMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateLastMapper.java index c8b29d0..6730a34 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateLastMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmAlarmStateLastMapper.java @@ -2,10 +2,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast; -import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay; +import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; /** * @Author: liurunyu @@ -69,4 +70,19 @@ * @return object by intakeId */ List<RmAlarmStateLast> selectByIntakeId(Long intakeId); + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟 + * @param params + * @return + */ + Long getRecordCount(Map<?, ?> params); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍 + * @param params + * @return + */ + List<VoControllerAlarmState> getControllerAlarmStateLast(Map<?, ?> params); } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java index bafb46b..1d7ef01 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayLastMapper.java @@ -2,9 +2,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoRm.RmClientAmountDayLast; +import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; /** * @Author: liurunyu @@ -62,4 +64,19 @@ * @return update count */ int updateByPrimaryKey(RmClientAmountDayLast record); + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟 + * @param params + * @return + */ + Long getRecordCount(Map<?, ?> params); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍 + * @param params + * @return + */ + List<VoClientAmountDay> getClientAmountDayLast(Map<?, ?> params); } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java index 37d8992..0ab6a70 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmClientAmountDayMapper.java @@ -2,11 +2,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoRm.RmClientAmountDay; +import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; +import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; +import java.util.Map; /** * @Author: liurunyu @@ -71,4 +74,18 @@ * @return update count */ int updateByPrimaryKey(RmClientAmountDay record); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟 + * @param params + * @return + */ + Long getRecordCount(Map<?, ?> params); + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍 + * @param params + * @return + */ + List<VoClientAmountDay> getClientAmountDayHistory(Map<?, ?> params); } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoClientAmountDay.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoClientAmountDay.java new file mode 100644 index 0000000..d105f1c --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoClientAmountDay.java @@ -0,0 +1,62 @@ +package com.dy.pipIrrGlobal.voRm; + +import com.dy.common.po.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.sql.Date; + +/** + * @author :WuZeYu + * @Date :2024/7/23 16:21 + * @LastEditTime :2024/7/23 16:21 + * @Description + */ +@Data +@Schema(title = "鍐滄埛鏃ョ敤姘撮噺缁熻瑙嗗浘瀵硅薄") +public class VoClientAmountDay implements BaseEntity { + + private static final long serialVersionUID = 202407231622001L; + + @Schema(description = "鍐滄埛ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private String clientId; + + @Schema(description = "鏃ュ彇姘撮噺", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Double amount; + + @Schema(description = "鏃ヨ姳璐归噾棰�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Double money; + + @Schema(description = "缁熻鏃ユ湡(yyyy-mm-dd)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private java.sql.Date dt; + + @Schema(description = "缁熻鏃ユ渶鍚庝竴娆″紑闃�鏃ユ湡鏃堕棿锛坹yyy-mm-dd HH:MM:SS锛�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private java.util.Date openDtLast; + + @Schema(description = "缁熻鏃ユ渶鍚庝竴娆″叧闃�鏃ユ湡鏃堕棿锛坹yyy-mm-dd HH:MM:SS锛�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private java.util.Date closeDtLast; + + @Schema(description = "缁熻鏃ユ渶鍚庝竴娆″紑闃�鍙栨按閲�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Double thisAmountLast; + + @Schema(description = "缁熻鏃ユ渶鍚庝竴娆″紑闃�鑺辫垂閲戦", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Double thisMoneyLast; + + @Schema(description = "缁熻鏃ユ渶鍚庝竴娆″紑闃�鍙栨按鏃堕暱锛堝垎閽燂級", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private Long thisTimeLast; + + @Schema(description = "缁熻鏃ユ渶鍚庝竴娆″叧闃�涓婃姤鎺у埗鍣ㄦ椂閽�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private java.util.Date rtuDtLast; + + @Schema(description = "鍐滄埛濮撳悕", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private String clientName; + +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoControllerAlarmState.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoControllerAlarmState.java new file mode 100644 index 0000000..5443963 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voRm/VoControllerAlarmState.java @@ -0,0 +1,93 @@ +package com.dy.pipIrrGlobal.voRm; + +import com.dy.common.po.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author :WuZeYu + * @Date :2024/7/23 8:39 + * @LastEditTime :2024/7/23 8:39 + * @Description + */ +@Data +@Schema(title = "鎺у埗鍣ㄦ姤璀︿笌鐘舵�佽鍥惧璞�") +public class VoControllerAlarmState implements BaseEntity { + + private static final long serialVersionUID = 202407230842001L; + + @Schema(description = "鎺у埗鍣↖D") + private String controllerId; + + @Schema(description = "鍙栨按鍙D") + private String intakeId; + + @Schema(description = "鍙栨按鍙e悕绉�") + private String intakeName; + + @Schema(description = "鎺у埗鍣ㄥ湴鍧�") + private String rtuAddr; + + @Schema(description = "涓婃姤鏃ユ湡鏃堕棿") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date dt; + + @Schema(description = "鐘舵��-闃�闂�/娉碉紙0鎵撳紑銆�1鍏抽棴锛�") + private Byte valveState; + + @Schema(description = "鍓╀綑姘撮噺灏忎簬鎶ヨ涓婇檺鎶ヨ鎶ヨ锛�1锛氭姤璀︼紝 0锛氭甯�)") + private Byte alarmRemainWater; + + @Schema(description = "鍓╀綑姘撮噺涓�0鍏虫车/闃�(1锛氬叧娉碉紝0锛氭甯�)") + private Byte alarm0WaterRemain; + + @Schema(description = "骞寸敤姘撮噺澶т簬闄愬埗姘撮噺鎶ヨ(1锛氭姤璀� 0锛氭甯�)") + private Byte alarmExceedYear; + + @Schema(description = "娴侀噺璁℃晠闅�(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmWaterMeterFault; + + @Schema(description = "婕忔崯(鍋锋按)鎶ヨ(1锛氭姤璀︼紝 0锛氭甯�)") + private Byte alarmLoss; + + @Schema(description = "娴侀噺璁℃崯鍧�(姝e父閫氳浣嗙灛鏃朵负0)鎶ヨ(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmWaterMeterBreak; + + @Schema(description = "鐢佃〃鏁呴殰鎶ヨ(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmEleMeterFault; + + @Schema(description = "鍓╀綑閲戦涓�0(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarm0MoneyRemain; + + @Schema(description = "鎺у埗鍣ㄥ唴闂ㄦ姤璀�(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmInnerDoor; + + @Schema(description = "鎺у埗鍣ㄥ闂ㄦ墦寮�鎶ヨ(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmOuterDoor; + + @Schema(description = "浜ゆ祦缂洪」鎶ヨ(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmEleMiss; + + @Schema(description = "浜ゆ祦杩囨祦鎶ヨ(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmEleExceed; + + @Schema(description = "涓夌浉鐢垫瑺鍘嬫姤璀�(1锛氭姤璀︼紝0锛氭甯�)") + private Byte alarmEleLowVolt; + + @Schema(description = "IC鍗$姸鎬�(1銆佹湁鏁堬紝0锛氭棤鏁�)") + private Byte stateIcEnable; + + @Schema(description = "鐢垫睜鐢靛帇鎶ヨ锛�1锛氭姤璀︼紝0锛氭甯革級") + private Byte alarmBatteryVolt; + + @Schema(description = "闃�闂ㄦ姤璀︼紙1锛氭姤璀︼紝0锛氭甯革級") + private Byte alarmValve; + + @Schema(description = "渚涚數鏂瑰紡锛�0: 220V锛�1锛氳搫鐢垫睜锛�") + private Byte powerType; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml b/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml index 7b4214b..48c3eb0 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml @@ -72,7 +72,7 @@ pipIrr: global: - dev: true #鏄惁寮�鍙戦樁娈碉紝true鎴杅alse + dev: false #鏄惁寮�鍙戦樁娈碉紝true鎴杅alse dsName: ym #寮�鍙戦樁娈碉紝璁剧疆涓存椂鐨勬暟鎹簱鍚嶇О mw: webPort: 8070 @@ -130,6 +130,14 @@ # ym: 100 # pj: 101 +#椤圭洰閰嶇疆 +project: + #椤圭洰缂栫爜 + projectNo: 10 + #鎺у埗鍣ㄧ被鍨� + controllerType: 57 + + #閫氳鍗忚 #protocol: DYJS_2023,DYJS_2024 mw: diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml index dcddb9b..924a29c 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml @@ -1,327 +1,495 @@ <?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.RmAlarmStateHistoryMapper"> - <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> - <!--@mbg.generated--> - <!--@Table rm_alarm_state_history--> - <id column="id" jdbcType="BIGINT" property="id" /> - <result column="controller_id" jdbcType="BIGINT" property="controllerId" /> - <result column="intake_id" jdbcType="BIGINT" property="intakeId" /> - <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr" /> - <result column="dt" jdbcType="TIMESTAMP" property="dt" /> - <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt" /> - <result column="valve_state" jdbcType="TINYINT" property="valveState" /> - <result column="alarm_remain_water" jdbcType="TINYINT" property="alarmRemainWater" /> - <result column="alarm0_water_remain" jdbcType="TINYINT" property="alarm0WaterRemain" /> - <result column="alarm_exceed_year" jdbcType="TINYINT" property="alarmExceedYear" /> - <result column="alarm_water_meter_fault" jdbcType="TINYINT" property="alarmWaterMeterFault" /> - <result column="alarm_loss" jdbcType="TINYINT" property="alarmLoss" /> - <result column="alarm_water_meter_break" jdbcType="TINYINT" property="alarmWaterMeterBreak" /> - <result column="alarm_ele_meter_fault" jdbcType="TINYINT" property="alarmEleMeterFault" /> - <result column="alarm0_money_remain" jdbcType="TINYINT" property="alarm0MoneyRemain" /> - <result column="alarm_inner_door" jdbcType="TINYINT" property="alarmInnerDoor" /> - <result column="alarm_outer_door" jdbcType="TINYINT" property="alarmOuterDoor" /> - <result column="alarm_ele_miss" jdbcType="TINYINT" property="alarmEleMiss" /> - <result column="alarm_ele_exceed" jdbcType="TINYINT" property="alarmEleExceed" /> - <result column="alarm_ele_low_volt" jdbcType="TINYINT" property="alarmEleLowVolt" /> - <result column="state_ic_enable" jdbcType="TINYINT" property="stateIcEnable" /> - <result column="alarm_battery_volt" jdbcType="TINYINT" property="alarmBatteryVolt" /> - <result column="alarm_valve" jdbcType="TINYINT" property="alarmValve" /> - <result column="power_type" jdbcType="TINYINT" property="powerType" /> - </resultMap> - <sql id="Base_Column_List"> - <!--@mbg.generated--> - id, controller_id, intake_id, rtu_addr, dt, rtu_dt, valve_state, alarm_remain_water, - alarm0_water_remain, alarm_exceed_year, alarm_water_meter_fault, alarm_loss, alarm_water_meter_break, - alarm_ele_meter_fault, alarm0_money_remain, alarm_inner_door, alarm_outer_door, alarm_ele_miss, - alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable,alarm_battery_volt,alarm_valve,power_type - </sql> - <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> - <!--@mbg.generated--> - select - <include refid="Base_Column_List" /> - from rm_alarm_state_history - where id = #{id,jdbcType=BIGINT} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> - <!--@mbg.generated--> - delete from rm_alarm_state_history - where id = #{id,jdbcType=BIGINT} - </delete> - <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> - <!--@mbg.generated--> - insert into rm_alarm_state_history (id, controller_id, intake_id, - rtu_addr, dt, rtu_dt, - valve_state, alarm_remain_water, alarm0_water_remain, - alarm_exceed_year, alarm_water_meter_fault, - alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, - alarm0_money_remain, alarm_inner_door, alarm_outer_door, - alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, - state_ic_enable,alarm_battery_volt,alarm_valve,power_type) - values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, - #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, - #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, #{alarm0WaterRemain,jdbcType=TINYINT}, - #{alarmExceedYear,jdbcType=TINYINT}, #{alarmWaterMeterFault,jdbcType=TINYINT}, - #{alarmLoss,jdbcType=TINYINT}, #{alarmWaterMeterBreak,jdbcType=TINYINT}, #{alarmEleMeterFault,jdbcType=TINYINT}, - #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, #{alarmOuterDoor,jdbcType=TINYINT}, - #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, #{alarmEleLowVolt,jdbcType=TINYINT}, - #{stateIcEnable,jdbcType=TINYINT}, #{alarmBatteryVolt,jdbcType=TINYINT}, #{alarmValve,jdbcType=TINYINT}, - #{powerType,jdbcType=TINYINT}) - </insert> - <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> - <!--@mbg.generated--> - insert into rm_alarm_state_history - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> + <!--@mbg.generated--> + <!--@Table rm_alarm_state_history--> + <id column="id" jdbcType="BIGINT" property="id"/> + <result column="controller_id" jdbcType="BIGINT" property="controllerId"/> + <result column="intake_id" jdbcType="BIGINT" property="intakeId"/> + <result column="rtu_addr" jdbcType="VARCHAR" property="rtuAddr"/> + <result column="dt" jdbcType="TIMESTAMP" property="dt"/> + <result column="rtu_dt" jdbcType="TIMESTAMP" property="rtuDt"/> + <result column="valve_state" jdbcType="TINYINT" property="valveState"/> + <result column="alarm_remain_water" jdbcType="TINYINT" property="alarmRemainWater"/> + <result column="alarm0_water_remain" jdbcType="TINYINT" property="alarm0WaterRemain"/> + <result column="alarm_exceed_year" jdbcType="TINYINT" property="alarmExceedYear"/> + <result column="alarm_water_meter_fault" jdbcType="TINYINT" property="alarmWaterMeterFault"/> + <result column="alarm_loss" jdbcType="TINYINT" property="alarmLoss"/> + <result column="alarm_water_meter_break" jdbcType="TINYINT" property="alarmWaterMeterBreak"/> + <result column="alarm_ele_meter_fault" jdbcType="TINYINT" property="alarmEleMeterFault"/> + <result column="alarm0_money_remain" jdbcType="TINYINT" property="alarm0MoneyRemain"/> + <result column="alarm_inner_door" jdbcType="TINYINT" property="alarmInnerDoor"/> + <result column="alarm_outer_door" jdbcType="TINYINT" property="alarmOuterDoor"/> + <result column="alarm_ele_miss" jdbcType="TINYINT" property="alarmEleMiss"/> + <result column="alarm_ele_exceed" jdbcType="TINYINT" property="alarmEleExceed"/> + <result column="alarm_ele_low_volt" jdbcType="TINYINT" property="alarmEleLowVolt"/> + <result column="state_ic_enable" jdbcType="TINYINT" property="stateIcEnable"/> + <result column="alarm_battery_volt" jdbcType="TINYINT" property="alarmBatteryVolt"/> + <result column="alarm_valve" jdbcType="TINYINT" property="alarmValve"/> + <result column="power_type" jdbcType="TINYINT" property="powerType"/> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> id, - </if> - <if test="controllerId != null"> controller_id, - </if> - <if test="intakeId != null"> intake_id, - </if> - <if test="rtuAddr != null"> rtu_addr, - </if> - <if test="dt != null"> dt, - </if> - <if test="rtuDt != null"> rtu_dt, - </if> - <if test="valveState != null"> valve_state, - </if> - <if test="alarmRemainWater != null"> alarm_remain_water, - </if> - <if test="alarm0WaterRemain != null"> alarm0_water_remain, - </if> - <if test="alarmExceedYear != null"> alarm_exceed_year, - </if> - <if test="alarmWaterMeterFault != null"> alarm_water_meter_fault, - </if> - <if test="alarmLoss != null"> alarm_loss, - </if> - <if test="alarmWaterMeterBreak != null"> alarm_water_meter_break, - </if> - <if test="alarmEleMeterFault != null"> alarm_ele_meter_fault, - </if> - <if test="alarm0MoneyRemain != null"> alarm0_money_remain, - </if> - <if test="alarmInnerDoor != null"> alarm_inner_door, - </if> - <if test="alarmOuterDoor != null"> alarm_outer_door, - </if> - <if test="alarmEleMiss != null"> alarm_ele_miss, - </if> - <if test="alarmEleExceed != null"> alarm_ele_exceed, - </if> - <if test="alarmEleLowVolt != null"> alarm_ele_low_volt, - </if> - <if test="stateIcEnable != null"> state_ic_enable, - </if> - <if test="alarmBatteryVolt != null"> alarm_battery_volt, - </if> - <if test="alarmValve != null"> alarm_valve, - </if> - <if test="powerType != null"> - power_type, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="controllerId != null"> - #{controllerId,jdbcType=BIGINT}, - </if> - <if test="intakeId != null"> - #{intakeId,jdbcType=BIGINT}, - </if> - <if test="rtuAddr != null"> - #{rtuAddr,jdbcType=VARCHAR}, - </if> - <if test="dt != null"> - #{dt,jdbcType=TIMESTAMP}, - </if> - <if test="rtuDt != null"> - #{rtuDt,jdbcType=TIMESTAMP}, - </if> - <if test="valveState != null"> - #{valveState,jdbcType=TINYINT}, - </if> - <if test="alarmRemainWater != null"> - #{alarmRemainWater,jdbcType=TINYINT}, - </if> - <if test="alarm0WaterRemain != null"> - #{alarm0WaterRemain,jdbcType=TINYINT}, - </if> - <if test="alarmExceedYear != null"> - #{alarmExceedYear,jdbcType=TINYINT}, - </if> - <if test="alarmWaterMeterFault != null"> - #{alarmWaterMeterFault,jdbcType=TINYINT}, - </if> - <if test="alarmLoss != null"> - #{alarmLoss,jdbcType=TINYINT}, - </if> - <if test="alarmWaterMeterBreak != null"> - #{alarmWaterMeterBreak,jdbcType=TINYINT}, - </if> - <if test="alarmEleMeterFault != null"> - #{alarmEleMeterFault,jdbcType=TINYINT}, - </if> - <if test="alarm0MoneyRemain != null"> - #{alarm0MoneyRemain,jdbcType=TINYINT}, - </if> - <if test="alarmInnerDoor != null"> - #{alarmInnerDoor,jdbcType=TINYINT}, - </if> - <if test="alarmOuterDoor != null"> - #{alarmOuterDoor,jdbcType=TINYINT}, - </if> - <if test="alarmEleMiss != null"> - #{alarmEleMiss,jdbcType=TINYINT}, - </if> - <if test="alarmEleExceed != null"> - #{alarmEleExceed,jdbcType=TINYINT}, - </if> - <if test="alarmEleLowVolt != null"> - #{alarmEleLowVolt,jdbcType=TINYINT}, - </if> - <if test="stateIcEnable != null"> - #{stateIcEnable,jdbcType=TINYINT}, - </if> - <if test="alarmBatteryVolt != null"> - #{alarmBatteryVolt,jdbcType=TINYINT}, - </if> - <if test="alarmValve != null"> - #{alarmValve,jdbcType=TINYINT}, - </if> - <if test="powerType != null"> - #{powerType,jdbcType=TINYINT}, - </if> - </trim> - </insert> - <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> - <!--@mbg.generated--> - update rm_alarm_state_history - <set> - <if test="controllerId != null"> - controller_id = #{controllerId,jdbcType=BIGINT}, - </if> - <if test="intakeId != null"> - intake_id = #{intakeId,jdbcType=BIGINT}, - </if> - <if test="rtuAddr != null"> - rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, - </if> - <if test="dt != null"> - dt = #{dt,jdbcType=TIMESTAMP}, - </if> - <if test="rtuDt != null"> - rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, - </if> - <if test="valveState != null"> - valve_state = #{valveState,jdbcType=TINYINT}, - </if> - <if test="alarmRemainWater != null"> - alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, - </if> - <if test="alarm0WaterRemain != null"> - alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, - </if> - <if test="alarmExceedYear != null"> - alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, - </if> - <if test="alarmWaterMeterFault != null"> - alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, - </if> - <if test="alarmLoss != null"> - alarm_loss = #{alarmLoss,jdbcType=TINYINT}, - </if> - <if test="alarmWaterMeterBreak != null"> - alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, - </if> - <if test="alarmEleMeterFault != null"> - alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, - </if> - <if test="alarm0MoneyRemain != null"> - alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, - </if> - <if test="alarmInnerDoor != null"> - alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, - </if> - <if test="alarmOuterDoor != null"> - alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, - </if> - <if test="alarmEleMiss != null"> - alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, - </if> - <if test="alarmEleExceed != null"> - alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, - </if> - <if test="alarmEleLowVolt != null"> - alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, - </if> - <if test="stateIcEnable != null"> - state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, - </if> - <if test="alarmBatteryVolt != null"> - alarm_battery_volt = #{alarmBatteryVolt,jdbcType=TINYINT}, - </if> - <if test="alarmValve != null"> - alarm_valve = #{alarmValve,jdbcType=TINYINT}, - </if> - <if test="powerType != null"> - power_type = #{powerType,jdbcType=TINYINT}, - </if> - </set> - where id = #{id,jdbcType=BIGINT} - </update> - <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> - <!--@mbg.generated--> - update rm_alarm_state_history - set controller_id = #{controllerId,jdbcType=BIGINT}, - intake_id = #{intakeId,jdbcType=BIGINT}, - rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, - dt = #{dt,jdbcType=TIMESTAMP}, - rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, - valve_state = #{valveState,jdbcType=TINYINT}, - alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, - alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, - alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, - alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, - alarm_loss = #{alarmLoss,jdbcType=TINYINT}, - alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, - alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, - alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, - alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, - alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, - alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, - alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, - alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, - state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, - alarm_battery_volt = #{alarmBatteryVolt,jdbcType=TINYINT}, - alarm_valve = #{alarmValve,jdbcType=TINYINT}, - power_type = #{powerType,jdbcType=TINYINT} - where id = #{id,jdbcType=BIGINT} - </update> + power_type + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List"/> + from rm_alarm_state_history + where id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete + from rm_alarm_state_history + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> + <!--@mbg.generated--> + insert into rm_alarm_state_history (id, controller_id, intake_id, + rtu_addr, dt, rtu_dt, + valve_state, alarm_remain_water, alarm0_water_remain, + alarm_exceed_year, alarm_water_meter_fault, + alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, + alarm0_money_remain, alarm_inner_door, alarm_outer_door, + alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, + state_ic_enable, alarm_battery_volt, alarm_valve, power_type) + values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, + #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, + #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, + #{alarm0WaterRemain,jdbcType=TINYINT}, + #{alarmExceedYear,jdbcType=TINYINT}, #{alarmWaterMeterFault,jdbcType=TINYINT}, + #{alarmLoss,jdbcType=TINYINT}, #{alarmWaterMeterBreak,jdbcType=TINYINT}, + #{alarmEleMeterFault,jdbcType=TINYINT}, + #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, + #{alarmOuterDoor,jdbcType=TINYINT}, + #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, + #{alarmEleLowVolt,jdbcType=TINYINT}, + #{stateIcEnable,jdbcType=TINYINT}, #{alarmBatteryVolt,jdbcType=TINYINT}, #{alarmValve,jdbcType=TINYINT}, + #{powerType,jdbcType=TINYINT}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> + <!--@mbg.generated--> + insert into rm_alarm_state_history + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="controllerId != null"> + controller_id, + </if> + <if test="intakeId != null"> + intake_id, + </if> + <if test="rtuAddr != null"> + rtu_addr, + </if> + <if test="dt != null"> + dt, + </if> + <if test="rtuDt != null"> + rtu_dt, + </if> + <if test="valveState != null"> + valve_state, + </if> + <if test="alarmRemainWater != null"> + alarm_remain_water, + </if> + <if test="alarm0WaterRemain != null"> + alarm0_water_remain, + </if> + <if test="alarmExceedYear != null"> + alarm_exceed_year, + </if> + <if test="alarmWaterMeterFault != null"> + alarm_water_meter_fault, + </if> + <if test="alarmLoss != null"> + alarm_loss, + </if> + <if test="alarmWaterMeterBreak != null"> + alarm_water_meter_break, + </if> + <if test="alarmEleMeterFault != null"> + alarm_ele_meter_fault, + </if> + <if test="alarm0MoneyRemain != null"> + alarm0_money_remain, + </if> + <if test="alarmInnerDoor != null"> + alarm_inner_door, + </if> + <if test="alarmOuterDoor != null"> + alarm_outer_door, + </if> + <if test="alarmEleMiss != null"> + alarm_ele_miss, + </if> + <if test="alarmEleExceed != null"> + alarm_ele_exceed, + </if> + <if test="alarmEleLowVolt != null"> + alarm_ele_low_volt, + </if> + <if test="stateIcEnable != null"> + state_ic_enable, + </if> + <if test="alarmBatteryVolt != null"> + alarm_battery_volt, + </if> + <if test="alarmValve != null"> + alarm_valve, + </if> + <if test="powerType != null"> + power_type, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="controllerId != null"> + #{controllerId,jdbcType=BIGINT}, + </if> + <if test="intakeId != null"> + #{intakeId,jdbcType=BIGINT}, + </if> + <if test="rtuAddr != null"> + #{rtuAddr,jdbcType=VARCHAR}, + </if> + <if test="dt != null"> + #{dt,jdbcType=TIMESTAMP}, + </if> + <if test="rtuDt != null"> + #{rtuDt,jdbcType=TIMESTAMP}, + </if> + <if test="valveState != null"> + #{valveState,jdbcType=TINYINT}, + </if> + <if test="alarmRemainWater != null"> + #{alarmRemainWater,jdbcType=TINYINT}, + </if> + <if test="alarm0WaterRemain != null"> + #{alarm0WaterRemain,jdbcType=TINYINT}, + </if> + <if test="alarmExceedYear != null"> + #{alarmExceedYear,jdbcType=TINYINT}, + </if> + <if test="alarmWaterMeterFault != null"> + #{alarmWaterMeterFault,jdbcType=TINYINT}, + </if> + <if test="alarmLoss != null"> + #{alarmLoss,jdbcType=TINYINT}, + </if> + <if test="alarmWaterMeterBreak != null"> + #{alarmWaterMeterBreak,jdbcType=TINYINT}, + </if> + <if test="alarmEleMeterFault != null"> + #{alarmEleMeterFault,jdbcType=TINYINT}, + </if> + <if test="alarm0MoneyRemain != null"> + #{alarm0MoneyRemain,jdbcType=TINYINT}, + </if> + <if test="alarmInnerDoor != null"> + #{alarmInnerDoor,jdbcType=TINYINT}, + </if> + <if test="alarmOuterDoor != null"> + #{alarmOuterDoor,jdbcType=TINYINT}, + </if> + <if test="alarmEleMiss != null"> + #{alarmEleMiss,jdbcType=TINYINT}, + </if> + <if test="alarmEleExceed != null"> + #{alarmEleExceed,jdbcType=TINYINT}, + </if> + <if test="alarmEleLowVolt != null"> + #{alarmEleLowVolt,jdbcType=TINYINT}, + </if> + <if test="stateIcEnable != null"> + #{stateIcEnable,jdbcType=TINYINT}, + </if> + <if test="alarmBatteryVolt != null"> + #{alarmBatteryVolt,jdbcType=TINYINT}, + </if> + <if test="alarmValve != null"> + #{alarmValve,jdbcType=TINYINT}, + </if> + <if test="powerType != null"> + #{powerType,jdbcType=TINYINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> + <!--@mbg.generated--> + update rm_alarm_state_history + <set> + <if test="controllerId != null"> + controller_id = #{controllerId,jdbcType=BIGINT}, + </if> + <if test="intakeId != null"> + intake_id = #{intakeId,jdbcType=BIGINT}, + </if> + <if test="rtuAddr != null"> + rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, + </if> + <if test="dt != null"> + dt = #{dt,jdbcType=TIMESTAMP}, + </if> + <if test="rtuDt != null"> + rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, + </if> + <if test="valveState != null"> + valve_state = #{valveState,jdbcType=TINYINT}, + </if> + <if test="alarmRemainWater != null"> + alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, + </if> + <if test="alarm0WaterRemain != null"> + alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, + </if> + <if test="alarmExceedYear != null"> + alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, + </if> + <if test="alarmWaterMeterFault != null"> + alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, + </if> + <if test="alarmLoss != null"> + alarm_loss = #{alarmLoss,jdbcType=TINYINT}, + </if> + <if test="alarmWaterMeterBreak != null"> + alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, + </if> + <if test="alarmEleMeterFault != null"> + alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, + </if> + <if test="alarm0MoneyRemain != null"> + alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, + </if> + <if test="alarmInnerDoor != null"> + alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, + </if> + <if test="alarmOuterDoor != null"> + alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, + </if> + <if test="alarmEleMiss != null"> + alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, + </if> + <if test="alarmEleExceed != null"> + alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, + </if> + <if test="alarmEleLowVolt != null"> + alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, + </if> + <if test="stateIcEnable != null"> + state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, + </if> + <if test="alarmBatteryVolt != null"> + alarm_battery_volt = #{alarmBatteryVolt,jdbcType=TINYINT}, + </if> + <if test="alarmValve != null"> + alarm_valve = #{alarmValve,jdbcType=TINYINT}, + </if> + <if test="powerType != null"> + power_type = #{powerType,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateHistory"> + <!--@mbg.generated--> + update rm_alarm_state_history + set controller_id = #{controllerId,jdbcType=BIGINT}, + intake_id = #{intakeId,jdbcType=BIGINT}, + rtu_addr = #{rtuAddr,jdbcType=VARCHAR}, + dt = #{dt,jdbcType=TIMESTAMP}, + rtu_dt = #{rtuDt,jdbcType=TIMESTAMP}, + valve_state = #{valveState,jdbcType=TINYINT}, + alarm_remain_water = #{alarmRemainWater,jdbcType=TINYINT}, + alarm0_water_remain = #{alarm0WaterRemain,jdbcType=TINYINT}, + alarm_exceed_year = #{alarmExceedYear,jdbcType=TINYINT}, + alarm_water_meter_fault = #{alarmWaterMeterFault,jdbcType=TINYINT}, + alarm_loss = #{alarmLoss,jdbcType=TINYINT}, + alarm_water_meter_break = #{alarmWaterMeterBreak,jdbcType=TINYINT}, + alarm_ele_meter_fault = #{alarmEleMeterFault,jdbcType=TINYINT}, + alarm0_money_remain = #{alarm0MoneyRemain,jdbcType=TINYINT}, + alarm_inner_door = #{alarmInnerDoor,jdbcType=TINYINT}, + alarm_outer_door = #{alarmOuterDoor,jdbcType=TINYINT}, + alarm_ele_miss = #{alarmEleMiss,jdbcType=TINYINT}, + alarm_ele_exceed = #{alarmEleExceed,jdbcType=TINYINT}, + alarm_ele_low_volt = #{alarmEleLowVolt,jdbcType=TINYINT}, + state_ic_enable = #{stateIcEnable,jdbcType=TINYINT}, + alarm_battery_volt = #{alarmBatteryVolt,jdbcType=TINYINT}, + alarm_valve = #{alarmValve,jdbcType=TINYINT}, + power_type = #{powerType,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> +<select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_alarm_state_history rash + Left join pr_intake pint on rash.intake_id = pint.id + <where> + <if test="alarmState == 1"> + and ( + alarm_remain_water = 1 + or alarm0_water_remain = 1 + or alarm_exceed_year = 1 + or alarm_water_meter_fault = 1 + or alarm_loss = 1 + or alarm_water_meter_break = 1 + or alarm_ele_meter_fault = 1 + or alarm0_money_remain = 1 + or alarm_inner_door = 1 + or alarm_outer_door = 1 + or alarm_ele_miss = 1 + or alarm_ele_exceed = 1 + or alarm_ele_low_volt = 1 + or alarm_battery_volt = 1 + or alarm_valve = 1 + ) + </if> + <if test="alarmState == 0"> + and ( + alarm_remain_water = 0 + and alarm0_water_remain = 0 + and alarm_exceed_year = 0 + and alarm_water_meter_fault = 0 + and alarm_loss = 0 + and alarm_water_meter_break = 0 + and alarm_ele_meter_fault = 0 + and alarm0_money_remain = 0 + and alarm_inner_door = 0 + and alarm_outer_door = 0 + and alarm_ele_miss = 0 + and alarm_ele_exceed = 0 + and alarm_ele_low_volt = 0 + and alarm_battery_volt = 0 + and alarm_valve = 0 + ) + </if> + <if test="valveState != null"> + and rash.valve_state = #{valveState,jdbcType=TINYINT} + </if> + <if test="intakeName != null"> + and pint.name = #{intakeName,jdbcType=VARCHAR} + </if> + <if test="startDt != null"> + and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getControllerAlarmStateHistory" resultType="com.dy.pipIrrGlobal.voRm.VoControllerAlarmState"> + select + CAST(rash.controller_id AS char)AS controllerId, + CAST(rash.intake_id AS char)AS intakeId, + pint.name as intakeName, + rash.rtu_addr as rtuAddr, + rash.dt as dt, + rash.valve_state as valveState, + rash.alarm_remain_water as alarmRemainWater, + rash.alarm0_water_remain as alarm0WaterRemain, + rash.alarm_exceed_year as alarmExceedYear, + rash.alarm_water_meter_fault as alarmWaterMeterFault, + rash.alarm_loss as alarmLoss, + rash.alarm_water_meter_break as alarmWaterMeterBreak, + rash.alarm_ele_meter_fault as alarmEleMeterFault, + rash.alarm0_money_remain as alarm0MoneyRemain, + rash.alarm_inner_door as alarmInnerDoor, + rash.alarm_outer_door as alarmOuterDoor, + rash.alarm_ele_miss as alarmEleMiss, + rash.alarm_ele_exceed as alarmEleExceed, + rash.alarm_ele_low_volt as alarmEleLowVolt, + rash.state_ic_enable as stateIcEnable, + rash.alarm_battery_volt as alarmBatteryVolt, + rash.alarm_valve as alarmValve, + rash.power_type as powerType + from rm_alarm_state_history rash + Left join pr_intake pint on rash.intake_id = pint.id + <where> + <if test="alarmState == 1"> + and ( + alarm_remain_water = 1 + or alarm0_water_remain = 1 + or alarm_exceed_year = 1 + or alarm_water_meter_fault = 1 + or alarm_loss = 1 + or alarm_water_meter_break = 1 + or alarm_ele_meter_fault = 1 + or alarm0_money_remain = 1 + or alarm_inner_door = 1 + or alarm_outer_door = 1 + or alarm_ele_miss = 1 + or alarm_ele_exceed = 1 + or alarm_ele_low_volt = 1 + or alarm_battery_volt = 1 + or alarm_valve = 1 + ) + </if> + <if test="alarmState == 0"> + and ( + alarm_remain_water = 0 + and alarm0_water_remain = 0 + and alarm_exceed_year = 0 + and alarm_water_meter_fault = 0 + and alarm_loss = 0 + and alarm_water_meter_break = 0 + and alarm_ele_meter_fault = 0 + and alarm0_money_remain = 0 + and alarm_inner_door = 0 + and alarm_outer_door = 0 + and alarm_ele_miss = 0 + and alarm_ele_exceed = 0 + and alarm_ele_low_volt = 0 + and alarm_battery_volt = 0 + and alarm_valve = 0 + ) + </if> + <if test="valveState != null"> + and rash.valve_state = #{valveState,jdbcType=TINYINT} + </if> + <if test="intakeName != null"> + and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') + </if> + <if test="startDt != null"> + and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + ORDER BY rash.dt DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml index b24461d..6fb51ff 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml @@ -331,4 +331,147 @@ power_type = #{powerType,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_alarm_state_last rasl + Left join pr_intake pint on intake_id = pint.id + <where> + <if test="alarmState == 1"> + and ( + alarm_remain_water = 1 + or alarm0_water_remain = 1 + or alarm_exceed_year = 1 + or alarm_water_meter_fault = 1 + or alarm_loss = 1 + or alarm_water_meter_break = 1 + or alarm_ele_meter_fault = 1 + or alarm0_money_remain = 1 + or alarm_inner_door = 1 + or alarm_outer_door = 1 + or alarm_ele_miss = 1 + or alarm_ele_exceed = 1 + or alarm_ele_low_volt = 1 + or alarm_battery_volt = 1 + or alarm_valve = 1 + ) + </if> + <if test="alarmState == 0"> + and ( + alarm_remain_water = 0 + and alarm0_water_remain = 0 + and alarm_exceed_year = 0 + and alarm_water_meter_fault = 0 + and alarm_loss = 0 + and alarm_water_meter_break = 0 + and alarm_ele_meter_fault = 0 + and alarm0_money_remain = 0 + and alarm_inner_door = 0 + and alarm_outer_door = 0 + and alarm_ele_miss = 0 + and alarm_ele_exceed = 0 + and alarm_ele_low_volt = 0 + and alarm_battery_volt = 0 + and alarm_valve = 0 + ) + </if> + <if test="valveState != null"> + and rasl.valve_state = #{valveState,jdbcType=TINYINT} + </if> + <if test="intakeName != null"> + and pint.name = #{intakeName,jdbcType=VARCHAR} + </if> + <if test="startDt != null"> + and rasl.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rasl.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getControllerAlarmStateLast" resultType="com.dy.pipIrrGlobal.voRm.VoControllerAlarmState"> + select + CAST(rasl.controller_id AS char)AS controllerId, + CAST(rasl.intake_id AS char)AS intakeId, + pint.name as intakeName, + rasl.rtu_addr as rtuAddr, + rasl.dt as dt, + rasl.valve_state as valveState, + rasl.alarm_remain_water as alarmRemainWater, + rasl.alarm0_water_remain as alarm0WaterRemain, + rasl.alarm_exceed_year as alarmExceedYear, + rasl.alarm_water_meter_fault as alarmWaterMeterFault, + rasl.alarm_loss as alarmLoss, + rasl.alarm_water_meter_break as alarmWaterMeterBreak, + rasl.alarm_ele_meter_fault as alarmEleMeterFault, + rasl.alarm0_money_remain as alarm0MoneyRemain, + rasl.alarm_inner_door as alarmInnerDoor, + rasl.alarm_outer_door as alarmOuterDoor, + rasl.alarm_ele_miss as alarmEleMiss, + rasl.alarm_ele_exceed as alarmEleExceed, + rasl.alarm_ele_low_volt as alarmEleLowVolt, + rasl.state_ic_enable as stateIcEnable, + rasl.alarm_battery_volt as alarmBatteryVolt, + rasl.alarm_valve as alarmValve, + rasl.power_type as powerType + from rm_alarm_state_last rasl + Left join pr_intake pint on intake_id = pint.id + <where> + <if test="alarmState == 1"> + and ( + alarm_remain_water = 1 + or alarm0_water_remain = 1 + or alarm_exceed_year = 1 + or alarm_water_meter_fault = 1 + or alarm_loss = 1 + or alarm_water_meter_break = 1 + or alarm_ele_meter_fault = 1 + or alarm0_money_remain = 1 + or alarm_inner_door = 1 + or alarm_outer_door = 1 + or alarm_ele_miss = 1 + or alarm_ele_exceed = 1 + or alarm_ele_low_volt = 1 + or alarm_battery_volt = 1 + or alarm_valve = 1 + ) + </if> + <if test="alarmState == 0"> + and ( + alarm_remain_water = 0 + and alarm0_water_remain = 0 + and alarm_exceed_year = 0 + and alarm_water_meter_fault = 0 + and alarm_loss = 0 + and alarm_water_meter_break = 0 + and alarm_ele_meter_fault = 0 + and alarm0_money_remain = 0 + and alarm_inner_door = 0 + and alarm_outer_door = 0 + and alarm_ele_miss = 0 + and alarm_ele_exceed = 0 + and alarm_ele_low_volt = 0 + and alarm_battery_volt = 0 + and alarm_valve = 0 + ) + </if> + <if test="valveState != null"> + and rasl.valve_state = #{valveState,jdbcType=TINYINT} + </if> + <if test="intakeName != null"> + and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') + </if> + <if test="startDt != null"> + and rasl.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rasl.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + ORDER BY rasl.dt DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml index c7f20a2..8179361 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayLastMapper.xml @@ -188,4 +188,53 @@ rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_client_amount_day_last rcadl + Left join se_client sc on sc.id = rcadl.client_id + <where> + <if test="clientName != null"> + and sc.name = #{clientName,jdbcType=VARCHAR} + </if> + <if test="startDt != null"> + and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getClientAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoClientAmountDay"> + select + CAST(rcadl.client_id AS char)AS clientId, + rcadl.amount as amount, + rcadl.money as money, + rcadl.dt as dt, + rcadl.open_dt_last as openDtLast, + rcadl.close_dt_last as closeDtLast, + rcadl.this_amount_last as thisAmountLast, + rcadl.this_money_last as thisMoneyLast, + rcadl.this_time_last as thisTimeLast, + rcadl.rtu_dt_last as rtuDtLast, + sc.name as clientName + from rm_client_amount_day_last rcadl + Left join se_client sc on sc.id = rcadl.client_id + <where> + <if test="clientName != null"> + and sc.name = #{clientName,jdbcType=VARCHAR} + </if> + <if test="startDt != null"> + and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + ORDER BY rcadl.dt DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml index cbd5d43..8c8f8ef 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmClientAmountDayMapper.xml @@ -178,4 +178,53 @@ rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_client_amount_day rcad + Left join se_client sc on sc.id = rcad.client_id + <where> + <if test="clientName != null"> + and sc.name = #{clientName,jdbcType=VARCHAR} + </if> + <if test="startDt != null"> + and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getClientAmountDayHistory" resultType="com.dy.pipIrrGlobal.voRm.VoClientAmountDay"> + select + CAST(rcad.client_id AS char)AS clientId, + rcad.amount as amount, + rcad.money as money, + rcad.dt as dt, + rcad.open_dt_last as openDtLast, + rcad.close_dt_last as closeDtLast, + rcad.this_amount_last as thisAmountLast, + rcad.this_money_last as thisMoneyLast, + rcad.this_time_last as thisTimeLast, + rcad.rtu_dt_last as rtuDtLast, + sc.name as clientName + from rm_client_amount_day rcad + Left join se_client sc on sc.id = rcad.client_id + <where> + <if test="clientName != null"> + and sc.name = #{clientName,jdbcType=VARCHAR} + </if> + <if test="startDt != null"> + and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + </if> + <if test="endDt != null"> + and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + </if> + </where> + ORDER BY rcad.dt DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> </mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/MidResultActionError.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/MidResultActionError.java index 21590fa..520b761 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/MidResultActionError.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/forTcp/MidResultActionError.java @@ -2,6 +2,7 @@ import com.dy.common.mw.protocol.MidResult; import com.dy.common.mw.protocol.MidResultAction; +import com.dy.common.mw.protocol.MidResultError; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -12,13 +13,13 @@ @Override public void doAction(MidResult result) { - //if(result != null && result instanceof MidResultError){ - // MidResultError rs = (MidResultError)result ; - // log.error("瑙f瀽鎴栨瀯閫�" + (rs.protocolName==null?"":("閫氫俊鍗忚" + rs.protocolName + "鐨�")) + "RTU" + (rs.rtuAddr==null?"":("(鍦板潃" + rs.rtuAddr + ")" )) + "鏁版嵁鍑洪敊" + (rs.message == null?"":("锛�" + rs.message))); - // if(rs.e != null){ - // log.error(rs.e); - // rs.e.printStackTrace(); - // } - //} + if(result != null && result instanceof MidResultError){ + MidResultError rs = (MidResultError)result ; + log.error("瑙f瀽鎴栨瀯閫�" + (rs.protocolName==null?"":("閫氫俊鍗忚" + rs.protocolName + "鐨�")) + "RTU" + (rs.rtuAddr==null?"":("(鍦板潃" + rs.rtuAddr + ")" )) + "鏁版嵁鍑洪敊" + (rs.message == null?"":("锛�" + rs.message))); + if(rs.e != null){ + log.error(rs.e); + rs.e.printStackTrace(); + } + } } } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/application-database.yml b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/application-database.yml index 9373985..34bb341 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/application-database.yml +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/application-database.yml @@ -3,9 +3,9 @@ datasource: #閰嶇疆鏁版嵁婧� type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull + url: jdbc:mysql://192.168.40.166:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull # url: jdbc:mysql://127.0.0.1:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull - url: jdbc:mysql://8.140.179.55:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull +# url: jdbc:mysql://8.140.179.55:3306/pipIrr_ym?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull username: root password: dysql,;.abc!@# druid: diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java index e98153a..21d02e1 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/CommandResultCtrl.java @@ -27,7 +27,7 @@ @PostMapping(path = "receive", consumes = MediaType.APPLICATION_JSON_VALUE) public void receive(@RequestBody Data data) { JSONObject job_data = (JSONObject) JSON.toJSON(data); - //System.out.println(job_data.toJSONString()); + String job_dataS = job_data.toJSONString(); JSONObject job_subData = job_data.getJSONObject("subData").getJSONObject("subData"); JSONObject job_response = new JSONObject(); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/AutomaticClose.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/AutomaticClose.java new file mode 100644 index 0000000..1597b7f --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/common/dto/AutomaticClose.java @@ -0,0 +1,44 @@ +package com.dy.pipIrrRemote.common.dto; + +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * @author ZhuBaoMin + * @date 2024-07-23 10:36 + * @LastEditTime 2024-07-23 10:36 + * @Description 鑷姩鍏抽榾锛堝畾鏃跺叧闃�銆佸畾閲忓叧闃�锛変紶杈撳璞� + */ + +@Data +public class AutomaticClose extends DtoBase { + public static final long serialVersionUID = 202407231039001L; + + /** + * 闃�鎺у櫒鍦板潃 + */ + @NotBlank(message = "闃�鎺у櫒鍦板潃涓嶈兘涓虹┖") + private String rtuAddr; + + /** + * 铏氭嫙鍗$紪鍙� + */ + @NotBlank(message = "铏氭嫙鍗$紪鍙蜂笉鑳戒负绌�") + private String vcNum; + + /** + * 璁㈠崟鍙� + */ + @NotBlank(message = "璁㈠崟鍙蜂笉鑳戒负绌�") + private String orderNo; + + /** + * 鐢ㄦ按鏃堕暱锛屾嫢鏈夊畾鏃跺叧闃� + */ + private Integer minutes; + + /** + * 棰勭敤姘撮噺锛屾嫢鏈夊畾閲忓叧闃� + */ + private Integer waterAmount; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java new file mode 100644 index 0000000..15abb5a --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ClientAmountDayQueryVo.java @@ -0,0 +1,38 @@ +package com.dy.pipIrrRemote.records; + +import com.dy.common.webUtil.QueryConditionVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author :WuZeYu + * @Date :2024/7/23 15:55 + * @LastEditTime :2024/7/23 15:55 + * @Description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ToString(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@Builder +@Schema(name = "鍐滄埛鏃ョ敤姘撮噺缁熻鏌ヨ鏉′欢") +public class ClientAmountDayQueryVo extends QueryConditionVo { + + @Schema(description = "鍐滄埛濮撳悕", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private String clientName; + + @Schema(description = "缁熻寮�濮嬫棩鏈�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startDt; + + @Schema(description = "缁熻缁撴潫鏃ユ湡", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endDt; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java new file mode 100644 index 0000000..199b9b0 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/ControllerAlarmStateQueryVo.java @@ -0,0 +1,44 @@ +package com.dy.pipIrrRemote.records; + +import com.dy.common.webUtil.QueryConditionVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * @author :WuZeYu + * @Date :2024/7/22 20:01 + * @LastEditTime :2024/7/22 20:01 + * @Description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ToString(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@Builder +@Schema(name = "鎺у埗鍣ㄦ姤璀︿笌鐘舵�佹煡璇㈡潯浠�") +public class ControllerAlarmStateQueryVo extends QueryConditionVo { + + @Schema(description = "鍙栨按鍙e悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + private String intakeName; + + @Schema(description = "闃�闂ㄧ姸鎬�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)//锛�0鎵撳紑銆�1鍏抽棴锛� + private Byte valveState; + + @Schema(description = "寮�濮嬫椂闂�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startDt; + + @Schema(description = "缁撴潫鏃堕棿", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date endDt; + + @Schema(description = "鎶ヨ鐘舵��", requiredMode = Schema.RequiredMode.NOT_REQUIRED)//锛�0姝e父銆�1鎶ヨ锛� + private Byte alarmState; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java new file mode 100644 index 0000000..c012a5e --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsCtrl.java @@ -0,0 +1,153 @@ +package com.dy.pipIrrRemote.records; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; +import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; +import com.dy.pipIrrGlobal.voSe.VoActiveCard; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author :WuZeYu + * @Date :2024/7/22 20:00 + * @LastEditTime :2024/7/22 20:00 + * @Description + */ +@Slf4j +@Tag(name = "妫�娴嬫帶鍒舵煡璇�", description = "妫�娴嬫帶鍒舵煡璇�") +@RestController +@RequestMapping(path = "remoteRecords") +public class RecordsCtrl { + @Autowired + private RecordsSv recordsSv; + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鎺у埗鍣ㄦ姤璀︿笌鐘舵�佸垪琛紙鍘嗗彶锛� + * + * @param vo 鏌ヨ鏉′欢 + * @return 绗﹀悎鏉′欢鐨勬帶鍒跺櫒鎶ヨ涓庣姸鎬佸垪琛紙鍘嗗彶锛� + */ + @Operation(summary = "鑾峰緱涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佽褰�", description = "杩斿洖涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佹暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佹暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getControllerAlarmStateHistory") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory(@RequestBody ControllerAlarmStateQueryVo vo) { + try { + QueryResultVo<List<VoControllerAlarmState>> res = recordsSv.getControllerAlarmStateHistory(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鎺у埗鍣ㄦ姤璀︿笌鐘舵�佽褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鎺у埗鍣ㄦ姤璀︿笌鐘舵�佸垪琛紙鏈�鏂帮級 + * + * @param vo 鏌ヨ鏉′欢 + * @return 绗﹀悎鏉′欢鐨勬帶鍒跺櫒鎶ヨ涓庣姸鎬佸垪琛紙鏈�鏂帮級 + */ + @Operation(summary = "鑾峰緱涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佽褰�", description = "杩斿洖涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佹暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佹暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getControllerAlarmStateLast") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast(@RequestBody ControllerAlarmStateQueryVo vo) { + try { + QueryResultVo<List<VoControllerAlarmState>> res = recordsSv.getControllerAlarmStateLast(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鎺у埗鍣ㄨ褰曞紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻鍒楄〃锛堝巻鍙诧級 + * + * @param vo 鏌ヨ鏉′欢 + * @return 绗﹀悎鏉′欢鐨勫啘鎴锋棩鐢ㄦ按閲忕粺璁″垪琛紙鍘嗗彶锛� + */ + @Operation(summary = "鑾峰緱涓�椤靛啘鎴锋棩鐢ㄦ按閲忕粺璁¤褰�", description = "杩斿洖涓�椤靛啘鎴锋棩鐢ㄦ按閲忕粺璁℃暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佹暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getClientAmountDayHistory") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory(@RequestBody ClientAmountDayQueryVo vo) { + try { + QueryResultVo<List<VoClientAmountDay>> res = recordsSv.getClientAmountDayHistory(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻鍒楄〃锛堟渶鏂帮級 + * + * @param vo 鏌ヨ鏉′欢 + * @return 绗﹀悎鏉′欢鐨勫啘鎴锋棩鐢ㄦ按閲忕粺璁″垪琛紙鏈�鏂帮級 + */ + @Operation(summary = "鑾峰緱涓�椤靛啘鎴锋棩鐢ㄦ按閲忕粺璁¤褰�", description = "杩斿洖涓�椤靛啘鎴锋棩鐢ㄦ按閲忕粺璁℃暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佹暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = VoActiveCard.class))} + ) + }) + @GetMapping(path = "/getClientAmountDayLast") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast(@RequestBody ClientAmountDayQueryVo vo) { + try { + QueryResultVo<List<VoClientAmountDay>> res = recordsSv.getClientAmountDayLast(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鑾峰彇鍐滄埛鏃ョ敤姘撮噺缁熻璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsSv.java new file mode 100644 index 0000000..b5c94a7 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/records/RecordsSv.java @@ -0,0 +1,121 @@ +package com.dy.pipIrrRemote.records; + +import com.dy.common.webUtil.QueryResultVo; +import com.dy.pipIrrGlobal.daoRm.RmAlarmStateHistoryMapper; +import com.dy.pipIrrGlobal.daoRm.RmAlarmStateLastMapper; +import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayLastMapper; +import com.dy.pipIrrGlobal.daoRm.RmClientAmountDayMapper; +import com.dy.pipIrrGlobal.voRm.VoClientAmountDay; +import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; +import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.common.utils.PojoUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @author :WuZeYu + * @Date :2024/7/22 20:01 + * @LastEditTime :2024/7/22 20:01 + * @Description + */ +@Slf4j +@Service +public class RecordsSv { + @Autowired + private RmAlarmStateHistoryMapper rmAlarmStateHistoryMapper; + @Autowired + private RmAlarmStateLastMapper rmAlarmStateLastMapper; + + @Autowired + private RmClientAmountDayLastMapper rmClientAmountDayLastMapper; + @Autowired + private RmClientAmountDayMapper rmClientAmountDayMapper; + + + /** + * 鑾峰緱涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佽褰�(鍘嗗彶) + * @param vo + * @return + */ + public QueryResultVo<List<VoControllerAlarmState>> getControllerAlarmStateHistory(ControllerAlarmStateQueryVo vo) { + + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); + + Long itemTotal = rmAlarmStateHistoryMapper.getRecordCount(params); + + QueryResultVo<List<VoControllerAlarmState>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = vo.pageSize; + rsVo.pageCurr = vo.pageCurr; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmAlarmStateHistoryMapper.getControllerAlarmStateHistory(params); + return rsVo; + } + + + /** + * 鑾峰緱涓�椤垫帶鍒跺櫒鎶ヨ涓庣姸鎬佽褰�(鏈�鏂�) + * @param vo + * @return + */ + public QueryResultVo<List<VoControllerAlarmState>> getControllerAlarmStateLast(ControllerAlarmStateQueryVo vo) { + + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); + + Long itemTotal = rmAlarmStateLastMapper.getRecordCount(params); + + QueryResultVo<List<VoControllerAlarmState>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = vo.pageSize; + rsVo.pageCurr = vo.pageCurr; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmAlarmStateLastMapper.getControllerAlarmStateLast(params); + return rsVo; + } + + + /** + * 鑾峰緱涓�椤靛啘鎴锋棩鐢ㄦ按閲忕粺璁¤褰�(鍘嗗彶) + * @param vo + * @return + */ + public QueryResultVo<List<VoClientAmountDay>> getClientAmountDayHistory(ClientAmountDayQueryVo vo) { + + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); + + Long itemTotal = rmClientAmountDayMapper.getRecordCount(params); + + QueryResultVo<List<VoClientAmountDay>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = vo.pageSize; + rsVo.pageCurr = vo.pageCurr; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmClientAmountDayMapper.getClientAmountDayHistory(params); + return rsVo; + } + + + + /** + * 鑾峰緱涓�椤靛啘鎴锋棩鐢ㄦ按閲忕粺璁¤褰�(鏈�鏂�) + * @param vo + * @return + */ + public QueryResultVo<List<VoClientAmountDay>> getClientAmountDayLast(ClientAmountDayQueryVo vo) { + + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); + + Long itemTotal = rmClientAmountDayLastMapper.getRecordCount(params); + + QueryResultVo<List<VoClientAmountDay>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = vo.pageSize; + rsVo.pageCurr = vo.pageCurr; + + rsVo.calculateAndSet(itemTotal, params); + rsVo.obj = rmClientAmountDayLastMapper.getClientAmountDayLast(params); + return rsVo; + } +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/RtuCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/RtuCtrl.java index 5768ebf..e4b0ec0 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/RtuCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/RtuCtrl.java @@ -32,9 +32,6 @@ import java.util.Objects; -//import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com97Vo; -//import com.dy.common.mw.protocol.p206V1_0_0.downVos.ComXyVo; - /** * @author ZhuBaoMin * @date 2024-05-21 14:31 @@ -93,11 +90,6 @@ Long intakeId = po.getIntakeId(); Long operator = po.getOperator(); Long comId = idLongGenerator.generate(); - - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); @@ -179,11 +171,6 @@ Long operator = po.getOperator(); Long comId = idLongGenerator.generate(); - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } - // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); if(job_rtu == null) { @@ -243,11 +230,6 @@ Long intakeId = po.getIntakeId(); Long operator = po.getOperator(); Long comId = idLongGenerator.generate(); - - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); @@ -310,11 +292,6 @@ Long operator = po.getOperator(); Long comId = idLongGenerator.generate(); - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } - // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); if(job_rtu == null) { @@ -374,11 +351,6 @@ Long intakeId = po.getIntakeId(); Long operator = po.getOperator(); Long comId = idLongGenerator.generate(); - - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java index 06f622c..c0d871e 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/valve/ValveCtrl.java @@ -5,8 +5,13 @@ import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com97Vo; import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com98Vo; +import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com99Vo; +import com.dy.common.mw.protocol.p206V1_0_0.downVos.ComA0Vo; import com.dy.common.mw.protocol.p206V202404.CodeV202404; -import com.dy.common.mw.protocol.p206V202404.downVos.*; +import com.dy.common.mw.protocol.p206V202404.downVos.ComCd15Vo; +import com.dy.common.mw.protocol.p206V202404.downVos.ComCd92_A2Vo; +import com.dy.common.mw.protocol.p206V202404.downVos.ComCd93_A3Vo; +import com.dy.common.mw.protocol.p206V202404.downVos.ComCd9CVo; import com.dy.common.util.IDLongGenerator; import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; @@ -104,11 +109,6 @@ if(vcId == null) { return BaseResponseUtils.buildErrorMsg(RemoteResultCode.PLEASE_SELECT_A_VC.getMessage()); } - } - - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); } // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄 @@ -239,11 +239,6 @@ String orderNo = voUnclosedParam.getOrderNo(); Long comId = idLongGenerator.generate(); - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } - // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚 JSONObject job_rtu = getRtu(null, rtuAddr); if(job_rtu == null) { @@ -317,6 +312,168 @@ } /** + * 瀹氭椂鍏抽榾 + * @param automaticClose + * @param bindingResult + * @return + */ + @PostMapping(path = "timed_close", consumes = MediaType.APPLICATION_JSON_VALUE) + @Transactional(rollbackFor = Exception.class) + @SsoAop() + public BaseResponse<Boolean> timedClose(@RequestBody @Valid AutomaticClose automaticClose, BindingResult bindingResult) { + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + Long intakeId = automaticClose.getIntakeId(); + String rtuAddr = automaticClose.getRtuAddr(); + String vcNum = automaticClose.getVcNum(); + String orderNo = automaticClose.getOrderNo(); + Integer minutes = automaticClose.getMinutes(); + Long operator = automaticClose.getOperator(); + + Long vcId = Optional.ofNullable(seVirtualCardMapper.getVcIdByNum(vcNum)).orElse(0L); + Long comId = idLongGenerator.generate(); + + // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄 + VoVirtualCard vc = commandSv.getVcById(vcId); + if (vc == null) { + return BaseResponseUtils.buildErrorMsg(RemoteResultCode.PLEASE_SELECT_A_VC.getMessage()); + } + Double moneyRemain = vc.getMoney(); + + // 鑾峰彇姘翠环 + Double waterPrice = commandSv.getPrice(); + + // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚 + JSONObject job_rtu = getRtu(null, rtuAddr); + if(job_rtu == null) { + return BaseResponseUtils.buildErrorMsg(RemoteResultCode.RTU_NOT_EXIST.getMessage()); + } + String protocol = job_rtu.getString("protocol"); + String orgTag = job_rtu.getString("orgTag"); + comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw); + + String commandCode = null; + if(protocol.equals("p206V202404")) { + return BaseResponseUtils.buildSuccess(); + } else if(protocol.equals("p206V1_0_1")) { + // 鑾峰彇鍔熻兘鐮� + commandCode = CodeV1_0_1.cd_99; + + // 鍒涘缓瑙嗗浘 + Com99Vo param = new Com99Vo(); + param.setIcCardNo(vcNum); + param.setMoneyRemain(moneyRemain); + param.setWaterPrice(waterPrice); + param.setMinutes(minutes); + param.setOrderNo(orderNo); + + /** + * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋� + * 1 鍑嗗鍙傛暟 + * 2 璋冪敤鍏叡鏂规硶 + */ + Param myParam = new Param(); + myParam.setComId(comId); + myParam.setComType((byte)2); + myParam.setCommandCode(commandCode); + myParam.setCommandName(CodeV202404.getCodeName(commandCode)); + myParam.setIntakeId(intakeId); + myParam.setRtuAddr(rtuAddr); + myParam.setProtocol(protocol); + myParam.setVcId(vcId); + myParam.setParam(param); + myParam.setRtuResultSendWebUrl(rtuCallbackUrl_rm); + myParam.setOperator(operator); + return dealWithCommandResult(myParam); + } else { + return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�"); + } + } + + /** + * 瀹氶噺鍏抽榾 + * @param automaticClose + * @param bindingResult + * @return + */ + @PostMapping(path = "quantify_close", consumes = MediaType.APPLICATION_JSON_VALUE) + @Transactional(rollbackFor = Exception.class) + @SsoAop() + public BaseResponse<Boolean> quantifyClose(@RequestBody @Valid AutomaticClose automaticClose, BindingResult bindingResult) { + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + Long intakeId = automaticClose.getIntakeId(); + String rtuAddr = automaticClose.getRtuAddr(); + String vcNum = automaticClose.getVcNum(); + String orderNo = automaticClose.getOrderNo(); + Integer waterAmount = automaticClose.getWaterAmount(); + Long operator = automaticClose.getOperator(); + + Long vcId = Optional.ofNullable(seVirtualCardMapper.getVcIdByNum(vcNum)).orElse(0L); + Long comId = idLongGenerator.generate(); + + // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄 + VoVirtualCard vc = commandSv.getVcById(vcId); + if (vc == null) { + return BaseResponseUtils.buildErrorMsg(RemoteResultCode.PLEASE_SELECT_A_VC.getMessage()); + } + Double moneyRemain = vc.getMoney(); + + // 鑾峰彇姘翠环 + Double waterPrice = commandSv.getPrice(); + + // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚 + JSONObject job_rtu = getRtu(null, rtuAddr); + if(job_rtu == null) { + return BaseResponseUtils.buildErrorMsg(RemoteResultCode.RTU_NOT_EXIST.getMessage()); + } + String protocol = job_rtu.getString("protocol"); + String orgTag = job_rtu.getString("orgTag"); + comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw); + + String commandCode = null; + if(protocol.equals("p206V202404")) { + return BaseResponseUtils.buildSuccess(); + } else if(protocol.equals("p206V1_0_1")) { + // 鑾峰彇鍔熻兘鐮� + commandCode = CodeV1_0_1.cd_A0; + + // 鍒涘缓瑙嗗浘 + ComA0Vo param = new ComA0Vo(); + param.setIcCardNo(vcNum); + param.setMoneyRemain(moneyRemain); + param.setWaterPrice(waterPrice); + param.setWaterAmount(waterAmount); + param.setOrderNo(orderNo); + + /** + * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋� + * 1 鍑嗗鍙傛暟 + * 2 璋冪敤鍏叡鏂规硶 + */ + Param myParam = new Param(); + myParam.setComId(comId); + myParam.setComType((byte)2); + myParam.setCommandCode(commandCode); + myParam.setCommandName(CodeV202404.getCodeName(commandCode)); + myParam.setIntakeId(intakeId); + myParam.setRtuAddr(rtuAddr); + myParam.setProtocol(protocol); + myParam.setVcId(vcId); + myParam.setParam(param); + myParam.setRtuResultSendWebUrl(rtuCallbackUrl_rm); + myParam.setOperator(operator); + return dealWithCommandResult(myParam); + } else { + return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�"); + } + } + + /** * 鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍 * @param operator * @return @@ -354,11 +511,6 @@ Long operator = po.getOperator(); String flowNo = RandomStringUtils.randomNumeric(12); // 鐢熸垚12浣嶉殢鏈烘暟 Long comId = idLongGenerator.generate(); - - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); @@ -433,11 +585,6 @@ Long operator = card.getOperator(); Long comId = idLongGenerator.generate(); - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } - // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); if(job_rtu == null) { @@ -498,11 +645,6 @@ // Boolean valid = usability.getValid(); // Long operator = usability.getOperator(); // Long comId = idLongGenerator.generate(); - // - // // 鑾峰彇绯荤粺鍙傛暟 - // if(!setuped) { - // setUp(); - // } // // // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 // JSONObject job_rtu = getRtu(intakeId, null); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandResultCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandResultCtrl.java index e5e2113..493625f 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandResultCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandResultCtrl.java @@ -1,8 +1,8 @@ package com.dy.pipIrrWechat.command; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.dy.common.mw.protocol.Data; -import com.dy.common.webUtil.BaseResponse; -import com.dy.common.webUtil.BaseResponseUtils; import com.dy.pipIrrGlobal.command.ComSupport; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; @@ -25,16 +25,21 @@ @RequestMapping(path="comRes") public class CommandResultCtrl extends ComSupport { @PostMapping(path = "receive", consumes = MediaType.APPLICATION_JSON_VALUE) - public BaseResponse<String> receive(@RequestBody Data data) { - Long comId = 0L; - if(data.getCommandId() != null) { - comId = Long.parseLong(data.getCommandId()); - } + public void receive(@RequestBody Data data) { + JSONObject job_data = (JSONObject) JSON.toJSON(data); + String job_dataS = job_data.toJSONString(); + JSONObject job_subData = job_data.getJSONObject("subData").getJSONObject("subData"); - CompletableFuture<Data> feature = (CompletableFuture<Data>) features.get(comId); + JSONObject job_response = new JSONObject(); + job_response.put("data", job_subData); + job_response.put("commandCode", job_data.getString("code")); + job_response.put("commandId", job_data.getString("commandId")); + + CompletableFuture<JSONObject> feature = (CompletableFuture<JSONObject>) features.get(job_data.getLong("commandId")); if(feature != null) { - feature.complete(data); + feature.complete(job_response); + }else{ + feature.complete(new JSONObject()); } - return BaseResponseUtils.buildSuccess("ok"); } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java index b3058bf..4dbfadf 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/ValveCtrl.java @@ -1,9 +1,12 @@ package com.dy.pipIrrWechat.command; import com.alibaba.fastjson2.JSONObject; +import com.dy.common.aop.SsoAop; import com.dy.common.mw.protocol.p206V1_0_0.CodeV1_0_1; import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com97Vo; import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com98Vo; +import com.dy.common.mw.protocol.p206V1_0_0.downVos.Com99Vo; +import com.dy.common.mw.protocol.p206V1_0_0.downVos.ComA0Vo; import com.dy.common.mw.protocol.p206V202404.CodeV202404; import com.dy.common.mw.protocol.p206V202404.downVos.ComCd15Vo; import com.dy.common.mw.protocol.p206V202404.downVos.ComCd92_A2Vo; @@ -17,6 +20,7 @@ import com.dy.pipIrrGlobal.pojoSe.SeClientCard; import com.dy.pipIrrGlobal.voRm.VoUnclosedValve; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; +import com.dy.pipIrrWechat.command.dto.AutomaticClose; import com.dy.pipIrrWechat.command.dto.Recharge; import com.dy.pipIrrWechat.command.dto.ValveClose; import com.dy.pipIrrWechat.command.dto.ValveOpen; @@ -116,11 +120,6 @@ if (vcId == null) { return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage()); } - } - - // 鑾峰彇绯荤粺鍙傛暟 - if (!setuped) { - setUp(); } // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄 @@ -240,11 +239,6 @@ Long operator = valve.getOperator(); Long comId = idLongGenerator.generate(); - // 鑾峰彇绯荤粺鍙傛暟 - if (!setuped) { - setUp(); - } - // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚 JSONObject job_rtu = getRtu(null, rtuAddr); if (job_rtu == null) { @@ -318,6 +312,168 @@ } /** + * 瀹氭椂鍏抽榾 + * @param automaticClose + * @param bindingResult + * @return + */ + @PostMapping(path = "timed_close", consumes = MediaType.APPLICATION_JSON_VALUE) + @Transactional(rollbackFor = Exception.class) + @SsoAop() + public BaseResponse<Boolean> timedClose(@RequestBody @Valid AutomaticClose automaticClose, BindingResult bindingResult) { + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + Long intakeId = automaticClose.getIntakeId(); + String rtuAddr = automaticClose.getRtuAddr(); + String vcNum = automaticClose.getVcNum(); + String orderNo = automaticClose.getOrderNo(); + Integer minutes = automaticClose.getMinutes(); + Long operator = automaticClose.getOperator(); + + Long vcId = Optional.ofNullable(seVirtualCardMapper.getVcIdByNum(vcNum)).orElse(0L); + Long comId = idLongGenerator.generate(); + + // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄 + VoVirtualCard vc = commandSv.getVcById(vcId); + if (vc == null) { + return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage()); + } + Double moneyRemain = vc.getMoney(); + + // 鑾峰彇姘翠环 + Double waterPrice = commandSv.getPrice(); + + // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚 + JSONObject job_rtu = getRtu(null, rtuAddr); + if(job_rtu == null) { + return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage()); + } + String protocol = job_rtu.getString("protocol"); + String orgTag = job_rtu.getString("orgTag"); + comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw); + + String commandCode = null; + if(protocol.equals("p206V202404")) { + return BaseResponseUtils.buildSuccess(); + } else if(protocol.equals("p206V1_0_1")) { + // 鑾峰彇鍔熻兘鐮� + commandCode = CodeV1_0_1.cd_99; + + // 鍒涘缓瑙嗗浘 + Com99Vo param = new Com99Vo(); + param.setIcCardNo(vcNum); + param.setMoneyRemain(moneyRemain); + param.setWaterPrice(waterPrice); + param.setMinutes(minutes); + param.setOrderNo(orderNo); + + /** + * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋� + * 1 鍑嗗鍙傛暟 + * 2 璋冪敤鍏叡鏂规硶 + */ + Param myParam = new Param(); + myParam.setComId(comId); + myParam.setComType((byte)2); + myParam.setCommandCode(commandCode); + myParam.setCommandName(CodeV202404.getCodeName(commandCode)); + myParam.setIntakeId(intakeId); + myParam.setRtuAddr(rtuAddr); + myParam.setProtocol(protocol); + myParam.setVcId(vcId); + myParam.setParam(param); + myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx); + myParam.setOperator(operator); + return dealWithCommandResult(myParam); + } else { + return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�"); + } + } + + /** + * 瀹氶噺鍏抽榾 + * @param automaticClose + * @param bindingResult + * @return + */ + @PostMapping(path = "quantify_close", consumes = MediaType.APPLICATION_JSON_VALUE) + @Transactional(rollbackFor = Exception.class) + @SsoAop() + public BaseResponse<Boolean> quantifyClose(@RequestBody @Valid AutomaticClose automaticClose, BindingResult bindingResult) { + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + + Long intakeId = automaticClose.getIntakeId(); + String rtuAddr = automaticClose.getRtuAddr(); + String vcNum = automaticClose.getVcNum(); + String orderNo = automaticClose.getOrderNo(); + Integer waterAmount = automaticClose.getWaterAmount(); + Long operator = automaticClose.getOperator(); + + Long vcId = Optional.ofNullable(seVirtualCardMapper.getVcIdByNum(vcNum)).orElse(0L); + Long comId = idLongGenerator.generate(); + + // 铏氭嫙鍗D鎹㈣櫄鎷熷崱瀵硅薄 + VoVirtualCard vc = commandSv.getVcById(vcId); + if (vc == null) { + return BaseResponseUtils.buildErrorMsg(WechatResultCode.PLEASE_SELECT_A_VC.getMessage()); + } + Double moneyRemain = vc.getMoney(); + + // 鑾峰彇姘翠环 + Double waterPrice = commandSv.getPrice(); + + // 闃�鎺у櫒鍦板潃鎹㈠彇姘村彛ID鍜岄�氳鍗忚 + JSONObject job_rtu = getRtu(null, rtuAddr); + if(job_rtu == null) { + return BaseResponseUtils.buildErrorMsg(WechatResultCode.RTU_NOT_EXIST.getMessage()); + } + String protocol = job_rtu.getString("protocol"); + String orgTag = job_rtu.getString("orgTag"); + comSendUrl = env.getProperty(pro_mw + "." + orgTag + "." + key_mw); + + String commandCode = null; + if(protocol.equals("p206V202404")) { + return BaseResponseUtils.buildSuccess(); + } else if(protocol.equals("p206V1_0_1")) { + // 鑾峰彇鍔熻兘鐮� + commandCode = CodeV1_0_1.cd_A0; + + // 鍒涘缓瑙嗗浘 + ComA0Vo param = new ComA0Vo(); + param.setIcCardNo(vcNum); + param.setMoneyRemain(moneyRemain); + param.setWaterPrice(waterPrice); + param.setWaterAmount(waterAmount); + param.setOrderNo(orderNo); + + /** + * 鏋勯�犲懡浠ゃ�佸彂閫佸懡浠ゅ苟澶勭悊璇锋眰缁撴灉鍙婃墽琛岀粨鏋� + * 1 鍑嗗鍙傛暟 + * 2 璋冪敤鍏叡鏂规硶 + */ + Param myParam = new Param(); + myParam.setComId(comId); + myParam.setComType((byte)2); + myParam.setCommandCode(commandCode); + myParam.setCommandName(CodeV202404.getCodeName(commandCode)); + myParam.setIntakeId(intakeId); + myParam.setRtuAddr(rtuAddr); + myParam.setProtocol(protocol); + myParam.setVcId(vcId); + myParam.setParam(param); + myParam.setRtuResultSendWebUrl(rtuCallbackUrl_wx); + myParam.setOperator(operator); + return dealWithCommandResult(myParam); + } else { + return BaseResponseUtils.buildErrorMsg("绯荤粺鏆備笉鏀寔璇ュ崗璁�"); + } + } + + /** * 鏍规嵁鎿嶄綔鍛業D鑾峰彇鏈叧闃�璁板綍 * * @param operator @@ -354,11 +510,6 @@ Long operator = po.getOperator(); String flowNo = RandomStringUtils.randomNumeric(12); // 鐢熸垚12浣嶉殢鏈烘暟 Long comId = idLongGenerator.generate(); - - // 鑾峰彇绯荤粺鍙傛暟 - if(!setuped) { - setUp(); - } // 鍙栨按鍙D鎹㈤榾鎺у櫒鍦板潃鍙婇�氳鍗忚 JSONObject job_rtu = getRtu(intakeId, null); diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/AutomaticClose.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/AutomaticClose.java new file mode 100644 index 0000000..5989744 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/dto/AutomaticClose.java @@ -0,0 +1,43 @@ +package com.dy.pipIrrWechat.command.dto; + +import jakarta.validation.constraints.NotBlank; +import lombok.Data; + +/** + * @author ZhuBaoMin + * @date 2024-07-23 10:55 + * @LastEditTime 2024-07-23 10:55 + * @Description + */ +@Data +public class AutomaticClose extends DtoBase { + public static final long serialVersionUID = 202407231056001L; + + /** + * 闃�鎺у櫒鍦板潃 + */ + @NotBlank(message = "闃�鎺у櫒鍦板潃涓嶈兘涓虹┖") + private String rtuAddr; + + /** + * 铏氭嫙鍗$紪鍙� + */ + @NotBlank(message = "铏氭嫙鍗$紪鍙蜂笉鑳戒负绌�") + private String vcNum; + + /** + * 璁㈠崟鍙� + */ + @NotBlank(message = "璁㈠崟鍙蜂笉鑳戒负绌�") + private String orderNo; + + /** + * 鐢ㄦ按鏃堕暱锛屾嫢鏈夊畾鏃跺叧闃� + */ + private Integer minutes; + + /** + * 棰勭敤姘撮噺锛屾嫢鏈夊畾閲忓叧闃� + */ + private Integer waterAmount; +} -- Gitblit v1.8.0