|
|
|
@ -1,6 +1,7 @@
@@ -1,6 +1,7 @@
|
|
|
|
|
package com.ruoyi.code.camera.scheduled; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.RuntimeUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.ruoyi.code.camera.domain.Camera; |
|
|
|
|
import com.ruoyi.code.camera.domain.CameraBrand; |
|
|
|
|
import com.ruoyi.code.camera.service.ICameraBrandService; |
|
|
|
@ -29,13 +30,14 @@ public class RtspScreenshotTask {
@@ -29,13 +30,14 @@ public class RtspScreenshotTask {
|
|
|
|
|
@Autowired |
|
|
|
|
private ICameraBrandService iCameraBrandService; |
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0/5 * * * ?") |
|
|
|
|
@Scheduled(fixedRate = 1000000) |
|
|
|
|
// @Scheduled(cron = "0 0/5 * * * ?")
|
|
|
|
|
public void rtspScreenshot(){ |
|
|
|
|
List<String> strList = new ArrayList<>(); |
|
|
|
|
String path = RuoYiConfig.getProfile() + File.separator; |
|
|
|
|
String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + File.separator; |
|
|
|
|
String currentTime = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss").format(new Date()) + ".jpg"; |
|
|
|
|
List<Camera> list = cameraService.list(); |
|
|
|
|
List<Camera> list = cameraService.list(new QueryWrapper<Camera>().eq("access_type","1")); |
|
|
|
|
for (Camera camera : list) { |
|
|
|
|
CameraBrand cameraBrand = iCameraBrandService.getById(camera.getBrand()); |
|
|
|
|
String fileName = path+camera.getDevsn()+File.separator+currentDate; |
|
|
|
|