From 21854bd168bdc7ed5105bac5fb9b71bfbc31281a Mon Sep 17 00:00:00 2001 From: pengwei Date: Thu, 23 Oct 2025 19:03:17 +0800 Subject: [PATCH] =?UTF-8?q?fit:=E5=A4=A7=E5=B1=8F=E6=8F=90=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SubOneSupervisionNotifyController.java | 12 ++++++---- .../java/com/biutag/supervision/job/Job.java | 23 ++++++++----------- .../SupervisionApplicationTests.java | 6 +++++ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java index cba2448..c0a5b0d 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -193,15 +193,17 @@ public class SubOneSupervisionNotifyController { .in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.XCDC.getValue(), ProblemSourcesEnum.LMGZ.getValue(), ProblemSourcesEnum.ZXDC.getValue()))); if(!negatives.isEmpty()){ List negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList(); - superviseMapIconVo.setTotalPro(String.valueOf(negatives.size())); - //已办理 - superviseMapIconVo.setCompletedNumber(negatives.stream().filter(item ->ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count()); - //办理中 - superviseMapIconVo.setProcessingNumber(negatives.size() - superviseMapIconVo.getCompletedNumber()); // 办结率 // superviseMapIconVo.setCompletedRate(superviseMapIconVo.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(superviseMapIconVo.getCompletedNumber(), superviseMapIconVo.getProblemNumber()), 100), 0).doubleValue()); //问责人数 、问责单位数 CompletableFuture.allOf( + CompletableFutureUtil.runSyncObject(()->{ + superviseMapIconVo.setTotalPro(String.valueOf(negatives.size())); + //已办理 + superviseMapIconVo.setCompletedNumber(negatives.stream().filter(item ->ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count()); + //办理中 + superviseMapIconVo.setProcessingNumber(negatives.size() - superviseMapIconVo.getCompletedNumber()); + }), CompletableFutureUtil.runSyncObject(() -> { //问责人数 long personNumber = negativeIds.isEmpty() ? 0 : negativeBlameService.count(new LambdaQueryWrapper().in(NegativeBlame::getNegativeId, negativeIds) diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 8b97f55..4956597 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -64,20 +64,17 @@ public class Job { // 每日04:00更新基础数据 @Scheduled(cron = "0 0 4 * * ?") public void updateBaseData() { - List happenTime = new ArrayList<>(); - - Date firstDayOfYear = Date.from( - LocalDate.now() // 当前日期 - .withDayOfYear(1) // 调整为当年第1天 - .atStartOfDay() // 转换为当天的00:00:00 - .atZone(ZoneId.systemDefault()) // 添加系统时区 - .toInstant() // 转为Instant - ); + // 0秒 - Date start = Date.from(LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()); - Date end = Date.from(LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant()); - - happenTime.add(firstDayOfYear); + //LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant() + //LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant() + LocalDateTime firstDay = LocalDate.now() + .withDayOfYear(1) + .atStartOfDay(); + List happenTime = new ArrayList<>(); + Date start = Date.from(firstDay.atZone(ZoneId.systemDefault()).toInstant()); + Date end = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()); + happenTime.add(start); happenTime.add(end); businessDepartService.generate(happenTime); businessPoliceService.generate(happenTime); diff --git a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java index 4dae7fc..cf50082 100644 --- a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java +++ b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java @@ -55,6 +55,12 @@ class SupervisionApplicationTests { void contextLoads() throws FileNotFoundException { List files = negativeFileService.list(new LambdaQueryWrapper().eq(NegativeFile::getFileName, "123.jpg")); System.out.println(files); + testFun(); + } + + + void testFun(){ + job.updateBaseData(); } public String getPathTrace(SupDepart depart) {