feat(REQ-3714): 处理班组长提示

This commit is contained in:
zhanghonghao 2025-03-13 15:56:42 +08:00
parent 2ed02cd04c
commit 15648e026f

View File

@ -231,10 +231,12 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
} }
} }
Set<Long> teamLeadPersonSet = new HashSet<>();
nodeUsers.stream().filter(e -> e.getIdentityType().equals(IdentityType.WORKER_LEADER.getCode())).findAny().ifPresent(e -> { nodeUsers.stream().filter(e -> e.getIdentityType().equals(IdentityType.WORKER_LEADER.getCode())).findAny().ifPresent(e -> {
BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo(); BatchDeleteNodeUserCheckResp.CheckFailInfo checkFailInfo = new BatchDeleteNodeUserCheckResp.CheckFailInfo();
checkFailInfo.setType(CheckInfoTypeEnum.TEAM_LEADER); checkFailInfo.setType(CheckInfoTypeEnum.TEAM_LEADER);
addFailInfo(failInfoMap, e.getPersonId(), checkFailInfo); addFailInfo(failInfoMap, e.getPersonId(), checkFailInfo);
teamLeadPersonSet.add(e.getPersonId());
}); });
// 判断小组长小组长不允许删除 // 判断小组长小组长不允许删除
@ -251,6 +253,10 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
List<RoleUserResp> saasRoleUserInfo = roleUserGateway.pageAll(roleUserParam); List<RoleUserResp> saasRoleUserInfo = roleUserGateway.pageAll(roleUserParam);
saasRoleUserInfo = saasRoleUserInfo.stream().filter(e -> Objects.nonNull(e.getRole())).collect(Collectors.toList()); saasRoleUserInfo = saasRoleUserInfo.stream().filter(e -> Objects.nonNull(e.getRole())).collect(Collectors.toList());
saasRoleUserInfo.forEach(e -> { saasRoleUserInfo.forEach(e -> {
// 班组长不用校验因为班组长也会有管理员角色
if (teamLeadPersonSet.contains(e.getPersonId())) {
return;
}
Optional<RoleTypeEnum> roleTypeEnumOptional = RoleTypeEnum.fromValue(e.getRole().getRoleType()); Optional<RoleTypeEnum> roleTypeEnumOptional = RoleTypeEnum.fromValue(e.getRole().getRoleType());
RoleTypeEnum roleTypeEnum = RoleTypeEnum.AUTO_OWN; RoleTypeEnum roleTypeEnum = RoleTypeEnum.AUTO_OWN;
if (roleTypeEnumOptional.isPresent()) { if (roleTypeEnumOptional.isPresent()) {