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
a0408817
Commit
a0408817
authored
Oct 23, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加仅超管可用标志字段
parent
e5a48c43
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
16 deletions
+109
-16
TabSysMenuMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
+11
-0
TabSysMenu.java
...service/src/main/java/com/gic/auth/entity/TabSysMenu.java
+28
-1
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
+6
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+5
-1
TabSysMenuMapper.xml
...th-service/src/main/resources/mapper/TabSysMenuMapper.xml
+49
-14
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
View file @
a0408817
...
...
@@ -3,6 +3,7 @@ package com.gic.auth.dao.mapper;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.entity.TabSysMenu
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -166,4 +167,13 @@ public interface TabSysMenuMapper {
* @return void
*/
void
updateParentCodeByParentId
(
@Param
(
"parentId"
)
Integer
parentId
,
@Param
(
"parentCode"
)
String
parentCode
);
/**
* 仅超管可用的操作项
* @Title: listAdminOnlyOperationItem
* @Description:
* @author guojuxing
* @return java.util.List<com.gic.auth.entity.TabSysUser>
*/
List
<
TabSysUser
>
listAdminOnlyOperationItem
();
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabSysMenu.java
View file @
a0408817
...
...
@@ -92,10 +92,20 @@ public class TabSysMenu {
private
Integer
menuType
;
/**
* 应用版本名称
* 应用版本名称
基础版/高级版
*/
private
String
menuVersionName
;
/**
* 前端使用:二级域名,也就是项目的部署路径,比如门店项目部署在/damo-store下面,那么就是/damo-store
*/
private
String
projectUrlForWeb
;
/**
* 操作项 ,仅超管可用 1:是 0:否
*/
private
Integer
adminOnlySign
;
public
Integer
getMenuId
()
{
return
menuId
;
}
...
...
@@ -239,4 +249,20 @@ public class TabSysMenu {
public
void
setMenuVersionName
(
String
menuVersionName
)
{
this
.
menuVersionName
=
menuVersionName
;
}
public
String
getProjectUrlForWeb
()
{
return
projectUrlForWeb
;
}
public
void
setProjectUrlForWeb
(
String
projectUrlForWeb
)
{
this
.
projectUrlForWeb
=
projectUrlForWeb
;
}
public
Integer
getAdminOnlySign
()
{
return
adminOnlySign
;
}
public
void
setAdminOnlySign
(
Integer
adminOnlySign
)
{
this
.
adminOnlySign
=
adminOnlySign
;
}
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuService.java
View file @
a0408817
...
...
@@ -4,6 +4,7 @@ package com.gic.auth.service;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.entity.TabSysMenu
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
com.github.pagehelper.Page
;
...
...
@@ -144,4 +145,13 @@ public interface MenuService {
* @return void
*/
void
updateParentCodeByParentId
(
Integer
parentId
,
String
parentCode
);
/**
* 查询仅超管可用的操作项
* @Title: listAdminOnlyOperationItem
* @Description:
* @author guojuxing
* @return java.util.List<com.gic.auth.entity.TabSysUser>
*/
List
<
TabSysUser
>
listAdminOnlyOperationItem
();
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
a0408817
...
...
@@ -5,6 +5,7 @@ import java.util.Date;
import
java.util.List
;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -144,6 +145,11 @@ public class MenuServiceImpl implements MenuService {
tabSysMenuMapper
.
updateParentCodeByParentId
(
parentId
,
parentCode
);
}
@Override
public
List
<
TabSysUser
>
listAdminOnlyOperationItem
()
{
return
tabSysMenuMapper
.
listAdminOnlyOperationItem
();
}
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 @
a0408817
...
...
@@ -264,7 +264,9 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO
.
setMenuType
(
MenuTypeEnum
.
OPERATION
.
getCode
());
ServiceResponse
<
Integer
>
saveOperationItemResult
=
saveChildPage
(
menuDTO
,
MenuDTO
.
SaveOperationItemValid
.
class
);
if
(
saveOperationItemResult
.
isSuccess
())
{
if
(
menuDTO
.
isNeedCreateAuthItem
())
{
if
(
menuDTO
.
getAdminOnlySign
()
!=
null
&&
menuDTO
.
getAdminOnlySign
().
intValue
()
==
MenuOperationItemConstants
.
ADMIN_ONLY
)
{
//如果是仅超管可用,则不同步生成权限项
}
else
if
(
menuDTO
.
isNeedCreateAuthItem
())
{
//同步生成权限项
AuthItemSaveQO
authItemSaveQO
=
new
AuthItemSaveQO
();
authItemSaveQO
.
setMenuName
(
menuDTO
.
getMenuName
());
...
...
@@ -898,6 +900,8 @@ public class MenuApiServiceImpl implements MenuApiService {
resultList
.
add
(
menuDTO
);
}
}
List
<
TabSysUser
>
adminOnlyOperationItemList
=
menuService
.
listAdminOnlyOperationItem
();
resultList
.
addAll
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
adminOnlyOperationItemList
));
return
ServiceResponse
.
success
(
resultList
);
}
}
gic-platform-auth-service/src/main/resources/mapper/TabSysMenuMapper.xml
View file @
a0408817
...
...
@@ -20,10 +20,13 @@
<result
column=
"menu_version"
jdbcType=
"VARCHAR"
property=
"menuVersion"
/>
<result
column=
"menu_type"
jdbcType=
"INTEGER"
property=
"menuType"
/>
<result
column=
"menu_version_name"
jdbcType=
"VARCHAR"
property=
"menuVersionName"
/>
<result
column=
"project_url_for_web"
jdbcType=
"VARCHAR"
property=
"projectUrlForWeb"
/>
<result
column=
"admin_only_sign"
jdbcType=
"INTEGER"
property=
"adminOnlySign"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
menu_id, menu_name, project, menu_url, parent_id, target, icon_url, sort, status,
create_time, update_time, level, is_show, menu_code, parent_code, menu_version, menu_type, menu_version_name
create_time, update_time, level, is_show, menu_code, parent_code, menu_version, menu_type,
menu_version_name, project_url_for_web, admin_only_sign
</sql>
<sql
id=
"tree_filter"
>
and menu_type != 2
...
...
@@ -53,15 +56,17 @@
icon_url, sort, status,
create_time, update_time, level,
is_show, menu_code, parent_code,
menu_version, menu_type, menu_version_name)
menu_version, menu_type, menu_version_name,
project_url_for_web, admin_only_sign)
values (#{menuId,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
#{menuUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{target,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{level,jdbcType=INTEGER},
#{isShow,jdbcType=INTEGER}, #{menuCode,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR},
#{menuVersion,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, #{menuVersionName,jdbcType=VARCHAR})
#{menuVersion,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, #{menuVersionName,jdbcType=VARCHAR},
#{projectUrlForWeb,jdbcType=VARCHAR}, #{adminOnlySign,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.auth.entity.TabSysMenu"
useGeneratedKeys=
"true"
keyProperty=
"menuId
"
>
<insert
id=
"insertSelective"
keyProperty=
"menuId"
parameterType=
"com.gic.auth.entity.TabSysMenu"
useGeneratedKeys=
"true
"
>
insert into tab_sys_menu
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"menuId != null"
>
...
...
@@ -118,6 +123,12 @@
<if
test=
"menuVersionName != null"
>
menu_version_name,
</if>
<if
test=
"projectUrlForWeb != null"
>
project_url_for_web,
</if>
<if
test=
"adminOnlySign != null"
>
admin_only_sign,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"menuId != null"
>
...
...
@@ -174,6 +185,12 @@
<if
test=
"menuVersionName != null"
>
#{menuVersionName,jdbcType=VARCHAR},
</if>
<if
test=
"projectUrlForWeb != null"
>
#{projectUrlForWeb,jdbcType=VARCHAR},
</if>
<if
test=
"adminOnlySign != null"
>
#{adminOnlySign,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabSysMenu"
>
...
...
@@ -230,6 +247,12 @@
<if
test=
"menuVersionName != null"
>
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
</if>
<if
test=
"projectUrlForWeb != null"
>
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
</if>
<if
test=
"adminOnlySign != null"
>
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER},
</if>
</set>
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
...
...
@@ -251,11 +274,13 @@
parent_code = #{parentCode,jdbcType=VARCHAR},
menu_version = #{menuVersion,jdbcType=VARCHAR},
menu_type = #{menuType,jdbcType=INTEGER},
menu_version_name = #{menuVersionName,jdbcType=VARCHAR}
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER}
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
<select
id=
"listMenu"
resultMap=
"BaseResultMap"
parameterType=
"com.gic.auth.qo.MenuListQO
"
>
<select
id=
"listMenu"
parameterType=
"com.gic.auth.qo.MenuListQO"
resultMap=
"BaseResultMap
"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_menu
...
...
@@ -314,7 +339,7 @@
order by sort
</select>
<select
id=
"pageMenuOperationItem"
resultMap=
"BaseResultMap"
parameterType=
"com.gic.auth.qo.MenuOperationItemListQO
"
>
<select
id=
"pageMenuOperationItem"
parameterType=
"com.gic.auth.qo.MenuOperationItemListQO"
resultMap=
"BaseResultMap
"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_menu
...
...
@@ -337,9 +362,9 @@
<include
refid=
"Base_Column_List"
/>
from tab_sys_menu
where status=1
<if
test=
"null != menuIdList and menuIdList.size()
>
0"
>
<if
test=
"null != menuIdList and menuIdList.size()
>
0"
>
and menu_id in
<foreach
c
ollection=
"menuIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")
"
>
<foreach
c
lose=
")"
collection=
"menuIdList"
index=
"index"
item=
"item"
open=
"("
separator=
",
"
>
#{item}
</foreach>
</if>
...
...
@@ -353,7 +378,7 @@
from tab_sys_menu a
where a.status=1
and a.parent_id = #{menuId}
<include
refid=
"role_filter"
></include
>
<include
refid=
"role_filter"
/
>
</select>
...
...
@@ -373,7 +398,7 @@
<if
test=
"project != null"
>
and project = #{project}
</if>
<include
refid=
"tree_filter"
></include
>
<include
refid=
"tree_filter"
/
>
order by level,sort
</select>
...
...
@@ -385,10 +410,10 @@
from tab_sys_menu
where status=1
and project != 'gic'
<include
refid=
"tree_filter"
></include
>
<if
test=
"null != projectList and projectList.size()
>
0"
>
<include
refid=
"tree_filter"
/
>
<if
test=
"null != projectList and projectList.size()
>
0"
>
and project in
<foreach
c
ollection=
"projectList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")
"
>
<foreach
c
lose=
")"
collection=
"projectList"
index=
"index"
item=
"item"
open=
"("
separator=
",
"
>
#{item}
</foreach>
</if>
...
...
@@ -409,4 +434,13 @@
where parent_id = #{parentId}
and status = 1
</update>
<select
id=
"listAdminOnlyOperationItem"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_menu
where status = 1
and admin_only_sign = 1
and menu_type = 2
</select>
</mapper>
\ No newline at end of file
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