Commit beb15419 authored by KeYong's avatar KeYong

修改裝備數據監聽topic

parent 09200d23
...@@ -109,19 +109,20 @@ public class EquipmentIotMqttReceiveConfig { ...@@ -109,19 +109,20 @@ public class EquipmentIotMqttReceiveConfig {
iSyncDataService.saveOrUpdateEquipIotCodeRedisData(equipAndCars); iSyncDataService.saveOrUpdateEquipIotCodeRedisData(equipAndCars);
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
if (equipAndCars.size() > 0) { if (equipAndCars.size() > 0) {
for (EquipmentSpecificVo specificVo : equipAndCars) { // for (EquipmentSpecificVo specificVo : equipAndCars) {
String iotCode = specificVo.getIotCode(); // String iotCode = specificVo.getIotCode();
if (iotCode.length() > 8) { // if (iotCode.length() > 8) {
String prefix = iotCode.substring(0, 8); // String prefix = iotCode.substring(0, 8);
String suffix = iotCode.substring(8); // String suffix = iotCode.substring(8);
String topicTotal = String.format("%s/%s/property", prefix, suffix); // String topicTotal = String.format("%s/%s/property", prefix, suffix);
list.add(topicTotal); // list.add(topicTotal);
} // }
} // }
} else { } else {
list.add(defaultTopic); list.add(defaultTopic);
} }
list.addAll(ConfigPageTopicEnum.getEnumTopicList()); //大屏数据推送接口订阅 list.addAll(ConfigPageTopicEnum.getEnumTopicList()); //大屏数据推送接口订阅
list.add("+/+/property"); // 添加iot車輛裝備數據上報事件监听
list.add("+/+/event"); // 添加iot事件监听 list.add("+/+/event"); // 添加iot事件监听
String[] arr = list.toArray(new String[list.size()]); String[] arr = list.toArray(new String[list.size()]);
adapter = new MqttPahoMessageDrivenChannelAdapter(clientId + "_inbound", mqttPahoClientFactory(), arr); adapter = new MqttPahoMessageDrivenChannelAdapter(clientId + "_inbound", mqttPahoClientFactory(), arr);
......
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