| | |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.channel.domain.ArdChannel; |
| | | import com.ruoyi.device.channel.mapper.ArdChannelMapper; |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService; |
| | | import com.ruoyi.media.domain.Vtdu; |
| | | import com.ruoyi.media.service.IVtduService; |
| | | import com.ruoyi.scheduling.domian.SchedulingParam; |
| | | import com.ruoyi.utils.gis.GisUtil; |
| | | import com.ruoyi.utils.tools.ArdTool; |
| | |
| | | |
| | | @Resource |
| | | private ArdChannelMapper ardChannelMapper; |
| | | |
| | | @Resource |
| | | private IVtduService vtduService; |
| | | |
| | | @PostConstruct |
| | | public void loadCameras() { |
| | | //清空相机缓存 |
| | | Collection<String> cacheKeys = redisCache.keys(getCacheKey("*")); |
| | | redisCache.deleteObject(cacheKeys); |
| | | //重新加载相机到缓存 |
| | | List<ArdCameras> ardCameras = selectArdCamerasListNoDataScope(new ArdCameras()); |
| | | for (ArdCameras ardCamera : ardCameras) { |
| | | redisCache.setCacheObject(getCacheKey(ardCamera.getId()), ardCamera); |
| | |
| | | */ |
| | | @Override |
| | | public ArdCameras selectArdCamerasById(String id) { |
| | | return ardCamerasMapper.selectArdCamerasById(id); |
| | | ArdCameras ardCameras = ardCamerasMapper.selectArdCamerasById(id); |
| | | if (ardCameras != null) { |
| | | ArdChannel ardChannel = new ArdChannel(); |
| | | ardChannel.setDeviceId(ardCameras.getId()); |
| | | List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel); |
| | | if (ardChannels != null) { |
| | | ardCameras.setChannelList(ardChannels); |
| | | } |
| | | } |
| | | return ardCameras; |
| | | } |
| | | |
| | | /** |
| | |
| | | if (res > 0) { |
| | | for (String id : ids) { |
| | | redisCache.deleteObject(getCacheKey(id)); |
| | | //删除流媒体 |
| | | vtduService.deleteVtduByCameraId(id); |
| | | //删除当前相机的所有通道 |
| | | ardChannelMapper.deleteArdChannelByDeviceId(id); |
| | | } |
| | |
| | | } |
| | | |
| | | public List findOptions(ArdCameras ardCameras) { |
| | | return ardCamerasMapper.findOptions(ardCameras); |
| | | List<ArdCameras> options = ardCamerasMapper.findOptions(ardCameras); |
| | | for (ArdCameras camera : |
| | | options) { |
| | | ArdChannel ardChannel = new ArdChannel(); |
| | | ardChannel.setDeviceId(camera.getId()); |
| | | List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel); |
| | | camera.setChannelList(ardChannels); |
| | | } |
| | | return options; |
| | | } |
| | | |
| | | /** |