|
@@ -1,13 +1,25 @@
|
|
package com.management.platform.task;
|
|
package com.management.platform.task;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.management.platform.constant.Constant;
|
|
import com.management.platform.constant.Constant;
|
|
|
|
+import com.management.platform.entity.Screenshot;
|
|
|
|
+import com.management.platform.mapper.ScreenshotMapper;
|
|
|
|
+import com.management.platform.service.ScreenshotService;
|
|
import com.management.platform.util.AuthService;
|
|
import com.management.platform.util.AuthService;
|
|
|
|
+import com.management.platform.util.CheckPicUtil;
|
|
import com.management.platform.util.RedisUtil;
|
|
import com.management.platform.util.RedisUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.time.temporal.TemporalAccessor;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -22,6 +34,12 @@ public class TimingTask {
|
|
@Autowired
|
|
@Autowired
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private ScreenshotMapper screenshotMapper;
|
|
|
|
+
|
|
|
|
+ @Value(value = "${upload.path}")
|
|
|
|
+ private String path;
|
|
|
|
+
|
|
// @Scheduled(cron = "0 */5 * * * ?")//配置时间段触发(每五分钟触发一次)
|
|
// @Scheduled(cron = "0 */5 * * * ?")//配置时间段触发(每五分钟触发一次)
|
|
public void pictureDetectionTask(){
|
|
public void pictureDetectionTask(){
|
|
String accessToken = "";
|
|
String accessToken = "";
|
|
@@ -35,6 +53,15 @@ public class TimingTask {
|
|
redisUtil.setKeyWithExpireTime("accessToken",accessToken,expiresTimeOut);
|
|
redisUtil.setKeyWithExpireTime("accessToken",accessToken,expiresTimeOut);
|
|
}
|
|
}
|
|
//利用token去检测
|
|
//利用token去检测
|
|
|
|
+// DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
+// LocalDateTime l = LocalDateTime.parse("2019-02-03",dateTimeFormatter);
|
|
|
|
+ List<Screenshot> screenshots = screenshotMapper.selectList(new QueryWrapper<Screenshot>()
|
|
|
|
+ .eq("date_str", DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDateTime.now()))
|
|
|
|
+ .eq("is_handle", Constant.UN_HANDLE));
|
|
|
|
+ for (Screenshot screenshot : screenshots) {
|
|
|
|
+ String general = CheckPicUtil.general(path + screenshot.getPicUrl().substring("/upload/".length()), accessToken);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|