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
1d0570e5
Commit
1d0570e5
authored
Nov 19, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
已购买的应用添加逻辑:拓展包查询
parent
7fedb354
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
40 deletions
+73
-40
TabSysMenuMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
+19
-3
MenuService.java
...rvice/src/main/java/com/gic/auth/service/MenuService.java
+11
-0
MenuServiceImpl.java
.../main/java/com/gic/auth/service/impl/MenuServiceImpl.java
+5
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+16
-37
TabSysMenuMapper.xml
...th-service/src/main/resources/mapper/TabSysMenuMapper.xml
+22
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
View file @
1d0570e5
...
...
@@ -79,6 +79,7 @@ public interface TabSysMenuMapper {
* @return int
*/
int
getMaxSortByParentId
(
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"project"
)
String
project
);
/**
* 查询页面下的操作项列表数据
* @Title: listMenuItemByParentId
...
...
@@ -98,6 +99,7 @@ public interface TabSysMenuMapper {
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
List
<
TabSysMenu
>
listMenuByParentId
(
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"project"
)
String
project
);
/**
* 分页查询操作项
* @Title: pageMenuOperationItem
...
...
@@ -127,6 +129,7 @@ public interface TabSysMenuMapper {
* @return java.util.List<com.gic.auth.dto.AuthItemListDTO>
*/
List
<
AuthItemListDTO
>
listAuthItemByMenuId
(
@Param
(
"menuId"
)
Integer
menuId
);
/**
* 统计页面下的子项目
* @Title: countChildByParentId
...
...
@@ -136,6 +139,7 @@ public interface TabSysMenuMapper {
* @return int
*/
int
countChildByParentId
(
@Param
(
"menuId"
)
Integer
menuId
);
/**
* 查询菜单树(页面&权限项)
* @Title: listMenuTree
...
...
@@ -147,7 +151,19 @@ public interface TabSysMenuMapper {
*/
List
<
TabSysMenu
>
listMenuTree
(
@Param
(
"project"
)
String
project
,
@Param
(
"versionCode"
)
String
versionCode
);
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
/**
* 查询应用权限
* @Title: selectAppMenuByParam
* @Description:
* @author guojuxing
* @param projectList appID List
* @param versionList 版本/拓展包 list
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
List
<
TabSysMenu
>
selectAppMenuByParam
(
@Param
(
"projectList"
)
List
<
String
>
projectList
,
@Param
(
"versionList"
)
List
<
String
>
versionList
);
/**
* 相同code个数
...
...
@@ -157,7 +173,7 @@ public interface TabSysMenuMapper {
* @param menuCode
* @return int
*/
int
countByMenuCode
(
@Param
(
"menuCode"
)
String
menuCode
,
@Param
(
"menuId"
)
Integer
menuId
);
int
countByMenuCode
(
@Param
(
"menuCode"
)
String
menuCode
,
@Param
(
"menuId"
)
Integer
menuId
);
/**
* 批量更新子集的父级code数据,根据父级ID
...
...
@@ -167,7 +183,7 @@ public interface TabSysMenuMapper {
* @param parentId
* @return void
*/
void
updateParentCodeByParentId
(
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"parentCode"
)
String
parentCode
);
void
updateParentCodeByParentId
(
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"parentCode"
)
String
parentCode
);
/**
* 仅超管可用的操作项
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuService.java
View file @
1d0570e5
...
...
@@ -128,6 +128,17 @@ public interface MenuService {
List
<
TabSysMenu
>
selectByProjectList
(
List
<
String
>
projectList
);
/**
* 查询应用权限
* @Title: selectAppMenuByParam
* @Description:
* @author guojuxing
* @param projectList appID List
* @param versionList 版本/拓展包 list
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
List
<
TabSysMenu
>
selectAppMenuByParam
(
List
<
String
>
projectList
,
List
<
String
>
versionList
);
/**
* 是否重复页面code
* @Title: isRepeatMenuCode
* @Description:
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
1d0570e5
...
...
@@ -135,6 +135,11 @@ public class MenuServiceImpl implements MenuService {
}
@Override
public
List
<
TabSysMenu
>
selectAppMenuByParam
(
List
<
String
>
projectList
,
List
<
String
>
versionList
)
{
return
tabSysMenuMapper
.
selectAppMenuByParam
(
projectList
,
versionList
);
}
@Override
public
boolean
isRepeatMenuCode
(
String
code
,
Integer
menuId
)
{
int
count
=
tabSysMenuMapper
.
countByMenuCode
(
code
,
menuId
);
if
(
count
>
0
)
{
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
1d0570e5
...
...
@@ -3,7 +3,7 @@ package com.gic.auth.service.outer.impl;
import
java.util.*
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.open.api.dto.
ServeExpanDTO
;
import
com.gic.open.api.dto.
*
;
import
com.gic.open.api.service.ServeApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -31,8 +31,6 @@ import com.gic.commons.util.PageHelperUtils;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.enterprise.utils.valid.ValidParamsUtils
;
import
com.gic.open.api.dto.ApplicationDTO
;
import
com.gic.open.api.dto.ServePropDTO
;
import
com.gic.open.api.service.AppTokenApiService
;
import
com.gic.open.api.service.ApplicationApiService
;
...
...
@@ -175,18 +173,27 @@ public class MenuApiServiceImpl implements MenuApiService {
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
)
{
ServiceResponse
<
List
<
ApplicationDTO
>>
appResult
=
appTokenApiService
.
listApplicationBy
EnterpriseId
(
Long
.
valueOf
(
enterpriseId
),
null
);
ServiceResponse
<
List
<
Application
Token
DTO
>>
appResult
=
appTokenApiService
.
listApplicationBy
eId
(
Long
.
valueOf
(
enterpriseId
)
);
if
(
appResult
.
isSuccess
())
{
List
<
ApplicationDTO
>
appList
=
appResult
.
getResult
();
List
<
Application
Token
DTO
>
appList
=
appResult
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
appList
))
{
saveHasBuyAppMenu
(
appList
);
//调用所有的应用列表保存接口,保证,已购买的应用已经在菜单
saveAppMenu
();
//查询已购买的有权限的app应用菜单
List
<
String
>
projectList
=
new
ArrayList
<>(
appList
.
size
());
for
(
ApplicationDTO
app
:
appList
)
{
List
<
String
>
versionList
=
new
ArrayList
<>();
for
(
ApplicationTokenDTO
app
:
appList
)
{
projectList
.
add
(
app
.
getApplicationId
().
toString
());
versionList
.
add
(
app
.
getVersionCode
());
if
(
CollectionUtils
.
isNotEmpty
(
app
.
getExpanList
()))
{
for
(
ApplicationExpanDTO
expanDTO
:
app
.
getExpanList
())
{
versionList
.
add
(
expanDTO
.
getAppExpanId
().
toString
());
}
}
}
List
<
MenuDTO
>
menuList
=
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
menuService
.
select
ByProjectList
(
project
List
));
menuService
.
select
AppMenuByParam
(
projectList
,
version
List
));
return
ServiceResponse
.
success
(
menuList
);
}
else
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
...
...
@@ -616,34 +623,6 @@ public class MenuApiServiceImpl implements MenuApiService {
}
/**
* 商户已购买的应用,变成一级菜单
* @Title: saveHasBuyAppMenu
* @Description:
* @author guojuxing
* @param hasBuyAppList
* @return void
*/
private
void
saveHasBuyAppMenu
(
List
<
ApplicationDTO
>
hasBuyAppList
)
{
Map
<
String
,
TabSysMenu
>
appMenu
=
getFirstLevelAppMenu
();
for
(
ApplicationDTO
app
:
hasBuyAppList
)
{
if
(
appMenu
.
containsKey
(
app
.
getApplicationId
().
toString
()))
{
//如果已存在,则更新版本信息
MenuDTO
menuDTO
=
new
MenuDTO
();
menuDTO
.
setMenuName
(
app
.
getName
());
menuDTO
.
setProject
(
app
.
getApplicationId
().
toString
());
menuDTO
.
setMenuId
(
appMenu
.
get
(
app
.
getApplicationId
().
toString
()).
getMenuId
());
menuService
.
updatePage
(
menuDTO
);
}
else
{
MenuDTO
menuDTO
=
new
MenuDTO
();
menuDTO
.
setMenuName
(
app
.
getName
());
menuDTO
.
setProject
(
app
.
getApplicationId
().
toString
());
setNormalFieldValue
(
menuDTO
);
menuService
.
savePage
(
menuDTO
);
}
}
}
/**
* 第一级页面通用字段值设置
* @param menuDTO
*/
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysMenuMapper.xml
View file @
1d0570e5
...
...
@@ -428,6 +428,28 @@
</if>
</select>
<select
id=
"selectAppMenuByParam"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_menu
where status=1
and project != 'gic'
<include
refid=
"tree_filter"
/>
<if
test=
"null != projectList and projectList.size() > 0"
>
and project in
<foreach
close=
")"
collection=
"projectList"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"versionList != null and versionList.size() > 0"
>
and (
<foreach
collection=
"versionList"
index=
"index"
item=
"item"
separator=
"or"
>
menu_version like concat('%_', #{item}, '_%' )
</foreach>
)
</if>
</select>
<select
id=
"countByMenuCode"
resultType=
"int"
>
SELECT count(1) from tab_sys_menu
where status = 1
...
...
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