| | |
| | | String deviceSn= stateReceiver.getGateway(); |
| | | DeviceQueryParam param = DeviceQueryParam.builder().deviceSn(deviceSn).build(); |
| | | List<DeviceDTO> deviceDTOS = _deviceService.getDevicesByParams(param); |
| | | // List<DeviceDTO> gatewaysList = _deviceService.getDevicesByParams(DeviceQueryParam.builder().childSn(deviceSn).build()); |
| | | String childSn = deviceDTOS.get(0).getChildDeviceSn(); |
| | | List<LiveStatusTwoReceiver> list = mapper.convertValue(dataNode.get(StateDataEnum.LIVESTATUS.getDesc()), new TypeReference<List<LiveStatusTwoReceiver>>() {}); |
| | | for (LiveStatusTwoReceiver receiver : list) { |
| | | if(receiver.getVideoId().contains(childSn)){ |
| | | stateReceiver.setData(receiver); |
| | | continue; |
| | | if(deviceDTOS!=null && deviceDTOS.size()>0) |
| | | { |
| | | String childSn = deviceDTOS.get(0).getChildDeviceSn(); |
| | | List<LiveStatusTwoReceiver> list = mapper.convertValue(dataNode.get(StateDataEnum.LIVESTATUS.getDesc()), new TypeReference<List<LiveStatusTwoReceiver>>() {}); |
| | | for (LiveStatusTwoReceiver receiver : list) { |
| | | if(receiver.getVideoId().contains(childSn)){ |
| | | stateReceiver.setData(receiver); |
| | | continue; |
| | | } |
| | | } |
| | | stateReceiver.setGateway(childSn); |
| | | String liveStatus = ""; |
| | | try{ |
| | | liveStatus=mapper.writeValueAsString(stateReceiver); |
| | | } |
| | | catch (Exception e){ |
| | | log.error("接收state直播设备状态反馈转换异常:{}",e); |
| | | } |
| | | _deviceService.setChildRedisCamera(childSn, liveStatus); |
| | | } |
| | | stateReceiver.setGateway(childSn); |
| | | String liveStatus = ""; |
| | | try{ |
| | | liveStatus=mapper.writeValueAsString(stateReceiver); |
| | | } |
| | | catch (Exception e){ |
| | | log.error("接收state直播设备状态反馈转换异常:{}",e); |
| | | } |
| | | _deviceService.setChildRedisCamera(childSn, liveStatus); |
| | | log.info("接收state直播设备状态反馈:{}",liveStatus); |
| | | |
| | | return stateReceiver; |
| | | } |
| | | return handler.handleState(dataNode, stateReceiver, sn); |