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
7d4260f9
Commit
7d4260f9
authored
Oct 27, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品菜单从gic移动到应用
parent
3fc4e9b2
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
0 deletions
+158
-0
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+11
-0
TabSysMenuMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
+20
-0
MenuService.java
...rvice/src/main/java/com/gic/auth/service/MenuService.java
+25
-0
MenuServiceImpl.java
.../main/java/com/gic/auth/service/impl/MenuServiceImpl.java
+25
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+43
-0
TabSysMenuMapper.xml
...th-service/src/main/resources/mapper/TabSysMenuMapper.xml
+23
-0
MenuController.java
...main/java/com/gic/auth/web/controller/MenuController.java
+11
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
7d4260f9
...
...
@@ -500,6 +500,17 @@ public interface MenuApiService {
ServiceResponse
<
Void
>
syncProductMenu
(
String
menuCode
);
/**
* gic菜单转到某一个应用下面
* @Title: switchGicMenuToApp
* @Description:
* @author guojuxing
* @param gicMenuCode
* @param appMenuCode
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
switchGicMenuToApp
(
String
gicMenuCode
,
String
appMenuCode
);
/**
* test
* @Title: test
* @Description:
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
View file @
7d4260f9
...
...
@@ -143,6 +143,26 @@ public interface TabSysMenuMapper {
List
<
TabSysMenu
>
listByParentMenuIdList
(
@Param
(
"parentMenuIdList"
)
List
<
Integer
>
parentMenuIdList
);
/**
* gic菜单转应用菜单的时候,批量进行修改相关数据
* @Title: updateMenuTmp
* @Description:
* @author guojuxing
* @param menuIdList
* @param project
* @param parentId
* @param parentCode
* @param menuVersion
* @param menuVersionName
* @return void
*/
void
updateMenuTmp
(
@Param
(
"menuIdList"
)
List
<
Integer
>
menuIdList
,
@Param
(
"project"
)
String
project
,
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"parentCode"
)
String
parentCode
,
@Param
(
"menuVersion"
)
String
menuVersion
,
@Param
(
"menuVersionName"
)
String
menuVersionName
);
/**
* selectByIdsAndOrderBy
* @Title: selectByIdsAndOrderBy
* @Description:
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuService.java
View file @
7d4260f9
...
...
@@ -260,6 +260,31 @@ public interface MenuService {
*/
void
deleteNotInApp
(
List
<
String
>
projectList
);
/**
* 查询所有的level >= 3的数据
* @Title: listMenuForGicContainChild
* @Description:
* @author guojuxing
* @param parentIdList level = 2的menu_id集合
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
List
<
TabSysMenu
>
listMenuForGicContainChild
(
List
<
Integer
>
parentIdList
);
/**
* gic菜单转应用菜单的时候,批量进行修改相关数据
* @Title: updateMenuTmp
* @Description:
* @author guojuxing
* @param menuIdList 需要修改的菜单ID集合
* @param project applicationId
* @param parentId 应用菜单的menuId
* @param parentCode 应用菜单的menuCode
* @param menuVersion 应用的版本code
* @param menuVersionName 应用的版本名称
* @return void
*/
void
updateMenuTmp
(
List
<
Integer
>
menuIdList
,
String
project
,
Integer
parentId
,
String
parentCode
,
String
menuVersion
,
String
menuVersionName
);
/***********同步测试环境数据到生产************/
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
7d4260f9
...
...
@@ -228,6 +228,31 @@ public class MenuServiceImpl implements MenuService {
}
@Override
public
List
<
TabSysMenu
>
listMenuForGicContainChild
(
List
<
Integer
>
parentIdList
)
{
if
(
CollectionUtils
.
isEmpty
(
parentIdList
))
{
return
new
ArrayList
<>();
}
List
<
TabSysMenu
>
result
=
new
ArrayList
<>();
List
<
TabSysMenu
>
list
=
tabSysMenuMapper
.
listByParentMenuIdList
(
parentIdList
);
while
(
CollectionUtils
.
isNotEmpty
(
list
))
{
result
.
addAll
(
list
);
List
<
Integer
>
menuIdList
=
list
.
stream
()
.
filter
(
e
->
e
!=
null
)
.
map
(
e
->
e
.
getMenuId
())
.
collect
(
Collectors
.
toList
());
list
.
clear
();
list
=
tabSysMenuMapper
.
listByParentMenuIdList
(
menuIdList
);
}
return
result
;
}
@Override
public
void
updateMenuTmp
(
List
<
Integer
>
menuIdList
,
String
project
,
Integer
parentId
,
String
parentCode
,
String
menuVersion
,
String
menuVersionName
)
{
tabSysMenuMapper
.
updateMenuTmp
(
menuIdList
,
project
,
parentId
,
parentCode
,
menuVersion
,
menuVersionName
);
}
@Override
public
List
<
TabSysMenu
>
listMenuTemp
(
String
project
)
{
return
tabSysMenuMapper
.
listMenuTemp
(
project
);
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
7d4260f9
...
...
@@ -802,6 +802,49 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public
ServiceResponse
<
Void
>
switchGicMenuToApp
(
String
gicMenuCode
,
String
appMenuCode
)
{
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"
);
}
TabSysMenu
appMenu
=
menuService
.
getMenuByMenuCode
(
appMenuCode
);
boolean
isNotAppMenu
=
appMenu
==
null
||
appMenu
.
getLevel
()
!=
1
||
appMenu
.
getProject
().
equals
(
MenuProjectConstants
.
DEFAULT_PROJECT
)
||
gicMenu
.
getPlatformType
()
!=
MenuPlatformTypeEnum
.
GIC
.
getCode
();
if
(
isNotAppMenu
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"不存在或者不是应用对应的code"
);
}
String
applicationId
=
appMenu
.
getProject
();
Integer
parentId
=
appMenu
.
getMenuId
();
String
parentCode
=
appMenu
.
getMenuCode
();
String
menuVersion
=
appMenu
.
getMenuVersion
();
String
menuVersionName
=
appMenu
.
getMenuVersionName
();
//第二层级需要修改的
//1:修改project
//2:修改parent_id,parent_code
//3:menu_version menu_version_name
List
<
TabSysMenu
>
list
=
menuService
.
listByParentMenuIdList
(
Arrays
.
asList
(
gicMenu
.
getMenuId
()));
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
Integer
>
menuIdList
=
list
.
stream
().
filter
(
e
->
e
!=
null
).
map
(
e
->
e
.
getMenuId
()).
collect
(
Collectors
.
toList
());
menuService
.
updateMenuTmp
(
menuIdList
,
applicationId
,
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
,
applicationId
,
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
));
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysMenuMapper.xml
View file @
7d4260f9
...
...
@@ -490,6 +490,29 @@
</if>
</select>
<update
id=
"updateMenuTmp"
>
update tab_sys_menu set
<if
test=
"parentId != null"
>
parent_id = #{parentId},
</if>
<if
test=
"parentCode != null and parentCode != ''"
>
parent_code = #{parentCode},
</if>
<if
test=
"menuVersion != null and menuVersion != ''"
>
menu_version = #{menuVersion},
</if>
<if
test=
"menuVersionName != null and menuVersionName != ''"
>
menu_version_name = #{menuVersionName},
</if>
project = #{project}
where menu_id in
<foreach
close=
")"
collection=
"menuIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
and delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select
id=
"selectByIdsAndOrderBy"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/MenuController.java
View file @
7d4260f9
...
...
@@ -113,12 +113,23 @@ public class MenuController {
return
RestResponse
.
success
(
getAppId
(
null
,
menuCode
));
}
/**
* gic菜单转到某一个应用下面
* @param menuCode
* @return
*/
@IgnoreLogin
@RequestMapping
(
"sync-menu-to-pro"
)
public
RestResponse
syncMenuToPro
(
String
menuCode
)
{
return
RestResponse
.
success
(
menuApiService
.
syncProductMenu
(
menuCode
));
}
@IgnoreLogin
@RequestMapping
(
"switch-gic-menu-to-app"
)
public
RestResponse
switchGicMenuToApp
(
String
gicMenuCode
,
String
appMenuCode
)
{
return
RestResponse
.
success
(
menuApiService
.
switchGicMenuToApp
(
gicMenuCode
,
appMenuCode
));
}
@RequestMapping
(
"login-collaborator-menu-of-app"
)
public
RestResponse
getCollaboratorMenu
(
String
appId
,
String
menuCode
)
{
LOGGER
.
info
(
"查询登录用户的协作应用的菜单参数:{}-{}"
,
appId
,
menuCode
);
...
...
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