Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-usercenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9460fa6a
authored
Mar 30, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用户返回下级全部组织id接口
1 parent
9e6b5e2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
src/main/java/cn/com/glsx/shield/modules/service/OrganizationService.java
src/main/java/cn/com/glsx/shield/modules/service/OrganizationService.java
View file @
9460fa6
...
...
@@ -34,7 +34,7 @@ import javax.annotation.Resource;
import
java.util.*
;
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
...
...
@@ -309,25 +309,11 @@ public class OrganizationService {
}
public
Set
<
Long
>
getAllSubOrgIds
()
{
Integer
rolePermissionType
=
ShieldContextHolder
.
getRolePermissionType
();
//租户维度
if
(
all
.
getCode
().
equals
(
rolePermissionType
)
||
assignTenants
.
getCode
().
equals
(
rolePermissionType
))
{
Set
<
Long
>
tenantIdList
=
ShieldContextHolder
.
getVisibleTenantIds
();
List
<
Department
>
departmentList
=
departmentMapper
.
selectByTenantIds
(
tenantIdList
);
List
<
Organization
>
subOrgList
=
organizationMapper
.
selectAllSubBySuperiorId
(
ShieldContextHolder
.
getDepartmentId
());
Set
<
Long
>
deptIdSet
=
departmentList
.
stream
().
map
(
Department:
:
get
Id
).
collect
(
Collectors
.
toSet
());
Set
<
Long
>
subOrgIdList
=
subOrgList
.
stream
().
map
(
Organization:
:
getSub
Id
).
collect
(
Collectors
.
toSet
());
return
deptIdSet
;
}
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
subOrgIdList
;
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment