From 1918d037b5a9dd466a8e65925ac80f10d900f205 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期四, 19 六月 2025 15:05:35 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml | 145 ++++ pipIrr-platform/文档/水肥气象墒情/水肥站、气象站、墒情站协议.docx | 0 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureCtrl.java | 171 +++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTermCommon.java | 3 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttCtrl.java | 76 ++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStWeather.java | 74 ++ pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java | 14 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/ManureVo.java | 9 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStopCtrl.java | 9 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/Vo4Up.java | 3 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComCtrlVo.java | 3 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttSimpleVo.java | 20 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStSoil.java | 74 ++ pipIrr-platform/pipIrr-web/pipIrr-web-terminal/src/main/java/com/dy/pipIrrTerminal/card/CardSv.java | 1 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilCtrl.java | 171 +++++ pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/StateVo.java | 8 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilSv.java | 67 + pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdParam.java | 9 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java | 171 +++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStManureMapper.java | 37 + pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml | 145 ++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStManure.java | 75 ++ pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttTopic.java | 11 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/WeatherVo.java | 8 pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml | 145 ++++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStSoilMapper.java | 37 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoMqttSimple.java | 27 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStartCtrl.java | 45 + pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStWeatherMapper.java | 37 + pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties | 10 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java | 65 + pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java | 67 + pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdDto.java | 16 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/SoilVo.java | 8 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdSv.java | 15 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureSv.java | 66 + pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComSetParamVo.java | 4 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java | 65 + pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/说明.txt | 1 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java | 65 + pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/ProtocolParserSdV1.java | 15 41 files changed, 1,971 insertions(+), 21 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java index 5a03f7e..8389f8e 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttMsgParser.java @@ -3,6 +3,7 @@ import com.dy.common.mw.protocol.Command; import com.dy.common.mw.protocol4Mqtt.pSdV1.ProtocolConstantSdV1; import com.dy.common.mw.protocol4Mqtt.pSdV1.ProtocolParserSdV1; +import com.dy.common.util.NumUtil; import org.eclipse.paho.client.mqttv3.MqttMessage; /** @@ -14,14 +15,21 @@ public static MqttTopic parseSubTopic(String topic) throws Exception { if(topic != null && topic.trim().length() != 0){ String[] topicGrp = topic.split("/") ; - if(topicGrp.length != 4){ + if(topicGrp.length != 5){ throw new Exception("鎺ユ敹鐨刴qtt娑堟伅涓婚涓嶅彲璇嗗埆") ; }else{ + if(NumUtil.isPlusIntNumber(topicGrp[4])){ + throw new Exception("鎺ユ敹鐨刴qtt娑堟伅涓婚涓嶅彲璇嗗埆") ; + } + if(Integer.parseInt(topicGrp[4]) <= 0){ + throw new Exception("鎺ユ敹鐨刴qtt娑堟伅涓婚涓嶅彲璇嗗埆") ; + } MqttTopic vo = new MqttTopic() ; vo.orgTag = topicGrp[0] ; vo.protocol = topicGrp[1] ; vo.devId = topicGrp[2] ; - vo.name = topicGrp[3] ; + vo.type = topicGrp[3] ; + vo.no = Integer.parseInt(topicGrp[4]) ; return vo ; } }else{ @@ -30,7 +38,7 @@ } public static String createPubTopic(MqttTopic tp) throws Exception { - return tp.orgTag + "/" + tp.protocol + "/" + tp.devId + "/" + tp.name; + return tp.orgTag + "/" + tp.protocol + "/" + tp.devId + "/" + tp.type + "/" + tp.no; } public static MqttSubMsg parseSubMsg(MqttTopic subTopic, MqttMessage mqttMsg, MqttCallback callback) throws Exception { diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttTopic.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttTopic.java index d088e08..da40d12 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttTopic.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/MqttTopic.java @@ -16,18 +16,19 @@ public String orgTag ;//缁勭粐鏍囪瘑 public String protocol ;//鍗忚鍚嶇О public String devId ;//璁惧锛團Box锛塈D - public String name;//娑堟伅涓婚鏈鍚嶇О + public String type;//娴嬬珯绫诲瀷 + public Integer no;//娴嬬珯缂栧彿 public boolean isEmpty(){ - return orgTag == null || protocol == null || devId == null || name == null - || orgTag.trim().length() == 0 || protocol.trim().length() == 0 || devId.trim().length() == 0 || name.trim().length() == 0 ; + return orgTag == null || protocol == null || devId == null || type == null || no == null + || orgTag.trim().length() == 0 || protocol.trim().length() == 0 || devId.trim().length() == 0 || type.trim().length() == 0 || no <= 0 ; } public String shortName(){ - return name; + return type + "/" + no; } public String longName(){ - return orgTag + "/" + protocol + "/" + devId + "/" + name; + return orgTag + "/" + protocol + "/" + devId + "/" + type + "/" + no; } } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/Vo4Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/Vo4Up.java index 2fd7a81..4c7a764 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/Vo4Up.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/Vo4Up.java @@ -6,5 +6,8 @@ * @Description */ public interface Vo4Up { + + public void setNo(Integer no) ; + String toString() ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/ProtocolParserSdV1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/ProtocolParserSdV1.java index 1a7d373..77c38d8 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/ProtocolParserSdV1.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/ProtocolParserSdV1.java @@ -30,7 +30,7 @@ MqttSubMsgSdV1 msg = new MqttSubMsgSdV1(subTopic, strTxt); Vo4Up vo ; DevRunInfo stInfo = null ; - switch (subTopic.name) { + switch (subTopic.type) { case ProtocolConstantSdV1.SubTopicWeather -> { vo = JSON.parseObject(strTxt, WeatherVo.class); break; @@ -56,9 +56,10 @@ break; } default -> { - throw new Exception("鎺ユ敹鍒癕QTT娑堟伅锛屽崗璁�" + subTopic.protocol + "锛岃澶嘔D" + subTopic.devId + "锛屼富棰�" + subTopic.name + "娑堟伅瑙f瀽閫昏緫鏈疄鐜�"); + throw new Exception("鎺ユ敹鍒癕QTT娑堟伅锛屽崗璁�" + subTopic.protocol + "锛岃澶嘔D" + subTopic.devId + "锛屼富棰�" + subTopic.type + "娑堟伅瑙f瀽閫昏緫鏈疄鐜�"); } } + vo.setNo(subTopic.no) ; msg.vo4Up = vo ; callback.callback(msg); callback.notify(msg.deviceId, stInfo); @@ -131,7 +132,7 @@ msg.isCacheForOffLine = false ; msg.hasResponse = true ; msg.cd = CodeSdV1.cd_Fault ; - msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicFault) ; + msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicFault, cvo.no) ; msg.msg = JSON.toJSONString(new FaultClearVo(cvo.startTrueStopFalse ?(byte)1:0)) ; return msg ; } @@ -147,7 +148,7 @@ msg.isCacheForOffLine = false ; msg.hasResponse = true ; msg.cd = CodeSdV1.cd_Fault ; - msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicStir) ; + msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicStir, cvo.no) ; msg.msg = JSON.toJSONString(new StirStartVo(cvo.startTrueStopFalse ?(byte)1:0)) ; return msg ; } @@ -163,7 +164,7 @@ msg.isCacheForOffLine = false ; msg.hasResponse = true ; msg.cd = CodeSdV1.cd_Fault ; - msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicInject) ; + msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicInject, cvo.no) ; msg.msg = JSON.toJSONString(new InjectStartVo(cvo.startTrueStopFalse ?(byte)1:0)) ; return msg ; } @@ -179,7 +180,7 @@ msg.isCacheForOffLine = false ; msg.hasResponse = true ; msg.cd = CodeSdV1.cd_Fault ; - msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicIrr) ; + msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicIrr, cvo.no) ; msg.msg = JSON.toJSONString(new StirStartVo(cvo.startTrueStopFalse ?(byte)1:0)) ; return msg ; } @@ -196,7 +197,7 @@ msg.isCacheForOffLine = false ; msg.hasResponse = false ; msg.cd = CodeSdV1.cd_Param ; - msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicParam) ; + msg.topic = new MqttTopic(orgTag, com.protocol, com.rtuAddr, ProtocolConstantSdV1.PubTopicParam, cvo.no) ; msg.msg = JSON.toJSONString(new ParamSetVo(cvo.stirDuration, cvo.injectDuration)) ; return msg ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComCtrlVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComCtrlVo.java index 6e6e9f6..255f6c8 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComCtrlVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComCtrlVo.java @@ -6,6 +6,9 @@ * @Description */ public class ComCtrlVo { + + public Integer no ;//璁惧缂栧彿 + //鍚仠鍔ㄤ綔锛宼rue鏄紝false鍚� //鍙互鎵ц鍔熻兘鐮� 00锛�01锛�02锛�03鐨勫姩浣� public boolean startTrueStopFalse;// diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComSetParamVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComSetParamVo.java index a14d5b1..f544218 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComSetParamVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/comParam/ComSetParamVo.java @@ -1,6 +1,5 @@ package com.dy.common.mw.protocol4Mqtt.pSdV1.comParam; -import com.alibaba.fastjson2.annotation.JSONField; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -14,6 +13,9 @@ @NoArgsConstructor @AllArgsConstructor public class ComSetParamVo { + //璁惧缂栧彿 + public Integer no ; + // 鎼呮媽璁惧畾鏃堕棿 public Integer stirDuration ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/ManureVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/ManureVo.java index a2f9ae8..9244e7f 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/ManureVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/ManureVo.java @@ -15,6 +15,8 @@ @JSONField(name = "flexem_message_id") public Integer messageId ;//娑堟伅ID + public Integer no ;//娴嬬珯缂栧彿锛屽叾涓嶅湪JSON鏁版嵁涓紝鍏朵腑涓婚涓� + @JSONField(name = "鑲ユ枡娴侀噺") public Float manureFlow ;//鑲ユ枡娴侀噺 @@ -28,6 +30,12 @@ public Long devDt ;//璁惧鏃堕棿 public String devDtStr ;//璁惧鏃堕棿 + + @Override + public void setNo(Integer no ){ + this.no = no ; + } + public String getDevDtStr() { if(devDt == null){ return DateTime.yyyy_MM_dd_HH_mm_ss(DateTime.getDate(devDt)) ; @@ -49,4 +57,5 @@ sb.append("\n") ; return sb.toString() ; } + } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/SoilVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/SoilVo.java index f5bb1e0..b4f8d7a 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/SoilVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/SoilVo.java @@ -15,6 +15,8 @@ @JSONField(name = "flexem_message_id") public Integer messageId ;//娑堟伅ID + public Integer no ;//娴嬬珯缂栧彿锛屽叾涓嶅湪JSON鏁版嵁涓紝鍏朵腑涓婚涓� + @JSONField(name = "鍦熷¥婀垮害1") public Float soilHumidity1 ;//鍦熷¥婀垮害1 @@ -43,6 +45,12 @@ public Long devDt ;//璁惧鏃堕棿 public String devDtStr ;//璁惧鏃堕棿 + + @Override + public void setNo(Integer no ){ + this.no = no ; + } + public String getDevDtStr() { if(devDt == null){ return DateTime.yyyy_MM_dd_HH_mm_ss(DateTime.getDate(devDt)) ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/StateVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/StateVo.java index fb3885d..da78e62 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/StateVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/StateVo.java @@ -15,6 +15,8 @@ @JSONField(name = "flexem_message_id") public Integer messageId ;//娑堟伅ID + public Integer no ;//娴嬬珯缂栧彿锛屽叾涓嶅湪JSON鏁版嵁涓紝鍏朵腑涓婚涓� + @JSONField(name = "鎼呮媽杩愯") public Byte stirRunning ;//鎼呮媽杩愯 @@ -31,6 +33,12 @@ public Long devDt ;//璁惧鏃堕棿 public String devDtStr ;//璁惧鏃堕棿 + + @Override + public void setNo(Integer no ){ + this.no = no ; + } + public String getDevDtStr() { if(devDt == null){ return DateTime.yyyy_MM_dd_HH_mm_ss(DateTime.getDate(devDt)) ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/WeatherVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/WeatherVo.java index 170bf51..1b2b510 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/WeatherVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol4Mqtt/pSdV1/upVos/WeatherVo.java @@ -16,6 +16,8 @@ @JSONField(name = "flexem_message_id") public Integer messageId ;//娑堟伅ID + public Integer no ;//娴嬬珯缂栧彿锛屽叾涓嶅湪JSON鏁版嵁涓紝鍏朵腑涓婚涓� + @JSONField(name = "浜屾哀鍖栫⒊") public Integer carbonDioxide ;//浜屾哀鍖栫⒊ @@ -42,6 +44,12 @@ public Long devDt ;//璁惧鏃堕棿 public String devDtStr ;//璁惧鏃堕棿 + + @Override + public void setNo(Integer no ){ + this.no = no ; + } + public String getDevDtStr() { if(devDt != null){ return DateTime.yyyy_MM_dd_HH_mm_ss(DateTime.getDate(devDt)) ; diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStManureMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStManureMapper.java new file mode 100644 index 0000000..62a2163 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStManureMapper.java @@ -0,0 +1,37 @@ +package com.dy.pipIrrGlobal.daoPr; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dy.pipIrrGlobal.pojoPr.PrStManure; +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/17 16:09 + * @Description + */ +@Mapper +public interface PrStManureMapper extends BaseMapper<PrStManure> { + int deleteByPrimaryKey(Long id); + + /** + * 閫昏緫鍒犻櫎 + * @param id primaryKey + * @return update count + */ + int deleteLogicById(Long id); + + int insert(PrStManure record); + + int insertSelective(PrStManure record); + + PrStManure selectByPrimaryKey(Long id); + + List<VoMqttSimple> selectAllSimple() ; + + int updateByPrimaryKeySelective(PrStManure record); + + int updateByPrimaryKey(PrStManure record); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStSoilMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStSoilMapper.java new file mode 100644 index 0000000..63e744b --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStSoilMapper.java @@ -0,0 +1,37 @@ +package com.dy.pipIrrGlobal.daoPr; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dy.pipIrrGlobal.pojoPr.PrStSoil; +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/17 16:09 + * @Description + */ +@Mapper +public interface PrStSoilMapper extends BaseMapper<PrStSoil> { + int deleteByPrimaryKey(Long id); + + /** + * 閫昏緫鍒犻櫎 + * @param id primaryKey + * @return update count + */ + int deleteLogicById(Long id); + + int insert(PrStSoil record); + + int insertSelective(PrStSoil record); + + PrStSoil selectByPrimaryKey(Long id); + + List<VoMqttSimple> selectAllSimple() ; + + int updateByPrimaryKeySelective(PrStSoil record); + + int updateByPrimaryKey(PrStSoil record); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStWeatherMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStWeatherMapper.java new file mode 100644 index 0000000..0a66151 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoPr/PrStWeatherMapper.java @@ -0,0 +1,37 @@ +package com.dy.pipIrrGlobal.daoPr; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dy.pipIrrGlobal.pojoPr.PrStWeather; +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/17 16:10 + * @Description + */ +@Mapper +public interface PrStWeatherMapper extends BaseMapper<PrStWeather> { + int deleteByPrimaryKey(Long id); + + /** + * 閫昏緫鍒犻櫎 + * @param id primaryKey + * @return update count + */ + int deleteLogicById(Long id); + + int insert(PrStWeather record); + + int insertSelective(PrStWeather record); + + PrStWeather selectByPrimaryKey(Long id); + + List<VoMqttSimple> selectAllSimple() ; + + int updateByPrimaryKeySelective(PrStWeather record); + + int updateByPrimaryKey(PrStWeather record); +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStManure.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStManure.java new file mode 100644 index 0000000..ce4d50f --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStManure.java @@ -0,0 +1,75 @@ +package com.dy.pipIrrGlobal.pojoPr; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * @Author: liurunyu + * @Date: 2025/6/17 16:09 + * @Description + */ + +/** + * 姘磋偉鏈猴紙绔欙級 + */ +@TableName(value="pr_st_manure", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "姘磋偉鏈猴紙绔欙級") +public class PrStManure implements BaseEntity { + + public static final long serialVersionUID = 202506171615001L; + /** + * 涓婚敭 + */ + @Schema(description = "涓婚敭", requiredMode = Schema.RequiredMode.REQUIRED) + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + public Long id; + + /** + * 姘磋偉绔欑紪鍙� + */ + @Schema(description = "姘磋偉绔欑紪鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Integer no ; + + /** + * 姘磋偉绔欏悕绉� + */ + @Schema(description = "姘磋偉绔欏悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public String name; + + /** + * 缁忓害 + */ + @Schema(description = "姘磋偉绔欑粡搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lng; + + /** + * 绾害 + */ + @Schema(description = "姘磋偉绔欑含搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lat; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞淇℃伅", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public String remark; + + /** + * 鏄惁鍒犻櫎锛�1鏄紝0鍚︼級 + */ + @Schema(description = "鏄惁鍒犻櫎", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStSoil.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStSoil.java new file mode 100644 index 0000000..56ad0c7 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStSoil.java @@ -0,0 +1,74 @@ +package com.dy.pipIrrGlobal.pojoPr; + +/** + * @Author: liurunyu + * @Date: 2025/6/17 16:09 + * @Description + */ + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * 澧掓儏绔� + */ +@TableName(value="pr_st_soil", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "澧掓儏绔�") +public class PrStSoil implements BaseEntity { + + public static final long serialVersionUID = 202506171615002L; + /** + * 涓婚敭 + */ + @Schema(description = "涓婚敭", requiredMode = Schema.RequiredMode.REQUIRED) + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + public Long id; + + /** + * 澧掓儏绔欑紪鍙� + */ + @Schema(description = "澧掓儏绔欑紪鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Integer no ; + /** + * 澧掓儏绔欏悕绉� + */ + @Schema(description = "澧掓儏绔欏悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public String name; + + /** + * 缁忓害 + */ + @Schema(description = "澧掓儏绔欑粡搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lng; + + /** + * 绾害 + */ + @Schema(description = "澧掓儏绔欑含搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lat; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞淇℃伅", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public String remark; + + /** + * 鏄惁鍒犻櫎锛�1鏄紝0鍚︼級 + */ + @Schema(description = "鏄惁鍒犻櫎", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStWeather.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStWeather.java new file mode 100644 index 0000000..77db182 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoPr/PrStWeather.java @@ -0,0 +1,74 @@ +package com.dy.pipIrrGlobal.pojoPr; + +/** + * @Author: liurunyu + * @Date: 2025/6/17 16:10 + * @Description + */ + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * 姘旇薄绔� + */ +@TableName(value="pr_st_weather", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "姘旇薄绔�") +public class PrStWeather implements BaseEntity { + + public static final long serialVersionUID = 202506171615003L; + /** + * 涓婚敭 + */ + @Schema(description = "涓婚敭", requiredMode = Schema.RequiredMode.REQUIRED) + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + public Long id; + + /** + * 姘旇薄绔欑紪鍙� + */ + @Schema(description = "姘旇薄绔欑紪鍙�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Integer no ; + /** + * 姘旇薄绔欏悕绉� + */ + @Schema(description = "姘旇薄绔欏悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public String name; + + /** + * 缁忓害 + */ + @Schema(description = "姘旇薄绔欑粡搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lng; + + /** + * 绾害 + */ + @Schema(description = "姘旇薄绔欑含搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lat; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞淇℃伅", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public String remark; + + /** + * 鏄惁鍒犻櫎锛�1鏄紝0鍚︼級 + */ + @Schema(description = "鏄惁鍒犻櫎", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; + +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoMqttSimple.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoMqttSimple.java new file mode 100644 index 0000000..9ca9872 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voPr/VoMqttSimple.java @@ -0,0 +1,27 @@ +package com.dy.pipIrrGlobal.voPr; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 15:09 + * @Description + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ToString(callSuper = true) +@NoArgsConstructor +@AllArgsConstructor +@Builder +@Schema(name = "鍐滀笟鐏屾簤缁煎悎绔欏垎绔欑畝鍗曞�煎璞�") +@JsonPropertyOrder({ "id", "name", "no"}) +public class VoMqttSimple { + @JSONField(serializeUsing= ObjectWriterImplToString.class) + public Long id ; + public String name ;//鍚嶇О + public Integer no ;//缂栧彿 +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTermCommon.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTermCommon.java index 0c30807..978a464 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTermCommon.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTermCommon.java @@ -26,4 +26,7 @@ private Long cardNum; private String orderNo; + + //鍏呭�煎悗浣欓 + private Float balance; } diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml new file mode 100644 index 0000000..c16fe8a --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStManureMapper.xml @@ -0,0 +1,145 @@ +<?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.daoPr.PrStManureMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoPr.PrStManure"> + <!--@mbg.generated--> + <!--@Table pr_st_manure--> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="no" jdbcType="INTEGER" property="no" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="lng" jdbcType="DOUBLE" property="lng" /> + <result column="lat" jdbcType="DOUBLE" property="lat" /> + <result column="remark" jdbcType="VARCHAR" property="remark" /> + <result column="deleted" jdbcType="TINYINT" property="deleted" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, `no`, `name`, lng, lat, remark, deleted + </sql> + <sql id="part_Column_List"> + <!--@mbg.generated--> + id, `no`, `name`, lng, lat, remark + </sql> + <sql id="simple_Column_List"> + <!--@mbg.generated--> + id, `no`, `name` + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from pr_st_manure + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple"> + <!--@mbg.generated--> + select + <include refid="simple_Column_List" /> + from pr_st_manure + where deleted != 1 ; + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from pr_st_manure + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="deleteLogicById" parameterType="java.lang.Long"> + <!--@mbg.generated--> + update pr_st_manure set deleted = 1 + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStManure"> + <!--@mbg.generated--> + insert into pr_st_manure (id, `no`, `name`, lng, + lat, remark, deleted) + values (#{id,jdbcType=BIGINT}, #{no,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, + #{lng,jdbcType=DOUBLE}, #{lat,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, + #{deleted,jdbcType=TINYINT}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStManure"> + <!--@mbg.generated--> + insert into pr_st_manure + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="no != null"> + `no`, + </if> + <if test="name != null"> + `name`, + </if> + <if test="lng != null"> + lng, + </if> + <if test="lat != null"> + lat, + </if> + <if test="remark != null"> + remark, + </if> + <if test="deleted != null"> + deleted, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="no != null"> + #{no,jdbcType=INTEGER}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="lng != null"> + #{lng,jdbcType=DOUBLE}, + </if> + <if test="lat != null"> + #{lat,jdbcType=DOUBLE}, + </if> + <if test="remark != null"> + #{remark,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=TINYINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStManure"> + <!--@mbg.generated--> + update pr_st_manure + <set> + <if test="no != null"> + `no` = #{no,jdbcType=INTEGER}, + </if> + <if test="name != null"> + `name` = #{name,jdbcType=VARCHAR}, + </if> + <if test="lng != null"> + lng = #{lng,jdbcType=DOUBLE}, + </if> + <if test="lat != null"> + lat = #{lat,jdbcType=DOUBLE}, + </if> + <if test="remark != null"> + remark = #{remark,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStManure"> + <!--@mbg.generated--> + update pr_st_manure + set `no` = #{no,jdbcType=INTEGER}, + `name` = #{name,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=DOUBLE}, + lat = #{lat,jdbcType=DOUBLE}, + remark = #{remark,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml new file mode 100644 index 0000000..682efa1 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStSoilMapper.xml @@ -0,0 +1,145 @@ +<?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.daoPr.PrStSoilMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoPr.PrStSoil"> + <!--@mbg.generated--> + <!--@Table pr_st_soil--> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="no" jdbcType="INTEGER" property="no" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="lng" jdbcType="DOUBLE" property="lng" /> + <result column="lat" jdbcType="DOUBLE" property="lat" /> + <result column="remark" jdbcType="VARCHAR" property="remark" /> + <result column="deleted" jdbcType="TINYINT" property="deleted" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, `no`, `name`, lng, lat, remark, deleted + </sql> + <sql id="part_Column_List"> + <!--@mbg.generated--> + id, `no`, `name`, lng, lat, remark + </sql> + <sql id="simple_Column_List"> + <!--@mbg.generated--> + id, `no`, `name` + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from pr_st_soil + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple"> + <!--@mbg.generated--> + select + <include refid="simple_Column_List" /> + from pr_st_soil + where deleted != 1 ; + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from pr_st_soil + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="deleteLogicById" parameterType="java.lang.Long"> + <!--@mbg.generated--> + update pr_st_soil set deleted = 1 + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStSoil"> + <!--@mbg.generated--> + insert into pr_st_soil (id, `no`, `name`, lng, + lat, remark, deleted) + values (#{id,jdbcType=BIGINT}, #{no,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, + #{lng,jdbcType=DOUBLE}, #{lat,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, + #{deleted,jdbcType=TINYINT}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStSoil"> + <!--@mbg.generated--> + insert into pr_st_soil + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="no != null"> + `no`, + </if> + <if test="name != null"> + `name`, + </if> + <if test="lng != null"> + lng, + </if> + <if test="lat != null"> + lat, + </if> + <if test="remark != null"> + remark, + </if> + <if test="deleted != null"> + deleted, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="no != null"> + #{no,jdbcType=INTEGER}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="lng != null"> + #{lng,jdbcType=DOUBLE}, + </if> + <if test="lat != null"> + #{lat,jdbcType=DOUBLE}, + </if> + <if test="remark != null"> + #{remark,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=TINYINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStSoil"> + <!--@mbg.generated--> + update pr_st_soil + <set> + <if test="no != null"> + `no` = #{no,jdbcType=INTEGER}, + </if> + <if test="name != null"> + `name` = #{name,jdbcType=VARCHAR}, + </if> + <if test="lng != null"> + lng = #{lng,jdbcType=DOUBLE}, + </if> + <if test="lat != null"> + lat = #{lat,jdbcType=DOUBLE}, + </if> + <if test="remark != null"> + remark = #{remark,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStSoil"> + <!--@mbg.generated--> + update pr_st_soil + set `no` = #{no,jdbcType=INTEGER}, + `name` = #{name,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=DOUBLE}, + lat = #{lat,jdbcType=DOUBLE}, + remark = #{remark,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml new file mode 100644 index 0000000..e971ed2 --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/PrStWeatherMapper.xml @@ -0,0 +1,145 @@ +<?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.daoPr.PrStWeatherMapper"> + <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoPr.PrStWeather"> + <!--@mbg.generated--> + <!--@Table pr_st_weather--> + <id column="id" jdbcType="BIGINT" property="id" /> + <result column="no" jdbcType="INTEGER" property="no" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="lng" jdbcType="DOUBLE" property="lng" /> + <result column="lat" jdbcType="DOUBLE" property="lat" /> + <result column="remark" jdbcType="VARCHAR" property="remark" /> + <result column="deleted" jdbcType="TINYINT" property="deleted" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, `no`, `name`, lng, lat, remark, deleted + </sql> + <sql id="part_Column_List"> + <!--@mbg.generated--> + id, `no`, `name`, lng, lat, remark + </sql> + <sql id="simple_Column_List"> + <!--@mbg.generated--> + id, `no`, `name` + </sql> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from pr_st_weather + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectAllSimple" resultType="com.dy.pipIrrGlobal.voPr.VoMqttSimple"> + <!--@mbg.generated--> + select + <include refid="simple_Column_List" /> + from pr_st_weather + where deleted != 1 ; + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from pr_st_weather + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="deleteLogicById" parameterType="java.lang.Long"> + <!--@mbg.generated--> + update pr_st_weather set deleted = 1 + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStWeather"> + <!--@mbg.generated--> + insert into pr_st_weather (id, `no`, `name`, lng, + lat, remark, deleted) + values (#{id,jdbcType=BIGINT}, #{no,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, + #{lng,jdbcType=DOUBLE}, #{lat,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, + #{deleted,jdbcType=TINYINT}) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStWeather"> + <!--@mbg.generated--> + insert into pr_st_weather + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="no != null"> + `no`, + </if> + <if test="name != null"> + `name`, + </if> + <if test="lng != null"> + lng, + </if> + <if test="lat != null"> + lat, + </if> + <if test="remark != null"> + remark, + </if> + <if test="deleted != null"> + deleted, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="no != null"> + #{no,jdbcType=INTEGER}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="lng != null"> + #{lng,jdbcType=DOUBLE}, + </if> + <if test="lat != null"> + #{lat,jdbcType=DOUBLE}, + </if> + <if test="remark != null"> + #{remark,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + #{deleted,jdbcType=TINYINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStWeather"> + <!--@mbg.generated--> + update pr_st_weather + <set> + <if test="no != null"> + `no` = #{no,jdbcType=INTEGER}, + </if> + <if test="name != null"> + `name` = #{name,jdbcType=VARCHAR}, + </if> + <if test="lng != null"> + lng = #{lng,jdbcType=DOUBLE}, + </if> + <if test="lat != null"> + lat = #{lat,jdbcType=DOUBLE}, + </if> + <if test="remark != null"> + remark = #{remark,jdbcType=VARCHAR}, + </if> + <if test="deleted != null"> + deleted = #{deleted,jdbcType=TINYINT}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoPr.PrStWeather"> + <!--@mbg.generated--> + update pr_st_weather + set `no` = #{no,jdbcType=INTEGER}, + `name` = #{name,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=DOUBLE}, + lat = #{lat,jdbcType=DOUBLE}, + remark = #{remark,jdbcType=VARCHAR}, + deleted = #{deleted,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + </update> +</mapper> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties index 6eaec36..3d08c73 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/resources/config.properties @@ -24,7 +24,7 @@ # 鐢樺窞锛� 60103 # 鍑夊窞锛� 60104 # 閲戝窛锛� 60105 -tcp.port=60000 +tcp.port=60000ba_divide #RTU涓婅鏁版嵁鏈�灏忛棿闅旓紝澶т簬杩欎釜闂撮殧璁や负璁惧绂荤嚎浜嗭紝娴嬫帶涓�浣撻榾鏄�3锛岃〃闃�涓�浣撴満鏄�6锛岄粯璁ら噰鐢ㄦ椂闂存渶闀跨殑6 base.upData.min.interval=6 @@ -32,21 +32,21 @@ # MQTT鏈嶅姟閰嶇疆 # mqtt.enable 鏄惁鍚姩 # mqtt.protocolAndDeviceIds 鍦ㄥ瓙绯荤粺锛坥rgTag锛変腑鎺ュ叆鐨勮澶�(FBox)鎵�鐢ㄥ崗璁強璁惧id闆嗗悎,澶氫釜鐢ㄩ�楀彿闅斿紑锛屽崗璁笌ID鐢ㄦ鏂滄潬闅斿紑锛屼緥濡傦細sd1/338220031439,sd1/338220031440 -# mqtt.subTopicAndQos 璁㈤槄涓婚涓嶲os锛屼富棰樺悕涓庡叾Qos鐢ㄩ�楀彿闅斿紑锛屽涓富棰樺強Qos鐢ㄥ垎鍙烽殧寮�锛屼緥濡傦細topic1,1;topic2,1;topic3,1 +# mqtt.subTopicAndQos 璁㈤槄涓婚涓嶲os锛屼富棰樺悕涓庡叾Qos鐢ㄩ�楀彿闅斿紑锛屽涓富棰樺強Qos鐢ㄥ垎鍙烽殧寮�锛屼富棰樺悕鐢辩珯绫诲瀷鍙婄紪鍙风粍鎴愶紝鍗充竴涓狥Box鍙互鎺ュ叆澶氫釜鍚岀被鍨嬬殑娴嬬珯锛岀珯缂栧彿浠�1寮�濮嬶紝绔欑被鍨嬩笌缂栧彿鐢ㄦ鏂滄潬闅斿紑锛屼緥濡傦細weather/1,1;weather/2,1;manure/1,1 # 233鏈嶅姟鍣細 # 鍏冭皨锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 娌欑洏锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 娴嬭瘯锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 姊呮睙锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 121鏈嶅姟鍣細 -# 姘戝嫟锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather,1;soil,1;manure,1;state,1 +# 姘戝嫟锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1 # 寤跺簡锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 榛戦緳姹燂細 mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 鐢樺窞锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= # 鍑夊窞锛� mqtt.enable=false mqtt.protocolAndDeviceIds= mqtt.topicAndQos= -# 閲戝窛锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather,1;soil,1;manure,1;state,1 +# 閲戝窛锛� mqtt.enable=true mqtt.protocolAndDeviceIds=? mqtt.topicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1 mqtt.enable=false mqtt.protocolAndDeviceIds=sd1/338220031439,sd1/338220031440 -mqtt.subTopicAndQos=weather,1;soil,1;manure,1;state,1 +mqtt.subTopicAndQos=weather/1,1;soil/1,1;manure/1,1;state/1,1 #MQtt璁惧鍦ㄤ竴瀹氭椂闂达紙鍒嗛挓锛夊悗鏈彂甯冩秷鎭紝璁や负璁惧绂荤嚎 mqtt.noSubThenOff=10 diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttCtrl.java new file mode 100644 index 0000000..b037d8a --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttCtrl.java @@ -0,0 +1,76 @@ +package com.dy.pipIrrProject.mqtt; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrProject.mqtt.manure.ManureSv; +import com.dy.pipIrrProject.mqtt.soil.SoilSv; +import com.dy.pipIrrProject.mqtt.weather.WeatherSv; +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.RequiredArgsConstructor; +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 14:55 + * @Description + */ +@Slf4j +@Tag(name = "鍐滀笟鐏屾簤缁煎悎绔�", description = "鍐滀笟鐏屾簤缁煎悎绔欑鐞�") +@RestController +@RequestMapping(path = "mqtt") +@RequiredArgsConstructor +public class MqttCtrl { + + private ManureSv manureSv ; + private SoilSv soilSv ; + private WeatherSv weatherSv ; + + @Autowired + public void setSv(ManureSv manureSv, SoilSv soilSv, WeatherSv weatherSv) { + this.manureSv = manureSv; + this.soilSv = soilSv; + this.weatherSv = weatherSv; + } + + + /** + * 瀹㈡埛绔姹傚緱鍒版墍鏈夋按鑲ユ満銆佹皵璞$珯銆佸鎯呯珯绠�鍗曚俊鎭� + * @return 鎵�鏈夋按鑲ユ満銆佹皵璞$珯銆佸鎯呯珯绠�鍗曚俊鎭� + */ + @Operation(summary = "鑾峰緱鍏ㄩ儴姘磋偉鏈恒�佹皵璞$珯銆佸鎯呯珯绠�鍗曚俊鎭�", description = "杩斿洖鍏ㄩ儴姘磋偉鏈恒�佹皵璞$珯銆佸鎯呯珯绠�鍗曚俊鎭�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖鍏ㄩ儴姘磋偉鏈恒�佹皵璞$珯銆佸鎯呯珯绠�鍗曚俊鎭暟鎹紙BaseResponse.content:TypesVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = MqttSimpleVo.class))} + ) + }) + @GetMapping(path = "allSimple") + @SsoAop() + public BaseResponse<MqttSimpleVo> allSimple() { + try { + MqttSimpleVo reVo = new MqttSimpleVo() ; + reVo.manures = this.manureSv.allSimple() ; + reVo.soils = this.soilSv.allSimple() ; + reVo.weathers = this.weatherSv.allSimple() ; + return BaseResponseUtils.buildSuccess(reVo); + } catch (Exception e) { + log.error("鏌ヨ鍏ㄩ儴姘磋偉鏈恒�佹皵璞$珯銆佸鎯呯珯绠�鍗曚俊鎭紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + } + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttSimpleVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttSimpleVo.java new file mode 100644 index 0000000..cd46bfd --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/MqttSimpleVo.java @@ -0,0 +1,20 @@ +package com.dy.pipIrrProject.mqtt; + +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import lombok.Data; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 15:22 + * @Description + */ +@Data +public class MqttSimpleVo { + public List<VoMqttSimple> manures; + + public List<VoMqttSimple> soils; + + public List<VoMqttSimple> weathers; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureCtrl.java new file mode 100644 index 0000000..19dad05 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureCtrl.java @@ -0,0 +1,171 @@ +package com.dy.pipIrrProject.mqtt.manure; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoPr.PrStManure; +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 jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import java.util.Objects; + +/** + * @Author: liurunyu + * @Date: 2025/6/19 10:41 + * @Description + */ +@Slf4j +@Tag(name = "姘磋偉鏈虹鐞�", description = "姘磋偉鏈虹鐞�") +@RestController +@RequestMapping(path = "manureStation") +@RequiredArgsConstructor +public class ManureCtrl { + private ManureSv sv; + + @Autowired + private void setSv(ManureSv sv){ + this.sv = sv ; + } + + + /** + * 寰楀埌涓�濂楁按鑲ユ満鏁版嵁 + * @return 涓�濂楁按鑲ユ満鏁版嵁 + */ + @Operation(summary = "涓�濂楁按鑲ユ満", description = "寰楀埌涓�濂楁按鑲ユ満鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�濂楁按鑲ユ満鏁版嵁锛圔aseResponse.content:{}锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = PrStManure.class))} + ) + }) + @GetMapping(path = "one") + @SsoAop() + public BaseResponse<PrStManure> one(Long id){ + return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); + } + + /** + * 淇濆瓨姘磋偉鏈� + * @param dto 淇濆瓨姘磋偉鏈篺orm琛ㄥ崟瀵硅薄 + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "淇濆瓨姘磋偉鏈�", description = "鎻愪氦姘磋偉鏈烘暟鎹紙form琛ㄥ崟锛夛紝杩涜淇濆瓨") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) + @SsoAop() + public BaseResponse<Boolean> save(@RequestBody @Valid ManureDto dto, BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + PrStManure po = dto.toNewPo() ; + po.deleted = 0 ; + int count; + try { + count = this.sv.save(po); + } catch (Exception e) { + log.error("淇濆瓨姘磋偉鏈哄紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + + /** + * 缂栬緫淇敼姘磋偉鏈� + * @param dto 淇濆瓨姘磋偉鏈篺orm琛ㄥ崟瀵硅薄 + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "缂栬緫淇敼姘磋偉鏈�", description = "鎻愪氦姘磋偉鏈烘暟鎹紙form琛ㄥ崟锛夛紝杩涜淇敼") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) + @SsoAop() + public BaseResponse<Boolean> update(@RequestBody @Valid ManureDto dto, BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + PrStManure po = dto.toPo() ; + if(po.id == null){ + return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D") ; + } + int count; + try { + count = this.sv.update(po); + } catch (Exception e) { + log.error("淇濆瓨姘磋偉鏈哄紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + + + /** + * 鍒犻櫎姘磋偉鏈� + * @param id 姘磋偉鏈篒D + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "鍒犻櫎姘磋偉鏈�", description = "鎻愪氦姘磋偉鏈篒D锛岃繘琛岄�昏緫鍒犻櫎") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "delete") + @SsoAop() + public BaseResponse<Boolean> delete(Long id){ + if(id == null){ + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + } + int count; + try { + count = this.sv.delete(id); + } catch (Exception e) { + log.error("淇濆瓨姘磋偉鏈哄紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java new file mode 100644 index 0000000..077cd46 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureDto.java @@ -0,0 +1,65 @@ +package com.dy.pipIrrProject.mqtt.manure; + +import com.dy.pipIrrGlobal.pojoPr.PrStManure; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 14:52 + * @Description + */ +@Data +@Schema(name = "姘磋偉鏈�") +public class ManureDto { + public static final long serialVersionUID = 202506091032001L; + /** + * 涓婚敭 + */ + public String id; + + /** + * 姘磋偉鏈哄悕绉� + */ + @NotEmpty(message = "姘磋偉鏈哄悕绉颁笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public String name; + /** + * 姘磋偉鏈虹紪鍙� + */ + @NotNull(message = "姘磋偉鏈虹紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Integer no; + + + /** + * 缁忓害 + */ + public Double lng; + + /** + * 绾害 + */ + public Double lat; + + /** + * 澶囨敞 + */ + public String remark; + + public PrStManure toNewPo(){ + PrStManure po = new PrStManure(); + po.name = this.name; + po.no = this.no; + po.lng = this.lng; + po.lat = this.lat; + po.remark = this.remark; + return po; + } + public PrStManure toPo(){ + PrStManure po = this.toNewPo(); + po.id = Long.parseLong(this.id) ; + return po; + } +} + diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureSv.java new file mode 100644 index 0000000..afcf207 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/manure/ManureSv.java @@ -0,0 +1,66 @@ +package com.dy.pipIrrProject.mqtt.manure; + +import com.dy.pipIrrGlobal.daoPr.PrStManureMapper; +import com.dy.pipIrrGlobal.pojoPr.PrStManure; +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 14:53 + * @Description + */ +@Slf4j +@Service +public class ManureSv { + + @Autowired + private PrStManureMapper dao; + + public List<VoMqttSimple> allSimple(){ + return this.dao.selectAllSimple() ; + } + + /** + * 寰楀埌涓�涓疄浣� + * @param id 瀹炰綋ID + * @return 瀹炰綋 + */ + public PrStManure selectById(Long id){ + return this.dao.selectById(id) ; + } + /** + * 淇濆瓨锛堟坊鍔狅級瑙嗛鐩戞帶鐐� + * @param po + * @return + */ + @Transactional + Integer save(PrStManure po) { + return dao.insert(po); + } + + /** + * 淇敼瀹炰綋 + * @param po 瀹炰綋 + * @return 鏁伴噺 + */ + @Transactional + public int update(PrStManure po) { + return this.dao.updateByPrimaryKeySelective(po); + } + + /** + * 淇濆瓨淇敼瀹炰綋 + * @param id 瀹炰綋ID + * @return 褰卞搷璁板綍鏁伴噺 + */ + @Transactional + public int delete(Long id){ + return this.dao.deleteLogicById(id) ; + } +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilCtrl.java new file mode 100644 index 0000000..7386c4f --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilCtrl.java @@ -0,0 +1,171 @@ +package com.dy.pipIrrProject.mqtt.soil; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoPr.PrStSoil; +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 jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import java.util.Objects; + +/** + * @Author: liurunyu + * @Date: 2025/6/19 10:41 + * @Description + */ +@Slf4j +@Tag(name = "澧掓儏绔欑鐞�", description = "澧掓儏绔欑鐞�") +@RestController +@RequestMapping(path = "soilStation") +@RequiredArgsConstructor +public class SoilCtrl { + private SoilSv sv; + + @Autowired + private void setSv(SoilSv sv){ + this.sv = sv ; + } + + + /** + * 寰楀埌涓�濂楀鎯呯珯鏁版嵁 + * @return 涓�濂楀鎯呯珯鏁版嵁 + */ + @Operation(summary = "涓�濂楀鎯呯珯", description = "寰楀埌涓�濂楀鎯呯珯鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�濂楀鎯呯珯鏁版嵁锛圔aseResponse.content:{}锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = PrStSoil.class))} + ) + }) + @GetMapping(path = "one") + @SsoAop() + public BaseResponse<PrStSoil> one(Long id){ + return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); + } + + /** + * 淇濆瓨澧掓儏绔� + * @param dto 淇濆瓨澧掓儏绔檉orm琛ㄥ崟瀵硅薄 + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "淇濆瓨澧掓儏绔�", description = "鎻愪氦澧掓儏绔欐暟鎹紙form琛ㄥ崟锛夛紝杩涜淇濆瓨") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) + @SsoAop() + public BaseResponse<Boolean> save(@RequestBody @Valid SoilDto dto, BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + PrStSoil po = dto.toNewPo() ; + po.deleted = 0 ; + int count; + try { + count = this.sv.save(po); + } catch (Exception e) { + log.error("淇濆瓨澧掓儏绔欏紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + + /** + * 缂栬緫淇敼澧掓儏绔� + * @param dto 淇濆瓨澧掓儏绔檉orm琛ㄥ崟瀵硅薄 + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "缂栬緫淇敼澧掓儏绔�", description = "鎻愪氦澧掓儏绔欐暟鎹紙form琛ㄥ崟锛夛紝杩涜淇敼") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) + @SsoAop() + public BaseResponse<Boolean> update(@RequestBody @Valid SoilDto dto, BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + PrStSoil po = dto.toPo() ; + if(po.id == null){ + return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D") ; + } + int count; + try { + count = this.sv.update(po); + } catch (Exception e) { + log.error("淇濆瓨澧掓儏绔欏紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + + + /** + * 鍒犻櫎澧掓儏绔� + * @param id 澧掓儏绔橧D + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "鍒犻櫎澧掓儏绔�", description = "鎻愪氦澧掓儏绔橧D锛岃繘琛岄�昏緫鍒犻櫎") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "delete") + @SsoAop() + public BaseResponse<Boolean> delete(Long id){ + if(id == null){ + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + } + int count; + try { + count = this.sv.delete(id); + } catch (Exception e) { + log.error("淇濆瓨澧掓儏绔欏紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java new file mode 100644 index 0000000..83e5511 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilDto.java @@ -0,0 +1,65 @@ +package com.dy.pipIrrProject.mqtt.soil; + +import com.dy.pipIrrGlobal.pojoPr.PrStSoil; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 14:52 + * @Description + */ +@Data +@Schema(name = "澧掓儏绔�") +public class SoilDto { + public static final long serialVersionUID = 202506191032001L; + /** + * 涓婚敭 + */ + public String id; + + /** + * 澧掓儏绔欏悕绉� + */ + @NotEmpty(message = "澧掓儏绔欏悕绉颁笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public String name; + /** + * 澧掓儏绔欑紪鍙� + */ + @NotNull(message = "澧掓儏绔欑紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Integer no; + + + /** + * 缁忓害 + */ + public Double lng; + + /** + * 绾害 + */ + public Double lat; + + /** + * 澶囨敞 + */ + public String remark; + + public PrStSoil toNewPo(){ + PrStSoil po = new PrStSoil(); + po.name = this.name; + po.no = this.no; + po.lng = this.lng; + po.lat = this.lat; + po.remark = this.remark; + return po; + } + public PrStSoil toPo(){ + PrStSoil po = this.toNewPo(); + po.id = Long.parseLong(this.id) ; + return po; + } +} + diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilSv.java new file mode 100644 index 0000000..e0303c6 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/soil/SoilSv.java @@ -0,0 +1,67 @@ +package com.dy.pipIrrProject.mqtt.soil; + +import com.dy.pipIrrGlobal.daoPr.PrStSoilMapper; +import com.dy.pipIrrGlobal.pojoPr.PrStSoil; +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 15:14 + * @Description + */ +@Slf4j +@Service +public class SoilSv { + + @Autowired + private PrStSoilMapper dao; + + public List<VoMqttSimple> allSimple(){ + return this.dao.selectAllSimple() ; + } + + + /** + * 寰楀埌涓�涓疄浣� + * @param id 瀹炰綋ID + * @return 瀹炰綋 + */ + public PrStSoil selectById(Long id){ + return this.dao.selectById(id) ; + } + /** + * 淇濆瓨锛堟坊鍔狅級瑙嗛鐩戞帶鐐� + * @param po + * @return + */ + @Transactional + Integer save(PrStSoil po) { + return dao.insert(po); + } + + /** + * 淇敼瀹炰綋 + * @param po 瀹炰綋 + * @return 鏁伴噺 + */ + @Transactional + public int update(PrStSoil po) { + return this.dao.updateByPrimaryKeySelective(po); + } + + /** + * 淇濆瓨淇敼瀹炰綋 + * @param id 瀹炰綋ID + * @return 褰卞搷璁板綍鏁伴噺 + */ + @Transactional + public int delete(Long id){ + return this.dao.deleteLogicById(id) ; + } +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java new file mode 100644 index 0000000..f40de60 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java @@ -0,0 +1,171 @@ +package com.dy.pipIrrProject.mqtt.weather; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoPr.PrStWeather; +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 jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import java.util.Objects; + +/** + * @Author: liurunyu + * @Date: 2025/6/19 10:41 + * @Description + */ +@Slf4j +@Tag(name = "姘旇薄绔欑鐞�", description = "姘旇薄绔欑鐞�") +@RestController +@RequestMapping(path = "weatherStation") +@RequiredArgsConstructor +public class WeatherCtrl { + private WeatherSv sv; + + @Autowired + private void setSv(WeatherSv sv){ + this.sv = sv ; + } + + + /** + * 寰楀埌涓�濂楁皵璞$珯鏁版嵁 + * @return 涓�濂楁皵璞$珯鏁版嵁 + */ + @Operation(summary = "涓�濂楁皵璞$珯", description = "寰楀埌涓�濂楁皵璞$珯鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�濂楁皵璞$珯鏁版嵁锛圔aseResponse.content:{}锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = PrStWeather.class))} + ) + }) + @GetMapping(path = "one") + @SsoAop() + public BaseResponse<PrStWeather> one(Long id){ + return BaseResponseUtils.buildSuccess(this.sv.selectById(id)); + } + + /** + * 淇濆瓨姘旇薄绔� + * @param dto 淇濆瓨姘旇薄绔檉orm琛ㄥ崟瀵硅薄 + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "淇濆瓨姘旇薄绔�", description = "鎻愪氦姘旇薄绔欐暟鎹紙form琛ㄥ崟锛夛紝杩涜淇濆瓨") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) + @SsoAop() + public BaseResponse<Boolean> save(@RequestBody @Valid WeatherDto dto, BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + PrStWeather po = dto.toNewPo() ; + po.deleted = 0 ; + int count; + try { + count = this.sv.save(po); + } catch (Exception e) { + log.error("淇濆瓨姘旇薄绔欏紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + + /** + * 缂栬緫淇敼姘旇薄绔� + * @param dto 淇濆瓨姘旇薄绔檉orm琛ㄥ崟瀵硅薄 + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "缂栬緫淇敼姘旇薄绔�", description = "鎻愪氦姘旇薄绔欐暟鎹紙form琛ㄥ崟锛夛紝杩涜淇敼") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) + @SsoAop() + public BaseResponse<Boolean> update(@RequestBody @Valid WeatherDto dto, BindingResult bindingResult){ + if(bindingResult != null && bindingResult.hasErrors()){ + return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); + } + PrStWeather po = dto.toPo() ; + if(po.id == null){ + return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D") ; + } + int count; + try { + count = this.sv.update(po); + } catch (Exception e) { + log.error("淇濆瓨姘旇薄绔欏紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + + + /** + * 鍒犻櫎姘旇薄绔� + * @param id 姘旇薄绔橧D + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "鍒犻櫎姘旇薄绔�", description = "鎻愪氦姘旇薄绔橧D锛岃繘琛岄�昏緫鍒犻櫎") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "delete") + @SsoAop() + public BaseResponse<Boolean> delete(Long id){ + if(id == null){ + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + } + int count; + try { + count = this.sv.delete(id); + } catch (Exception e) { + log.error("淇濆瓨姘旇薄绔欏紓甯�", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + if(count <= 0){ + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; + }else{ + return BaseResponseUtils.buildSuccess(true) ; + } + } + +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java new file mode 100644 index 0000000..9a142f2 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherDto.java @@ -0,0 +1,65 @@ +package com.dy.pipIrrProject.mqtt.weather; + +import com.dy.pipIrrGlobal.pojoPr.PrStWeather; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.Data; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 14:52 + * @Description + */ +@Data +@Schema(name = "姘旇薄绔�") +public class WeatherDto { + public static final long serialVersionUID = 202506191038001L; + /** + * 涓婚敭 + */ + public String id; + + /** + * 姘旇薄绔欏悕绉� + */ + @NotEmpty(message = "姘旇薄绔欏悕绉颁笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public String name; + /** + * 姘旇薄绔欑紪鍙� + */ + @NotNull(message = "姘旇薄绔欑紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Integer no; + + + /** + * 缁忓害 + */ + public Double lng; + + /** + * 绾害 + */ + public Double lat; + + /** + * 澶囨敞 + */ + public String remark; + + public PrStWeather toNewPo(){ + PrStWeather po = new PrStWeather(); + po.name = this.name; + po.no = this.no; + po.lng = this.lng; + po.lat = this.lat; + po.remark = this.remark; + return po; + } + public PrStWeather toPo(){ + PrStWeather po = this.toNewPo(); + po.id = Long.parseLong(this.id) ; + return po; + } +} + diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java new file mode 100644 index 0000000..6b93d7e --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherSv.java @@ -0,0 +1,67 @@ +package com.dy.pipIrrProject.mqtt.weather; + +import com.dy.pipIrrGlobal.daoPr.PrStWeatherMapper; +import com.dy.pipIrrGlobal.pojoPr.PrStWeather; +import com.dy.pipIrrGlobal.voPr.VoMqttSimple; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Author: liurunyu + * @Date: 2025/6/18 15:15 + * @Description + */ +@Slf4j +@Service +public class WeatherSv { + + @Autowired + private PrStWeatherMapper dao; + + public List<VoMqttSimple> allSimple(){ + return this.dao.selectAllSimple() ; + } + + + /** + * 寰楀埌涓�涓疄浣� + * @param id 瀹炰綋ID + * @return 瀹炰綋 + */ + public PrStWeather selectById(Long id){ + return this.dao.selectById(id) ; + } + /** + * 淇濆瓨锛堟坊鍔狅級瑙嗛鐩戞帶鐐� + * @param po + * @return + */ + @Transactional + Integer save(PrStWeather po) { + return dao.insert(po); + } + + /** + * 淇敼瀹炰綋 + * @param po 瀹炰綋 + * @return 鏁伴噺 + */ + @Transactional + public int update(PrStWeather po) { + return this.dao.updateByPrimaryKeySelective(po); + } + + /** + * 淇濆瓨淇敼瀹炰綋 + * @param id 瀹炰綋ID + * @return 褰卞搷璁板綍鏁伴噺 + */ + @Transactional + public int delete(Long id){ + return this.dao.deleteLogicById(id) ; + } +} diff --git "a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/\350\257\264\346\230\216.txt" "b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/\350\257\264\346\230\216.txt" new file mode 100644 index 0000000..d0f1e72 --- /dev/null +++ "b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/\350\257\264\346\230\216.txt" @@ -0,0 +1 @@ +鍩轰簬MQTT鍗忚鐨勬按鑲ユ満銆佹皵璞°�佸鎯呯珯 \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdDto.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdDto.java new file mode 100644 index 0000000..8d9b6f1 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdDto.java @@ -0,0 +1,16 @@ +package com.dy.pipIrrRemote.monitor.mqttSd1.fault; + +import com.dy.pipIrrRemote.common.dto.DtoBase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author: liurunyu + * @Date: 2025/6/16 17:36 + * @Description + */ +@Data +@EqualsAndHashCode(callSuper=true) +public class CdDto extends DtoBase { + public static final long serialVersionUID = 202506161739001L; +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdParam.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdParam.java new file mode 100644 index 0000000..6fde608 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdParam.java @@ -0,0 +1,9 @@ +package com.dy.pipIrrRemote.monitor.mqttSd1.fault; + +/** + * @Author: liurunyu + * @Date: 2025/6/16 17:36 + * @Description + */ +public class CdParam { +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStartCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStartCtrl.java new file mode 100644 index 0000000..1a182a9 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStartCtrl.java @@ -0,0 +1,45 @@ +package com.dy.pipIrrRemote.monitor.mqttSd1.fault; + +import com.alibaba.fastjson2.JSONObject; +import com.dy.common.util.Callback; +import com.dy.pipIrrRemote.common.dto.DtoBase; +import com.dy.pipIrrRemote.monitor.common.ComCtrl; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author: liurunyu + * @Date: 2025/6/16 17:35 + * @Description + */ + +@Slf4j +@Tag(name = "杩滅▼鍛戒护", description = "娓呴櫎鏁呴殰") +@RestController("mqttSd1FaultStartCtrl") +@RequestMapping(path = "mqttSd1/faultStartCtrl") +@RequiredArgsConstructor +@Scope("prototype") //鍥犱负鏈夊璞$被灞炴�э紝鎵�浠ラ噰鐢ㄥ師鍨嬫ā寮忥紝姣忔璇锋眰鏂板缓涓�涓疄渚嬪璞� +public class CdStartCtrl extends ComCtrl { + + private static final String RtuSuccessMsg = "鎺у埗鍣ㄦ帴鏀跺苟鎵ц鍛戒护鎴愬姛锛屾棤杩斿洖鏁版嵁"; + + private static final String ComCode = "5B" ; + + @Autowired + private CdSv sv ; + + @Override + protected String checkDto(DtoBase dto) { + return null; + } + + @Override + protected String dealComResult(String code, JSONObject resultData, Callback callback) { + return null; + } +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStopCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStopCtrl.java new file mode 100644 index 0000000..e8e4617 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdStopCtrl.java @@ -0,0 +1,9 @@ +package com.dy.pipIrrRemote.monitor.mqttSd1.fault; + +/** + * @Author: liurunyu + * @Date: 2025/6/16 17:35 + * @Description + */ +public class CdStopCtrl { +} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdSv.java new file mode 100644 index 0000000..e1a3f6d --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/monitor/mqttSd1/fault/CdSv.java @@ -0,0 +1,15 @@ +package com.dy.pipIrrRemote.monitor.mqttSd1.fault; + +import com.dy.pipIrrRemote.monitor.common.ComSv; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author: liurunyu + * @Date: 2025/6/16 17:36 + * @Description + */ +@Slf4j +@Service("faultSv") +public class CdSv extends ComSv { +} \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-terminal/src/main/java/com/dy/pipIrrTerminal/card/CardSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-terminal/src/main/java/com/dy/pipIrrTerminal/card/CardSv.java index bb6f4c4..8ef5072 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-terminal/src/main/java/com/dy/pipIrrTerminal/card/CardSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-terminal/src/main/java/com/dy/pipIrrTerminal/card/CardSv.java @@ -603,6 +603,7 @@ voTermRecharge.setProjectNo(projectNo); voTermRecharge.setCardNum(po.getCardNum()); voTermRecharge.setOrderNo(orderNo); + voTermRecharge.setBalance(afterRecharge); map.put("success", true); map.put("msg", "鎿嶄綔鎴愬姛"); diff --git "a/pipIrr-platform/\346\226\207\346\241\243/\346\260\264\350\202\245\346\260\224\350\261\241\345\242\222\346\203\205/\346\260\264\350\202\245\347\253\231\343\200\201\346\260\224\350\261\241\347\253\231\343\200\201\345\242\222\346\203\205\347\253\231\345\215\217\350\256\256.docx" "b/pipIrr-platform/\346\226\207\346\241\243/\346\260\264\350\202\245\346\260\224\350\261\241\345\242\222\346\203\205/\346\260\264\350\202\245\347\253\231\343\200\201\346\260\224\350\261\241\347\253\231\343\200\201\345\242\222\346\203\205\347\253\231\345\215\217\350\256\256.docx" new file mode 100644 index 0000000..10fb1cb --- /dev/null +++ "b/pipIrr-platform/\346\226\207\346\241\243/\346\260\264\350\202\245\346\260\224\350\261\241\345\242\222\346\203\205/\346\260\264\350\202\245\347\253\231\343\200\201\346\260\224\350\261\241\347\253\231\343\200\201\345\242\222\346\203\205\347\253\231\345\215\217\350\256\256.docx" Binary files differ -- Gitblit v1.8.0