From 0e4c61cda1adac54871abf0cc82a7bac053cd272 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 26 Sep 2022 16:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E5=8A=9B=E7=94=B3=E8=AF=B7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BD=93=E5=89=8D=E8=8A=82=E7=82=B9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TAbilityApplicationController.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index 3b78d7f9..50250357 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -28,12 +28,15 @@ import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.service.SysDeptService; +import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.activiti.engine.HistoryService; +import org.activiti.engine.TaskService; import org.activiti.engine.history.HistoricProcessInstance; +import org.activiti.engine.task.Task; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,6 +63,9 @@ import java.util.stream.Collectors; @Api(tags = "能力申请表单") public class TAbilityApplicationController { private static final Logger logger = LoggerFactory.getLogger(TAbilityApplicationController.class); + + @Value("${project.place}") + private Integer projectPlace; @Autowired private TAbilityApplicationService tAbilityApplicationService; @Autowired @@ -76,8 +82,10 @@ public class TAbilityApplicationController { private SysDeptService sysDeptService; @Autowired protected HistoryService historyService; - @Value("${project.place}") - private Integer projectPlace; + @Autowired + private TaskService taskService; + @Autowired + private SysUserService sysUserService; /** @@ -264,6 +272,23 @@ public class TAbilityApplicationController { } } + if (tAbilityApplicationDTOList.get(0).getApproveStatus().equals("审核中")) { // 若处于审核中时 增加当前节点信息 + Task task = taskService.createTaskQuery().processInstanceId(tAbilityApplicationDTOList.get(0).getInstanceId()).active().includeProcessVariables().singleResult(); + if (task != null && StringUtils.isNotEmpty(task.getId()) && StringUtils.isNumeric(task.getAssignee())) { + HistoryDetailDTO detailDTO = new HistoryDetailDTO(); + detailDTO.setId(task.getId()); + detailDTO.setAssignee(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()); + taskHandleDetailInfo.add(detailDTO); + } + } + boolean finalBackToFirst = backToFirst; return new HashMap() { {