feat(REQ-3714): 调整班组长判断顺序,和当前人的判断
This commit is contained in:
parent
0985708ba7
commit
bc999a5035
@ -350,7 +350,7 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
|
|||||||
|
|
||||||
private void checkPermission(List<NodeUserDTO> nodeUsers, Long personId, Set<Long> nodePersonIds) {
|
private void checkPermission(List<NodeUserDTO> nodeUsers, Long personId, Set<Long> nodePersonIds) {
|
||||||
if (CollUtil.isEmpty(nodeUsers)) {
|
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("你已被移除当前项目,请刷新后重试当前操作!");
|
throw ResultCode.INVALID_PARAMS.toException("你已被移除当前项目,请刷新后重试当前操作!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -450,12 +450,6 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
|
|||||||
// 否则,自己下级小组,也可以。
|
// 否则,自己下级小组,也可以。
|
||||||
boolean isGroup = target.getNode() != null
|
boolean isGroup = target.getNode() != null
|
||||||
&& Objects.equals(target.getNode().getNodeType(), NodeTypeEnum.PROJECT_GROUP.getCode());
|
&& 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)) {
|
if (isPractitioner(target)) {
|
||||||
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
|
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
|
||||||
checkFailInfo.setType(CheckInfoTypeEnum.ANY_ADMIN);
|
checkFailInfo.setType(CheckInfoTypeEnum.ANY_ADMIN);
|
||||||
@ -466,6 +460,12 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
|
|||||||
if (isSameTeam) {
|
if (isSameTeam) {
|
||||||
return;
|
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());
|
Long belongProjectTeamNodeId = resolveProjectTeamNodeId(target.getOrganizationalNodeId());
|
||||||
if (Objects.equals(belongProjectTeamNodeId, operator.getOrganizationalNodeId())) {
|
if (Objects.equals(belongProjectTeamNodeId, operator.getOrganizationalNodeId())) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user