Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2f732dea
authored
Oct 12, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:超管返回所有组织权限
1 parent
bb6a2582
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
project-order/src/main/java/com/dituhui/pea/order/enums/OrganizationType.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
project-order/src/main/java/com/dituhui/pea/order/enums/OrganizationType.java
View file @
2f732de
...
...
@@ -7,6 +7,11 @@ package com.dituhui.pea.order.enums;
public
enum
OrganizationType
{
/**
* 超管
*/
admin
(
"admin"
),
/**
* 大区
*/
cluster
(
"cluster"
),
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
View file @
2f732de
...
...
@@ -235,6 +235,18 @@ public class OrganizationServiceImpl implements OrganizationService {
}).
collect
(
Collectors
.
toList
());
}
break
;
case
admin:
List
<
OrgClusterEntity
>
adminCluster
=
orgClusterDao
.
findAll
();
if
(
CollectionUtils
.
isNotEmpty
(
adminCluster
))
{
return
adminCluster
.
stream
().
map
(
c
->
{
OrganizationDTO
organizationDTO
=
new
OrganizationDTO
();
organizationDTO
.
setId
(
c
.
getClusterId
());
organizationDTO
.
setName
(
c
.
getName
());
organizationDTO
.
setType
(
OrganizationType
.
cluster
.
getValue
());
return
organizationDTO
;
}).
collect
(
Collectors
.
toList
());
}
break
;
default
:
break
;
}
...
...
project-user/src/main/java/com/dituhui/pea/user/service/UserService.java
View file @
2f732de
...
...
@@ -183,6 +183,14 @@ public class UserService {
//用户组织机构从关联表获取
List
<
OrganizationDTO
>
allOrgs
=
new
ArrayList
<>();
// 超管处理,不用配置资源自动拥有所有权限
if
(
ids
.
contains
(
Globals
.
SUPER_ADMIN_ID
))
{
Result
<
List
<
OrganizationDTO
>>
result
=
organizationService
.
getAllOrganizations
(
"admin"
,
Arrays
.
asList
(
"admin"
));
if
(
StringUtils
.
equals
(
ResultEnum
.
SUCCESS
.
getCode
(),
result
.
getCode
()))
{
allOrgs
=
result
.
getResult
();
}
}
else
{
List
<
UserOrgEntity
>
byUserId
=
userOrgDao
.
findByUserId
(
userDTO
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
byUserId
))
{
List
<
String
>
collect
=
byUserId
.
stream
().
map
(
UserOrgEntity:
:
getOrgId
).
collect
(
Collectors
.
toList
());
...
...
@@ -191,6 +199,7 @@ public class UserService {
allOrgs
=
result
.
getResult
();
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
allOrgs
))
{
// 设置第一个为当前权限等级
...
...
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