Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
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
base_platform_enterprise
gic-platform-enterprise
Commits
bbecec8e
Commit
bbecec8e
authored
Jan 16, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限菜单查询方式调整:一开始只查询第一层,代码回滚
parent
94281b70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
MenuController.java
...java/com/gic/operation/web/controller/MenuController.java
+16
-7
No files found.
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/MenuController.java
View file @
bbecec8e
...
...
@@ -117,17 +117,23 @@ public class MenuController {
public
RestResponse
listMenuTree
(
MenuListQO
params
)
{
LOGGER
.
info
(
"菜单列表查询参数:{}"
,
JSON
.
toJSONString
(
params
));
//逐级展开的方式,所以需要传ID,如果不传,默认查询第一层级,即level = 1
if
(
params
.
getMenuId
()
==
null
)
{
params
.
setLevel
(
1
);
}
// if (params.getMenuId() == null) {
// params.setLevel(1);
// }
long
serviceBefore
=
System
.
currentTimeMillis
();
if
(
params
.
getIsGIC
()
!=
null
&&
params
.
getIsGIC
()
==
MenuProjectConstants
.
APP_PROJECT_CODE
)
{
//如果是查询app应用类别,必须实时更新最新应用数据
params
.
setNeedUpdateAppMenu
(
true
);
}
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listMenuTree
(
params
);
long
serviceAfter
=
System
.
currentTimeMillis
();
LOGGER
.
info
(
"menuApiService.listMenuTree权限菜单服务调用时间:{}"
,
serviceAfter
-
serviceBefore
);
if
(
result
.
isSuccess
())
{
if
(
StringUtils
.
isBlank
(
params
.
getSearch
()))
{
return
RestResponse
.
success
(
addAuthItemSignAndChildrenSignToList
(
result
.
getResult
()));
List
<
Map
<
String
,
Object
>>
resultInfo
=
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
());
LOGGER
.
info
(
"changeListToTree权限菜单数据递归时间:{}"
,
System
.
currentTimeMillis
()
-
serviceAfter
);
return
RestResponse
.
success
(
resultInfo
);
}
else
{
return
ResultControllerUtils
.
commonResult
(
result
);
}
...
...
@@ -149,7 +155,8 @@ public class MenuController {
params
.
setMenuType
(
MenuTypeEnum
.
PAGE
.
getCode
());
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listMenuTree
(
params
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
changePageListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
return
RestResponse
.
success
(
changePageListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
}
return
EnterpriseRestResponse
.
failure
(
result
);
}
...
...
@@ -295,7 +302,8 @@ public class MenuController {
String
menuVersion
=
dto
.
getMenuVersion
();
String
menuVersionName
=
dto
.
getMenuVersionName
();
if
(
StringUtils
.
isNotBlank
(
menuVersion
))
{
String
[]
menuVersionArr
=
menuVersion
.
substring
(
1
,
menuVersion
.
length
()
-
1
).
split
(
SignConstants
.
UNDERLINE
);
String
[]
menuVersionArr
=
menuVersion
.
substring
(
1
,
menuVersion
.
length
()
-
1
)
.
split
(
SignConstants
.
UNDERLINE
);
String
[]
menuVersionNameArr
=
menuVersionName
.
split
(
SignConstants
.
SLASH
);
for
(
int
i
=
0
,
len
=
menuVersionArr
.
length
;
i
<
len
;
i
++)
{
map
.
put
(
menuVersionArr
[
i
],
menuVersionNameArr
[
i
]);
...
...
@@ -362,7 +370,8 @@ public class MenuController {
}
Set
<
String
>
authItemMap
=
new
HashSet
<>(
16
);
Set
<
String
>
childrenMap
=
new
HashSet
<>(
16
);
ServiceResponse
<
List
<
MenuDTO
>>
listByParentIdListResult
=
menuApiService
.
listByParentMenuIdList
(
parentMenuIdList
);
ServiceResponse
<
List
<
MenuDTO
>>
listByParentIdListResult
=
menuApiService
.
listByParentMenuIdList
(
parentMenuIdList
);
if
(
listByParentIdListResult
.
isSuccess
())
{
List
<
MenuDTO
>
listByParentIdList
=
listByParentIdListResult
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
listByParentIdList
))
{
...
...
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