mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 02:28:03 +08:00 
			
		
		
		
	【功能评审】Bpm:审批签名
This commit is contained in:
		| @ -58,7 +58,9 @@ public class BpmnVariableConstants { | ||||
|      * @see org.flowable.task.api.Task#getTaskLocalVariables() | ||||
|      */ | ||||
|     public static final String TASK_VARIABLE_REASON = "TASK_REASON"; | ||||
|  | ||||
|     /** | ||||
|      * 任务变量 - 签名图片 URL | ||||
|      */ | ||||
|     public static final String TASK_SIGN_PIC_URL = "TASK_SIGN_PIC_URL"; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -39,10 +39,10 @@ public class BpmProcessInstanceEventListener extends AbstractFlowableEngineEvent | ||||
|         processInstanceService.processProcessInstanceCompleted((ProcessInstance)event.getEntity()); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     // 特殊情况:当跳转到 EndEvent 流程实例未结束, 会执行 deleteProcessInstance 方法。 | ||||
|     @Override // 特殊情况:当跳转到 EndEvent 流程实例未结束, 会执行 deleteProcessInstance 方法 | ||||
|     protected void processCancelled(FlowableCancelledEvent event) { | ||||
|         ProcessInstance processInstance = processInstanceService.getProcessInstance(event.getProcessInstanceId()); | ||||
|         processInstanceService.processProcessInstanceCompleted(processInstance); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -213,6 +213,12 @@ public class FlowableUtils { | ||||
|         return (String) task.getTaskLocalVariables().get(BpmnVariableConstants.TASK_VARIABLE_REASON); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获得任务的签名图片 URL | ||||
|      * | ||||
|      * @param task 任务 | ||||
|      * @return 签名图片 URL | ||||
|      */ | ||||
|     public static String getTaskSignPicUrl(TaskInfo task) { | ||||
|         return (String) task.getTaskLocalVariables().get(BpmnVariableConstants.TASK_SIGN_PIC_URL); | ||||
|     } | ||||
|  | ||||
| @ -859,10 +859,11 @@ public class BpmTaskServiceImpl implements BpmTaskService { | ||||
|                 .moveActivityIdsToSingleActivityId(activityIds, endEvent.getId()) | ||||
|                 .changeState(); | ||||
|  | ||||
|         // 3. 如果跳转到 EndEvent 流程还未结束, 执行 deleteProcessInstance 方法。 | ||||
|         List<Execution> executionList = runtimeService.createExecutionQuery().processInstanceId(processInstanceId).list(); | ||||
|         if (CollUtil.isNotEmpty(executionList)) { | ||||
|             log.warn("执行跳转到 EndEvent 后, 流程实例未结束。执行 [deleteProcessInstance] 方法"); | ||||
|         // 3. 特殊:如果跳转到 EndEvent 流程还未结束, 执行 deleteProcessInstance 方法 | ||||
|         // TODO 芋艿:目前发现并行分支情况下,会存在这个情况,后续看看有没更好的方案; | ||||
|         List<Execution> executions = runtimeService.createExecutionQuery().processInstanceId(processInstanceId).list(); | ||||
|         if (CollUtil.isNotEmpty(executions)) { | ||||
|             log.warn("[moveTaskToEnd][执行跳转到 EndEvent 后, 流程实例未结束,强制执行 deleteProcessInstance 方法]"); | ||||
|             runtimeService.deleteProcessInstance(processInstanceId, reason); | ||||
|         } | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV