|
@ -588,6 +588,7 @@ public class DeviceMessageHandler { |
|
|
String stakeMark = strings[1]; |
|
|
String stakeMark = strings[1]; |
|
|
String direction = strings[2]; |
|
|
String direction = strings[2]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设备名称
|
|
|
//设备名称
|
|
|
meteorologicalDetectorData.setDeviceName(deviceName); |
|
|
meteorologicalDetectorData.setDeviceName(deviceName); |
|
|
//位置
|
|
|
//位置
|
|
@ -595,25 +596,60 @@ public class DeviceMessageHandler { |
|
|
//方向
|
|
|
//方向
|
|
|
meteorologicalDetectorData.setDirection(direction); |
|
|
meteorologicalDetectorData.setDirection(direction); |
|
|
|
|
|
|
|
|
//todo 首页推送事件消息 3气象检测器
|
|
|
//todo 首页推送事件消息 气象检测器
|
|
|
if (!meteorologicalDetectorData.getPrecipitationType().equals("0")) {//降水类型 0=无降;1=雨;2=雪;3=毛毛雨;4=雨夹雪;
|
|
|
if (!meteorologicalDetectorData.getPrecipitationType().equals("0")) {//降水类型 0=无降;1=雨;2=雪;3=毛毛雨;4=雨夹雪;
|
|
|
WebSocketService.broadcast(WebSocketEvent.WARNING, meteorologicalDetectorData); |
|
|
String precipitationType =""; |
|
|
|
|
|
if (meteorologicalDetectorData.getPrecipitationType().equals("1")){ |
|
|
|
|
|
precipitationType="发生降雨异常天气事件"; |
|
|
|
|
|
}if (meteorologicalDetectorData.getPrecipitationType().equals("2")){ |
|
|
|
|
|
precipitationType="发生降雪异常天气事件"; |
|
|
|
|
|
}if (meteorologicalDetectorData.getPrecipitationType().equals("3")){ |
|
|
|
|
|
precipitationType="发生毛毛雨异常天气事件"; |
|
|
|
|
|
}if (meteorologicalDetectorData.getPrecipitationType().equals("4")){ |
|
|
|
|
|
precipitationType="发生雨夹雪异常天气事件"; |
|
|
|
|
|
} |
|
|
|
|
|
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(); |
|
|
JSONObject object = new JSONObject(); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
String string = object.toString(); |
|
|
String string = object.toString(); |
|
|
|
|
|
|
|
|
DcWarning dcWarning = new DcWarning(); |
|
|
DcWarning dcWarning = new DcWarning(); |
|
|
dcWarning.setStakeMark(meteorologicalDetectorData.getStakeMark()); |
|
|
dcWarning.setStakeMark(meteorologicalDetectorData.getStakeMark()); |
|
|
|
|
|
|
|
|
dcWarning.setWarningSource(7);//气象检测器
|
|
|
dcWarning.setWarningSource(7);//气象检测器
|
|
|
dcWarning.setOtherConfig(string); |
|
|
dcWarning.setOtherConfig(string); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
|
|
|
if (direction.equals("菏泽方向")){ |
|
|
|
|
|
dcWarning.setDirection("1"); |
|
|
|
|
|
} |
|
|
|
|
|
if (direction.equals("济南方向")){ |
|
|
|
|
|
dcWarning.setDirection("3"); |
|
|
|
|
|
} |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
|
|
|
|
|
|
//待确认数量
|
|
|
//待确认数量
|
|
|
dcEventService.getCountNum(); |
|
|
dcEventService.getCountNum(); |
|
|
} |
|
|
} |
|
|
if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾;
|
|
|
if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾;
|
|
|
WebSocketService.broadcast(WebSocketEvent.WARNING, meteorologicalDetectorData); |
|
|
String precipitationType =""; |
|
|
|
|
|
if (meteorologicalDetectorData.getVisibilityType().equals("3")){ |
|
|
|
|
|
precipitationType="发生阴霾异常天气事件"; |
|
|
|
|
|
}if (meteorologicalDetectorData.getVisibilityType().equals("2")){ |
|
|
|
|
|
precipitationType="发生雾异常天气事件"; |
|
|
|
|
|
}if (meteorologicalDetectorData.getVisibilityType().equals("1")){ |
|
|
|
|
|
precipitationType="发生浓雾异常天气事件"; |
|
|
|
|
|
} |
|
|
|
|
|
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(); |
|
|
JSONObject object = new JSONObject(); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
String string = object.toString(); |
|
|
String string = object.toString(); |
|
@ -622,7 +658,12 @@ public class DeviceMessageHandler { |
|
|
dcWarning.setWarningSource(7);//气象检测器
|
|
|
dcWarning.setWarningSource(7);//气象检测器
|
|
|
dcWarning.setOtherConfig(string); |
|
|
dcWarning.setOtherConfig(string); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
|
|
|
if (direction.equals("菏泽方向")){ |
|
|
|
|
|
dcWarning.setDirection("1"); |
|
|
|
|
|
} |
|
|
|
|
|
if (direction.equals("济南方向")){ |
|
|
|
|
|
dcWarning.setDirection("3"); |
|
|
|
|
|
} |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
|
|
|
|
|
|
//待确认数量
|
|
|
//待确认数量
|
|
|