Commit 2c750b05 authored by duanruiming's avatar duanruiming

[update] 优化告警数据和页面统计联动

parent bc1b2049
...@@ -14,7 +14,6 @@ import net.wanji.web.mapper.TDeviceStatusMapper; ...@@ -14,7 +14,6 @@ import net.wanji.web.mapper.TDeviceStatusMapper;
import net.wanji.web.service.SituationDetectionService; import net.wanji.web.service.SituationDetectionService;
import net.wanji.web.vo.situationDetection.CommonEventAlarmOutVo; import net.wanji.web.vo.situationDetection.CommonEventAlarmOutVo;
import net.wanji.web.websocket.WebSocketServer; import net.wanji.web.websocket.WebSocketServer;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -38,7 +37,6 @@ public class CommonEventWarnTask { ...@@ -38,7 +37,6 @@ public class CommonEventWarnTask {
private final SituationDetectionService situationDetectionService; private final SituationDetectionService situationDetectionService;
private final TDeviceStatusMapper tDeviceStatusMapper; private final TDeviceStatusMapper tDeviceStatusMapper;
@Scheduled(fixedRate = 30 * 1000)
public void pushEvenWarnData() { public void pushEvenWarnData() {
try { try {
Set<WebSocketServer> events = WebSocketServer.getWebSocketSet(Constant.WEBSOCKET_TOPIC_EVENT_WARN); Set<WebSocketServer> events = WebSocketServer.getWebSocketSet(Constant.WEBSOCKET_TOPIC_EVENT_WARN);
......
...@@ -37,11 +37,13 @@ public class SignalStatusTask { ...@@ -37,11 +37,13 @@ public class SignalStatusTask {
private final ControlHistMapper controlHistMapper; private final ControlHistMapper controlHistMapper;
private final TDeviceStatusLogMapper tDeviceStatusLogMapper; private final TDeviceStatusLogMapper tDeviceStatusLogMapper;
private final BaseCrossInfoMapper baseCrossInfoMapper; private final BaseCrossInfoMapper baseCrossInfoMapper;
private final CommonEventWarnTask commonEventWarnTask;
@Scheduled(fixedRate = 30 * 1000) @Scheduled(fixedRate = 30 * 1000)
@Transactional @Transactional
public void syncSignalStatus() { public void syncSignalStatus() {
try { try {
JsonViewObject jsonViewObject = utcFeignClients.runningStatusAlarm(); JsonViewObject jsonViewObject = utcFeignClients.runningStatusAlarm();
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) { if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
log.error("定时任务同步信号机设备状态utcService调用异常"); log.error("定时任务同步信号机设备状态utcService调用异常");
...@@ -71,6 +73,9 @@ public class SignalStatusTask { ...@@ -71,6 +73,9 @@ public class SignalStatusTask {
updateSignalStatus(signalStatusVO, crossId, name, currentSignalStatus, currentFaultType); updateSignalStatus(signalStatusVO, crossId, name, currentSignalStatus, currentFaultType);
insertControlHist(signalStatusVO); insertControlHist(signalStatusVO);
}); });
// 远程同步状态后,推送告警事件
commonEventWarnTask.pushEvenWarnData();
} catch (Exception e) { } catch (Exception e) {
log.error("定时任务同步信号机设备状态远程utcService调用异常", e); log.error("定时任务同步信号机设备状态远程utcService调用异常", e);
} }
......
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