Commit f795e951 by levphon

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

1 parent 308f3ac7
......@@ -25,7 +25,6 @@ import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.common.utils.TreeModelUtil;
import com.glsx.plat.exception.SystemMessage;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -311,25 +310,21 @@ public class OrganizationService {
//租户维度
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());
return deptIdSet;
} else if (selfDepartment.getCode().equals(rolePermissionType) || subDepartment.getCode().equals(rolePermissionType)) {
if (subordinate.getCode().equals(rolePermissionType)) {
List<User> userList = userMapper.selectByIds(ShieldContextHolder.getVisibleCreatorIds());
//下级部门
Set<Long> subUserOrgIdList = userList.stream().map(User::getDepartmentId).collect(Collectors.toSet());
//自己部门
subUserOrgIdList.add(ShieldContextHolder.getDepartmentId());
return subUserOrgIdList;
} else {//self
return Sets.newHashSet(ShieldContextHolder.getDepartmentId());
}
} 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;
}
return Sets.newHashSet();
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!