|
|
@@ -9,6 +9,7 @@ import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; |
|
|
|
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent; |
|
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
@@ -39,6 +40,7 @@ import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO; |
|
|
|
import com.ningdatech.pmapi.user.entity.UserInfo; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import com.wflow.contants.HisProInsEndActId; |
|
|
@@ -97,6 +99,7 @@ public class TodoCenterManage { |
|
|
|
private final INdWorkNoticeStagingService workNoticeStagingService; |
|
|
|
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; |
|
|
|
private final IProjectApplicationService projectApplicationService; |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@@ -363,14 +366,27 @@ public class TodoCenterManage { |
|
|
|
} else { |
|
|
|
// 当前登录用户不是流程发起人 |
|
|
|
List<ProgressNode> currentProgressInfo = currentInstanceDetail.getProgressInfo(); |
|
|
|
|
|
|
|
ProgressNode progressNode = currentProgressInfo.get(currentProgressInfo.size() - 1); |
|
|
|
ProgressNode beforeProgressNode; |
|
|
|
ProgressNode currentProgressNode; |
|
|
|
// 说明当前节点是子流程节点 |
|
|
|
if (progressNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) { |
|
|
|
List<ProgressNode> children = progressNode.getChildren(); |
|
|
|
beforeProgressNode = children.get(children.size() - 2); |
|
|
|
currentProgressNode = children.get(children.size() - 1); |
|
|
|
} else { |
|
|
|
beforeProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 2); |
|
|
|
currentProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 1); |
|
|
|
} |
|
|
|
// 获取当前工作流任务前一个审核人信息 |
|
|
|
ProgressNode beforeProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 2); |
|
|
|
ProcessInstanceUserDto beforeUser = beforeProgressNode.getUser(); |
|
|
|
UserFullInfoDTO beforeUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(beforeUser.getUserId())); |
|
|
|
// 获取当前当前工作流任务当前审核人信息 |
|
|
|
ProgressNode currentProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 1); |
|
|
|
ProcessInstanceUserDto currentUser = currentProgressNode.getUser(); |
|
|
|
UserFullInfoDTO currentUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(currentUser.getUserId())); |
|
|
|
// 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 |
|
|
|
boolean orgFlag = currentUser.getOrgCode().equals(beforeUser.getOrgCode()); |
|
|
|
boolean orgFlag = currentUserInfo.getOrganizationCode().equals(beforeUserInfo.getOrganizationCode()); |
|
|
|
boolean userFlag = beforeUser.getUserId().equals(String.valueOf(userId)); |
|
|
|
if (!orgFlag) { |
|
|
|
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); |
|
|
|