Browse Source

fit:1、7月28号督察任务编辑和下发改造v1 2、7月29号 督察问题下发和督察问题状态变更;督察问题删除

master
pengwei 4 months ago
parent
commit
eac54c4a27
  1. 1
      src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java
  2. 21
      src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java
  3. 11
      src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java
  4. 2
      src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionProblemQueryParam.java
  5. 1
      src/main/java/com/biutag/supervision/pojo/dto/TaskManagementDto.java
  6. 4
      src/main/java/com/biutag/supervision/pojo/entity/SupTaskProblem.java
  7. 2
      src/main/java/com/biutag/supervision/pojo/param/TaskProblemQueryParam.java
  8. 2
      src/main/java/com/biutag/supervision/pojo/vo/TaskSelfexaminationProblemVo.java
  9. 25
      src/main/java/com/biutag/supervision/service/TaskManagementService.java

1
src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java

@ -63,6 +63,7 @@ public class SelfexaminationController {
LambdaQueryWrapper<SupTaskProblem> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SupTaskProblem::getTaskId, taskId)
.orderByDesc(SupTaskProblem::getCreateTime);
queryWrapper.like(StrUtil.isNotBlank(queryParam.getDetail()),SupTaskProblem::getThingDesc,queryParam.getDetail());
Page<SupTaskProblem> page = taskProblemService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
List<TaskSelfexaminationProblemVo> records = page.getRecords().stream().map(item -> {

21
src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java

@ -41,6 +41,9 @@ public class TaskProblemController {
if (TaskTypeEnum.problem_shooting.name().equals(queryParam.getTaskType()) && !AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) ) {
queryWrapper.eq(SupTaskProblem::getCreateUsername, user.getUserName());
}
if(StrUtil.isNotBlank(queryParam.getActionType())){
queryWrapper.eq(!"0".equals(queryParam.getActionType()),SupTaskProblem::getProblemState,queryParam.getActionType());
}
queryWrapper.orderByDesc(SupTaskProblem::getCreateTime);
Page<SupTaskProblem> page = taskProblemService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
page.getRecords().forEach(item -> {
@ -56,9 +59,27 @@ public class TaskProblemController {
return Result.success(taskProblemService.getById(id));
}
@PutMapping("{id}")
public Result<Boolean> upProblemState(@PathVariable Integer id){
SupTaskProblem supTaskProblem = taskProblemService.getById(id);
if("1".equals(supTaskProblem.getProblemState())){
supTaskProblem.setProblemState("2");
}else{
supTaskProblem.setProblemState("1");
}
return Result.success(taskProblemService.updateById(supTaskProblem));
}
@PostMapping
public Result<Boolean> add(@RequestBody TaskProblemDto dto) {
return Result.success(taskProblemService.save(dto));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable Integer id){
return Result.success(taskProblemService.removeById(id));
}
}

11
src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java

@ -160,13 +160,13 @@ public class TestingAlcoholController {
TaskInspectionProblemVo vo =new TaskInspectionProblemVo();
switch (distribute.getTableKey()){
case "sdzc":
case "selfexamination":
vo= distribute.getProblemVo();
break;
case "rcdc":
case "inspection":
vo= distribute.getProblemVo();
break;
case "lxgddc":
case "testing_alcohol":
//违反六项规定
List<SupTaskProblem> list = supTaskProblemService.list(new LambdaQueryWrapper<SupTaskProblem>().eq(SupTaskProblem::getTaskId,distribute.getTaskId()));
//判断
@ -185,7 +185,7 @@ public class TestingAlcoholController {
}
}
break;
case "zdrydc":
case "risk_personal":
List<SupTaskProblem> taskProblems = supTaskProblemService.list(new LambdaQueryWrapper<SupTaskProblem>().eq(SupTaskProblem::getSupRecordId,distribute.getSupRecordId()));
if(CollectionUtil.isNotEmpty(taskProblems)){
SupTaskProblem problem = taskProblems.get(0);
@ -198,6 +198,9 @@ public class TestingAlcoholController {
}
}
break;
default:
vo= distribute.getProblemVo();
break;
}

2
src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionProblemQueryParam.java

@ -18,4 +18,6 @@ public class TaskInspectionProblemQueryParam extends BasePage {
private String departId;
private String detail;
}

1
src/main/java/com/biutag/supervision/pojo/dto/TaskManagementDto.java

@ -18,6 +18,7 @@ import java.util.List;
@Setter
@Getter
public class TaskManagementDto {
private int id;
//任务名称
private String taskName;

4
src/main/java/com/biutag/supervision/pojo/entity/SupTaskProblem.java

@ -44,6 +44,7 @@ public class SupTaskProblem {
private Integer peopleNumber;
// 具体情况
@TableField("thing_desc")
private String thingDesc;
// 附件
@ -73,4 +74,7 @@ public class SupTaskProblem {
@TableField("sup_record_id")
private String supRecordId;
@TableField("problem_state")
private String problemState;
}

2
src/main/java/com/biutag/supervision/pojo/param/TaskProblemQueryParam.java

@ -16,4 +16,6 @@ public class TaskProblemQueryParam extends BasePage {
private Integer taskId;
private String contentId;
private String actionType;
}

2
src/main/java/com/biutag/supervision/pojo/vo/TaskSelfexaminationProblemVo.java

@ -29,7 +29,7 @@ public class TaskSelfexaminationProblemVo {
private String problemTypeCode;
// 具体情况
private String detail;
private String thingDesc;
private String distributionState;

25
src/main/java/com/biutag/supervision/service/TaskManagementService.java

@ -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;
}

Loading…
Cancel
Save