| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | List<LiveStatusTwoReceiver> list = mapper.convertValue(dataNode.get(StateDataEnum.LIVESTATUS.getDesc()), |
| | | new TypeReference<List<LiveStatusTwoReceiver>>() {}); |
| | | for (LiveStatusTwoReceiver receiver : list) { |
| | | if(receiver.getVideoId()!=null && receiver.getVideoId().contains(childSn)){ |
| | | // 机场1(Dock1)未连接飞行器时 childDeviceSn 为空,跳过匹配,避免 String.contains(null) 抛 NPE |
| | | if (StringUtils.hasText(childSn) && receiver.getVideoId() != null |
| | | && receiver.getVideoId().contains(childSn)) { |
| | | stateReceiver.setData(receiver); |
| | | continue; |
| | | } |
| | |
| | | catch (Exception e){ |
| | | log.error("接收state直播设备状态反馈转换异常:{}",e); |
| | | } |
| | | _deviceService.setChildRedisCamera(childSn, liveStatus); |
| | | // 无子设备 SN 时不写缓存,避免产生 COVER_STATE_PREFIX + null 的非法 Redis key |
| | | if (StringUtils.hasText(childSn)) { |
| | | _deviceService.setChildRedisCamera(childSn, liveStatus); |
| | | } |
| | | } |
| | | |
| | | return stateReceiver; |