|
|
|
|
@ -75,8 +75,6 @@ public class TaskManagementService {
|
|
|
|
|
if(CollectionUtil.isNotEmpty(dto.getFileList())){ |
|
|
|
|
task.setFiles(JSON.toJSONString(dto.getFileList())); |
|
|
|
|
} |
|
|
|
|
log.info("---------------------"); |
|
|
|
|
log.info(String.valueOf("六项规定督察".equals(dto.getSpecialType()))); |
|
|
|
|
if("日常督察".equals(dto.getSupervisionType())){ |
|
|
|
|
task.setTaskType("inspection"); |
|
|
|
|
}else{ |
|
|
|
|
@ -109,16 +107,16 @@ public class TaskManagementService {
|
|
|
|
|
task.setTaskType("risk_personal"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
taskService.save(task); |
|
|
|
|
taskService.saveOrUpdate(task); |
|
|
|
|
if("日常督察".equals(dto.getSupervisionType())){ |
|
|
|
|
SupTaskInspection testingAlcohol = new SupTaskInspection(); |
|
|
|
|
BeanUtils.copyProperties(dto, testingAlcohol); |
|
|
|
|
testingAlcohol.setTaskId(task.getId()); |
|
|
|
|
supTaskInspectionService.save(testingAlcohol); |
|
|
|
|
supTaskInspectionService.saveOrUpdate(testingAlcohol); |
|
|
|
|
dto.getPersons().forEach(item -> { |
|
|
|
|
item.setTaskId(task.getId()); |
|
|
|
|
}); |
|
|
|
|
return taskPersonService.saveBatch(dto.getPersons()); |
|
|
|
|
return taskPersonService.saveOrUpdateBatch(dto.getPersons()); |
|
|
|
|
}else{ |
|
|
|
|
if("所队自查".equals(dto.getSpecialType())){ |
|
|
|
|
SupTaskSelfexamination selfexamination = new SupTaskSelfexamination(); |
|
|
|
|
@ -127,7 +125,7 @@ public class TaskManagementService {
|
|
|
|
|
selfexamination.setRequirement(dto.getTaskContent()); |
|
|
|
|
selfexamination.setRequirementHtml(dto.getTaskContentHtml()); |
|
|
|
|
selfexamination.setHasSign(false); |
|
|
|
|
selfexaminationService.save(selfexamination); |
|
|
|
|
selfexaminationService.saveOrUpdate(selfexamination); |
|
|
|
|
// 自选单位
|
|
|
|
|
List<SupTaskSelfexaminationDepart> list = new ArrayList<>(); |
|
|
|
|
dto.getSelfOrgs().forEach(s->{ |
|
|
|
|
@ -138,13 +136,13 @@ public class TaskManagementService {
|
|
|
|
|
depart.setCreateTime(LocalDateTime.now()); |
|
|
|
|
list.add(depart); |
|
|
|
|
}); |
|
|
|
|
supTaskSelfexaminationDepartService.saveBatch(list); |
|
|
|
|
supTaskSelfexaminationDepartService.saveOrUpdateBatch(list); |
|
|
|
|
//任务内容
|
|
|
|
|
dto.getSelfContents().forEach(content -> { |
|
|
|
|
content.setTaskId(task.getId()); |
|
|
|
|
content.setStatus(TaskStatusEnum.todo.name()); |
|
|
|
|
}); |
|
|
|
|
return selfexaminationContentService.saveBatch(dto.getSelfContents()); |
|
|
|
|
return selfexaminationContentService.saveOrUpdateBatch(dto.getSelfContents()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if("六项规定督察".equals(dto.getSpecialType())){ |
|
|
|
|
@ -156,7 +154,7 @@ public class TaskManagementService {
|
|
|
|
|
testingAlcohol.setSummary(String.format("应检%s人,已检0人,未检0人,发现0个问题。", dto.getUserList().size())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
testingAlcoholService.save(testingAlcohol); |
|
|
|
|
testingAlcoholService.saveOrUpdate(testingAlcohol); |
|
|
|
|
//处理关联关系
|
|
|
|
|
List<SupTaskTestingAlcoholSampling> samplings = new ArrayList<>(); |
|
|
|
|
if(CollectionUtil.isNotEmpty(dto.getSamplingIds())){ |
|
|
|
|
@ -166,17 +164,17 @@ public class TaskManagementService {
|
|
|
|
|
sampling.setSamplingId(s); |
|
|
|
|
samplings.add(sampling); |
|
|
|
|
}); |
|
|
|
|
alcoholSamplingService.saveBatch(samplings); |
|
|
|
|
alcoholSamplingService.saveOrUpdateBatch(samplings); |
|
|
|
|
} |
|
|
|
|
dto.getPersons().forEach(item -> { |
|
|
|
|
item.setTaskId(task.getId()); |
|
|
|
|
}); |
|
|
|
|
taskPersonService.saveBatch(dto.getPersons()); |
|
|
|
|
taskPersonService.saveOrUpdateBatch(dto.getPersons()); |
|
|
|
|
dto.getUserList().forEach(item -> { |
|
|
|
|
item.setTaskId(task.getId()); |
|
|
|
|
item.setStatus(TaskStatusEnum.todo.name()); |
|
|
|
|
}); |
|
|
|
|
return testingAlcoholPeopleService.saveBatch(dto.getUserList()); |
|
|
|
|
return testingAlcoholPeopleService.saveOrUpdateBatch(dto.getUserList()); |
|
|
|
|
} |
|
|
|
|
if("重点人员管控".equals(dto.getSpecialType())){ |
|
|
|
|
List<SupTaskPerson> list = dto.getSupRiskDtoList().stream().map(item -> item.getControlEmpNo()).distinct().map(empNo -> { |
|
|
|
|
@ -192,7 +190,7 @@ public class TaskManagementService {
|
|
|
|
|
personalSup.setIdCode(controlIdcode); |
|
|
|
|
return personalSup; |
|
|
|
|
}).toList(); |
|
|
|
|
taskPersonService.saveBatch(list); |
|
|
|
|
taskPersonService.saveOrUpdateBatch(list); |
|
|
|
|
|
|
|
|
|
dto.getSupRiskDtoList().forEach(s->{ |
|
|
|
|
SupTaskPerson supTaskPerson = list.stream().filter(item -> item.getEmpNo().equals(s.getControlEmpNo())).findFirst().orElse(null); |
|
|
|
|
@ -304,6 +302,7 @@ public class TaskManagementService {
|
|
|
|
|
taskManagementDto.setSupRiskDtoList(supRiskDtoList); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
taskManagementDto.setId(id); |
|
|
|
|
return taskManagementDto; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|