mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 WorkflowService 增加获取流程变量方法
This commit is contained in:
		@@ -46,6 +46,13 @@ public interface WorkflowService {
 | 
			
		||||
     */
 | 
			
		||||
    void setVariable(Long instanceId, Map<String, Object> variable);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取流程变量
 | 
			
		||||
     *
 | 
			
		||||
     * @param instanceId 流程实例id
 | 
			
		||||
     */
 | 
			
		||||
    Map<String, Object> instanceVariable(Long instanceId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 按照业务id查询流程实例id
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -123,7 +123,7 @@ public interface IFlwInstanceService {
 | 
			
		||||
     * @param instanceId 实例id
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    Map<String, Object> instanceVariable(String instanceId);
 | 
			
		||||
    Map<String, Object> instanceVariable(Long instanceId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设置流程变量
 | 
			
		||||
 
 | 
			
		||||
@@ -344,7 +344,7 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
 | 
			
		||||
     * @param instanceId 实例id
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Map<String, Object> instanceVariable(String instanceId) {
 | 
			
		||||
    public Map<String, Object> instanceVariable(Long instanceId) {
 | 
			
		||||
        Map<String, Object> map = new HashMap<>();
 | 
			
		||||
        FlowInstance flowInstance = flowInstanceMapper.selectById(instanceId);
 | 
			
		||||
        Map<String, Object> variableMap = flowInstance.getVariableMap();
 | 
			
		||||
 
 | 
			
		||||
@@ -78,6 +78,16 @@ public class WorkflowServiceImpl implements WorkflowService {
 | 
			
		||||
        flwInstanceService.setVariable(instanceId, variables);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取流程变量
 | 
			
		||||
     *
 | 
			
		||||
     * @param instanceId 流程实例id
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public Map<String, Object> instanceVariable(Long instanceId) {
 | 
			
		||||
        return flwInstanceService.instanceVariable(instanceId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 按照业务id查询流程实例id
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user