|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|