【8.3.3】【dataScope】修复数据范围判空问题

pull/62/head
stylefeng 2025-01-26 18:05:41 +08:00
parent d9fa5a8ab3
commit 445a246de1
1 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,9 @@ public class UserRoleDataScopeImpl implements UserRoleDataScopeApi {
// 如果是32-指定机构层级及以下
else if (DataScopeTypeEnum.DEFINE_ORG_LEVEL_WITH_CHILD.getCode().equals(sysRoleDataScope.getDataScopeType())) {
Long parentOrgLevelOrgId = organizationServiceApi.getParentOrgLevel(loginUser.getCurrentOrgId(), sysRoleDataScope.getOrgLevelCode());
if (parentOrgLevelOrgId == null) {
continue;
}
Set<Long> subOrgIdList = this.getPointOrgAndSub(parentOrgLevelOrgId);
userOrgIdList.addAll(subOrgIdList);
}
@ -192,6 +195,9 @@ public class UserRoleDataScopeImpl implements UserRoleDataScopeApi {
* @since 2025/1/25 22:24
*/
public Set<Long> getPointOrgAndSub(Long orgId) {
if (orgId == null) {
return CollectionUtil.set(false);
}
Set<Long> subOrgIdList = this.dbOperatorApi.findSubListByParentId("sys_hr_organization", "org_pids", "org_id", orgId);
subOrgIdList.add(orgId);
return subOrgIdList;