Commit 2bd4b812 authored by zhangsen's avatar zhangsen

向iot推送消息配置代码

parent ca8eb07d
...@@ -151,6 +151,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -151,6 +151,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${isSendApp}") @Value("${isSendApp}")
private Boolean isSendApp; private Boolean isSendApp;
@Value("${isSendIot:false}")
private Boolean isSendIot;
private static Boolean bool = Boolean.FALSE; private static Boolean bool = Boolean.FALSE;
@Override @Override
...@@ -171,6 +174,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -171,6 +174,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (eqIotCodeList.size() > 1) { if (eqIotCodeList.size() > 1) {
log.info("有重复的{}数据!", iotCode); log.info("有重复的{}数据!", iotCode);
} }
//给 iot服务 推送消息 插数据到 influxdb
if (isSendIot) {
mqttSendGateway.sendToMqtt("influxdb/" + topic.substring(0, endIndex), message);
}
EquipmentSpecificVo vo = eqIotCodeList.get(0); EquipmentSpecificVo vo = eqIotCodeList.get(0);
topicEntity.setType(vo.getType()); topicEntity.setType(vo.getType());
topicEntity.setCode(vo.getCode()); topicEntity.setCode(vo.getCode());
......
...@@ -93,4 +93,6 @@ equipment.plan.pump=92010600,92030600,92130400,92140200,92150300 ...@@ -93,4 +93,6 @@ equipment.plan.pump=92010600,92030600,92130400,92140200,92150300
#iot.code.prefix.have.used=20210003,20210004,20210005 #iot.code.prefix.have.used=20210003,20210004,20210005
# 电力使用 # 电力使用
iot.code.prefix.have.used= iot.code.prefix.have.used=
#是否向iot推送消息
isSendIot=false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment