Merge remote-tracking branch 'origin/master'
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | 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("æ¥æ¶çmqttæ¶æ¯ä¸»é¢ä¸å¯è¯å«") ; |
| | | }else{ |
| | | if(NumUtil.isPlusIntNumber(topicGrp[4])){ |
| | | throw new Exception("æ¥æ¶çmqttæ¶æ¯ä¸»é¢ä¸å¯è¯å«") ; |
| | | } |
| | | if(Integer.parseInt(topicGrp[4]) <= 0){ |
| | | throw new Exception("æ¥æ¶çmqttæ¶æ¯ä¸»é¢ä¸å¯è¯å«") ; |
| | | } |
| | | 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{ |
| | |
| | | } |
| | | |
| | | 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 { |
| | |
| | | public String orgTag ;//ç»ç»æ è¯ |
| | | public String protocol ;//åè®®åç§° |
| | | public String devId ;//设å¤ï¼FBoxï¼ID |
| | | 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; |
| | | } |
| | | } |
| | |
| | | * @Description |
| | | */ |
| | | public interface Vo4Up { |
| | | |
| | | public void setNo(Integer no) ; |
| | | |
| | | String toString() ; |
| | | } |
| | |
| | | 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; |
| | |
| | | break; |
| | | } |
| | | default -> { |
| | | throw new Exception("æ¥æ¶å°MQTTæ¶æ¯ï¼åè®®" + subTopic.protocol + "ï¼è®¾å¤ID" + subTopic.devId + "ï¼ä¸»é¢" + subTopic.name + "æ¶æ¯è§£æé»è¾æªå®ç°"); |
| | | throw new Exception("æ¥æ¶å°MQTTæ¶æ¯ï¼åè®®" + subTopic.protocol + "ï¼è®¾å¤ID" + subTopic.devId + "ï¼ä¸»é¢" + subTopic.type + "æ¶æ¯è§£æé»è¾æªå®ç°"); |
| | | } |
| | | } |
| | | vo.setNo(subTopic.no) ; |
| | | msg.vo4Up = vo ; |
| | | callback.callback(msg); |
| | | callback.notify(msg.deviceId, stInfo); |
| | |
| | | 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 ; |
| | | } |
| | |
| | | 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 ; |
| | | } |
| | |
| | | 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 ; |
| | | } |
| | |
| | | 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 ; |
| | | } |
| | |
| | | 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 ; |
| | | } |
| | |
| | | * @Description |
| | | */ |
| | | public class ComCtrlVo { |
| | | |
| | | public Integer no ;//设å¤ç¼å· |
| | | |
| | | //å¯åå¨ä½ï¼trueæ¯ï¼falseå¦ |
| | | //å¯ä»¥æ§è¡åè½ç 00ï¼01ï¼02ï¼03çå¨ä½ |
| | | public boolean startTrueStopFalse;// |
| | |
| | | package com.dy.common.mw.protocol4Mqtt.pSdV1.comParam; |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class ComSetParamVo { |
| | | //设å¤ç¼å· |
| | | public Integer no ; |
| | | |
| | | // æ
æè®¾å®æ¶é´ |
| | | public Integer stirDuration ; |
| | | |
| | |
| | | @JSONField(name = "flexem_message_id") |
| | | public Integer messageId ;//æ¶æ¯ID |
| | | |
| | | public Integer no ;//æµç«ç¼å·ï¼å
¶ä¸å¨JSONæ°æ®ä¸ï¼å
¶ä¸ä¸»é¢ä¸ |
| | | |
| | | @JSONField(name = "è¥ææµé") |
| | | public Float manureFlow ;//è¥ææµé |
| | | |
| | |
| | | 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)) ; |
| | |
| | | sb.append("\n") ; |
| | | return sb.toString() ; |
| | | } |
| | | |
| | | } |
| | |
| | | @JSONField(name = "flexem_message_id") |
| | | public Integer messageId ;//æ¶æ¯ID |
| | | |
| | | public Integer no ;//æµç«ç¼å·ï¼å
¶ä¸å¨JSONæ°æ®ä¸ï¼å
¶ä¸ä¸»é¢ä¸ |
| | | |
| | | @JSONField(name = "å壤湿度1") |
| | | public Float soilHumidity1 ;//å壤湿度1 |
| | | |
| | |
| | | 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)) ; |
| | |
| | | @JSONField(name = "flexem_message_id") |
| | | public Integer messageId ;//æ¶æ¯ID |
| | | |
| | | public Integer no ;//æµç«ç¼å·ï¼å
¶ä¸å¨JSONæ°æ®ä¸ï¼å
¶ä¸ä¸»é¢ä¸ |
| | | |
| | | @JSONField(name = "æ
æè¿è¡") |
| | | public Byte stirRunning ;//æ
æè¿è¡ |
| | | |
| | |
| | | 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)) ; |
| | |
| | | @JSONField(name = "flexem_message_id") |
| | | public Integer messageId ;//æ¶æ¯ID |
| | | |
| | | public Integer no ;//æµç«ç¼å·ï¼å
¶ä¸å¨JSONæ°æ®ä¸ï¼å
¶ä¸ä¸»é¢ä¸ |
| | | |
| | | @JSONField(name = "äºæ°§å碳") |
| | | public Integer carbonDioxide ;//äºæ°§å碳 |
| | | |
| | |
| | | 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)) ; |
New file |
| | |
| | | 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); |
| | | |
| | | int insert(PrStManure record); |
| | | |
| | | int insertSelective(PrStManure record); |
| | | |
| | | PrStManure selectByPrimaryKey(Long id); |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStManure record); |
| | | |
| | | int updateByPrimaryKey(PrStManure record); |
| | | } |
New file |
| | |
| | | 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); |
| | | |
| | | int insert(PrStSoil record); |
| | | |
| | | int insertSelective(PrStSoil record); |
| | | |
| | | PrStSoil selectByPrimaryKey(Long id); |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStSoil record); |
| | | |
| | | int updateByPrimaryKey(PrStSoil record); |
| | | } |
New file |
| | |
| | | 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); |
| | | |
| | | int insert(PrStWeather record); |
| | | |
| | | int insertSelective(PrStWeather record); |
| | | |
| | | PrStWeather selectByPrimaryKey(Long id); |
| | | |
| | | List<VoMqttSimple> selectAllSimple() ; |
| | | |
| | | int updateByPrimaryKeySelective(PrStWeather record); |
| | | |
| | | int updateByPrimaryKey(PrStWeather record); |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrGlobal.voPr; |
| | | |
| | | 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 { |
| | | public Long id ; |
| | | public String name ;//åç§° |
| | | public Integer no ;//ç¼å· |
| | | } |
New file |
| | |
| | | <?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> |
| | | <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> |
New file |
| | |
| | | <?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> |
| | | <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> |
New file |
| | |
| | | <?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> |
| | | <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> |
| | |
| | | # çå·ï¼ 60103 |
| | | # åå·ï¼ 60104 |
| | | # éå·ï¼ 60105 |
| | | tcp.port=60000 |
| | | tcp.port=60000ba_divide |
| | | |
| | | #RTUä¸è¡æ°æ®æå°é´éï¼å¤§äºè¿ä¸ªé´é认为设å¤ç¦»çº¿äºï¼æµæ§ä¸ä½éæ¯3ï¼è¡¨éä¸ä½æºæ¯6ï¼é»è®¤éç¨æ¶é´æé¿ç6 |
| | | base.upData.min.interval=6 |
| | |
| | | # MQTTæå¡é
ç½® |
| | | # mqtt.enable æ¯å¦å¯å¨ |
| | | # mqtt.protocolAndDeviceIds å¨åç³»ç»ï¼orgTagï¼ä¸æ¥å
¥ç设å¤(FBox)æç¨åè®®å设å¤idéå,å¤ä¸ªç¨éå·éå¼ï¼åè®®ä¸IDç¨æ£ææ éå¼ï¼ä¾å¦ï¼sd1/338220031439,sd1/338220031440 |
| | | # mqtt.subTopicAndQos 订é
主é¢ä¸Qosï¼ä¸»é¢åä¸å
¶Qosç¨éå·éå¼ï¼å¤ä¸ªä¸»é¢åQosç¨åå·éå¼ï¼ä¾å¦ï¼topic1,1;topic2,1;topic3,1 |
| | | # mqtt.subTopicAndQos 订é
主é¢ä¸Qosï¼ä¸»é¢åä¸å
¶Qosç¨éå·éå¼ï¼å¤ä¸ªä¸»é¢åQosç¨åå·éå¼ï¼ä¸»é¢åç±ç«ç±»ååç¼å·ç»æï¼å³ä¸ä¸ªFBoxå¯ä»¥æ¥å
¥å¤ä¸ªåç±»åçæµç«ï¼ç«ç¼å·ä»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 |
New file |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/18 14:51 |
| | | * @Description |
| | | */ |
| | | public class ManureCtrl { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/18 14:52 |
| | | * @Description |
| | | */ |
| | | public class ManureDto { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/18 14:52 |
| | | * @Description |
| | | */ |
| | | public class ManureQo { |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.manure; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrStManureMapper; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/18 14:53 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ManureSv { |
| | | |
| | | @Autowired |
| | | private PrStManureMapper dao; |
| | | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.soil; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrStSoilMapper; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/18 15:14 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SoilSv { |
| | | |
| | | @Autowired |
| | | private PrStSoilMapper dao; |
| | | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrProject.mqtt.weather; |
| | | |
| | | import com.dy.pipIrrGlobal.daoPr.PrStWeatherMapper; |
| | | import com.dy.pipIrrGlobal.voPr.VoMqttSimple; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/18 15:15 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class WeatherSv { |
| | | |
| | | @Autowired |
| | | private PrStWeatherMapper dao; |
| | | |
| | | public List<VoMqttSimple> allSimple(){ |
| | | return this.dao.selectAllSimple() ; |
| | | } |
| | | } |
New file |
| | |
| | | åºäºMQTTåè®®çæ°´è¥æºãæ°è±¡ã墿
ç« |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.mqttSd1.fault; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/16 17:36 |
| | | * @Description |
| | | */ |
| | | public class CdParam { |
| | | } |
New file |
| | |
| | | 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("p202404V201Cd5BCtrl") |
| | | @RequestMapping(path = "p202404V201/cd5B") |
| | | @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; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrRemote.monitor.mqttSd1.fault; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/6/16 17:35 |
| | | * @Description |
| | | */ |
| | | public class CdStopCtrl { |
| | | } |
New file |
| | |
| | | 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 { |
| | | } |