包头待办bug修改

This commit is contained in:
guoshengxiong 2025-02-10 18:22:31 +08:00
parent e604c2f435
commit 08b8204893
4 changed files with 9 additions and 10 deletions

View File

@ -2,12 +2,13 @@ package com.wflow.workflow.bean.process;
/** /**
* 流程实例状态 * 流程实例状态
*
* @author : willian fu * @author : willian fu
* @since : 2024/5/5 * @since : 2024/5/5
*/ */
public enum ProcessStatus { public enum ProcessStatus {
PASS, //审批通过 PRE_PASS, //审批通过
PRE_RUNNING, //进行中 RUNNING, //进行中
PRE_REFUSE, //审批被驳回 REFUSE, //审批被驳回
PRE_CANCEL //审批撤销 PRE_CANCEL //审批撤销
} }

View File

@ -103,7 +103,7 @@ public class GlobalTaskListener extends AbstractFlowableEngineEventListener {
.content(StrUtil.builder("您提交的审批【", .content(StrUtil.builder("您提交的审批【",
instance.getProcessDefinitionName(), "】已经通过").toString()) instance.getProcessDefinitionName(), "】已经通过").toString())
.build()); .build());
runtimeService.updateBusinessStatus(event.getProcessInstanceId(), ProcessStatus.PASS.toString()); runtimeService.updateBusinessStatus(event.getProcessInstanceId(), ProcessStatus.PRE_PASS.toString());
log.info("[{}]审批流程[{}}]通过", instance.getProcessInstanceId(), instance.getProcessDefinitionName()); log.info("[{}]审批流程[{}}]通过", instance.getProcessInstanceId(), instance.getProcessDefinitionName());
super.processCompleted(event); super.processCompleted(event);
} }
@ -116,7 +116,7 @@ public class GlobalTaskListener extends AbstractFlowableEngineEventListener {
if (cause instanceof EndEvent){ if (cause instanceof EndEvent){
String endNode = ((EndEvent) cause).getId(); String endNode = ((EndEvent) cause).getId();
if ("refuse-end".equals(endNode)){ if ("refuse-end".equals(endNode)){
runtimeService.updateBusinessStatus(event.getProcessInstanceId(), ProcessStatus.PRE_REFUSE.toString()); runtimeService.updateBusinessStatus(event.getProcessInstanceId(), ProcessStatus.REFUSE.toString());
log.debug("监听到流程[{}]被驳回", event.getProcessInstanceId()); log.debug("监听到流程[{}]被驳回", event.getProcessInstanceId());
listenerExecutor.doProcessChangeHandler("refuse", event.getProcessInstanceId(), event.getProcessDefinitionId()); listenerExecutor.doProcessChangeHandler("refuse", event.getProcessInstanceId(), event.getProcessDefinitionId());
} else if ("cancel-end".equals(endNode)) { } else if ("cancel-end".equals(endNode)) {

View File

@ -1,5 +1,4 @@
package com.wflow.workflow.service.impl; package com.wflow.workflow.service.impl;
import java.util.Date;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
@ -32,7 +31,6 @@ import com.wflow.workflow.bean.vo.*;
import com.wflow.workflow.config.WflowGlobalVarDef; import com.wflow.workflow.config.WflowGlobalVarDef;
import com.wflow.workflow.service.*; import com.wflow.workflow.service.*;
import com.wflow.workflow.utils.Executor; import com.wflow.workflow.utils.Executor;
import com.zhgd.xmgl.security.SecurityUtil;
import com.zhgd.xmgl.security.util.SecurityUtils; import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.tenant.TenantContextHolder; import com.zhgd.xmgl.tenant.TenantContextHolder;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -436,13 +434,13 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService {
if (Objects.equals(customStatus, 1)) { if (Objects.equals(customStatus, 1)) {
instanceQuery.or().startedBy(userId + "").involvedUser(userId + "").endOr(); instanceQuery.or().startedBy(userId + "").involvedUser(userId + "").endOr();
} else if (Objects.equals(customStatus, 2)) { } else if (Objects.equals(customStatus, 2)) {
instanceQuery.or().processInstanceBusinessStatus(ProcessStatus.PASS.toString()).processInstanceBusinessStatus(ProcessStatus.PRE_CANCEL.toString()).endOr(); instanceQuery.or().processInstanceBusinessStatusLike("PRE%").endOr();
} }
Executor.builder() Executor.builder()
//customStatus 1待催办2已办结3审批进行中4审批被撤销5审批被驳回 //customStatus 1待催办2已办结3审批进行中4审批被撤销5审批被驳回
.ifTrueNext(Objects.equals(customStatus, 1), instanceQuery::unfinished) .ifTrueNext(Objects.equals(customStatus, 1), instanceQuery::unfinished)
.ifTrueNext(Objects.equals(customStatus, 3), instanceQuery::unfinished) .ifTrueNext(Objects.equals(customStatus, 3), instanceQuery::unfinished)
.ifNotBlankNext(Objects.equals(customStatus, 5) ? ProcessStatus.PRE_REFUSE.toString() : null, instanceQuery::processInstanceBusinessStatus) .ifNotBlankNext(Objects.equals(customStatus, 5) ? ProcessStatus.REFUSE.toString() : null, instanceQuery::processInstanceBusinessStatus)
.ifNotBlankNext(startUser, instanceQuery::startedBy) .ifNotBlankNext(startUser, instanceQuery::startedBy)
.ifNotBlankNext(code, instanceQuery::processDefinitionKey) .ifNotBlankNext(code, instanceQuery::processDefinitionKey)
.ifTrueNext(null != startTimes && startTimes.length > 1, () -> { .ifTrueNext(null != startTimes && startTimes.length > 1, () -> {

View File

@ -51,7 +51,7 @@ public class SubProcessInitTask implements JavaDelegate {
execution.setVariable("startDept", ownerDto.getOwnerDeptId()); execution.setVariable("startDept", ownerDto.getOwnerDeptId());
//设置节点流程变量缓存 //设置节点流程变量缓存
execution.setVariable(WflowGlobalVarDef.WFLOW_NODE_PROPS, propsMap); execution.setVariable(WflowGlobalVarDef.WFLOW_NODE_PROPS, propsMap);
runtimeService.updateBusinessStatus(execution.getProcessInstanceId(), ProcessStatus.PRE_RUNNING.toString()); runtimeService.updateBusinessStatus(execution.getProcessInstanceId(), ProcessStatus.RUNNING.toString());
log.info("设置子流程{}流程变量[{}, {}]", execution.getProcessInstanceId(), ownerDto.getOwner(), ownerDto.getOwnerDeptId()); log.info("设置子流程{}流程变量[{}, {}]", execution.getProcessInstanceId(), ownerDto.getOwner(), ownerDto.getOwnerDeptId());
} }
} }