Commit d6b1a065 authored by caotao's avatar caotao

移除请求influxdb数据得

parent 28739e6f
...@@ -557,7 +557,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -557,7 +557,7 @@ public class MonitorFanIdxController extends BaseController {
Map<String, String> map = monitorFanIndicatorMapper.getMajorBoosterStationInfoBySort(gatewayId, equipName); Map<String, String> map = monitorFanIndicatorMapper.getMajorBoosterStationInfoBySort(gatewayId, equipName);
String name = map.get("text").equals("1主变高压侧") || map.get("text").equals("1主变低压侧") ? map.get("text").substring(0, 3) : map.get("text"); String name = map.get("text").equals("1主变高压侧") || map.get("text").equals("1主变低压侧") ? map.get("text").substring(0, 3) : map.get("text");
String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE (equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机 or 'equipmentIndexName ='停机' or equipmentIndexName ='停机') and value = 'true'"; // String sql = " SELECT * FROM indicators_" + gatewayId + " WHERE (equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机 or 'equipmentIndexName ='停机' or equipmentIndexName ='停机') and value = 'true'";
Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(gatewayId, name); Map<String, Object> switchUrl = monitorFanIndicatorImpl.getSwitchUrl(gatewayId, name);
List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, "网络", name, null); List<Map<String, Object>> statusMonitoring = monitorFanIndicator.getStatusGzp(gatewayId, "网络", name, null);
......
...@@ -439,44 +439,44 @@ public class MonitoringServiceIMQTTmpl { ...@@ -439,44 +439,44 @@ public class MonitoringServiceIMQTTmpl {
@Scheduled(cron = "0 0/1 * * * *") @Scheduled(cron = "0 0/1 * * * *")
public void getIndicatorsSwitchInfo() { public void getIndicatorsSwitchInfo() {
Integer current = 1; // Integer current = 1;
Integer size = 99; // Integer size = 99;
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("booster_gateway_id").eq("station_type", "FDZ")); // List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("booster_gateway_id").eq("station_type", "FDZ"));
stationBasicList.forEach(stationBasic -> { // stationBasicList.forEach(stationBasic -> {
//获取系统的forntmodule 前期每次都查询 后续应该放到缓存中 // //获取系统的forntmodule 前期每次都查询 后续应该放到缓存中
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(stationBasic.getBoosterGatewayId()); // List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getBoosterStationInfo(stationBasic.getBoosterGatewayId());
for (int i = 0; i < boosterStationInfo.size(); i++) { // for (int i = 0; i < boosterStationInfo.size(); i++) {
Map<String, String> map = boosterStationInfo.get(i); // Map<String, String> map = boosterStationInfo.get(i);
sendIndicatorSwitch(stationBasic.getSequenceNbr().toString(), stationBasic.getBoosterGatewayId(), map.get("boosterName")); // sendIndicatorSwitch(stationBasic.getSequenceNbr().toString(), stationBasic.getBoosterGatewayId(), map.get("boosterName"));
} // }
}); // });
} }
public void sendIndicatorSwitch(String stationId, String bootStationGateWayId, String frontMoudule) { // public void sendIndicatorSwitch(String stationId, String bootStationGateWayId, String frontMoudule) {
String sql = "SELECT * FROM indicators_" + bootStationGateWayId + " where frontModule = '" + frontMoudule + "' and systemType='开关'"; // String sql = "SELECT * FROM indicators_" + bootStationGateWayId + " where frontModule = '" + frontMoudule + "' and systemType='开关'";
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql, IndicatorsDto.class); // List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql, IndicatorsDto.class);
//过滤掉包含数字的开关 // //过滤掉包含数字的开关
List<IndicatorsDto> result = indicatorsDtoList.stream().filter(indicatorsDto -> !indicatorsDto.getDisplayName().matches(".*\\d+.*")).collect(Collectors.toList()); // List<IndicatorsDto> result = indicatorsDtoList.stream().filter(indicatorsDto -> !indicatorsDto.getDisplayName().matches(".*\\d+.*")).collect(Collectors.toList());
HashMap<String, String> hashMap = new HashMap<>(); // HashMap<String, String> hashMap = new HashMap<>();
for (int i = 0; i < result.size(); i++) { // for (int i = 0; i < result.size(); i++) {
IndicatorsDto indicatorsDto = result.get(i); // IndicatorsDto indicatorsDto = result.get(i);
//此处需要根据查询的结果来动态的给定图片的url路径。 // //此处需要根据查询的结果来动态的给定图片的url路径。
hashMap.put("url" + i, "tetee"); // hashMap.put("url" + i, "tetee");
hashMap.put("display" + i, indicatorsDto.getDisplayName()); // hashMap.put("display" + i, indicatorsDto.getDisplayName());
} // }
Page<HashMap<String, String>> hashMapPage = new Page<>(); // Page<HashMap<String, String>> hashMapPage = new Page<>();
List<HashMap<String, String>> list = new ArrayList<>(); // List<HashMap<String, String>> list = new ArrayList<>();
list.add(hashMap); // list.add(hashMap);
hashMapPage.setRecords(list); // hashMapPage.setRecords(list);
hashMapPage.setTotal(list.size()); // hashMapPage.setTotal(list.size());
hashMapPage.setCurrent(1); // hashMapPage.setCurrent(1);
System.out.println(result.size()); // System.out.println(result.size());
try { // try {
emqKeeper.getMqttClient().publish(stationId + bootStationGateWayId + "_topic", JSON.toJSON(hashMapPage).toString().getBytes("UTF-8"), 1, true); // emqKeeper.getMqttClient().publish(stationId + bootStationGateWayId + "_topic", JSON.toJSON(hashMapPage).toString().getBytes("UTF-8"), 1, true);
logger.info(JSON.toJSONString(hashMapPage)); // logger.info(JSON.toJSONString(hashMapPage));
logger.info("-----------------发送升压站数据成功=================== 成功!"); // logger.info("-----------------发送升压站数据成功=================== 成功!");
} catch (Exception e) { // } catch (Exception e) {
logger.info("-----------------发送升压站数据成功=================== 成功!"); // logger.info("-----------------发送升压站数据成功=================== 成功!");
} // }
} // }
} }
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