Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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-auth
Commits
c1512a30
Commit
c1512a30
authored
Oct 12, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业ID的获取不在service层,在controller
parent
db822e20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+2
-1
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+1
-2
RoleController.java
...main/java/com/gic/auth/web/controller/RoleController.java
+16
-9
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
c1512a30
...
...
@@ -109,9 +109,10 @@ public interface MenuApiService {
* @Title: listAppPageOfHasBuy
* @Description:
* @author guojuxing
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
();
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
);
/**
* 编辑gic页面
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
c1512a30
...
...
@@ -140,8 +140,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
()
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
)
{
ServiceResponse
<
List
<
ApplicationDTO
>>
appResult
=
appTokenApiService
.
listApplicationByEnterpriseId
(
Long
.
valueOf
(
enterpriseId
),
null
);
if
(
appResult
.
isSuccess
())
{
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/RoleController.java
View file @
c1512a30
...
...
@@ -56,7 +56,8 @@ public class RoleController {
}
ServiceResponse
<
List
<
MenuDTO
>>
menuListResult
=
menuApiService
.
listByMenuIdList
(
menuIdList
);
ServiceResponse
<
List
<
MenuDTO
>>
gicResult
=
menuApiService
.
listMenuTreeForRole
(
MenuProjectConstants
.
DEFAULT_PROJECT
);
ServiceResponse
<
List
<
MenuDTO
>>
gicResult
=
menuApiService
.
listMenuTreeForRole
(
MenuProjectConstants
.
DEFAULT_PROJECT
);
Map
<
Integer
,
Object
>
gicMap
=
new
HashMap
<>(
16
);
if
(
gicResult
.
isSuccess
())
{
List
<
MenuDTO
>
gicMenuList
=
gicResult
.
getResult
();
...
...
@@ -64,10 +65,12 @@ public class RoleController {
gicMap
.
put
(
menuDTO
.
getMenuId
(),
1
);
}
}
vo
.
setGicMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
menuListResult
.
getResult
(),
gicMap
));
vo
.
setGicMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
menuListResult
.
getResult
(),
gicMap
));
//app已购买应用
ServiceResponse
<
List
<
MenuDTO
>>
appResult
=
menuApiService
.
listAppPageOfHasBuy
();
ServiceResponse
<
List
<
MenuDTO
>>
appResult
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
Map
<
Integer
,
Object
>
appMap
=
new
HashMap
<>(
16
);
if
(
gicResult
.
isSuccess
())
{
List
<
MenuDTO
>
appMenuList
=
appResult
.
getResult
();
...
...
@@ -75,7 +78,8 @@ public class RoleController {
appMap
.
put
(
menuDTO
.
getMenuId
(),
1
);
}
}
vo
.
setAppMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
menuListResult
.
getResult
(),
appMap
));
vo
.
setAppMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
menuListResult
.
getResult
(),
appMap
));
return
RestResponse
.
success
(
vo
);
}
return
EnterpriseRestResponse
.
failure
(
roleResult
);
...
...
@@ -137,18 +141,20 @@ public class RoleController {
*/
@RequestMapping
(
"/list-gic-menu-tree"
)
public
RestResponse
listMenuTree
()
{
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listMenuTreeForRole
(
MenuProjectConstants
.
DEFAULT_PROJECT
);
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listMenuTreeForRole
(
MenuProjectConstants
.
DEFAULT_PROJECT
);
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
return
RestResponse
.
success
(
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
}
return
EnterpriseRestResponse
.
failure
(
result
);
}
@RequestMapping
(
"/list-app-menu-tree"
)
public
RestResponse
listAppMenuTree
()
{
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listAppPageOfHasBuy
();
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
result
.
isSuccess
())
{
return
RestResponse
.
success
(
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
return
RestResponse
.
success
(
changeListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
result
.
getResult
()));
}
return
EnterpriseRestResponse
.
failure
(
result
);
}
...
...
@@ -176,7 +182,8 @@ public class RoleController {
return
result
;
}
public
static
List
<
Map
<
String
,
Object
>>
changeListToSelectTree
(
int
storeGroupId
,
List
<
MenuDTO
>
list
,
Map
<
Integer
,
Object
>
menuIdMap
)
{
public
static
List
<
Map
<
String
,
Object
>>
changeListToSelectTree
(
int
storeGroupId
,
List
<
MenuDTO
>
list
,
Map
<
Integer
,
Object
>
menuIdMap
)
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
if
(
list
!=
null
)
{
for
(
MenuDTO
menuDTO
:
list
)
{
...
...
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