liusuyi
2026-06-02 f652169cc5d6501511eece5df57b7b396fd7a7ab
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/ZlmRecordPlanServiceImpl.java
@@ -8,8 +8,8 @@
import com.ard.common.core.domain.R;
import com.ard.common.core.enums.LiveStreamType;
import com.ard.common.core.utils.DateUtils;
import com.ard.qs.api.RemoteQsDeviceService;
import com.ard.qs.api.domain.QsDevice;
import com.ard.zlm.service.ZlmStreamService;
import com.ard.zlm.domain.StreamChannel;
import com.ard.zlm.api.domain.MediaInfo;
import com.ard.zlm.api.domain.RTPServerParam;
import com.ard.zlm.api.domain.StreamInfo;
@@ -51,7 +51,7 @@
    private ZlmRecordPlanItemMapper zlmRecordPlanItemMapper;
    @Resource
    private RemoteQsDeviceService remoteQsDeviceService;
    private ZlmStreamService zlmStreamService;
    @Resource
    private RemoteChannelService remoteChannelService;
    @Resource
@@ -76,7 +76,7 @@
        }
        // 重新拉起
        R<ArdChannel> r = remoteChannelService.getInfo(deviceId, SecurityConstants.INNER);
        //  R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
        //  R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
        if (r.getCode() != HttpStatus.SUCCESS) {
            throw new RuntimeException("根据设备id查询设备信息失败");
        }
@@ -91,7 +91,7 @@
            return;
        }
//        if ("OFFLINE".equals(device.getDeviceStatus())) {
//        if (!Boolean.TRUE.equals(device.getDeviceOnLine())) {
//            log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现设备不在线, id: {}", deviceId);
//            return;
//        }
@@ -147,7 +147,7 @@
    public List<ZlmRecordPlan> selectZlmRecordPlanList(ZlmRecordPlan zlmRecordPlan) {
        List<ZlmRecordPlan> zlmRecordPlans = zlmRecordPlanMapper.selectZlmRecordPlanList(zlmRecordPlan);
        for (ZlmRecordPlan recordPlan : zlmRecordPlans) {
            R<Integer> r = remoteQsDeviceService.countRecordPlanDevice(recordPlan.getId(), SecurityConstants.INNER);
            R<Integer> r = zlmStreamService.countRecordPlanDevice(recordPlan.getId(), SecurityConstants.INNER);
            if (r.getCode() != HttpStatus.SUCCESS) {
                throw new RuntimeException("删除录像计划失败");
            }
@@ -214,7 +214,7 @@
    public int deleteZlmRecordPlanByIds(Long[] ids) {
        for (Long id : ids) {
            zlmRecordPlanItemMapper.cleanItems(id);
            R<Void> r = remoteQsDeviceService.cleanRecordPlanId(id, SecurityConstants.INNER);
            R<Void> r = zlmStreamService.cleanRecordPlanId(id, SecurityConstants.INNER);
            if (r.getCode() != HttpStatus.SUCCESS) {
                throw new RuntimeException("删除录像计划失败");
            }
@@ -248,7 +248,7 @@
//            recordStreamMap.keySet().forEach(startDeviceIdList::remove);
//            if (!startDeviceIdList.isEmpty()) {
//                // 获取所有的关联的设备
//              //  R<List<QsDevice>> r = remoteQsDeviceService.queryByIds(startDeviceIdList, SecurityConstants.INNER);
//              //  R<List<StreamChannel>> r = zlmStreamService.queryByIds(startDeviceIdList, SecurityConstants.INNER);
//                R<List<ArdChannel>> r = remoteChannelService.queryByIds(startDeviceIdList, SecurityConstants.INNER);
//                if (r.getCode() != HttpStatus.SUCCESS) {
//                    throw new RuntimeException("根据设备id集合查询设备信息失败");
@@ -257,7 +257,7 @@
//                if (!deviceList.isEmpty()) {
//                    // 查找是否已经开启录像, 如果没有则开启录像
//                    for (ArdChannel device : deviceList) {
////                        if ("OFFLINE".equals(device.getDeviceStatus())) {
////                        if (!Boolean.TRUE.equals(device.getDeviceOnLine())) {
////                            log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现设备不在线, id: {}", device.getId());
////                            return;
////                        }
@@ -302,7 +302,7 @@
                        streamInfo.getApp(), streamInfo.getStream());
                if (mediaInfo.getReaderCount() == null || mediaInfo.getReaderCount() == 0) {
                    R<ArdChannel> r = remoteChannelService.getInfo(deviceId, SecurityConstants.INNER);
                    // R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
                    // R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
                    if (r.getCode() != HttpStatus.SUCCESS) {
                        throw new RuntimeException("根据通道id查询设备信息失败");
                    }