From bcf62488f4d197355a9397cd5ed55b94a5828f7d Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 7 Mar 2023 22:00:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E5=9B=9E=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=86=85=E5=AE=B9=E8=B0=83=E6=95=B4=E5=B9=B6=E9=80=9A?= =?UTF-8?q?=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../todocenter/controller/TodoCenterController.java | 4 ++-- .../pmapi/todocenter/manage/TodoCenterManage.java | 21 +++++++-------------- .../pmapi/todocenter/model/dto/AdjustHandleDTO.java | 3 --- 3 files changed, 9 insertions(+), 19 deletions(-) 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; }