Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 6 months ago
parent
commit
743c15bb95
  1. 30
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java
  2. 6
      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);
}

6
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) {
@ -1229,11 +1231,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
} else if ("direction".equals(result.getRightPath())) {
if ("1".equals(result.getRight())) {
result.setRight("上行");
result.setRight("菏泽方向");
} else if ("2".equals(result.getRight())) {
result.setRight("中");
} else if ("3".equals(result.getRight())) {
result.setRight("下行");
result.setRight("济南方向");
}
} else if ("eventSubclass".equals(result.getRightPath())) {
if ("1-1".equals(result.getRight())) {

Loading…
Cancel
Save