diff --git a/src/main/java/com/wflow/workflow/service/impl/ProcessInstanceServiceImpl.java b/src/main/java/com/wflow/workflow/service/impl/ProcessInstanceServiceImpl.java index a877758..d0975a8 100644 --- a/src/main/java/com/wflow/workflow/service/impl/ProcessInstanceServiceImpl.java +++ b/src/main/java/com/wflow/workflow/service/impl/ProcessInstanceServiceImpl.java @@ -433,7 +433,6 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService { instanceQuery.processInstanceTenantId(TenantContextHolder.getTenantId()); Executor.builder() //customStatus 1待催办2已办结(只有PASS) - .ifNotBlankNext(Objects.equals(customStatus, 1) ? "PRE_%" : null, instanceQuery::processInstanceBusinessStatusLike) .ifNotBlankNext(Objects.equals(customStatus, 2) ? ProcessStatus.PASS.toString() : null, instanceQuery::processInstanceBusinessStatus) .ifNotBlankNext(startUser, instanceQuery::startedBy) .ifNotBlankNext(code, instanceQuery::processDefinitionKey) @@ -452,6 +451,9 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService { instanceQuery.variableValueLike(fieldId, "%" + fieldVal + "%"); } }); + if (Objects.equals(customStatus, 1)) { + instanceQuery.or().processInstanceBusinessStatusLike("PRE_%").unfinished().endOr(); + } List historicProcessInstances = new ArrayList<>(); if (StringUtils.isNotBlank(key)) { historicProcessInstances = instanceQuery