Browse Source

异常天气推送修改

develop
王兴琳 9 months ago
parent
commit
66e1705ee7
  1. 15
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java
  2. 12
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

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

@ -616,7 +616,6 @@ public class DeviceMessageHandler {
}
String content = direction + stakeMark + precipitationType;
Map<String, Object> contentMap = new HashMap<>();
JSONObject object = new JSONObject();
object.put("meteorologicalDetectorData", meteorologicalDetectorData);
@ -641,13 +640,10 @@ public class DeviceMessageHandler {
if (direction.equals(UniversalEnum.DIRECTION_OF_JINAN.getValue())) {
dcWarning.setDirection(UniversalEnum.THREE.getValue());
}
contentMap.put("content", content);
contentMap.put("event", dcWarning);
WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap);
dcWarningService.insertDcWarning(dcWarning);
//待确认数量
dcEventService.getCountNum();
}
@ -664,10 +660,7 @@ public class DeviceMessageHandler {
}
String content = direction + stakeMark + precipitationType;
Map<String, Object> contentMap = new HashMap<>();
contentMap.put("content", content);
contentMap.put("event", meteorologicalDetectorData);
WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap);
JSONObject object = new JSONObject();
object.put("meteorologicalDetectorData", meteorologicalDetectorData);
String string = object.toString();
@ -691,9 +684,7 @@ public class DeviceMessageHandler {
}
dcWarningService.insertDcWarning(dcWarning);
contentMap.put("content", content);
contentMap.put("event", dcWarning);
WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap);
//待确认数量
dcEventService.getCountNum();

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

@ -242,9 +242,17 @@ public class DcWarningServiceImpl implements IDcWarningService
break;
}
}
String content= direction+UniversalEnum.BLANK_SPACE.getValue() + dcWarning.getStakeMark()+UniversalEnum.BLANK_SPACE.getValue()+HAPPEN+EventSubclass+EVENT ;
Map<String,Object> contentMap = new HashMap<>();
contentMap.put("content",content);
if (dcWarning.getWarningSource() == 7) {
String remark = dcWarning.getRemark();
String[] split = remark.split(" ");
String s = split[split.length - 1];
contentMap.put("content",s);
}else {
String content= direction+UniversalEnum.BLANK_SPACE.getValue() + dcWarning.getStakeMark()+UniversalEnum.BLANK_SPACE.getValue()+HAPPEN+EventSubclass+EVENT ;
contentMap.put("content",content);
}
contentMap.put("event",dcWarning);
WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); //推送事件消息 0不是感知事件
dcEventService.getCountNum();

Loading…
Cancel
Save