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
74531e65
Commit
74531e65
authored
Jul 13, 2019
by
zjy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user/role/tright 7.13
parent
797dd760
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
RegisterServiceImpl.java
...gding/web/authority/service/impl/RegisterServiceImpl.java
+19
-16
No files found.
src/main/java/com/pangding/web/authority/service/impl/RegisterServiceImpl.java
View file @
74531e65
...
@@ -426,12 +426,13 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -426,12 +426,13 @@ public class RegisterServiceImpl implements RegisterService {
}
}
}
}
List
<
AuthorityVo
>
levelOneList
=
new
ArrayList
();
List
<
AuthorityVo
>
levelOneList
=
new
ArrayList
();
for
(
String
authorityId:
authorityIdList
)
{
for
(
int
i
=
0
;
i
<
authorityIdList
.
size
();
i
++
)
{
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
authorityGetReqVo
.
setId
(
authorityId
);
authorityGetReqVo
.
setId
(
authorityId
List
.
get
(
i
)
);
AuthorityVo
authorityVo
=
authorityDaoImpl
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
AuthorityVo
authorityVo
=
authorityDaoImpl
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
if
(
null
==
authorityVo
.
getPid
()
||
authorityVo
.
getPid
().
isEmpty
()){
levelOneList
.
add
(
authorityVo
);
levelOneList
.
add
(
authorityVo
);
authorityIdList
.
remove
(
i
);
}
}
}
}
Collections
.
sort
(
levelOneList
);
Collections
.
sort
(
levelOneList
);
...
@@ -442,7 +443,7 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -442,7 +443,7 @@ public class RegisterServiceImpl implements RegisterService {
for
(
AuthorityVo
authorityVo:
levelOneList
)
{
for
(
AuthorityVo
authorityVo:
levelOneList
)
{
AuthorityListByLevelResVo
resVo1
=
new
AuthorityListByLevelResVo
();
AuthorityListByLevelResVo
resVo1
=
new
AuthorityListByLevelResVo
();
ObjectHelper
.
writeWithFrom
(
resVo1
,
authorityVo
);
ObjectHelper
.
writeWithFrom
(
resVo1
,
authorityVo
);
List
<
AuthorityListByLevelResVo
>
childList
=
getChildList
(
authorityVo
.
getId
()
);
List
<
AuthorityListByLevelResVo
>
childList
=
getChildList
(
authorityVo
,
authorityIdList
);
resVo1
.
setChildList
(
childList
);
resVo1
.
setChildList
(
childList
);
authorityListByLevel
.
add
(
resVo1
);
authorityListByLevel
.
add
(
resVo1
);
}
}
...
@@ -455,22 +456,24 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -455,22 +456,24 @@ public class RegisterServiceImpl implements RegisterService {
return
resVo
;
return
resVo
;
}
}
private
List
<
AuthorityListByLevelResVo
>
getChildList
(
String
id
){
private
List
<
AuthorityListByLevelResVo
>
getChildList
(
AuthorityVo
authorityVo
,
List
<
String
>
authorityIdList
){
AuthorityGetReqVo
reqVo
=
new
AuthorityGetReqVo
();
List
<
AuthorityListByLevelResVo
>
resVoList
=
new
ArrayList
<>();
reqVo
.
setPid
(
id
);
for
(
int
i
=
0
;
i
<
authorityIdList
.
size
();
i
++)
{
List
<
AuthorityVo
>
childList
=
authorityDaoImpl
.
loadList
(
reqVo
,
AuthorityVo
.
class
);
AuthorityGetReqVo
authorityGetReqVo
=
new
AuthorityGetReqVo
();
List
<
AuthorityListByLevelResVo
>
childResList
=
new
ArrayList
();
authorityGetReqVo
.
setId
(
authorityIdList
.
get
(
i
));
if
(
null
!=
childList
&&
!
childList
.
isEmpty
()){
AuthorityVo
authorityVo1
=
authorityDaoImpl
.
load
(
authorityGetReqVo
,
AuthorityVo
.
class
);
for
(
AuthorityVo
authorityVo:
childList
)
{
if
(
authorityVo1
.
getPid
().
equals
(
authorityVo
.
getId
())){
authorityIdList
.
remove
(
i
);
AuthorityListByLevelResVo
resVo
=
new
AuthorityListByLevelResVo
();
AuthorityListByLevelResVo
resVo
=
new
AuthorityListByLevelResVo
();
ObjectHelper
.
writeWithFrom
(
resVo
,
authorityVo
);
ObjectHelper
.
writeWithFrom
(
resVo
,
authorityVo1
);
List
<
AuthorityListByLevelResVo
>
grandchildList
=
getChildList
(
authorityVo
.
getId
());
if
(
authorityIdList
.
size
()>
0
){
resVo
.
setChildList
(
grandchildList
);
resVo
.
setChildList
(
getChildList
(
authorityVo1
,
authorityIdList
));
childResList
.
add
(
resVo
);
}
resVoList
.
add
(
resVo
);
}
}
}
}
Collections
.
sort
(
childRes
List
);
Collections
.
sort
(
resVo
List
);
return
childRes
List
;
return
resVo
List
;
}
}
@Override
@Override
...
...
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