根据配置文件抓拍图片

This commit is contained in:
lcj
2025-10-11 10:50:14 +08:00
parent b47cdb5732
commit 00e9fa1ea3
3 changed files with 8 additions and 1 deletions

View File

@ -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<OthYs7Device> deviceList = ys7DeviceService.lambdaQuery()
.select(OthYs7Device::getId, OthYs7Device::getDeviceSerial, OthYs7Device::getDeviceName)