Commit 1a5a48fb authored by caotao's avatar caotao

光伏集电线增加状态属性

parent 7e09deca
......@@ -2114,7 +2114,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
public HashMap<String,String> getPvNBQStationBy(String gatewayId){
HashMap<String,String> result =new HashMap<>();
String totalSql = "SELECT * FROM indicators_" + gatewayId + " WHERE frontModule = '逆变器' and equipmentIndexName = '运行'";
List<IndicatorsDto> totalEquipmentList = influxDButils.getListData(totalSql, IndicatorsDto.class);
totalEquipmentList.forEach(indicatorsDto -> result.put(indicatorsDto.getEquipmentNumber(),"正常运行"));
String sql = "SELECT * FROM indicators_" + gatewayId + " WHERE frontModule='逆变器' and value = 'true' and (equipmentIndexName ='运行' or equipmentIndexName ='待机' or equipmentIndexName ='故障停机' or equipmentIndexName ='告警运行' or equipmentIndexName ='限额运行' or equipmentIndexName ='停机' or equipmentIndexName = '通讯故障' or equipmentIndexName = '降额运行') ;";
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(sql, IndicatorsDto.class);
indicatorsDtoList.forEach(indicatorsDto -> result.put(indicatorsDto.getEquipmentNumber(),CommonConstans.pvStatus.get(indicatorsDto.getEquipmentIndexName())));
return result;
}
}
......@@ -271,27 +271,27 @@ public class MonitoringServiceIMQTTmpl {
/**
* 实时同送-获取各场站的风机列表
*/
@Scheduled(cron = fanStatusListCron)
public void getFanStatusList() {
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
stationBasicList.forEach(stationBasic -> {
List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusList(String.valueOf(stationBasic.getSequenceNbr()));
Page<IndexDto> page = new Page<>(1, 999);
List<IndexDto> collect = fanStatusList.stream()
.limit(999)
.collect(Collectors.toList());
page.setTotal(fanStatusList.size());
page.setRecords(collect);
IPage<HashMap<String, String>> fanStatusListImages = getFanStatusListImages(collect);
try {
emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_fanStationFanStatusList_topic", JSON.toJSON(page).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_fanStationFanStatusListImages_topic", JSON.toJSON(fanStatusListImages).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送风电站风机列表数据消息=================== 成功!" + JSON.toJSONString(page));
} catch (Exception exception) {
logger.error("-----------------发送风电站风机列表数据消息=================== 失败!");
}
});
}
// @Scheduled(cron = fanStatusListCron)
// public void getFanStatusList() {
// List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("sequence_nbr").eq("station_type", "FDZ"));
// stationBasicList.forEach(stationBasic -> {
// List<IndexDto> fanStatusList = monitorFanIndicator.getFanStatusList(String.valueOf(stationBasic.getSequenceNbr()));
// Page<IndexDto> page = new Page<>(1, 999);
// List<IndexDto> collect = fanStatusList.stream()
// .limit(999)
// .collect(Collectors.toList());
// page.setTotal(fanStatusList.size());
// page.setRecords(collect);
// IPage<HashMap<String, String>> fanStatusListImages = getFanStatusListImages(collect);
// try {
// emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_fanStationFanStatusList_topic", JSON.toJSON(page).toString().getBytes("UTF-8"), 1, true);
// emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_fanStationFanStatusListImages_topic", JSON.toJSON(fanStatusListImages).toString().getBytes("UTF-8"), 1, true);
// logger.info("-----------------发送风电站风机列表数据消息=================== 成功!" + JSON.toJSONString(page));
// } catch (Exception exception) {
// logger.error("-----------------发送风电站风机列表数据消息=================== 失败!");
// }
// });
// }
@Scheduled(cron = fanCurrentDataCron)
public void getFanCurrentData() {
......
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