update 调整模型部署错误 添加获取流程实例id接口

This commit is contained in:
gssong 2024-06-03 21:03:58 +08:00
parent 7c448aed9f
commit 867e7bf665
5 changed files with 36 additions and 2 deletions

View File

@ -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);
}

View File

@ -67,4 +67,10 @@ public class TestLeaveVo implements Serializable {
@ExcelProperty(value = "状态")
private String status;
/**
* 流程实例id
*/
@ExcelProperty(value = "流程实例id")
private String processInstanceId;
}

View File

@ -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;
}
/**

View File

@ -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.