|
|
@ -16,6 +16,7 @@ import com.zc.business.enums.WarningSourceEnum; |
|
|
|
import com.zc.business.enums.WarningStateEnum; |
|
|
|
import com.zc.business.enums.WarningSubclassEnum; |
|
|
|
import com.zc.business.service.*; |
|
|
|
import com.zc.common.core.websocket.WebSocketService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -38,6 +39,8 @@ public class DeviceMessageHandler { |
|
|
|
private final int EVENT_STATE = 1; |
|
|
|
private final int EVENTEND_STATE = 4; |
|
|
|
private final int VISIBILITY_LEVEL = 8; |
|
|
|
private final String DEVICE_STATE = "deviceState"; |
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Resource |
|
|
@ -77,6 +80,7 @@ public class DeviceMessageHandler { |
|
|
|
// 批量更新设备状态
|
|
|
|
dcDeviceService.batchUpdate(dcDevices); |
|
|
|
|
|
|
|
WebSocketService.broadcast(DEVICE_STATE, dcDevices); //推送设备状态更新
|
|
|
|
// 批量更新中间库设备状态
|
|
|
|
middleDatabaseService.updateMiddleDatabaseDeviceByList(dcDevices); |
|
|
|
} |
|
|
|