From 57f73108ea226c4a8af2b891764abf206ac54d22 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 26 Sep 2022 17:15:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=80=E6=9C=89=E6=B5=81=E7=A8=8B=E6=B5=81?= =?UTF-8?q?=E8=BD=AC=E5=A2=9E=E5=8A=A0=E5=BD=93=E5=89=8D=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HistoryController.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java index 6707483a..aab1a9b3 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java @@ -31,6 +31,7 @@ import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.history.HistoricProcessInstance; import org.activiti.engine.history.HistoricProcessInstanceQuery; +import org.activiti.engine.task.Task; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -191,6 +192,28 @@ public class HistoryController { // @RequiresPermissions("sys:his:all") public Result getTaskHandleDetailInfo(String processInstanceId) { List list = activitiService.getTaskHandleDetailInfo(processInstanceId); + if (runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() != null) { // 流程是否结束 + Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).active().includeProcessVariables().singleResult(); + if (task != null && StringUtils.isNotEmpty(task.getId()) && StringUtils.isNumeric(task.getAssignee())) { + final HistoryDetailDTO detailDTO = new HistoryDetailDTO(); + detailDTO.setId(task.getId()); + detailDTO.setAssignee(task.getAssignee()); + detailDTO.setAssigneeName(sysUserService.get(Long.valueOf(task.getAssignee())).getRealName()); + detailDTO.setActivityName(task.getName()); + detailDTO.setActivityType(""); + detailDTO.setStartTime(task.getCreateTime()); + detailDTO.setEndTime(null); + detailDTO.setDurationInSeconds(null); + detailDTO.setExecutionId(task.getExecutionId()); + detailDTO.setProcessDefinitionId(task.getProcessDefinitionId()); + detailDTO.setComment("待审核"); + final List taskHandleDetailInfo_ = new ArrayList<>(); + taskHandleDetailInfo_.add(detailDTO); + taskHandleDetailInfo_.addAll(list); + list.clear(); + list = taskHandleDetailInfo_; + } + } return new Result().ok(list); }