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
1240b289
Commit
1240b289
authored
Nov 19, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品权限代码回滚
parent
039fed30
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
8 deletions
+59
-8
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+8
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+44
-6
MenuController.java
...main/java/com/gic/auth/web/controller/MenuController.java
+7
-2
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
1240b289
...
...
@@ -511,6 +511,14 @@ public interface MenuApiService {
ServiceResponse
<
Void
>
switchGicMenuToApp
(
String
gicMenuCode
,
String
appMenuCode
);
/**
* app菜单转到gic下面
* @param gicMenuCode
* @param appMenuCode
* @return
*/
ServiceResponse
<
Void
>
switchAppMenuToGic
(
String
gicMenuCode
,
String
appMenuCode
);
/**
* test
* @Title: test
* @Description:
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
1240b289
...
...
@@ -845,6 +845,48 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public
ServiceResponse
<
Void
>
switchAppMenuToGic
(
String
gicMenuCode
,
String
appMenuCode
)
{
TabSysMenu
appMenu
=
menuService
.
getMenuByMenuCode
(
appMenuCode
);
boolean
isNotAppMenu
=
appMenu
==
null
||
appMenu
.
getLevel
()
!=
1
||
appMenu
.
getProject
().
equals
(
MenuProjectConstants
.
DEFAULT_PROJECT
)
||
appMenu
.
getPlatformType
()
!=
MenuPlatformTypeEnum
.
GIC
.
getCode
();
if
(
isNotAppMenu
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"不存在或者不是应用对应的code"
);
}
TabSysMenu
gicMenu
=
menuService
.
getMenuByMenuCode
(
gicMenuCode
);
boolean
isNotGicMenu
=
gicMenu
==
null
||
gicMenu
.
getLevel
()
!=
1
||
!
gicMenu
.
getProject
().
equals
(
MenuProjectConstants
.
DEFAULT_PROJECT
)
||
gicMenu
.
getPlatformType
()
!=
MenuPlatformTypeEnum
.
GIC
.
getCode
();
if
(
isNotGicMenu
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"不存在或者不是gic对应的code"
);
}
Integer
parentId
=
gicMenu
.
getMenuId
();
String
parentCode
=
gicMenu
.
getMenuCode
();
String
menuVersion
=
gicMenu
.
getMenuVersion
();
String
menuVersionName
=
gicMenu
.
getMenuVersionName
();
//第二层级需要修改的数据
//1:修改project 为gic
//2:修改parent_id, parent_code
//3:menu_version,menu_version_name
List
<
TabSysMenu
>
list
=
menuService
.
listByParentMenuIdList
(
Arrays
.
asList
(
appMenu
.
getMenuId
()));
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
Integer
>
menuIdList
=
list
.
stream
().
filter
(
e
->
e
!=
null
).
map
(
e
->
e
.
getMenuId
()).
collect
(
Collectors
.
toList
());
menuService
.
updateMenuTmp
(
menuIdList
,
MenuProjectConstants
.
DEFAULT_PROJECT
,
parentId
,
parentCode
,
menuVersion
,
menuVersionName
);
//下面层级需要修改的
//1:修改project
//2:menu_version menu_version_name
List
<
TabSysMenu
>
childList
=
menuService
.
listMenuForGicContainChild
(
menuIdList
);
if
(
CollectionUtils
.
isNotEmpty
(
childList
))
{
List
<
Integer
>
childMenuIdList
=
childList
.
stream
().
filter
(
e
->
e
!=
null
).
map
(
e
->
e
.
getMenuId
()).
collect
(
Collectors
.
toList
());
menuService
.
updateMenuTmp
(
childMenuIdList
,
MenuProjectConstants
.
DEFAULT_PROJECT
,
null
,
null
,
menuVersion
,
menuVersionName
);
}
}
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
filterOperationUserDepartAuth
(
List
<
MenuDTO
>
resultList
,
UserDTO
tabSysUser
)
{
List
<
TabSysMenu
>
list
=
filterOperationUserDepartAuth
(
EntityUtil
.
changeEntityListNew
(
TabSysMenu
.
class
,
resultList
),
EntityUtil
.
changeEntityNew
(
TabSysUser
.
class
,
tabSysUser
));
...
...
@@ -1456,12 +1498,8 @@ public class MenuApiServiceImpl implements MenuApiService {
*/
private
Set
<
String
>
getBusinessFrontRes
(
Integer
enterpriseId
)
{
Set
<
String
>
resourcePage
=
new
HashSet
<>(
16
);
//商品资源获取接口调整
ServiceResponse
<
MenuDTO
>
goods
=
getHasBuyAppByMenuCode
(
AppMenuCodeConstants
.
GOODS_APP
,
enterpriseId
);
boolean
hasGoodsAuth
=
goods
.
isSuccess
();
if
(!
hasGoodsAuth
)
{
resourcePage
.
add
(
AppMenuCodeConstants
.
GOODS_GIC
);
}
//todo 是否商品资源变成应用
//过滤商品资源页面
ServiceResponse
<
List
<
EnterpriseResourceRelDTO
>>
resourceResult
=
enterpriseApiService
.
getBusinessFrontRes
(
enterpriseId
);
if
(
resourceResult
.
isSuccess
())
{
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/MenuController.java
View file @
1240b289
...
...
@@ -128,8 +128,13 @@ public class MenuController {
@IgnoreLogin
@HeaderSignIgnore
@RequestMapping
(
"switch-gic-menu-to-app"
)
public
RestResponse
switchGicMenuToApp
(
String
gicMenuCode
,
String
appMenuCode
)
{
return
RestResponse
.
success
(
menuApiService
.
switchGicMenuToApp
(
gicMenuCode
,
appMenuCode
));
public
RestResponse
switchGicMenuToApp
(
String
gicMenuCode
,
String
appMenuCode
,
Boolean
appToGic
)
{
if
(
appToGic
!=
null
&&
appToGic
)
{
menuApiService
.
switchAppMenuToGic
(
gicMenuCode
,
appMenuCode
);
}
else
{
menuApiService
.
switchGicMenuToApp
(
gicMenuCode
,
appMenuCode
);
}
return
RestResponse
.
success
();
}
@RequestMapping
(
"login-collaborator-menu-of-app"
)
...
...
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