diff --git a/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java b/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java index 794a1c6..f0dad77 100644 --- a/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java +++ b/src/main/java/com/biutag/supervision/controller/rightsComfort/SuperviseController.java @@ -1,5 +1,6 @@ package com.biutag.supervision.controller.rightsComfort; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -18,6 +19,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import java.text.ParseException; +import java.util.Date; @RestController @RequestMapping("/rights/supervise") @@ -36,9 +38,13 @@ public class SuperviseController { * */ @GetMapping public Result> list(RpcApplySupervisionQueryParam queryParam){ - if ("20252222".equals(queryParam.getCaseNumber())){ + if ("更新维权督办".equals(queryParam.getCaseNumber())){ try { - job.rights(); + if (CollectionUtil.isNotEmpty(queryParam.getHappenTime()) && queryParam.getHappenTime().size()>=2){ + Date startTime = queryParam.getHappenTime().get(0); + Date endTime = queryParam.getHappenTime().get(1); + job.rights(startTime, endTime); + } } catch (ParseException e) { throw new RuntimeException(e); } diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 3f047e4..84b6107 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -138,16 +138,28 @@ public class Job { private final RpcPersonService rpcPersonService; private final SupDictDataService dictDataService; + + + + @Scheduled(cron = "0 30 23 * * ?") + public void rights() throws ParseException { + Date startTime = Date.from(LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()); + Date endTime = Date.from(LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant()); + rights(startTime, endTime); + } + + + // 每天一次 23:30:00 //todo 维权信息 // @Scheduled(cron = "0 30 23 * * ?") - public void rights() throws ParseException { + public void rights(Date startTime, Date endTime) throws ParseException { log.info("rights--------------------"); log.info("维权信息抓取中---------------------"); // 维权 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date startTime = sdf.parse("2025-12-01 00:00:00"); - Date endTime = sdf.parse("2025-12-30 00:00:00"); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// Date startTime = sdf.parse("2025-12-01 00:00:00"); +// Date endTime = sdf.parse("2025-12-30 00:00:00"); // Date startTime = Date.from(LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()); // Date endTime = Date.from(LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant());