From 1e07b6de2c29143e7cca0b774c4bfe128d5ebdf5 Mon Sep 17 00:00:00 2001 From: pengwei Date: Fri, 24 Oct 2025 11:58:30 +0800 Subject: [PATCH] =?UTF-8?q?fit:=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/biutag/supervision/job/Job.java | 10 ++++++++-- .../supervision/SupervisionApplicationTests.java | 7 ++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 2c0d9e8..d7dac99 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -17,6 +17,8 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.Month; @@ -117,11 +119,15 @@ public class Job { // 每天一次 23:30:00 //todo 维权信息 @Scheduled(cron = "0 30 23 * * ?") - public void rights() { + public void rights() throws ParseException { log.info("rights--------------------"); log.info("维权信息抓取中---------------------"); // 维权 - List shrxxList = dwdAsjZfbaShrxx2Service.listAll(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date startTime = sdf.parse("2025-01-01 00:00:00"); + Date endTime = sdf.parse("2025-12-30 00:00:00"); + + List shrxxList = dwdAsjZfbaShrxx2Service.list(startTime,endTime); log.info("数据:{}条", shrxxList.size()); shrxxList.forEach(item -> { RpcApplySupervise rpcApply = new RpcApplySupervise(); diff --git a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java index cf50082..8b2ba39 100644 --- a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java +++ b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java @@ -20,6 +20,7 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.text.ParseException; import java.util.ArrayList; import java.util.List; @@ -52,15 +53,15 @@ class SupervisionApplicationTests { private NegativeFileService negativeFileService; @Test - void contextLoads() throws FileNotFoundException { + void contextLoads() throws FileNotFoundException, ParseException { List files = negativeFileService.list(new LambdaQueryWrapper().eq(NegativeFile::getFileName, "123.jpg")); System.out.println(files); testFun(); } - void testFun(){ - job.updateBaseData(); + void testFun() throws ParseException { + job.rights(); } public String getPathTrace(SupDepart depart) {