mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	update 调整模型部署错误 添加获取流程实例id接口
This commit is contained in:
		@@ -65,4 +65,12 @@ public interface WorkflowService {
 | 
			
		||||
     * @param variables 流程变量
 | 
			
		||||
     */
 | 
			
		||||
    void setVariablesLocal(String taskId, Map<String, Object> variables);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 按照业务id查询流程实例id
 | 
			
		||||
     *
 | 
			
		||||
     * @param businessKey 业务id
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    String getInstanceIdByBusinessKey(String businessKey);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -67,4 +67,10 @@ public class TestLeaveVo implements Serializable {
 | 
			
		||||
    @ExcelProperty(value = "状态")
 | 
			
		||||
    private String status;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 流程实例id
 | 
			
		||||
     */
 | 
			
		||||
    @ExcelProperty(value = "流程实例id")
 | 
			
		||||
    private String processInstanceId;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,9 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public TestLeaveVo queryById(Long id) {
 | 
			
		||||
        return baseMapper.selectVoById(id);
 | 
			
		||||
        TestLeaveVo testLeaveVo = baseMapper.selectVoById(id);
 | 
			
		||||
        testLeaveVo.setProcessInstanceId(workflowService.getInstanceIdByBusinessKey(String.valueOf(id)));
 | 
			
		||||
        return testLeaveVo;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,10 @@
 | 
			
		||||
package org.dromara.workflow.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import lombok.RequiredArgsConstructor;
 | 
			
		||||
import org.dromara.common.core.service.WorkflowService;
 | 
			
		||||
import org.dromara.workflow.domain.ActHiProcinst;
 | 
			
		||||
import org.dromara.workflow.service.IActHiProcinstService;
 | 
			
		||||
import org.dromara.workflow.service.IActProcessInstanceService;
 | 
			
		||||
import org.dromara.workflow.utils.WorkflowUtils;
 | 
			
		||||
import org.flowable.engine.RuntimeService;
 | 
			
		||||
@@ -21,7 +24,7 @@ public class WorkflowServiceImpl implements WorkflowService {
 | 
			
		||||
 | 
			
		||||
    private final IActProcessInstanceService iActProcessInstanceService;
 | 
			
		||||
    private final RuntimeService runtimeService;
 | 
			
		||||
 | 
			
		||||
    private final IActHiProcinstService iActHiProcinstService;
 | 
			
		||||
    /**
 | 
			
		||||
     * 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息
 | 
			
		||||
     *
 | 
			
		||||
@@ -98,4 +101,19 @@ public class WorkflowServiceImpl implements WorkflowService {
 | 
			
		||||
    public void setVariablesLocal(String taskId, Map<String, Object> variables) {
 | 
			
		||||
        runtimeService.setVariablesLocal(taskId, variables);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 按照业务id查询流程实例id
 | 
			
		||||
     *
 | 
			
		||||
     * @param businessKey 业务id
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getInstanceIdByBusinessKey(String businessKey) {
 | 
			
		||||
        ActHiProcinst actHiProcinst = iActHiProcinstService.selectByBusinessKey(businessKey);
 | 
			
		||||
        if (actHiProcinst == null) {
 | 
			
		||||
            return StrUtil.EMPTY;
 | 
			
		||||
        }
 | 
			
		||||
        return actHiProcinst.getId();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user