Commit f5485362 authored by KeYong's avatar KeYong

更新消息发送

parent 3a830e74
...@@ -1468,7 +1468,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1468,7 +1468,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
topicEntityVo.setTopic("equip/risk/trigger"); topicEntityVo.setTopic("equip/risk/trigger");
detailVo.setEquipInfo(equipInfoVo); detailVo.setEquipInfo(equipInfoVo);
detailVo.setAlarmInfo(alarmInfoVo); detailVo.setAlarmInfo(alarmInfoVo);
// topicEntityVo.setMessage(JSON.toJSONString(detailVo));
topicEntityVo.setData(JSON.toJSONString(detailVo)); topicEntityVo.setData(JSON.toJSONString(detailVo));
mqttSendGateway.sendToMqtt(riskTopicCreate, JSON.toJSONString(topicEntityVo)); mqttSendGateway.sendToMqtt(riskTopicCreate, JSON.toJSONString(topicEntityVo));
}); });
......
...@@ -105,6 +105,9 @@ public class CheckController extends AbstractBaseController { ...@@ -105,6 +105,9 @@ public class CheckController extends AbstractBaseController {
@Value("${patrol.message.create.topic}") @Value("${patrol.message.create.topic}")
private String patrolRiskCreateTopic; private String patrolRiskCreateTopic;
@Value("${patrol.center.risk.topic}")
private String riskTopic;
@Autowired @Autowired
private CheckMapper checkMapper; private CheckMapper checkMapper;
...@@ -288,10 +291,10 @@ public class CheckController extends AbstractBaseController { ...@@ -288,10 +291,10 @@ public class CheckController extends AbstractBaseController {
alarmInfoVo.setValue(String.valueOf(map.get("input_value"))); alarmInfoVo.setValue(String.valueOf(map.get("input_value")));
TopicEntityVo topicEntityVo = new TopicEntityVo(); TopicEntityVo topicEntityVo = new TopicEntityVo();
topicEntityVo.setTopic(patrolRiskCreateTopic); topicEntityVo.setTopic(riskTopic);
detailVo.setEquipInfo(equipInfoVo); detailVo.setEquipInfo(equipInfoVo);
detailVo.setAlarmInfo(alarmInfoVo); detailVo.setAlarmInfo(alarmInfoVo);
topicEntityVo.setMessage(JSON.toJSONString(detailVo)); topicEntityVo.setData(JSON.toJSONString(detailVo));
try { try {
webMqttComponent.publish(patrolRiskCreateTopic, JSON.toJSONString(topicEntityVo)); webMqttComponent.publish(patrolRiskCreateTopic, JSON.toJSONString(topicEntityVo));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -21,6 +21,8 @@ public class TopicEntityVo { ...@@ -21,6 +21,8 @@ public class TopicEntityVo {
private String message; private String message;
private String data;
private String type; private String type;
// 若是车辆返回车牌号 // 若是车辆返回车牌号
......
...@@ -53,6 +53,8 @@ patrol.point.classify.topic=patrol/point/classify ...@@ -53,6 +53,8 @@ patrol.point.classify.topic=patrol/point/classify
patrol.topic=patrol/# patrol.topic=patrol/#
# \u7AD9\u7AEFmessage\u76D1\u542C\u4E3B\u9898 # \u7AD9\u7AEFmessage\u76D1\u542C\u4E3B\u9898
patrol.message.create.topic=emq.risk.created patrol.message.create.topic=emq.risk.created
# \u4E2D\u5FC3\u7EA7\u76D1\u542C\u4E3B\u9898
patrol.center.risk.topic=patrol/risk/trigger
#\u505C\u6B62\u901A\u8FC7WEB\u516C\u5F00\u6240\u6709\u7AEF\u70B9 #\u505C\u6B62\u901A\u8FC7WEB\u516C\u5F00\u6240\u6709\u7AEF\u70B9
#management.endpoints.web.exposure.exclude=* #management.endpoints.web.exposure.exclude=*
## redis\u5931\u6548\u65F6\u95F4 ## redis\u5931\u6548\u65F6\u95F4
......
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