| | |
| | | import com.ruoyi.media.service.IVtduService;
|
| | | import com.ruoyi.rongcloud.service.RongCloudService;
|
| | | import com.ruoyi.system.service.ISysUserService;
|
| | | import com.ruoyi.utils.sdk.common.GlobalVariable;
|
| | | import com.ruoyi.utils.sdk.dhsdk.service.impl.DahuaSDK;
|
| | | import com.ruoyi.utils.sdk.hiksdk.service.impl.HikvisionSDK;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
| | | private CameraSDKFactory cameraSDKFactory;
|
| | | @Resource
|
| | | private IArdChannelService ardChannelService;
|
| | |
|
| | | /**
|
| | | * 同步相机在线状态
|
| | | * 刘苏义
|
| | |
| | | * @Description 同步通道状态实时同步流媒体
|
| | | * @Date 2024/7/9 16:01
|
| | | */
|
| | | public void syncChannelState() {
|
| | | log.warn("定时同步通道任务开始");
|
| | | public void syncChannelState(){
|
| | | log.debug("定时同步通道任务开始");
|
| | | //获取所有nvr设备
|
| | | List<ArdCameras> ardCamerasList = iArdCamerasService.selectArdCamerasListNoDataScope(new ArdCameras());
|
| | | List<ArdCameras> ardCamerasList = GlobalVariable.loginedSet.stream().collect(Collectors.toList());
|
| | | if (ardCamerasList.size() > 0) {
|
| | | ardCamerasList.stream()
|
| | | .forEach(ardCameras -> {
|
| | | //通过SDK获取NVR实际通道
|
| | | CameraSDK cameraSDK = cameraSDKFactory.createCameraSDK(ardCameras.getFactory());
|
| | | List<ArdChannel> ardChannelList = cameraSDK.getChannels(ardCameras);
|
| | | //同步通道表
|
| | | ArdChannel ardChannel=new ArdChannel();
|
| | | ardChannel.setDeviceId(ardCameras.getId());
|
| | | List<ArdChannel> ardChannelListDb = ardChannelService.selectArdChannelList(ardChannel);
|
| | | ardChannelService.asyncChannel(ardCameras,ardChannelListDb,ardChannelList);
|
| | | if (ardCameras.getLoginId() > 0) {
|
| | | //通过SDK获取NVR实际通道
|
| | | CameraSDK cameraSDK = cameraSDKFactory.createCameraSDK(ardCameras.getFactory());
|
| | | List<ArdChannel> ardChannelList = cameraSDK.getChannels(ardCameras);
|
| | | //同步通道表
|
| | | ArdChannel ardChannel = new ArdChannel();
|
| | | ardChannel.setDeviceId(ardCameras.getId());
|
| | | List<ArdChannel> ardChannelListDb = ardChannelService.selectArdChannelList(ardChannel);
|
| | | ardChannelService.asyncChannel(ardCameras, ardChannelListDb, ardChannelList);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | * 2023/10/13 14:13:53
|
| | | */
|
| | | public void syncVtdu() {
|
| | | log.warn("定时同步流媒体任务开始");
|
| | | log.debug("定时同步流媒体任务开始");
|
| | | List<String> nameList = mediaService.getNameList();
|
| | | List<Vtdu> vtduList = vtduService.selectVtduList(new Vtdu());
|
| | | vtduService.asyncVtdu(vtduList,nameList);
|
| | | vtduService.asyncVtdu(vtduList, nameList);
|
| | | }
|
| | | } |