From e58212399c3511b81849e7dfe812b1709e5d73f0 Mon Sep 17 00:00:00 2001 From: pengwei Date: Thu, 22 May 2025 11:43:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/DataPetitionComplaintController.java | 34 +++++++++++++++++++ .../work/ConfinementController.java | 2 +- .../pojo/param/ConfinementQueryParam.java | 2 ++ .../service/ConfinementService.java | 5 ++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java index 46e2f25..3235b70 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java @@ -82,10 +82,17 @@ public class DataPetitionComplaintController { } List list = new ArrayList<>(); + + // 定义关键词集合 + Set initialKeywords = Set.of("初访", "初次来信","到厅初信","初次来访","到厅初访","市局初信","到部初访","国家局初访"); + Set initialKeywordsTwo = Set.of("重复访","到部重访", "国信局重访", "重访"); ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener() { @Override public void invoke(DataPetitionComplaintImportDto data, AnalysisContext analysisContext) { + + + // 处理单位 if (StrUtil.isNotBlank(data.getInvolveDepartName())) { String[] departParts = data.getInvolveDepartName().replace("长沙市公安局", "").split("-"); @@ -110,6 +117,7 @@ public class DataPetitionComplaintController { } } + list.add(data); } @@ -258,6 +266,11 @@ public class DataPetitionComplaintController { @PostMapping("gab") @Transactional(rollbackFor = Exception.class) public Result add(@RequestBody List list) { + + // 定义关键词集合 + Set initialKeywords = Set.of("初访", "初次来信","到厅初信","初次来访","到厅初访","市局初信","到部初访","国家局初访"); + Set initialKeywordsTwo = Set.of("重复访","到部重访", "国信局重访", "重访"); + List petitionComplaints = list.stream().map(item -> { DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); BeanUtils.copyProperties(item, dataPetitionComplaint); @@ -265,6 +278,27 @@ public class DataPetitionComplaintController { dataPetitionComplaint.setCreateTime(LocalDateTime.now()); dataPetitionComplaint.setUpdateTime(LocalDateTime.now()); dataPetitionComplaint.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue()); + //信访形式 + if (StringUtil.isNotEmpty(item.getPetitionType())) { + dataPetitionComplaint.setChannelForFilingComplaints(item.getPetitionType()); + dataPetitionComplaint.setPetitionType(item.getPetitionType()); + } + + //信访内容 + if (StringUtil.isNotEmpty(item.getThingDesc())) { + //初访 + if(initialKeywords.stream().anyMatch(keyword -> + item.getThingDesc().contains(keyword)) ){ + dataPetitionComplaint.setInitialPetition("1"); +// updateWrapper.set(DataPetitionComplaint::getInitialPetition, "1" ); + } + //重访 + if(initialKeywordsTwo.stream().anyMatch(keyword -> + item.getThingDesc().contains(keyword)) ){ + dataPetitionComplaint.setInitialPetition("2"); +// updateWrapper.set(DataPetitionComplaint::getInitialPetition, "2" ); + } + } if (StrUtil.isNotBlank(item.getDiscoveryTime())) { try { dataPetitionComplaint.setDiscoveryTime(LocalDate.parse(item.getDiscoveryTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay()); diff --git a/src/main/java/com/biutag/supervision/controller/work/ConfinementController.java b/src/main/java/com/biutag/supervision/controller/work/ConfinementController.java index eeba1da..7525e03 100644 --- a/src/main/java/com/biutag/supervision/controller/work/ConfinementController.java +++ b/src/main/java/com/biutag/supervision/controller/work/ConfinementController.java @@ -60,7 +60,7 @@ public class ConfinementController { /** * 无用户权限判断的分页查询 * */ - @GetMapping("listALl") + @GetMapping("listAll") public Result> listAll(ConfinementQueryParam param){ return Result.success(confinementService.GetExportData(param)); diff --git a/src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java index 56c290d..ee06ee0 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java @@ -12,6 +12,8 @@ import java.util.List; @Getter @Setter public class ConfinementQueryParam extends BasePage { + + private String id; //姓名 private String name; //部门id diff --git a/src/main/java/com/biutag/supervision/service/ConfinementService.java b/src/main/java/com/biutag/supervision/service/ConfinementService.java index 384ef12..9ce0903 100644 --- a/src/main/java/com/biutag/supervision/service/ConfinementService.java +++ b/src/main/java/com/biutag/supervision/service/ConfinementService.java @@ -70,7 +70,10 @@ public class ConfinementService extends ServiceImpl GetExportData(ConfinementQueryParam param){ QueryWrapper queryWrapper = new QueryWrapper<>(); - //查询条件:姓名、部门、事由、禁闭时间(大于或者等于开始时间,小于或者等于结束时间) + //查询条件:id、姓名、部门、事由、禁闭时间(大于或者等于开始时间,小于或者等于结束时间) + if(StrUtil.isNotEmpty(param.getId())){ + queryWrapper.like(StrUtil.isBlank(param.getId()),"c1.id",StrUtil.trim(param.getId())); + } if(StrUtil.isNotEmpty(param.getName())){ queryWrapper.like(StrUtil.isBlank(param.getName()), "c1.name", StrUtil.trim(param.getName())); }