Browse Source

fix: 开始节点展示存在问题

master
tony 3 years ago
parent
commit
9cdbdc51b3
  1. 2
      LICENSE
  2. 35
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java

2
LICENSE

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. identification within third-party archives.
Copyright [yyyy] [name of copyright owner] Copyright (c) 2022 tony Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

35
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java

@ -794,27 +794,28 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
List<HistoricActivityInstance> list = historyService List<HistoricActivityInstance> list = historyService
.createHistoricActivityInstanceQuery() .createHistoricActivityInstanceQuery()
.processInstanceId(procInsId) .processInstanceId(procInsId)
.orderByHistoricActivityInstanceEndTime() .orderByHistoricActivityInstanceStartTime()
.desc().list(); .desc().list();
List<FlowTaskDto> hisFlowList = new ArrayList<>(); List<FlowTaskDto> hisFlowList = new ArrayList<>();
for (HistoricActivityInstance histIns : list) { for (HistoricActivityInstance histIns : list) {
// 展示开始节点 // 展示开始节点
if ("startEvent".equals(histIns.getActivityType())) { // if ("startEvent".equals(histIns.getActivityType())) {
FlowTaskDto flowTask = new FlowTaskDto(); // FlowTaskDto flowTask = new FlowTaskDto();
// 流程发起人信息 // // 流程发起人信息
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() // HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(histIns.getProcessInstanceId()) // .processInstanceId(histIns.getProcessInstanceId())
.singleResult(); // .singleResult();
SysUser startUser = sysUserService.selectUserById(Long.parseLong(historicProcessInstance.getStartUserId())); // SysUser startUser = sysUserService.selectUserById(Long.parseLong(historicProcessInstance.getStartUserId()));
flowTask.setTaskName(startUser.getNickName() + "(" + startUser.getDept().getDeptName() + ")发起申请"); // flowTask.setTaskName(startUser.getNickName() + "(" + startUser.getDept().getDeptName() + ")发起申请");
flowTask.setFinishTime(histIns.getEndTime()); // flowTask.setFinishTime(histIns.getEndTime());
hisFlowList.add(flowTask); // hisFlowList.add(flowTask);
} else if ("endEvent".equals(histIns.getActivityType())) { // } else if ("endEvent".equals(histIns.getActivityType())) {
FlowTaskDto flowTask = new FlowTaskDto(); // FlowTaskDto flowTask = new FlowTaskDto();
flowTask.setTaskName(StringUtils.isNotBlank(histIns.getActivityName()) ? histIns.getActivityName() : "结束"); // flowTask.setTaskName(StringUtils.isNotBlank(histIns.getActivityName()) ? histIns.getActivityName() : "结束");
flowTask.setFinishTime(histIns.getEndTime()); // flowTask.setFinishTime(histIns.getEndTime());
hisFlowList.add(flowTask); // hisFlowList.add(flowTask);
} else if (StringUtils.isNotBlank(histIns.getTaskId())) { // } else
if (StringUtils.isNotBlank(histIns.getTaskId())) {
FlowTaskDto flowTask = new FlowTaskDto(); FlowTaskDto flowTask = new FlowTaskDto();
flowTask.setTaskId(histIns.getTaskId()); flowTask.setTaskId(histIns.getTaskId());
flowTask.setTaskName(histIns.getActivityName()); flowTask.setTaskName(histIns.getActivityName());

Loading…
Cancel
Save