Commit 1f546c48 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 95c48e7d 238fc039
...@@ -868,9 +868,29 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -868,9 +868,29 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public void getAnalogQuantityInfo(String gatewayId, String stationId) { public void getAnalogQuantityInfo(String gatewayId, String stationId) {
if (StringUtils.isNotEmpty(gatewayId)) { if (StringUtils.isNotEmpty(gatewayId)) {
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(gatewayId); List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(gatewayId);
List<Map<String, String>> zbList = new ArrayList<>();
// 主变高压侧
Map<String, String> zbGYC = new HashMap<>();
for (Map<String, String> map : boosterStationInfo) { for (Map<String, String> map : boosterStationInfo) {
String sql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ ", gatewayId, "模拟量", map.get("boosterName")); String sql = String.format("SELECT equipmentIndexName, value, frontModule, unit, displayName FROM \"indicators_%s\" WHERE systemType = '%s' and frontModule =~/%s/ ", gatewayId, "模拟量", map.get("boosterName"));
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class); List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
if ("1主变高压侧".equals(map.get("boosterName"))) {
zbGYC = listData.stream().collect(Collectors.toMap(IndicatorsDto::getDisplayName, IndicatorsDto::getValue));
continue;
}
if ("1主变低压侧".equals(map.get("boosterName"))) {
listData.forEach(item -> {
HashMap<String, String> zbMap = new HashMap<>();
zbMap.put("title", item.getDisplayName());
zbMap.put("grade2", item.getValue());
if (StringUtils.isNotEmpty(item.getUnit())) {
zbMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
}
zbMap.put("titleYuanShi", item.getDisplayName());
zbList.add(zbMap);
});
continue;
}
ArrayList<Map<String, String>> resultList = new ArrayList<>(); ArrayList<Map<String, String>> resultList = new ArrayList<>();
listData.forEach(item -> { listData.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
...@@ -888,12 +908,25 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -888,12 +908,25 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
result.setTotal(resultList.size()); result.setTotal(resultList.size());
try { try {
log.info("消息内容:{}", JSON.toJSONString(result)); log.info("消息内容:{}", JSON.toJSONString(result));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, map.get("boosterCode"), "mnl"), JSON.toJSONString(result).getBytes(),0,false); emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, map.get("value"), "mnl"), JSON.toJSONString(result).getBytes(),2,false);
} catch (MqttException e) { } catch (MqttException e) {
log.info("消息发送失败"); log.info("消息发送失败");
e.printStackTrace(); e.printStackTrace();
} }
} }
Map<String, String> finalZbGYC = zbGYC;
zbList.forEach(item -> item.put("grade1", finalZbGYC.getOrDefault(item.get("titleYuanShi"), "0.0")));
IPage<Map<String, String>> zbResult = new Page<>();
zbResult.setRecords(zbList);
zbResult.setCurrent(1);
zbResult.setTotal(zbList.size());
try {
log.info("主变消息内容:{}", JSON.toJSONString(zbResult));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, 2, "mnl"), JSON.toJSONString(zbResult).getBytes(),2,false);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
}
} }
} }
...@@ -945,6 +978,21 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -945,6 +978,21 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
}); });
// 主线路图上各个路线名称
resultMap.put("xyx", "夏雩线");
resultMap.put("zbgy", "1主变高压侧");
resultMap.put("220mpt", "220kVⅠ母PT");
resultMap.put("jd1", "集电Ⅰ线");
resultMap.put("jd2", "集电Ⅱ线");
resultMap.put("jd3", "集电Ⅲ线");
resultMap.put("jd4", "集电Ⅳ线");
resultMap.put("zbdy", "1主变低压侧");
resultMap.put("dy1", "待用Ⅰ线");
resultMap.put("35mpt", "35kVⅠ母PT");
resultMap.put("1jdb", "1接地变");
resultMap.put("1svg", "1SVG");
resultMap.put("2svg", "2SVG");
//下方重复列表数据 //下方重复列表数据
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10); List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10);
ArrayList<Map<String, String>> resultList = new ArrayList<>(); ArrayList<Map<String, String>> resultList = new ArrayList<>();
......
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