From e04be7cb27ab27892f29f3af3fb74c7435fbef8f Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Tue, 4 Apr 2023 18:06:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E8=8A=82=E7=82=B9=E6=92=A4=E5=9B=9E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/todocenter/handle/WithDrawHandle.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 6f51383..8decebe 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 @@ -48,14 +48,21 @@ public class WithDrawHandle { * @return */ public Boolean checkCanWithdraw(String instanceId, ProcessProgressVo progressInstanceDetail) { + HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() + .processInstanceId(instanceId).singleResult(); + UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); + String employeeCode = userInfoDetails.getEmployeeCode(); //如果不是当前登录人 if(!ProcessStatusEnum.UNDER_REVIEW.getDesc() .equals(progressInstanceDetail.getStatus())){ return Boolean.FALSE; } - - return checkUserIsRoot(instanceId,null) || - checkUserIsBefore(progressInstanceDetail.getProgressInfo(),null); + // 如果当前登录用户是流程发起人,判断流程是否已经开始审批,如果开始审批,不能撤回 + Boolean userIsRoot = checkUserIsRoot(instanceId, null); + if (Boolean.TRUE.equals(userIsRoot) && canRootWithDraw(historicProcessInstance, employeeCode)){ + return Boolean.TRUE; + } + return checkUserIsBefore(progressInstanceDetail.getProgressInfo(),null); } //判断当前操作人 是上一个节点的审批人