|
@ -17,6 +17,7 @@ import com.zc.business.enums.WarningStateEnum; |
|
|
import com.zc.business.enums.WarningSubclassEnum; |
|
|
import com.zc.business.enums.WarningSubclassEnum; |
|
|
import com.zc.business.service.*; |
|
|
import com.zc.business.service.*; |
|
|
import com.zc.common.core.websocket.WebSocketService; |
|
|
import com.zc.common.core.websocket.WebSocketService; |
|
|
|
|
|
import com.zc.common.core.websocket.constant.WebSocketEvent; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -50,6 +51,9 @@ public class DeviceMessageHandler { |
|
|
@Resource |
|
|
@Resource |
|
|
private IDcWarningService dcWarningService; |
|
|
private IDcWarningService dcWarningService; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private IDcEventService dcEventService; |
|
|
|
|
|
|
|
|
@Resource |
|
|
@Resource |
|
|
private IMiddleDatabaseService middleDatabaseService; |
|
|
private IMiddleDatabaseService middleDatabaseService; |
|
|
|
|
|
|
|
@ -88,7 +92,7 @@ public class DeviceMessageHandler { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
WebSocketService.broadcast(DEVICE_STATE, dcDevices); //推送设备状态更新
|
|
|
WebSocketService.broadcast(WebSocketEvent.DEVICE_STATE, dcDevices); //推送设备状态更新
|
|
|
// 批量更新中间库设备状态
|
|
|
// 批量更新中间库设备状态
|
|
|
middleDatabaseService.updateMiddleDatabaseDeviceByList(dcDevices); |
|
|
middleDatabaseService.updateMiddleDatabaseDeviceByList(dcDevices); |
|
|
} |
|
|
} |
|
@ -593,7 +597,7 @@ public class DeviceMessageHandler { |
|
|
|
|
|
|
|
|
//todo 首页推送事件消息 3气象检测器
|
|
|
//todo 首页推送事件消息 3气象检测器
|
|
|
if (!meteorologicalDetectorData.getPrecipitationType().equals("0")) {//降水类型 0=无降;1=雨;2=雪;3=毛毛雨;4=雨夹雪;
|
|
|
if (!meteorologicalDetectorData.getPrecipitationType().equals("0")) {//降水类型 0=无降;1=雨;2=雪;3=毛毛雨;4=雨夹雪;
|
|
|
WebSocketService.broadcast("3", meteorologicalDetectorData); |
|
|
WebSocketService.broadcast(WebSocketEvent.WARNING, meteorologicalDetectorData); |
|
|
JSONObject object = new JSONObject(); |
|
|
JSONObject object = new JSONObject(); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
String string = object.toString(); |
|
|
String string = object.toString(); |
|
@ -604,9 +608,13 @@ public class DeviceMessageHandler { |
|
|
dcWarning.setOtherConfig(string); |
|
|
dcWarning.setOtherConfig(string); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
|
|
|
|
|
|
|
|
|
//待确认数量
|
|
|
|
|
|
Long count = dcEventService.getCountNum(); |
|
|
|
|
|
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count); |
|
|
} |
|
|
} |
|
|
if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾;
|
|
|
if (!meteorologicalDetectorData.getVisibilityType().equals("4")) {// 能见度类型,4 表示能见度良好3表示阴霾 2表示雾 1表示浓雾;
|
|
|
WebSocketService.broadcast("3", meteorologicalDetectorData); |
|
|
WebSocketService.broadcast(WebSocketEvent.WARNING, meteorologicalDetectorData); |
|
|
JSONObject object = new JSONObject(); |
|
|
JSONObject object = new JSONObject(); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
object.put("meteorologicalDetectorData", meteorologicalDetectorData); |
|
|
String string = object.toString(); |
|
|
String string = object.toString(); |
|
@ -617,6 +625,10 @@ public class DeviceMessageHandler { |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
dcWarning.setWarningTitle("气象预警"); |
|
|
|
|
|
|
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
dcWarningService.insertDcWarning(dcWarning); |
|
|
|
|
|
|
|
|
|
|
|
//待确认数量
|
|
|
|
|
|
Long count = dcEventService.getCountNum(); |
|
|
|
|
|
WebSocketService.broadcast(WebSocketEvent.EVENT_COUNT, count); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|