| | |
| | | .listPage((int)firstResult, (int)page.getSize()); |
| | | |
| | | List<FlowVO> records = new LinkedList<>(); |
| | | Map<String,String> processDefKeyMap = new HashMap<>(); |
| | | |
| | | //Map<String,String> processDefKeyMap = new HashMap<>();//使用TaskDefinitionKey缓存ProcessDefinitionKey |
| | | //Map<String,String> processDefNameMap = new HashMap<>();//使用TaskDefinitionKey缓存ProcessDefinitionName |
| | | Map<String,String> startUserMap = new HashMap<>();//使用userId缓存其姓名 |
| | | for(HistoricTaskInstance hisTask : processes) { |
| | | FlowVO vo = new FlowVO(); |
| | | |
| | | |
| | | HistoricProcessInstance processInstance = historyService |
| | | .createHistoricProcessInstanceQuery() |
| | | .processInstanceId(hisTask.getProcessInstanceId()) |
| | | .singleResult(); |
| | | vo.setProcessDefinitionKey(processInstance.getProcessDefinitionKey()); |
| | | |
| | | if(startUserMap.containsKey(processInstance.getStartUserId())) { |
| | | vo.setStartUserName(startUserMap.get(processInstance.getStartUserId())); |
| | | }else { |
| | | R<User> ru = userClient.userInfoById(Long.valueOf(processInstance.getStartUserId())); |
| | | if (ru.isSuccess()) { |
| | | vo.setStartUserName(ru.getData().getName()); |
| | | startUserMap.put(processInstance.getStartUserId(),ru.getData().getName()); |
| | | } |
| | | } |
| | | vo.setProcessCreateTime(processInstance.getStartTime()); |
| | | |
| | | vo.setProcessInstanceId(hisTask.getProcessInstanceId()); |
| | | //vo.setProcessDefinitionName(processInstance.getProcessDefinitionName()); |
| | | |
| | | |
| | | vo.setTaskName(hisTask.getName()); |
| | | vo.setCreateTime(hisTask.getCreateTime()); |
| | | vo.setEndTime(hisTask.getEndTime()); |
| | | vo.setVariables(hisTask.getProcessVariables()); |
| | | |
| | | //vo.setTaskDefinitionKey(); |
| | | //hisTask.getCreateTime() |
| | | Date processStartTime = historyService.createHistoricProcessInstanceQuery() |
| | | .processInstanceId(hisTask.getProcessInstanceId()) |
| | | .singleResult() |
| | | .getStartTime(); |
| | | |
| | | vo.setProcessCreateTime(processStartTime); |
| | | vo.setProcessCreateTime(processInstance.getStartTime()); |
| | | vo.setHistoryTaskEndTime(hisTask.getEndTime()); |
| | | |
| | | vo.setFile(getFileString(hisTask.getProcessInstanceId())); |