feat(REQ-3714): 调整班组长判断顺序,和当前人的判断

This commit is contained in:
zhanghonghao 2025-03-17 10:48:09 +08:00
parent 0985708ba7
commit bc999a5035

View File

@ -350,7 +350,7 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
private void checkPermission(List<NodeUserDTO> nodeUsers, Long personId, Set<Long> nodePersonIds) {
if (CollUtil.isEmpty(nodeUsers)) {
if (nodePersonIds.size() == 1 && Objects.equals(personId, nodePersonIds.stream().findFirst().orElse(null))) {
if (nodePersonIds.size() == 1 && nodePersonIds.contains(personId)) {
throw ResultCode.INVALID_PARAMS.toException("你已被移除当前项目,请刷新后重试当前操作!");
}
}
@ -450,12 +450,6 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
// 否则自己下级小组也可以
boolean isGroup = target.getNode() != null
&& Objects.equals(target.getNode().getNodeType(), NodeTypeEnum.PROJECT_GROUP.getCode());
if (!isGroup) {
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
checkFailInfo.setType(CheckInfoTypeEnum.NOT_IN_JURISDICTION);
addFailInfo(failInfoMap, target.getPersonId(), checkFailInfo);
return;
}
if (isPractitioner(target)) {
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
checkFailInfo.setType(CheckInfoTypeEnum.ANY_ADMIN);
@ -466,6 +460,12 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
if (isSameTeam) {
return;
}
if (!isGroup) {
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
checkFailInfo.setType(CheckInfoTypeEnum.NOT_IN_JURISDICTION);
addFailInfo(failInfoMap, target.getPersonId(), checkFailInfo);
return;
}
Long belongProjectTeamNodeId = resolveProjectTeamNodeId(target.getOrganizationalNodeId());
if (Objects.equals(belongProjectTeamNodeId, operator.getOrganizationalNodeId())) {