Browse Source

事件处置 指挥调度 添加默认数据。

develop
王兴琳 6 months ago
parent
commit
c7d64da05c
  1. 30
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java
  2. 2
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

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

@ -591,6 +591,35 @@ public class DeviceMessageHandler {
//方向
meteorologicalDetectorData.setDirection(direction);
//todo 首页推送事件消息 3气象检测器
if (!meteorologicalDetectorData.getPrecipitationType().equals("0")) {//降水类型 0=无降;1=雨;2=雪;3=毛毛雨;4=雨夹雪;
WebSocketService.broadcast("3", meteorologicalDetectorData);
JSONObject object = new JSONObject();
object.put("meteorologicalDetectorData", meteorologicalDetectorData);
String string = object.toString();
DcWarning dcWarning = new DcWarning();
dcWarning.setStakeMark(meteorologicalDetectorData.getStakeMark());
dcWarning.setWarningSource(7);//气象检测器
dcWarning.setOtherConfig(string);
dcWarning.setWarningTitle("气象预警");
dcWarningService.insertDcWarning(dcWarning);
}
if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾;
WebSocketService.broadcast("3", meteorologicalDetectorData);
JSONObject object = new JSONObject();
object.put("meteorologicalDetectorData", meteorologicalDetectorData);
String string = object.toString();
DcWarning dcWarning = new DcWarning();
dcWarning.setStakeMark(meteorologicalDetectorData.getStakeMark());
dcWarning.setWarningSource(7);//气象检测器
dcWarning.setOtherConfig(string);
dcWarning.setWarningTitle("气象预警");
dcWarningService.insertDcWarning(dcWarning);
}
meteorologicalDetectorData.setIotDeviceId(msg.get("deviceId").toString());
meteorologicalDetectorDataService.insertDcMeteorologicalDetectorData(meteorologicalDetectorData);
@ -618,6 +647,7 @@ public class DeviceMessageHandler {
mdDeviceData.setExpands(JSONObject.toJSONString(expands));
middleDatabaseService.insertMiddleDatabaseDeviceData(mdDeviceData);
}

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

@ -1096,10 +1096,12 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (dcEvent1 == null) {
return 1;
}
/*
//事件状态已被修改 返回成功
if (dcEvent1.getEventState() == state) {
return 1;
}
*/
int i = dcEventMapper.updateDcEventState(id, state);
if (i > 0) {

Loading…
Cancel
Save