Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TCM
tcm-system
Commits
60ce941b
Commit
60ce941b
authored
Jul 26, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/role/tright 7.26
parent
948279b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
RoleServiceImpl.java
.../pangding/web/authority/service/impl/RoleServiceImpl.java
+20
-0
No files found.
src/main/java/com/pangding/web/authority/service/impl/RoleServiceImpl.java
View file @
60ce941b
...
...
@@ -58,6 +58,8 @@ public class RoleServiceImpl implements RoleService {
List
<
String
>
authorityIds
=
webRoleReqVo
.
getAuthorityIds
();
if
(
authorityIds
!=
null
&&
!
authorityIds
.
isEmpty
()){
for
(
String
authorityId
:
authorityIds
)
{
/*查看该权限是否有上级权限*/
findParent
(
authorityId
,
webRoleReqVo
.
getId
());
RoleAuthorityVo
roleAuthorityRelation
=
new
RoleAuthorityVo
();
roleAuthorityRelation
.
setAuthorityId
(
authorityId
);
roleAuthorityRelation
.
setRoleId
(
webRoleReqVo
.
getId
());
...
...
@@ -68,6 +70,24 @@ public class RoleServiceImpl implements RoleService {
return
roleVo
.
getId
();
}
private
void
findParent
(
String
authorityId
,
String
roleId
){
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
authorityGetReqVo
.
setId
(
authorityId
);
AuthorityVo
authorityVo
=
authorityDaoImpl
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
if
(
null
!=
authorityVo
.
getPid
()
&&
!
authorityVo
.
getPid
().
isEmpty
()){
String
authorityPid
=
authorityVo
.
getPid
();
RoleAuthorityVo
roleAuthorityVo
=
new
RoleAuthorityVo
();
roleAuthorityVo
.
setAuthorityId
(
authorityPid
);
roleAuthorityVo
.
setRoleId
(
roleId
);
RoleAuthorityVo
roleAuthorityVo1
=
roleAuthorityDaoImpl
.
load
(
roleAuthorityVo
,
RoleAuthorityVo
.
class
);
if
(
null
==
roleAuthorityVo1
){
roleAuthorityVo
.
setId
(
StringHelper
.
getNewID
());
roleAuthorityDaoImpl
.
create
(
roleAuthorityVo
);
findParent
(
authorityPid
,
roleId
);
}
}
}
/**
* 更新RoleVo对象,并更新角色权限的对应关系
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment