Commit e91e52c8 authored by duanruiming's avatar duanruiming

[update] 信号机告警优化

parent 3777bf1a
......@@ -82,8 +82,10 @@ public class CommonEventWarnTask {
* @return
*/
private JsonViewObject getSignalWarnData() {
JsonViewObject jsonViewObject = null;
try {
List<CommonEventAlarmOutVo> results = new ArrayList<>();
JsonViewObject jsonViewObject = utcFeignClients.runningStatusAlarm();
jsonViewObject = utcFeignClients.runningStatusAlarm();
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
return jsonViewObject.fail("信号机告警UTC服务调用异常!");
}
......@@ -122,6 +124,9 @@ public class CommonEventWarnTask {
}
jsonViewObject.setTimestamp(now.toInstant(ZoneOffset.of("+8")).toEpochMilli());
jsonViewObject.setContent(results);
} catch (Exception e) {
log.error("获取信号机告警数据失败", e);
}
return jsonViewObject;
}
......@@ -138,6 +143,7 @@ public class CommonEventWarnTask {
* @param tDeviceStatusInfo1
*/
private static void buildSignalWarnData(List<CommonEventAlarmOutVo> results, String formatNow, String signalId, Integer currentStatus, Integer currentFaultType, String coordinate, String crossName, TDeviceStatusInfo tDeviceStatusInfo1) {
try {
if (SignalStatusTask.isExucuteUpdate(currentStatus, currentFaultType, tDeviceStatusInfo1)) {
CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
commonEventAlarmOutVo.setEventType(3);
......@@ -157,5 +163,8 @@ public class CommonEventWarnTask {
commonEventAlarmOutVo.setCoordinate(coordinate);
results.add(commonEventAlarmOutVo);
}
} catch (Exception e) {
log.error("构建信号机告警数据失败", e);
}
}
}
......@@ -130,7 +130,7 @@ public class WebSocketServer {
*/
@OnError
public void onError(Session session, Throwable error) {
log.error("主题:{},socket:{},连接异常,异常信息:{}", topic, userId, error);
log.error("主题:{},socket:{},连接异常,异常信息:{}", topic, userId, error.getMessage());
}
/**
......
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