|
@@ -1728,6 +1728,22 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
throw new MyException("找不到此任务!");
|
|
|
}
|
|
|
|
|
|
+ Optional<HistoricProcessInstance> historicProcessInstance = getHistoricProcessInstance(task.getProcessInstanceId());
|
|
|
+ HistoricProcessInstance historicProcess = historicProcessInstance.get();
|
|
|
+ //如果流程挂起了,报错
|
|
|
+ if (HistoricProcessInstance.STATE_SUSPENDED.equals(historicProcess.getState())) {
|
|
|
+ List<WorkflowRecord> recordList = workflowRecordMapper.selectList(
|
|
|
+ new QueryWrapper<WorkflowRecord>().lambda()
|
|
|
+ .eq(WorkflowRecord::getProcessId, task.getProcessInstanceId())
|
|
|
+ .orderByDesc(WorkflowRecord::getRecordTime)
|
|
|
+ );
|
|
|
+ String message = "流程已挂起,无法审核";
|
|
|
+ if(!recordList.isEmpty()){
|
|
|
+ message = recordList.get(0).getMessage();
|
|
|
+ }
|
|
|
+ throw new MyException(message);
|
|
|
+ }
|
|
|
+
|
|
|
//获取当前任务变量中的 schemaId
|
|
|
Long schemaId = Convert.toLong(taskService.getVariable(task.getId(), WorkflowConstant.PROCESS_SCHEMA_ID_KEY));
|
|
|
|
|
@@ -1840,7 +1856,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
|
|
|
List<LaunchAndApproveVo> result = new ArrayList<>();
|
|
|
|
|
|
- Optional<HistoricProcessInstance> historicProcessInstance = getHistoricProcessInstance(task.getProcessInstanceId());
|
|
|
+
|
|
|
|
|
|
try {
|
|
|
for (FormConfig formConfig : userTaskConfig.getFormConfigs()) {
|