Browse Source

fix:功能优化

master
pengwei 6 months ago
parent
commit
e58212399c
  1. 34
      src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java
  2. 2
      src/main/java/com/biutag/supervision/controller/work/ConfinementController.java
  3. 2
      src/main/java/com/biutag/supervision/pojo/param/ConfinementQueryParam.java
  4. 5
      src/main/java/com/biutag/supervision/service/ConfinementService.java

34
src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java

@ -82,10 +82,17 @@ public class DataPetitionComplaintController {
}
List<DataPetitionComplaintImportDto> list = new ArrayList<>();
// 定义关键词集合
Set<String> initialKeywords = Set.of("初访", "初次来信","到厅初信","初次来访","到厅初访","市局初信","到部初访","国家局初访");
Set<String> initialKeywordsTwo = Set.of("重复访","到部重访", "国信局重访", "重访");
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener<DataPetitionComplaintImportDto>() {
@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<Boolean> add(@RequestBody List<DataPetitionComplaintImportDto> list) {
// 定义关键词集合
Set<String> initialKeywords = Set.of("初访", "初次来信","到厅初信","初次来访","到厅初访","市局初信","到部初访","国家局初访");
Set<String> initialKeywordsTwo = Set.of("重复访","到部重访", "国信局重访", "重访");
List<DataPetitionComplaint> 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());

2
src/main/java/com/biutag/supervision/controller/work/ConfinementController.java

@ -60,7 +60,7 @@ public class ConfinementController {
/**
* 无用户权限判断的分页查询
* */
@GetMapping("listALl")
@GetMapping("listAll")
public Result<Page<ConfinementVo>> listAll(ConfinementQueryParam param){
return Result.success(confinementService.GetExportData(param));

2
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

5
src/main/java/com/biutag/supervision/service/ConfinementService.java

@ -70,7 +70,10 @@ public class ConfinementService extends ServiceImpl<ConfinementMapper, Confineme
public Page<ConfinementVo> GetExportData(ConfinementQueryParam param){
QueryWrapper<Confinement> 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()));
}

Loading…
Cancel
Save