‘liusuyi’
2023-10-24 ad8ef57ed5e577099991822f210bc4a09dec6ad0
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
@@ -12,6 +12,9 @@
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;
@@ -45,7 +48,8 @@
    @Resource
    private ArdChannelMapper ardChannelMapper;
    @Resource
    private IVtduService vtduService;
    @PostConstruct
    public void loadCameras() {
@@ -78,7 +82,16 @@
     */
    @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;
    }
    /**
@@ -160,6 +173,8 @@
        if (res > 0) {
            for (String id : ids) {
                redisCache.deleteObject(getCacheKey(id));
                //删除流媒体
                vtduService.deleteVtduByCameraId(id);
                //删除当前相机的所有通道
                ardChannelMapper.deleteArdChannelByDeviceId(id);
            }