add 添加流程记录版本信息

This commit is contained in:
gssong 2024-06-03 21:32:23 +08:00
parent cfc2dba275
commit e0253a4ea8
2 changed files with 8 additions and 2 deletions

View File

@ -36,6 +36,10 @@ public class ActHistoryInfoVo implements Serializable {
* 流程实例id
*/
private String processInstanceId;
/**
* 版本
*/
private Integer version;
/**
* 开始时间
*/

View File

@ -280,7 +280,7 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
}
}
map.put("taskList", taskList);
List<ActHistoryInfoVo> historyTaskList = getHistoryTaskList(processInstanceId);
List<ActHistoryInfoVo> historyTaskList = getHistoryTaskList(processInstanceId, processInstance.getProcessDefinitionVersion());
map.put("historyList", historyTaskList);
InputStream inputStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), processDefinition.getResourceName());
xml.append(IoUtil.read(inputStream, StandardCharsets.UTF_8));
@ -292,8 +292,9 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
* 获取历史任务节点信息
*
* @param processInstanceId 流程实例id
* @param version 版本
*/
private List<ActHistoryInfoVo> getHistoryTaskList(String processInstanceId) {
private List<ActHistoryInfoVo> getHistoryTaskList(String processInstanceId, Integer version) {
//查询任务办理记录
List<HistoricTaskInstance> list = QueryUtils.hisTaskInstanceQuery(processInstanceId).orderByHistoricTaskInstanceEndTime().desc().list();
list = StreamUtils.sorted(list, Comparator.comparing(HistoricTaskInstance::getEndTime, Comparator.nullsFirst(Date::compareTo)).reversed());
@ -305,6 +306,7 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
if (ObjectUtil.isNotEmpty(historicTaskInstance.getDurationInMillis())) {
actHistoryInfoVo.setRunDuration(getDuration(historicTaskInstance.getDurationInMillis()));
}
actHistoryInfoVo.setVersion(version);
actHistoryInfoVoList.add(actHistoryInfoVo);
}
List<ActHistoryInfoVo> historyInfoVoList = new ArrayList<>();