feat(办公管理): 新增 我的流程页面“重新发起”功能
This commit is contained in:
@@ -9,7 +9,6 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.JsonUtils;
|
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.flowable.core.domain.ProcessQuery;
|
import com.ruoyi.flowable.core.domain.ProcessQuery;
|
||||||
import com.ruoyi.workflow.domain.bo.WfCopyBo;
|
import com.ruoyi.workflow.domain.bo.WfCopyBo;
|
||||||
@@ -188,9 +187,9 @@ public class WfProcessController extends BaseController {
|
|||||||
@GetMapping("/getProcessForm")
|
@GetMapping("/getProcessForm")
|
||||||
@SaCheckPermission("workflow:process:start")
|
@SaCheckPermission("workflow:process:start")
|
||||||
public R<?> getForm(@RequestParam(value = "definitionId") String definitionId,
|
public R<?> getForm(@RequestParam(value = "definitionId") String definitionId,
|
||||||
@RequestParam(value = "deployId") String deployId) {
|
@RequestParam(value = "deployId") String deployId,
|
||||||
String formContent = processService.selectFormContent(definitionId, deployId);
|
@RequestParam(value = "procInsId", required = false) String procInsId) {
|
||||||
return R.ok(JsonUtils.parseObject(formContent, Map.class));
|
return R.ok(processService.selectFormContent(definitionId, deployId, procInsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ruoyi.workflow.service;
|
|||||||
|
|
||||||
import com.ruoyi.common.core.domain.PageQuery;
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.flowable.core.FormConf;
|
||||||
import com.ruoyi.flowable.core.domain.ProcessQuery;
|
import com.ruoyi.flowable.core.domain.ProcessQuery;
|
||||||
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
import com.ruoyi.workflow.domain.vo.WfDefinitionVo;
|
||||||
import com.ruoyi.workflow.domain.vo.WfDetailVo;
|
import com.ruoyi.workflow.domain.vo.WfDetailVo;
|
||||||
@@ -77,7 +78,7 @@ public interface IWfProcessService {
|
|||||||
* @param definitionId 流程定义ID
|
* @param definitionId 流程定义ID
|
||||||
* @param deployId 部署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
|
@Override
|
||||||
public String selectFormContent(String definitionId, String deployId) {
|
public FormConf selectFormContent(String definitionId, String deployId, String procInsId) {
|
||||||
BpmnModel bpmnModel = repositoryService.getBpmnModel(definitionId);
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(definitionId);
|
||||||
if (ObjectUtil.isNull(bpmnModel)) {
|
if (ObjectUtil.isNull(bpmnModel)) {
|
||||||
throw new RuntimeException("获取流程设计失败!");
|
throw new RuntimeException("获取流程设计失败!");
|
||||||
}
|
}
|
||||||
StartEvent startEvent = ModelUtils.getStartEvent(bpmnModel);
|
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::getDeployId, deployId)
|
||||||
.eq(WfDeployForm::getFormKey, startEvent.getFormKey())
|
.eq(WfDeployForm::getFormKey, startEvent.getFormKey())
|
||||||
.eq(WfDeployForm::getNodeKey, startEvent.getId()));
|
.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -112,6 +112,13 @@
|
|||||||
@click="handleStop(scope.row)"
|
@click="handleStop(scope.row)"
|
||||||
v-hasPermi="['workflow:process:cancel']"
|
v-hasPermi="['workflow:process:cancel']"
|
||||||
>取消</el-button>
|
>取消</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-refresh-right"
|
||||||
|
v-hasPermi="['workflow:process:start']"
|
||||||
|
@click="handleAgain(scope.row)"
|
||||||
|
>重新发起</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -237,6 +244,16 @@ export default {
|
|||||||
this.single = selection.length!==1
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
|
handleAgain(row) {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/workflow/process/start/' + row.deployId,
|
||||||
|
query: {
|
||||||
|
definitionId: row.procDefId,
|
||||||
|
procInsId: row.procInsId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(row);
|
||||||
|
},
|
||||||
/** 取消流程申请 */
|
/** 取消流程申请 */
|
||||||
handleStop(row){
|
handleStop(row){
|
||||||
const params = {
|
const params = {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
definitionId: null,
|
definitionId: null,
|
||||||
deployId: null,
|
deployId: null,
|
||||||
|
procInsId: null,
|
||||||
formOpen: false,
|
formOpen: false,
|
||||||
formData: {},
|
formData: {},
|
||||||
}
|
}
|
||||||
@@ -37,9 +38,11 @@ export default {
|
|||||||
initData() {
|
initData() {
|
||||||
this.deployId = this.$route.params && this.$route.params.deployId;
|
this.deployId = this.$route.params && this.$route.params.deployId;
|
||||||
this.definitionId = this.$route.query && this.$route.query.definitionId;
|
this.definitionId = this.$route.query && this.$route.query.definitionId;
|
||||||
|
this.procInsId = this.$route.query && this.$route.query.procInsId;
|
||||||
getProcessForm({
|
getProcessForm({
|
||||||
definitionId: this.definitionId,
|
definitionId: this.definitionId,
|
||||||
deployId: this.deployId
|
deployId: this.deployId,
|
||||||
|
procInsId: this.procInsId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.formData = res.data;
|
this.formData = res.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user