| | |
| | | package com.ard.device.channel.service.impl; |
| | | |
| | | import com.ard.common.constant.CacheConstants; |
| | | import com.ard.common.constant.UserConstants; |
| | | import com.ard.common.core.redis.RedisCache; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.device.camera.domain.ArdCamera; |
| | | import com.ard.device.camera.service.IArdCameraService; |
| | |
| | | import com.ard.vtdu.domain.ArdVtdu; |
| | | import com.ard.vtdu.service.IArdVtduService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class ArdChannelServiceImpl implements IArdChannelService { |
| | | @Resource |
| | | private IArdCameraService ardCameraService; |
| | | // @Resource |
| | | //private IArdCameraService ardCameraService; |
| | | @Resource |
| | | private ArdChannelMapper ardChannelMapper; |
| | | @Resource |
| | | private IArdVtduService ardVtduService; |
| | | @Resource |
| | | private MediamtxConfig mediamtxConfig; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * 查询通道管理 |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void syncVtdu() { |
| | | log.debug("定时同步Vtdu任务"); |
| | | List<ArdChannel> channels = this.selectArdChannelList(new ArdChannel()); |
| | |
| | | // 根据通道信息获取rtsp源地址 |
| | | private String getRtspSource(ArdChannel channel) { |
| | | String rtspSource = ""; |
| | | ArdCamera ardCamera = ardCameraService.selectArdCameraById(channel.getDeviceId()); |
| | | ArdCamera ardCamera = redisCache.getCacheObject(CacheConstants.CAMERA_LIST_KEY + channel.getDeviceId()); |
| | | if (ardCamera != null) { |
| | | switch (ardCamera.getFactory()) { |
| | | case "1": |