Browse Source

优化待处理数量推送

develop
lau572 10 months ago
parent
commit
e63dd47ec3
  1. 6
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java
  2. 9
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  3. 12
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

6
zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

@ -610,8 +610,7 @@ public class DeviceMessageHandler {
dcWarningService.insertDcWarning(dcWarning); dcWarningService.insertDcWarning(dcWarning);
//待确认数量 //待确认数量
Long count = dcEventService.getCountNum(); dcEventService.getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count);
} }
if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾; if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾;
WebSocketService.broadcast(WebSocketEvent.WARNING, meteorologicalDetectorData); WebSocketService.broadcast(WebSocketEvent.WARNING, meteorologicalDetectorData);
@ -627,8 +626,7 @@ public class DeviceMessageHandler {
dcWarningService.insertDcWarning(dcWarning); dcWarningService.insertDcWarning(dcWarning);
//待确认数量 //待确认数量
Long count = dcEventService.getCountNum(); dcEventService.getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count);
} }

9
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -575,8 +575,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
WebSocketService.broadcast(WebSocketEvent.EVENT, contentMap); //推送事件消息 0不是感知事件 WebSocketService.broadcast(WebSocketEvent.EVENT, contentMap); //推送事件消息 0不是感知事件
Long count = getCountNum(); getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count);
} }
@ -1059,8 +1058,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} }
} }
//推送待处理数量 //推送待处理数量
Long count = getCountNum(); getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT,count);
return i7; return i7;
} }
@ -1235,8 +1233,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (i > 0) { if (i > 0) {
//推送待处理数量 //推送待处理数量
Long count = getCountNum(); getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT,count);
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id);

12
zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

@ -236,8 +236,7 @@ public class DcWarningServiceImpl implements IDcWarningService
contentMap.put("content",content); contentMap.put("content",content);
contentMap.put("event",dcWarning); contentMap.put("event",dcWarning);
WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); //推送事件消息 0不是感知事件 WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); //推送事件消息 0不是感知事件
Long count = dcEventService.getCountNum(); dcEventService.getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count); //推送待处理数量
} }
//优先级策略(还差优先级策略需要配置) //优先级策略(还差优先级策略需要配置)
@ -527,8 +526,7 @@ public class DcWarningServiceImpl implements IDcWarningService
return AjaxResult.error("操作失败"); return AjaxResult.error("操作失败");
} }
//推送待处理数量 //推送待处理数量
Long count = dcEventService.getCountNum(); dcEventService.getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT,count);
return AjaxResult.success("操作成功"); return AjaxResult.success("操作成功");
} }
@ -627,8 +625,7 @@ public class DcWarningServiceImpl implements IDcWarningService
Integer i = dcWarningMapper.updateEndSection(dcWarnings); Integer i = dcWarningMapper.updateEndSection(dcWarnings);
//推送待处理消息数量 //推送待处理消息数量
Long num = dcEventService.getCountNum(); dcEventService.getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, num);
return i; return i;
} }
@ -953,8 +950,7 @@ public class DcWarningServiceImpl implements IDcWarningService
dcWarning.setUpdateTime(DateUtils.getNowDate()); dcWarning.setUpdateTime(DateUtils.getNowDate());
Integer i = dcWarningMapper.falseAlarmResolution(dcWarning); Integer i = dcWarningMapper.falseAlarmResolution(dcWarning);
//推送待处理数量 //推送待处理数量
Long count = dcEventService.getCountNum(); dcEventService.getCountNum();
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT,count);
return i; return i;
} }

Loading…
Cancel
Save