| | |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.flowable.task.api.Task; |
| | | import org.flowable.task.api.history.HistoricTaskInstance; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @AllArgsConstructor |
| | |
| | | if(vars.containsKey(FlowContants.CURED_NODE_ID)){ |
| | | programProperties.setCuredNodeId(Func.toLong(vars.get(FlowContants.CURED_NODE_ID))); |
| | | } |
| | | programProperties.setCureProgramUseable(String.valueOf(vars.get(FlowContants.CURE_PROGRAM_USEABLE))); |
| | | |
| | | |
| | | ProcessInstance processInstance = runtimeService.createProcessInstanceQuery() |
| | | .processInstanceId(processInstanceId) |
| | |
| | | return historicInstance != null && historicInstance.getEndTime() == null; |
| | | } |
| | | |
| | | /** |
| | | * 上一步处理人 |
| | | * @param processInstanceId 流程实例id |
| | | * @return assignee |
| | | */ |
| | | public String previusAssignee(String processInstanceId) { |
| | | // 获取历史任务实例 |
| | | List<HistoricTaskInstance> historicTasks = historyService.createHistoricTaskInstanceQuery() |
| | | .processInstanceId(processInstanceId) |
| | | .orderByHistoricTaskInstanceEndTime().asc() |
| | | .list(); |
| | | |
| | | // 获取上一个已完成的任务 |
| | | String assignee = ""; |
| | | if(!historicTasks.isEmpty()) { |
| | | assignee = historicTasks.get(historicTasks.size() - 1).getAssignee(); |
| | | } |
| | | return assignee; |
| | | } |
| | | } |
| | | |
| | | |