| | |
| | | if (allChannelMap.containsKey(deviceChannel.getChannelId())) { |
| | | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| | | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| | | if (allChannelMap.get(deviceChannel.getChannelId()).getStatus() !=deviceChannel.getStatus()){ |
| | | List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId()); |
| | | if (!CollectionUtils.isEmpty(strings)){ |
| | | strings.forEach(platformId->{ |
| | | eventPublisher.catalogEventPublish(platformId, deviceChannel, deviceChannel.getStatus()==1?CatalogEvent.ON:CatalogEvent.OFF); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | channels.add(deviceChannel); |
| | | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| | |
| | | if (allChannelMap.containsKey(deviceChannel.getChannelId())) { |
| | | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| | | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| | | deviceChannel.setUpdateTime(DateUtil.getNow()); |
| | | updateChannels.add(deviceChannel); |
| | | }else { |
| | | deviceChannel.setCreateTime(DateUtil.getNow()); |
| | | addChannels.add(deviceChannel); |
| | | } |
| | | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Device queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId) { |
| | | List<Device> devices = platformChannelMapper.queryDeviceInfoByPlatformIdAndChannelId(platformId, channelId); |
| | | if (devices.size() > 1) { |
| | | // 出现长度大于0的时候肯定是国标通道的ID重复了 |
| | | logger.warn("国标ID存在重复:{}", channelId); |
| | | } |
| | | if (devices.size() == 0) { |
| | | return null; |
| | | }else { |
| | | return devices.get(0); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询最新移动位置 |
| | | * @param deviceId |