liusuyi
2025-12-27 fbced0c4dd4950a184f8471ef71995aa93dafd50
优化
3 files modified
21 ■■■■■ changed files
ard-device/src/main/java/com/ard/device/camera/service/impl/ArdCameraServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
ard-device/src/main/java/com/ard/device/channel/service/impl/ArdChannelServiceImpl.java 13 ●●●●● patch | view | raw | blame | history
ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdVtduServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
ard-device/src/main/java/com/ard/device/camera/service/impl/ArdCameraServiceImpl.java
@@ -379,7 +379,7 @@
     * @author 刘苏义
     * @date 2024/8/22 14:37
     */
    @Scheduled(cron = "0/10 * * * * ?")
    @Scheduled(fixedDelay = 5000)
    public void syncChannel() {
        try {
            log.debug("定时执行同步通道任务");
@@ -408,7 +408,7 @@
     * @author 刘苏义
     * @date 2024/8/22 14:37
     */
    @Scheduled(cron = "0/30 * * * * ?")
    @Scheduled(fixedDelay = 30000)
    public void failedReconnect() {
        try {
            log.debug("定时执行失败相机重连任务");
@@ -427,7 +427,7 @@
     * 刘苏义
     * 2023/10/8 14:54:41
     */
    @Scheduled(cron = "0/10 * * * * ?")
    @Scheduled(fixedDelay = 5000)
    public void cameraState() {
        try {
            log.debug("定时执行同步相机在线状态任务");
ard-device/src/main/java/com/ard/device/channel/service/impl/ArdChannelServiceImpl.java
@@ -1,6 +1,8 @@
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;
@@ -11,6 +13,7 @@
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;
@@ -27,14 +30,16 @@
@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;
    /**
     * 查询通道管理
@@ -141,7 +146,7 @@
    }
    @Scheduled(cron = "0/5 * * * * ?")
    @Scheduled(fixedDelay = 5000)
    public void syncVtdu() {
        log.debug("定时同步Vtdu任务");
        List<ArdChannel> channels = this.selectArdChannelList(new ArdChannel());
@@ -221,7 +226,7 @@
    // 根据通道信息获取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":
ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdVtduServiceImpl.java
@@ -38,7 +38,7 @@
        mediaService.clearAll();
    }
    @Scheduled(cron = "0/5 * * * * ?")
    @Scheduled(fixedDelay = 5000)
    public void syncMediamtx() {
        log.debug("定时同步MediaMTX任务");
        List<String> nameList = mediaService.getNameList();