| | |
| | | .processInstanceId(procInsId) |
| | | .orderByHistoricActivityInstanceStartTime() |
| | | .desc().list(); |
| | | Date now =new Date(); |
| | | //扩展 |
| | | List<HistoricTaskInstance> taskList = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(procInsId) |
| | | .list(); |
| | | List<FlowTaskDto> hisFlowList = new ArrayList<>(); |
| | | for (HistoricActivityInstance histIns : list) { |
| | | // 展示开始节点 |
| | |
| | | } |
| | | |
| | | flowTask.setDuration(histIns.getDurationInMillis() == null || histIns.getDurationInMillis() == 0 ? null : getDate(histIns.getDurationInMillis())); |
| | | String taskId = histIns.getTaskId(); |
| | | |
| | | //扩展 判断是否超时 |
| | | for (HistoricTaskInstance taskInstance : taskList) { |
| | | Date dueDate = taskInstance.getDueDate(); |
| | | //找到对应任务节点 |
| | | if(dueDate!=null && taskInstance.getId().equals(taskId) ) { |
| | | //如果任务还没完成 |
| | | if(flowTask.getDuration()==null) { |
| | | //判断当前时间是否超过到期时间 |
| | | if (now.after(dueDate)) flowTask.setOvertime(Boolean.TRUE); |
| | | }else { |
| | | //如果任务节点已经完成了,用完成时间判断 |
| | | if(histIns.getEndTime().after(dueDate)) flowTask.setOvertime(Boolean.TRUE); |
| | | } |
| | | } |
| | | } |
| | | // 获取意见评论内容 |
| | | List<Comment> commentList = taskService.getProcessInstanceComments(histIns.getProcessInstanceId()); |
| | | commentList.forEach(comment -> { |
| | |
| | | @Override |
| | | public AjaxResult flowXmlAndNode(String procInsId, String deployId) { |
| | | try { |
| | | Date now = new Date(); |
| | | List<FlowViewerDto> flowViewerList = new ArrayList<>(); |
| | | // 获取已经完成的节点 |
| | | List<HistoricActivityInstance> listFinished = historyService.createHistoricActivityInstanceQuery() |
| | | .processInstanceId(procInsId) |
| | | .finished() |
| | | .list(); |
| | | //获取所有任务节点信息(扩展) |
| | | List<HistoricTaskInstance> taskList = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(procInsId) |
| | | .finished() |
| | | .list(); |
| | |
| | | FlowViewerDto flowViewerDto = new FlowViewerDto(); |
| | | flowViewerDto.setKey(s.getActivityId()); |
| | | flowViewerDto.setCompleted(true); |
| | | //扩展内容 已完成的用完成时间判断 |
| | | Date endTime = s.getEndTime(); |
| | | for (HistoricTaskInstance task : taskList) { |
| | | if(s.getTaskId()!=null && s.getTaskId().equals(task.getId())){ |
| | | if(task.getDueDate()!=null && endTime.after(task.getDueDate())){ |
| | | flowViewerDto.setOvertime(true); |
| | | } |
| | | } |
| | | } |
| | | // 退回节点不进行展示 |
| | | if (StringUtils.isBlank(s.getDeleteReason())) { |
| | | flowViewerList.add(flowViewerDto); |
| | |
| | | FlowViewerDto flowViewerDto = new FlowViewerDto(); |
| | | flowViewerDto.setKey(s.getActivityId()); |
| | | flowViewerDto.setCompleted(false); |
| | | //扩展内容 代办的通过当前时间去判断 |
| | | for (HistoricTaskInstance task : taskList) { |
| | | if(s.getTaskId()!=null && s.getTaskId().equals(task.getId())){ |
| | | if(task.getDueDate()!=null && now.after(task.getDueDate())){ |
| | | flowViewerDto.setOvertime(true); |
| | | } |
| | | } |
| | | } |
| | | flowViewerList.add(flowViewerDto); |
| | | }); |
| | | Map<String, Object> result = new HashMap(); |