|
@ -21,6 +21,7 @@ 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; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.text.ParseException; |
|
|
import java.text.ParseException; |
|
@ -79,6 +80,12 @@ public class DeviceMessageHandler { |
|
|
|
|
|
|
|
|
// 批量更新设备状态
|
|
|
// 批量更新设备状态
|
|
|
dcDeviceService.batchUpdate(dcDevices); |
|
|
dcDeviceService.batchUpdate(dcDevices); |
|
|
|
|
|
dcDevices.forEach(dcDevice -> { |
|
|
|
|
|
DcDevice device = redisCache.getCacheMapValue(RedisKeyConstants.DC_DEVICES, dcDevice.getIotDeviceId()); |
|
|
|
|
|
if (!ObjectUtils.isEmpty(device)) { |
|
|
|
|
|
dcDevice.setId(device.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
WebSocketService.broadcast(DEVICE_STATE, dcDevices); //推送设备状态更新
|
|
|
WebSocketService.broadcast(DEVICE_STATE, dcDevices); //推送设备状态更新
|
|
|
// 批量更新中间库设备状态
|
|
|
// 批量更新中间库设备状态
|
|
|