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
c199a27d
Commit
c199a27d
authored
Sep 26, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询已购买应用类别接口修复
parent
4722ad4d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
6 deletions
+82
-6
TabSysMenuMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
+3
-0
MenuService.java
...rvice/src/main/java/com/gic/auth/service/MenuService.java
+10
-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
+5
-5
TabSysMenuMapper.xml
...th-service/src/main/resources/mapper/TabSysMenuMapper.xml
+18
-0
RoleController.java
...main/java/com/gic/auth/web/controller/RoleController.java
+4
-1
AppMenuVO.java
...auth-web/src/main/java/com/gic/auth/web/vo/AppMenuVO.java
+37
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
View file @
c199a27d
...
...
@@ -144,4 +144,6 @@ public interface TabSysMenuMapper {
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
List
<
TabSysMenu
>
listMenuTree
(
@Param
(
"project"
)
String
project
);
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuService.java
View file @
c199a27d
...
...
@@ -114,4 +114,14 @@ public interface MenuService {
* @return java.util.List<com.gic.auth.dto.MenuDTO>
*/
List
<
TabSysMenu
>
listMenuTree
(
String
project
);
/**
* 根据项目查询
* @Title: selectByProjectList
* @Description:
* @author guojuxing
* @param projectList
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
List
<
TabSysMenu
>
selectByProjectList
(
List
<
String
>
projectList
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
c199a27d
...
...
@@ -125,6 +125,11 @@ public class MenuServiceImpl implements MenuService {
return
tabSysMenuMapper
.
listMenuTree
(
project
);
}
@Override
public
List
<
TabSysMenu
>
selectByProjectList
(
List
<
String
>
projectList
)
{
return
tabSysMenuMapper
.
selectByProjectList
(
projectList
);
}
private
void
updateSort
(
Integer
sort
,
Integer
id
)
{
TabSysMenu
record
=
new
TabSysMenu
();
record
.
setMenuId
(
id
);
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
c199a27d
...
...
@@ -143,12 +143,12 @@ public class MenuApiServiceImpl implements MenuApiService {
List
<
ApplicationDTO
>
appList
=
appResult
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
appList
))
{
saveHasBuyAppMenu
(
appList
);
List
<
Integer
>
menuId
List
=
new
ArrayList
<>(
appList
.
size
());
List
<
String
>
project
List
=
new
ArrayList
<>(
appList
.
size
());
for
(
ApplicationDTO
app
:
appList
)
{
menuIdList
.
add
(
app
.
getApplicationId
().
intValue
());
projectList
.
add
(
app
.
getApplicationId
().
toString
());
}
List
<
MenuDTO
>
menuList
=
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
menuService
.
selectBy
Ids
(
menuId
List
));
menuService
.
selectBy
ProjectList
(
project
List
));
return
ServiceResponse
.
success
(
menuList
);
}
else
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
...
...
@@ -480,7 +480,7 @@ public class MenuApiServiceImpl implements MenuApiService {
if
(
appListResponse
.
isSuccess
())
{
List
<
ApplicationDTO
>
appList
=
appListResponse
.
getResult
();
for
(
ApplicationDTO
app
:
appList
)
{
if
(
appMenu
.
containsKey
(
app
.
getApplicationId
()))
{
if
(
appMenu
.
containsKey
(
app
.
getApplicationId
()
.
toString
()
))
{
//如果已存在,则更新版本信息
MenuDTO
menuDTO
=
new
MenuDTO
();
menuDTO
.
setMenuName
(
app
.
getName
());
...
...
@@ -503,7 +503,7 @@ public class MenuApiServiceImpl implements MenuApiService {
private
void
saveHasBuyAppMenu
(
List
<
ApplicationDTO
>
hasBuyAppList
)
{
Map
<
String
,
TabSysMenu
>
appMenu
=
getFirstLevelAppMenu
();
for
(
ApplicationDTO
app
:
hasBuyAppList
)
{
if
(
appMenu
.
containsKey
(
app
.
getApplicationId
()))
{
if
(
appMenu
.
containsKey
(
app
.
getApplicationId
()
.
toString
()
))
{
//如果已存在,则更新版本信息
MenuDTO
menuDTO
=
new
MenuDTO
();
menuDTO
.
setMenuName
(
app
.
getName
());
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysMenuMapper.xml
View file @
c199a27d
...
...
@@ -375,4 +375,21 @@
order by level,sort
</select>
<select
id=
"selectByProjectList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_menu
where status=1
and level = 1
and menu_type = 0
and project != 'gic'
<if
test=
"null != projectList and projectList.size() > 0"
>
and project in
<foreach
collection=
"projectList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/RoleController.java
View file @
c199a27d
...
...
@@ -5,6 +5,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.gic.auth.constant.MenuTypeEnum
;
import
com.gic.auth.web.vo.AppMenuVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -107,7 +109,7 @@ public class RoleController {
@RequestMapping
(
"/list-app-menu-tree"
)
public
RestResponse
listAppMenuTree
()
{
return
EnterpriseRestResponse
.
failure
(
menuApiService
.
listAppPageOfHasBuy
()
);
return
ResultControllerUtils
.
commonResult
(
menuApiService
.
listAppPageOfHasBuy
(),
AppMenuVO
.
class
);
}
public
static
List
<
Map
<
String
,
Object
>>
changeListToTree
(
int
storeGroupId
,
List
<
MenuDTO
>
list
)
{
...
...
@@ -119,6 +121,7 @@ public class RoleController {
data
.
put
(
"menuId"
,
menuDTO
.
getMenuId
());
data
.
put
(
"menuName"
,
menuDTO
.
getMenuName
());
data
.
put
(
"project"
,
menuDTO
.
getProject
());
data
.
put
(
"menuType"
,
menuDTO
.
getMenuType
());
List
<
Map
<
String
,
Object
>>
children
=
changeListToTree
(
menuDTO
.
getMenuId
(),
list
);
if
(
children
==
null
||
children
.
size
()
<
1
)
{
data
.
put
(
"children"
,
null
);
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/vo/AppMenuVO.java
0 → 100644
View file @
c199a27d
package
com
.
gic
.
auth
.
web
.
vo
;
import
java.io.Serializable
;
/**
* 已购买的应用列表
* @ClassName: AppMenuVO
* @Description:
* @author guojuxing
* @date 2019/9/26 4:18 PM
*/
public
class
AppMenuVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7795916812136309666L
;
/**
*
*/
private
Integer
menuId
;
private
String
menuName
;
public
Integer
getMenuId
()
{
return
menuId
;
}
public
void
setMenuId
(
Integer
menuId
)
{
this
.
menuId
=
menuId
;
}
public
String
getMenuName
()
{
return
menuName
;
}
public
void
setMenuName
(
String
menuName
)
{
this
.
menuName
=
menuName
;
}
}
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