diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index 56a827f5..f89a98a5 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/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); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 9f2c9158..e2837faa 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -1096,10 +1096,12 @@ public class DcEventServiceImpl extends ServiceImpl impl if (dcEvent1 == null) { return 1; } +/* //事件状态已被修改 返回成功 if (dcEvent1.getEventState() == state) { return 1; } +*/ int i = dcEventMapper.updateDcEventState(id, state); if (i > 0) {