feat(办公管理): 新增 我的流程页面“重新发起”功能
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.workflow.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.flowable.core.FormConf;
|
||||
import com.ruoyi.flowable.core.domain.ProcessQuery;
|
||||
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
||||
import com.ruoyi.workflow.domain.vo.WfDetailVo;
|
||||
@@ -77,7 +78,7 @@ public interface IWfProcessService {
|
||||
* @param definitionId 流程定义ID
|
||||
* @param deployId 部署ID
|
||||
*/
|
||||
String selectFormContent(String definitionId, String deployId);
|
||||
FormConf selectFormContent(String definitionId, String deployId, String procInsId);
|
||||
|
||||
/**
|
||||
* 启动流程实例
|
||||
|
||||
@@ -549,17 +549,30 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectFormContent(String definitionId, String deployId) {
|
||||
public FormConf selectFormContent(String definitionId, String deployId, String procInsId) {
|
||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(definitionId);
|
||||
if (ObjectUtil.isNull(bpmnModel)) {
|
||||
throw new RuntimeException("获取流程设计失败!");
|
||||
}
|
||||
StartEvent startEvent = ModelUtils.getStartEvent(bpmnModel);
|
||||
WfDeployFormVo deployFormVo = deployFormMapper.selectVoOne(new LambdaQueryWrapper<WfDeployForm>()
|
||||
WfDeployForm deployForm = deployFormMapper.selectOne(new LambdaQueryWrapper<WfDeployForm>()
|
||||
.eq(WfDeployForm::getDeployId, deployId)
|
||||
.eq(WfDeployForm::getFormKey, startEvent.getFormKey())
|
||||
.eq(WfDeployForm::getNodeKey, startEvent.getId()));
|
||||
return deployFormVo.getContent();
|
||||
FormConf formConf = JsonUtils.parseObject(deployForm.getContent(), FormConf.class);
|
||||
if (ObjectUtil.isNull(formConf)) {
|
||||
throw new RuntimeException("获取流程表单失败!");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(procInsId)) {
|
||||
// 获取流程实例
|
||||
HistoricProcessInstance historicProcIns = historyService.createHistoricProcessInstanceQuery()
|
||||
.processInstanceId(procInsId)
|
||||
.includeProcessVariables()
|
||||
.singleResult();
|
||||
// 填充表单信息
|
||||
ProcessFormUtils.fillFormData(formConf, historicProcIns.getProcessVariables());
|
||||
}
|
||||
return formConf;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user