From 28eac71fecf3ef769e152ee16a925e45c2b8d4c9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 5 May 2023 17:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E5=A4=84=E7=90=86=20=E5=8A=A0taskId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/handle/PassHandle.java | 1 + .../pmapi/todocenter/handle/WithDrawHandle.java | 26 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/PassHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/PassHandle.java index e5fe92e..5b71af7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/PassHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/PassHandle.java @@ -56,6 +56,7 @@ public class PassHandle { }else if(activity.getActivityId().startsWith("seal")){ res.setCanSeal(Boolean.TRUE); } + break; } } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java index d07c051..03d4377 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java @@ -78,8 +78,10 @@ public class WithDrawHandle { .filter(c -> !NodeTypeEnum.CC.name().equals(c.getNodeType().name())) .collect(Collectors.toList()); - //1.判断出 当前审批人和上一个审批人 - ProgressNode progressNode = currentProgressInfo.get(currentProgressInfo.size() - 1); + //1.判断出 当前审批人和上一个审批人 如果传了taskid + ProgressNode progressNode = StringUtils.isBlank(param.getTaskId()) ? + currentProgressInfo.get(currentProgressInfo.size() - 1) + : findSubNodeByTaskId(param.getTaskId(),currentProgressInfo); ProgressNode beforeProgressNode = null; ProgressNode currentProgressNode = null; @@ -177,6 +179,26 @@ public class WithDrawHandle { } /** + * 找到其 所在的子流程父节点 + * @param taskId + * @return + */ + private ProgressNode findSubNodeByTaskId(String taskId,List currentProgressInfos) { + for(ProgressNode progressNode : currentProgressInfos){ + if(progressNode.getNodeType().equals(NodeTypeEnum.SUB)){ + List children = progressNode.getChildren(); + for(ProgressNode c : children){ + if(taskId.equals(c.getTaskId())){ + //如果任务ID对得上 返回其 所在的子流程 + return progressNode; + } + } + } + } + return null; + } + + /** * 判断撤回用户 是不是发起人 * @param processInstanceId * @param task