diff --git a/xinnengyuan/ruoyi-admin/src/main/resources/application-dev.yml b/xinnengyuan/ruoyi-admin/src/main/resources/application-dev.yml index ee05c0f2..5ac44e23 100644 --- a/xinnengyuan/ruoyi-admin/src/main/resources/application-dev.yml +++ b/xinnengyuan/ruoyi-admin/src/main/resources/application-dev.yml @@ -298,6 +298,8 @@ dxf2GeoJson: ys7: app-key: 3acf9f1a43dc4209841e0893003db0a2 app-secret: 09e29c70ae1161fbc3ce2030fc09ba2e + job: + capture-enabled: false # 控制是否启用萤石抓拍任务 #ys7: # app-key: 081b0d6d5f7f4de8bc5c7fa350fb26ec # app-secret: caa37b9f60ef02deb57e563bc190e6db diff --git a/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml b/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml index 1623c947..41e621cd 100644 --- a/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml +++ b/xinnengyuan/ruoyi-admin/src/main/resources/application-prod.yml @@ -301,6 +301,8 @@ dxf2GeoJson: ys7: app-key: 3acf9f1a43dc4209841e0893003db0a2 app-secret: 4bbf3e9394f55d3af6e3af27b2d3db36 + job: + capture-enabled: true # 控制是否启用萤石抓拍任务 # 斯巴达算法 sparta: url: http://119.3.204.120:8040 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java index 1ceca99e..29c727de 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/cycle/IncSyncYs7DeviceCapturePicData.java @@ -10,6 +10,7 @@ import org.dromara.other.domain.enums.OthDeviceStatusEnum; import org.dromara.other.service.IOthDevicePresetService; import org.dromara.other.service.IOthYs7DeviceImgService; import org.dromara.other.service.IOthYs7DeviceService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -27,6 +28,7 @@ import java.util.stream.Collectors; */ @Slf4j @Component +@ConditionalOnProperty(prefix = "ys7.job", name = "capture-enabled", havingValue = "true") public class IncSyncYs7DeviceCapturePicData { @Resource @@ -44,8 +46,9 @@ public class IncSyncYs7DeviceCapturePicData { private final ExecutorService executorService = Executors.newFixedThreadPool(5); // 每 15 分钟执行一次 - @Scheduled(cron = "0 */15 7-19 * * ?") + @Scheduled(cron = "0 */10 7-19 * * ?") public void run() { + log.info("执行萤石设备抓拍图片"); // 查询所有在线的摄像头设备,仅获取必要字段 List deviceList = ys7DeviceService.lambdaQuery() .select(OthYs7Device::getId, OthYs7Device::getDeviceSerial, OthYs7Device::getDeviceName)