feat(REQ-3714): 人员查询异常处理

This commit is contained in:
zhanghonghao 2025-03-12 11:40:00 +08:00
parent 8e111ebbae
commit 04a13c9741

View File

@ -206,7 +206,7 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
// 查询当前登录及待删除人员在当前项目中的参与记录仅限当前登录单位
List<NodeUserDTO> nodeUsers = nodeUserService.list(query);
// 校验当前入参
checkPermission(nodeUsers, personId, failInfoMap);
checkPermission(nodeUsers);
// 过滤当前操作人员
nodeUsers = nodeUsers.stream()
.filter(e -> !Objects.equals(e.getPersonId(), personId))
@ -316,17 +316,10 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
}
}
private void checkPermission(List<NodeUserDTO> nodeUsers, Long personId, Map<Long, List<BatchDeleteNodeUserCheckResp.CheckFailInfo>> failInfoMap) {
private void checkPermission(List<NodeUserDTO> nodeUsers) {
if (CollUtil.isEmpty(nodeUsers)) {
throw ResultCode.INVALID_PARAMS.toException("你已被移除当前项目,请刷新后重试当前操作!");
}
if (nodeUsers.stream().noneMatch(e -> Objects.equals(e.getPersonId(), personId))) {
nodeUsers.forEach(e -> {
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
checkFailInfo.setType(CheckInfoTypeEnum.NOT_IN_JURISDICTION);
addFailInfo(failInfoMap, e.getPersonId(), checkFailInfo);
});
}
}
private List<Long> getSpecialRole() {