Commit 187ef6d5 authored by caotao's avatar caotao

优化消息推送service

parent f5dd77b6
......@@ -283,76 +283,78 @@ public class MonitoringServiceIMQTTmpl {
@Scheduled(cron = "0 0/1 * * * *")
public void getFanCurrentData() {
Integer current = 1;
Integer size = 99;
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()));
fanStatusList.forEach(indexDto -> {
String stationBasicId = String.valueOf(stationBasic.getSequenceNbr());
String equipmentNumber = indexDto.getEquipmentNumber();
String topicPrefix = stationBasicId+"_"+equipmentNumber;
String topicPrefix = stationBasicId + "_" + equipmentNumber;
IndexDto info = monitorFanIndicator.getFanBasicInfoByEquipNum(equipmentNumber, stationBasicId);
HashMap<String,Object> windspeddInfo= new HashMap<>();
String windspeddInfoValue = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber,"实时监控表计","风速");
windspeddInfo.put("value",windspeddInfoValue);
windspeddInfo.put("value",100);
String activepower = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber,"实时监控表计","有功功率");
String powerFrequency = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber,"实时监控表计","电网频率");
String hubSpeed = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber,"实时监控表计","轮毂转速");
HashMap<String, List<String>> realTimeTemperatureResult = monitorFanIndicator.getRealTimeTemperature(equipmentNumber, stationBasicId,"实时监控表计");
IPage<IndexDto> realTimedata=monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber,stationBasicId,"实时运行数据",1,99,"");
Map<String, Object> windSpeedOfFan=monitorFanIndicator.getDetailsWindSpeed(stationBasic.getFanGatewayId(),equipmentNumber);
HashMap<String, Object> windspeddInfo = new HashMap<>();
String windspeddInfoValue = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber, "实时监控表计", "风速");
windspeddInfo.put("value", windspeddInfoValue);
windspeddInfo.put("value", 100);
String activepower = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber, "实时监控表计", "有功功率");
String powerFrequency = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber, "实时监控表计", "电网频率");
String hubSpeed = monitorFanIndicator.getFanDataByType(stationBasicId, equipmentNumber, "实时监控表计", "轮毂转速");
HashMap<String, List<String>> realTimeTemperatureResult = monitorFanIndicator.getRealTimeTemperature(equipmentNumber, stationBasicId, "实时监控表计");
IPage<IndexDto> realTimedata = monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, stationBasicId, "实时运行数据", current, size, "");
Map<String, Object> windSpeedOfFan = monitorFanIndicator.getDetailsWindSpeed(stationBasic.getFanGatewayId(), equipmentNumber);
//发电机系统
IPage<IndexDto> fdjSystem=monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber,stationBasicId,"实时运行数据",1,99,"发电机系统");
List<Map<String, Object>> fdjSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(),equipmentNumber,"发电机系统");
IPage<IndexDto> fdjSystem = monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, stationBasicId, "实时运行数据", current, size,"发电机系统");
List<Map<String, Object>> fdjSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(), equipmentNumber, "发电机系统");
//机舱与塔筒系统
IPage<IndexDto> jcyttSystem=monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber,stationBasicId,"实时运行数据",1,99,"机舱与塔筒系统");
List<Map<String, Object>> jcyttSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(),equipmentNumber,"机舱与塔筒系统");
IPage<IndexDto> jcyttSystem = monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, stationBasicId, "实时运行数据", current, size, "机舱与塔筒系统");
List<Map<String, Object>> jcyttSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(), equipmentNumber, "机舱与塔筒系统");
//偏航与液压系统
IPage<IndexDto> phyyySystem=monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber,stationBasicId,"实时运行数据",1,99,"偏航与液压系统");
List<Map<String, Object>> phyyySystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(),equipmentNumber,"偏航与液压系统");
IPage<IndexDto> phyyySystem = monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, stationBasicId, "实时运行数据", current, size, "偏航与液压系统");
List<Map<String, Object>> phyyySystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(), equipmentNumber, "偏航与液压系统");
//变流与主控系统
IPage<IndexDto> blyzkSystem=monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber,stationBasicId,"实时运行数据",1,99,"变流与主控系统");
List<Map<String, Object>> blyzkSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(),equipmentNumber,"变流与主控系统");
IPage<IndexDto> blyzkSystem = monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, stationBasicId, "实时运行数据", current, size, "变流与主控系统");
List<Map<String, Object>> blyzkSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(), equipmentNumber, "变流与主控系统");
//变流与主控系统
IPage<IndexDto> ylSystem=monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber,stationBasicId,"实时运行数据",1,99,"叶轮系统");
List<Map<String, Object>> ylSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(),equipmentNumber,"叶轮系统");
IPage<IndexDto> ylSystem = monitorFanIndicator.getFanIdxInfoByPage(equipmentNumber, stationBasicId, "实时运行数据", current, size, "叶轮系统");
List<Map<String, Object>> ylSystemStatus = monitorFanIndicator.getStatusMonitoring(stationBasic.getFanGatewayId(), equipmentNumber, "叶轮系统");
try {
//{stationBasicId}_{equipmentNumber}_fanBasicInfo_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_fanBasicInfo_topic", JSON.toJSON(info).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_fanBasicInfo_topic", JSON.toJSON(info).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windspeddInfo_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_windspeddInfo_topic", JSON.toJSON(windspeddInfo).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_windspeddInfo_topic", JSON.toJSON(windspeddInfo).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_activepower_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_activepower_topic", activepower.getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_activepower_topic", activepower.getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_powerFrequency_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_powerFrequency_topic", powerFrequency.getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_powerFrequency_topic", powerFrequency.getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_hubSpeed_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_hubSpeed_topic", hubSpeed.getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_hubSpeed_topic", hubSpeed.getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_realTimeTemperature_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_realTimeTemperature_topic", JSON.toJSON(realTimeTemperatureResult).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_realTimeTemperature_topic", JSON.toJSON(realTimeTemperatureResult).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_realTimedata_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_realTimedata_topic", JSON.toJSON(realTimedata).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_realTimedata_topic", JSON.toJSON(realTimedata).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_windSpeedOfFan_topic", JSON.toJSON(windSpeedOfFan).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_windSpeedOfFan_topic", JSON.toJSON(windSpeedOfFan).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_fdjSystem_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_fdjSystem_topic", JSON.toJSON(fdjSystem).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_fdjSystem_topic", JSON.toJSON(fdjSystem).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_fdjSystemStatus_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_fdjSystemStatus_topic", JSON.toJSON(fdjSystemStatus).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_fdjSystemStatus_topic", JSON.toJSON(fdjSystemStatus).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_jcyttSystem_topic", JSON.toJSON(jcyttSystem).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_jcyttSystem_topic", JSON.toJSON(jcyttSystem).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_jcyttSystemStatus_topic", JSON.toJSON(jcyttSystemStatus).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_jcyttSystemStatus_topic", JSON.toJSON(jcyttSystemStatus).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_phyyySystem_topic", JSON.toJSON(phyyySystem).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_phyyySystem_topic", JSON.toJSON(phyyySystem).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_phyyySystemStatus_topic", JSON.toJSON(phyyySystemStatus).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_phyyySystemStatus_topic", JSON.toJSON(phyyySystemStatus).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_blyzkSystem_topic", JSON.toJSON(blyzkSystem).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_blyzkSystem_topic", JSON.toJSON(blyzkSystem).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_blyzkSystemStatus_topic", JSON.toJSON(blyzkSystemStatus).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_blyzkSystemStatus_topic", JSON.toJSON(blyzkSystemStatus).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_ylSystem_topic", JSON.toJSON(ylSystem).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_ylSystem_topic", JSON.toJSON(ylSystem).toString().getBytes("UTF-8"), 1, true);
//{stationBasicId}_{equipmentNumber}_windSpeedOfFan_topic
emqKeeper.getMqttClient().publish(topicPrefix+ "_ylSystemStatus_topic", JSON.toJSON(ylSystemStatus).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(topicPrefix + "_ylSystemStatus_topic", JSON.toJSON(ylSystemStatus).toString().getBytes("UTF-8"), 1, true);
logger.info("-----------------发送风电站风机基础数据消息=================== 成功!");
} catch (Exception exception) {
logger.error("-----------------发送风电站风机基础数据消息=================== 失败!");
......
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