From bef523fdec150b6cbc7c81c92069dd9a0a6a4d57 Mon Sep 17 00:00:00 2001 From: pengwei Date: Fri, 24 Oct 2025 09:26:59 +0800 Subject: [PATCH] =?UTF-8?q?fit:=E5=AE=9A=E6=97=B6=E4=BB=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biutag/supervision/config/InterceptorConfig.java | 2 +- .../controller/data/DataMailBoxController.java | 12 ++++++++++++ src/main/java/com/biutag/supervision/job/Job.java | 4 ++-- .../supervision/service/BusinessDepartService.java | 9 +++++---- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java index 405a810..910c998 100644 --- a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -47,7 +47,7 @@ public class InterceptorConfig implements WebMvcConfigurer { .excludePathPatterns("/common/**") .excludePathPatterns("/app/**") // excel导出 - .excludePathPatterns("/data/petitionComplaint12337/export/result","/err","/sampling/export/samplingPoling", "/negative/books/export/**","/data/petitionComplaint/export/**","/confinement/export","/books/dataThread/export") + .excludePathPatterns("/data/mailbox/updateBaseData","/data/petitionComplaint12337/export/result","/err","/sampling/export/samplingPoling", "/negative/books/export/**","/data/petitionComplaint/export/**","/confinement/export","/books/dataThread/export") .excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**")); registry.addInterceptor(new ApiInterceptor()) .addPathPatterns("/api/jwdc/**"); diff --git a/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java b/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java index 1501b28..3b50eed 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.job.Job; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.DataPetitionComplaintReplenishDto; import com.biutag.supervision.pojo.entity.DataMailbox; @@ -22,6 +23,7 @@ import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.SupDictDataService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -43,6 +45,9 @@ public class DataMailBoxController { private final DataMailboxService dataMailboxService; private final SupDictDataService dictDataService; + + + private final Job job; @GetMapping public Result> list(NegativeQueryParam param) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() @@ -101,4 +106,11 @@ public class DataMailBoxController { }).sheet(0).headRowNumber(1).doRead(); return Result.success(); } + + @GetMapping("/updateBaseData") + public Result updateBaseData(){ + + job.updateBaseData(); + return Result.success(); + } } diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 3392752..80c6b2c 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -62,10 +62,10 @@ public class Job { } // 每日04:00更新基础数据 - @Scheduled(cron = "0 0 3 * * ?") + @Scheduled(cron = "0 0 23 * * ?") public void updateBaseData() { // 0秒 - + log.info("获取数据-------updateBaseData-----------"); //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() diff --git a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java index 68f2df0..436a52f 100644 --- a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java +++ b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java @@ -143,6 +143,7 @@ public class BusinessDepartService extends ServiceImpl resultMap = resultList.stream().collect(Collectors.toMap(map -> (String) map.get("departId"), map -> (Long) map.get("groupId"))); List groupIds = new ArrayList<>(); + log.info("映射成是我们单位的数据"); // 映射成是我们单位的数据 generateBusinessDepartList(happenTime, gBaseJJDSList, resultMap, resultMap2, resultMap3, groupIds, businessDepartList, gBaseAJJBXXListSA, gBaseAJJBXXListLA, gBaseAJJBXXListPA); List> nameList = statisticsGroupMapper.getNameByGroupIds(groupIds); @@ -160,7 +161,7 @@ public class BusinessDepartService extends ServiceImpl happenTime, List gBaseJJDSList, Map resultMap, Map resultMap2, Map resultMap3, List groupIds, List businessDepartList, List gBaseAJJBXXListSA, List gBaseAJJBXXListLA, List gBaseAJJBXXListPA) { for (GBaseJJD gBaseJJD : gBaseJJDSList) { - Long groupId = Long.valueOf(resultMap2.get(gBaseJJD.getGxdwdm())); + Long groupId = resultMap.get(resultMap2.get(gBaseJJD.getGxdwdm())); if (groupId == null) { continue; } @@ -169,7 +170,7 @@ public class BusinessDepartService extends ServiceImpl