diff --git a/src/main/java/com/wflow/controller/CustomController.java b/src/main/java/com/wflow/controller/CustomController.java index 03655af..f46c02e 100644 --- a/src/main/java/com/wflow/controller/CustomController.java +++ b/src/main/java/com/wflow/controller/CustomController.java @@ -190,7 +190,7 @@ public class CustomController { * @return */ private JSONObject getToObj(JSONObject jo, String toName, JSONObject children) { - if (children == null || children.getString("name") == null) { + if (children == null) { return null; } if (Objects.equals(children.getString("name"), toName)) { @@ -208,10 +208,8 @@ public class CustomController { return toObj; } } - } else { - return getToObj(children, toName, children.getJSONObject("children")); } - return null; + return getToObj(children, toName, children.getJSONObject("children")); } /** @@ -239,8 +237,8 @@ public class CustomController { for (int j = 0; j < array.size(); j++) { setToObj(children, fromName, set, array.getJSONObject(j)); } - } else { - setToObj(children, fromName, set, children.getJSONObject("children")); } + setToObj(children, fromName, set, children.getJSONObject("children")); + } } 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 fe0171e..b97458b 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,11 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService { if (Objects.equals(customStatus, 1)) { instanceQuery.or().startedBy(startUser + "").involvedUser(startUser + "").endOr(); } else if (Objects.equals(customStatus, 2)) { - instanceQuery.or().processInstanceBusinessStatusLike("PRE%").endOr(); + instanceQuery.or().startedBy(startUser + "").involvedUser(startUser + "").endOr(); + instanceQuery.finished(); + } + if (!Objects.equals(customStatus, 1) && !Objects.equals(customStatus, 2)) { + instanceQuery.startedBy(startUser); } Executor.builder() //customStatus 1待催办2已办结3审批进行中4审批被撤销5审批被驳回6审批通过7审批被驳回(发起人是自己) @@ -441,9 +445,8 @@ public class ProcessInstanceServiceImpl implements ProcessInstanceService { .ifTrueNext(Objects.equals(customStatus, 3), instanceQuery::unfinished) .ifNotBlankNext(Objects.equals(customStatus, 5) ? ProcessStatus.REFUSE.toString() : null, instanceQuery::processInstanceBusinessStatus) .ifNotBlankNext(Objects.equals(customStatus, 6) ? ProcessStatus.PRE_PASS.toString() : null, instanceQuery::processInstanceBusinessStatus) - .ifNotBlankNext(Objects.equals(customStatus, 7) ? ProcessStatus.PRE_PASS.toString() : null, instanceQuery::processInstanceBusinessStatus) + .ifNotBlankNext(Objects.equals(customStatus, 7) ? ProcessStatus.REFUSE.toString() : null, instanceQuery::processInstanceBusinessStatus) .ifNotBlankNext(Objects.equals(customStatus, 7) ? SecurityUtils.getUser().getUserId() + "" : "", instanceQuery::startedBy) - .ifNotBlankNext(!Objects.equals(customStatus, 1) ? startUser : "", instanceQuery::startedBy) .ifNotBlankNext(code, instanceQuery::processDefinitionKey) .ifTrueNext(null != startTimes && startTimes.length > 1, () -> { instanceQuery.startedAfter(DateUtil.parse(startTimes[0]));