Commit 9460fa6a by levphon

用户返回下级全部组织id接口

1 parent 9e6b5e2b
...@@ -34,7 +34,7 @@ import javax.annotation.Resource; ...@@ -34,7 +34,7 @@ import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.com.glsx.admin.common.constant.UserConstants.RolePermitCastType.*; import static cn.com.glsx.admin.common.constant.UserConstants.RolePermitCastType.getBeanNameByCode;
/** /**
* @author: taoyr * @author: taoyr
...@@ -309,25 +309,11 @@ public class OrganizationService { ...@@ -309,25 +309,11 @@ public class OrganizationService {
} }
public Set<Long> getAllSubOrgIds() { public Set<Long> getAllSubOrgIds() {
Integer rolePermissionType = ShieldContextHolder.getRolePermissionType(); List<Organization> subOrgList = organizationMapper.selectAllSubBySuperiorId(ShieldContextHolder.getDepartmentId());
//租户维度
if (all.getCode().equals(rolePermissionType) || assignTenants.getCode().equals(rolePermissionType)) {
Set<Long> tenantIdList = ShieldContextHolder.getVisibleTenantIds();
List<Department> departmentList = departmentMapper.selectByTenantIds(tenantIdList);
Set<Long> deptIdSet = departmentList.stream().map(Department::getId).collect(Collectors.toSet()); Set<Long> subOrgIdList = subOrgList.stream().map(Organization::getSubId).collect(Collectors.toSet());
return deptIdSet; return subOrgIdList;
} else {
List<User> userList = userMapper.selectByIds(ShieldContextHolder.getVisibleCreatorIds());
//可见用户部门部门
Set<Long> subUserOrgIdList = userList.stream().map(User::getDepartmentId).collect(Collectors.toSet());
//自己部门
subUserOrgIdList.add(ShieldContextHolder.getDepartmentId());
return subUserOrgIdList;
}
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!