diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java index 3def55b..18b0c36 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java @@ -164,9 +164,9 @@ public class TodoCenterController { } @ApiOperation(value = "被退回项目内容调整并通过", notes = "被退回项目内容调整并通过") - @PostMapping + @PostMapping("/adjustAndHandle") public String startTheProcess(@Validated @RequestBody AdjustHandleDTO dto) { - String instanceId = todoCenterManage.adjustment(dto); + String instanceId = todoCenterManage.adjustmentAndHandle(dto); return "退回项目内容调整并且重新通过 【" + instanceId + "】 成功"; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 26e0359..e262694 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -45,6 +45,7 @@ import com.wflow.contants.HisProInsEndActId; import com.wflow.exception.BusinessException; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import com.wflow.workflow.bean.dto.ReqProcessHandlerDTO; +import com.wflow.workflow.bean.process.ProcessComment; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.process.enums.NodeTypeEnum; import com.wflow.workflow.bean.vo.ProcessInstanceVo; @@ -127,20 +128,13 @@ public class TodoCenterManage { return PageVo.empty(); } - List instances = historyService.createHistoricProcessInstanceQuery() - .list(); - Map instanceMap = CollUtils.listToMap(instances, HistoricProcessInstance::getId); - List resVos = projectPage.getRecords().stream().map(d -> { ResToBeProcessedVO res = new ResToBeProcessedVO(); BeanUtils.copyProperties(d, res); res.setProjectId(d.getId()); ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode()); res.setNodeId(taskVo.getTaskDefKey()); - if (instanceMap.containsKey(d.getInstCode())) { - res.setProcessStatusName(processInstanceService - .buildProcessStatusStr(instanceMap.get(d.getInstCode()))); - } + res.setProcessStatusName(taskVo.getStatus()); res.setProcessLaunchTime(d.getCreateOn()); return res; }).collect(Collectors.toList()); @@ -628,9 +622,8 @@ public class TodoCenterManage { return PageVo.empty(); } List instCodes = userIdoList.stream().map(ProcessTaskVo::getInstanceId).collect(Collectors.toList()); - List instances = historyService.createHistoricProcessInstanceQuery() - .list(); - Map instanceMap = CollUtils.listToMap(instances, HistoricProcessInstance::getId); + Map taskVoMap = userIdoList.stream().collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); + // 分页查询项目信息 ProjectListReq projectListReq = new ProjectListReq(); @@ -645,7 +638,8 @@ public class TodoCenterManage { ResToBeProcessedVO res = new ResToBeProcessedVO(); BeanUtils.copyProperties(d, res); res.setProjectId(d.getId()); - res.setProcessStatusName(processInstanceService.buildProcessStatusStr(instanceMap.get(d.getInstCode()))); + ProcessTaskVo taskVo = taskVoMap.get(d.getInstCode()); + res.setProcessStatusName(taskVo.getStatus()); res.setProcessLaunchTime(d.getCreateOn()); res.setProcessHandleTime(d.getUpdateOn()); return res; @@ -906,7 +900,7 @@ public class TodoCenterManage { * @return */ @Transactional(rollbackFor = Exception.class) - public String adjustment(AdjustHandleDTO dto) { + public String adjustmentAndHandle(AdjustHandleDTO dto) { ProjectDTO projectDto = dto.getProjectInfo(); Project projectInfo = projectService.getById(projectDto.getId()); @@ -926,7 +920,6 @@ public class TodoCenterManage { handlerDTO.setInstanceId(dto.getInstanceId()); handlerDTO.setTaskId(dto.getTaskId()); handlerDTO.setAction(ProcessHandlerEnum.PASS); - handlerDTO.setAuditInfo(dto.getAuditInfo()); handler(handlerDTO); return dto.getInstanceId(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/AdjustHandleDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/AdjustHandleDTO.java index 6378d49..df583f0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/AdjustHandleDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/AdjustHandleDTO.java @@ -53,7 +53,4 @@ public class AdjustHandleDTO implements Serializable { @ApiModelProperty("任务ID") @NotNull(message = "任务ID不能为空!") private String taskId; - - @ApiModelProperty("审核信息") - private ProcessComment auditInfo; }