|
|
|
|
@ -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()); |
|
|
|
|
|