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
30cb026c
Commit
30cb026c
authored
Jul 30, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加字段区分好办菜单。重载接口
parent
184bd926
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
455 additions
and
12 deletions
+455
-12
MenuProjectConstants.java
...main/java/com/gic/auth/constant/MenuProjectConstants.java
+10
-0
MenuDTO.java
...form-auth-api/src/main/java/com/gic/auth/dto/MenuDTO.java
+15
-1
AuthItemSaveQO.java
...uth-api/src/main/java/com/gic/auth/qo/AuthItemSaveQO.java
+14
-0
MenuListQO.java
...rm-auth-api/src/main/java/com/gic/auth/qo/MenuListQO.java
+14
-0
MenuOperationItemListQO.java
...rc/main/java/com/gic/auth/qo/MenuOperationItemListQO.java
+15
-1
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+19
-0
MenuForHaoBanApiService.java
...in/java/com/gic/auth/service/MenuForHaoBanApiService.java
+172
-0
TabSysMenuMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
+1
-0
TabSysMenu.java
...service/src/main/java/com/gic/auth/entity/TabSysMenu.java
+15
-0
MenuService.java
...rvice/src/main/java/com/gic/auth/service/MenuService.java
+1
-0
MenuServiceImpl.java
.../main/java/com/gic/auth/service/impl/MenuServiceImpl.java
+10
-0
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+33
-6
MenuForHaoBanApiServiceImpl.java
.../auth/service/outer/impl/MenuForHaoBanApiServiceImpl.java
+113
-0
TabSysMenuMapper.xml
...th-service/src/main/resources/mapper/TabSysMenuMapper.xml
+23
-4
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/constant/MenuProjectConstants.java
View file @
30cb026c
...
@@ -26,4 +26,14 @@ public class MenuProjectConstants {
...
@@ -26,4 +26,14 @@ public class MenuProjectConstants {
* all
* all
*/
*/
public
final
static
int
ALL_CODE
=
3
;
public
final
static
int
ALL_CODE
=
3
;
/**
* 好办后台
*/
public
final
static
String
HAO_BAN_PROJECT
=
"haoban"
;
/**
* 好办小程序
*/
public
final
static
String
HAO_BAN_WECHAT_PROJECT
=
"haobanWechat"
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/MenuDTO.java
View file @
30cb026c
...
@@ -135,7 +135,7 @@ public class MenuDTO implements Serializable {
...
@@ -135,7 +135,7 @@ public class MenuDTO implements Serializable {
private
String
parentCode
;
private
String
parentCode
;
/**
/**
* 多选,例如_1_2_格式,
如果是GIC菜单 1gic标准版 2gic集团版;如果是应用菜单 1:基础班 2:高级版
* 多选,例如_1_2_格式,
根据应用版本
*/
*/
@NotBlank
(
message
=
"版本不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
,
@NotBlank
(
message
=
"版本不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
,
SaveAppChildPageValid
.
class
,
SaveOperationItemValid
.
class
,
UpdateGICChildPageValid
.
class
,
SaveAppChildPageValid
.
class
,
SaveOperationItemValid
.
class
,
UpdateGICChildPageValid
.
class
,
...
@@ -178,6 +178,11 @@ public class MenuDTO implements Serializable {
...
@@ -178,6 +178,11 @@ public class MenuDTO implements Serializable {
*/
*/
private
List
<
MenuAuthDepartDTO
>
menuAuthDepartList
;
private
List
<
MenuAuthDepartDTO
>
menuAuthDepartList
;
/**
* 0:gic 1:好办后台 2:好办小程序
*/
private
Integer
platformType
;
public
Integer
getMenuId
()
{
public
Integer
getMenuId
()
{
return
menuId
;
return
menuId
;
}
}
...
@@ -355,4 +360,13 @@ public class MenuDTO implements Serializable {
...
@@ -355,4 +360,13 @@ public class MenuDTO implements Serializable {
this
.
authType
=
authType
;
this
.
authType
=
authType
;
return
this
;
return
this
;
}
}
public
Integer
getPlatformType
()
{
return
platformType
;
}
public
MenuDTO
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
return
this
;
}
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/AuthItemSaveQO.java
View file @
30cb026c
...
@@ -46,6 +46,11 @@ public class AuthItemSaveQO extends PageQO {
...
@@ -46,6 +46,11 @@ public class AuthItemSaveQO extends PageQO {
@NotNull
(
message
=
"主键ID不能为空"
,
groups
=
{
EditAuthItemValid
.
class
})
@NotNull
(
message
=
"主键ID不能为空"
,
groups
=
{
EditAuthItemValid
.
class
})
private
Integer
menuId
;
private
Integer
menuId
;
/**
* 0:gic 1:好办后台 2:好办小程序
*/
private
Integer
platformType
=
0
;
public
String
getMenuName
()
{
public
String
getMenuName
()
{
return
menuName
;
return
menuName
;
}
}
...
@@ -77,4 +82,13 @@ public class AuthItemSaveQO extends PageQO {
...
@@ -77,4 +82,13 @@ public class AuthItemSaveQO extends PageQO {
public
void
setMenuId
(
Integer
menuId
)
{
public
void
setMenuId
(
Integer
menuId
)
{
this
.
menuId
=
menuId
;
this
.
menuId
=
menuId
;
}
}
public
Integer
getPlatformType
()
{
return
platformType
;
}
public
AuthItemSaveQO
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
return
this
;
}
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/MenuListQO.java
View file @
30cb026c
...
@@ -50,6 +50,11 @@ public class MenuListQO extends PageQO{
...
@@ -50,6 +50,11 @@ public class MenuListQO extends PageQO{
*/
*/
private
List
<
Integer
>
authTypeList
;
private
List
<
Integer
>
authTypeList
;
/**
* 0:gic 1:好办后台 2:好办小程序
*/
private
Integer
platformType
;
public
String
getSearch
()
{
public
String
getSearch
()
{
return
search
;
return
search
;
}
}
...
@@ -122,4 +127,13 @@ public class MenuListQO extends PageQO{
...
@@ -122,4 +127,13 @@ public class MenuListQO extends PageQO{
this
.
authTypeList
=
authTypeList
;
this
.
authTypeList
=
authTypeList
;
return
this
;
return
this
;
}
}
public
Integer
getPlatformType
()
{
return
platformType
;
}
public
MenuListQO
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
return
this
;
}
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/MenuOperationItemListQO.java
View file @
30cb026c
...
@@ -15,10 +15,15 @@ public class MenuOperationItemListQO extends PageQO{
...
@@ -15,10 +15,15 @@ public class MenuOperationItemListQO extends PageQO{
*/
*/
private
String
search
;
private
String
search
;
/**
/**
* 1:gic菜单 2:app菜单
* 1:gic菜单 2:app菜单
(platformType = 0的时候选择)
*/
*/
private
Integer
isGIC
;
private
Integer
isGIC
;
/**
* 0:gic 1:好办后台 2:好办小程序
*/
private
Integer
platformType
=
0
;
public
String
getSearch
()
{
public
String
getSearch
()
{
return
search
;
return
search
;
}
}
...
@@ -34,4 +39,13 @@ public class MenuOperationItemListQO extends PageQO{
...
@@ -34,4 +39,13 @@ public class MenuOperationItemListQO extends PageQO{
public
void
setIsGIC
(
Integer
isGIC
)
{
public
void
setIsGIC
(
Integer
isGIC
)
{
this
.
isGIC
=
isGIC
;
this
.
isGIC
=
isGIC
;
}
}
public
Integer
getPlatformType
()
{
return
platformType
;
}
public
MenuOperationItemListQO
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
return
this
;
}
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
30cb026c
...
@@ -180,6 +180,15 @@ public interface MenuApiService {
...
@@ -180,6 +180,15 @@ public interface MenuApiService {
*/
*/
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTree
(
MenuListQO
params
);
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTree
(
MenuListQO
params
);
/**查询gic菜单页面树数据 (好办)
* @Title: listMenuTreeForHaoban
* @Description:
* @author guojuxing
* @param params
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTreeForHaoban
(
MenuListQO
params
);
ServiceResponse
<
List
<
MenuAuthDepartDTO
>>
listAllAuthDepart
(
List
<
String
>
menuCodeList
);
ServiceResponse
<
List
<
MenuAuthDepartDTO
>>
listAllAuthDepart
(
List
<
String
>
menuCodeList
);
/**
/**
...
@@ -224,6 +233,16 @@ public interface MenuApiService {
...
@@ -224,6 +233,16 @@ public interface MenuApiService {
ServiceResponse
<
Void
>
saveGICPage
(
MenuDTO
menuDTO
);
ServiceResponse
<
Void
>
saveGICPage
(
MenuDTO
menuDTO
);
/**
/**
* 新增页面(好办)
* @Title: savePageForHaoban
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
savePageForHaoban
(
MenuDTO
menuDTO
);
/**
* 查询已经购买的应用
* 查询已经购买的应用
* @Title: listAppPageOfHasBuy
* @Title: listAppPageOfHasBuy
* @Description:
* @Description:
...
...
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuForHaoBanApiService.java
0 → 100644
View file @
30cb026c
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.qo.AuthItemSaveQO
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
java.util.List
;
/**
* 好办菜单
* @ClassName: MenuForHaoBanApiService
* @Description:
* @author guojuxing
* @date 2020/7/30 2:06 PM
*/
public
interface
MenuForHaoBanApiService
{
/**
* 新增菜单
* @Title: savePage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
savePage
(
MenuDTO
menuDTO
);
/**
* 编辑菜单 (
* @Title: updatePage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updatePage
(
MenuDTO
menuDTO
);
/**
* 删除菜单
* @Title: deleteMenu
* @Description:
* @author guojuxing
* @param menuId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
deleteMenu
(
Integer
menuId
);
/**
* 新增子菜单
* @Title: saveChildPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
saveChildPage
(
MenuDTO
menuDTO
);
/**
* 编辑子菜单
* @Title: updateChildPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateChildPage
(
MenuDTO
menuDTO
);
/**
* 新增操作项
* @Title: saveOperationItem
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
saveOperationItem
(
MenuDTO
menuDTO
);
/**
* 编辑操作项
* @Title: updateOperationItem
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateOperationItem
(
MenuDTO
menuDTO
);
/**
* 分页查询操作项
* @Title: pageMenuOperationItem
* @Description:
* @author guojuxing
* @param params
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
Page
<
MenuDTO
>>
pageMenuOperationItem
(
MenuOperationItemListQO
params
);
/**
* 详情
* @Title: getDetailById
* @Description:
* @author guojuxing
* @param menuId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.MenuDTO>
*/
ServiceResponse
<
MenuDTO
>
getDetailById
(
Integer
menuId
);
/**
* 新增权限项
* @Title: saveAuthItem
* @Description:
* @author guojuxing
* @param params
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
saveAuthItem
(
AuthItemSaveQO
params
);
/**
* 编辑权限项
* @Title: updateAuthItem
* @Description:
* @author guojuxing
* @param params
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateAuthItem
(
AuthItemSaveQO
params
);
/**
* 查看菜单下的权限项
* @Title: listAuthItemByMenuId
* @Description:
* @author guojuxing
* @param menuId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.AuthItemListDTO>>
*/
ServiceResponse
<
List
<
AuthItemListDTO
>>
listAuthItemByMenuId
(
Integer
menuId
);
/**
* 根据code查询,因为code唯一
* @Title: getMenuByMenuCode
* @Description:
* @author guojuxing
* @param menuCode
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.MenuDTO>
*/
ServiceResponse
<
MenuDTO
>
getMenuByMenuCode
(
String
menuCode
);
/**
* 查询菜单数数据
* @Title: listMenu
* @Description:
* @author guojuxing
* @param search 页面名称/code
* @param menuType 0:页面 1:权限项 2:操作项
* @param platformType 0:gic 1:好办后台 2:好办小程序
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listMenu
(
String
search
,
Integer
menuType
,
Integer
platformType
);
/**
* 查询页面下面的操作项列表数据
* @Title: listMenuItemByParentId
* @Description:
* @author guojuxing
* @param parentId 菜单ID
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listMenuItemByParentId
(
Integer
parentId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
View file @
30cb026c
...
@@ -157,6 +157,7 @@ public interface TabSysMenuMapper {
...
@@ -157,6 +157,7 @@ public interface TabSysMenuMapper {
@Param
(
"versionCode"
)
String
versionCode
,
@Param
(
"versionCode"
)
String
versionCode
,
@Param
(
"list"
)
List
<
Integer
>
authTypeList
);
@Param
(
"list"
)
List
<
Integer
>
authTypeList
);
@Deprecated
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
/**
/**
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/entity/TabSysMenu.java
View file @
30cb026c
...
@@ -111,6 +111,11 @@ public class TabSysMenu {
...
@@ -111,6 +111,11 @@ public class TabSysMenu {
*/
*/
private
Integer
authType
;
private
Integer
authType
;
/**
* 0:gic 1:好办后台 2:好办小程序
*/
private
Integer
platformType
;
public
Integer
getMenuId
()
{
public
Integer
getMenuId
()
{
return
menuId
;
return
menuId
;
}
}
...
@@ -279,4 +284,13 @@ public class TabSysMenu {
...
@@ -279,4 +284,13 @@ public class TabSysMenu {
this
.
authType
=
authType
;
this
.
authType
=
authType
;
return
this
;
return
this
;
}
}
public
Integer
getPlatformType
()
{
return
platformType
;
}
public
TabSysMenu
setPlatformType
(
Integer
platformType
)
{
this
.
platformType
=
platformType
;
return
this
;
}
}
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuService.java
View file @
30cb026c
...
@@ -136,6 +136,7 @@ public interface MenuService {
...
@@ -136,6 +136,7 @@ public interface MenuService {
* @param projectList
* @param projectList
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
*/
@Deprecated
List
<
TabSysMenu
>
selectByProjectList
(
List
<
String
>
projectList
);
List
<
TabSysMenu
>
selectByProjectList
(
List
<
String
>
projectList
);
/**
/**
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
30cb026c
...
@@ -29,6 +29,9 @@ public class MenuServiceImpl implements MenuService {
...
@@ -29,6 +29,9 @@ public class MenuServiceImpl implements MenuService {
private
TabSysMenuMapper
tabSysMenuMapper
;
private
TabSysMenuMapper
tabSysMenuMapper
;
@Override
@Override
public
List
<
TabSysMenu
>
listMenu
(
MenuListQO
params
)
{
public
List
<
TabSysMenu
>
listMenu
(
MenuListQO
params
)
{
if
(
params
.
getPlatformType
()
==
null
)
{
params
.
setPlatformType
(
0
);
}
return
this
.
tabSysMenuMapper
.
listMenu
(
params
);
return
this
.
tabSysMenuMapper
.
listMenu
(
params
);
}
}
...
@@ -43,6 +46,10 @@ public class MenuServiceImpl implements MenuService {
...
@@ -43,6 +46,10 @@ public class MenuServiceImpl implements MenuService {
TabSysMenu
record
=
EntityUtil
.
changeEntityNew
(
TabSysMenu
.
class
,
menuDTO
);
TabSysMenu
record
=
EntityUtil
.
changeEntityNew
(
TabSysMenu
.
class
,
menuDTO
);
record
.
setCreateTime
(
new
Date
());
record
.
setCreateTime
(
new
Date
());
record
.
setUpdateTime
(
new
Date
());
record
.
setUpdateTime
(
new
Date
());
if
(
record
.
getPlatformType
()
==
null
)
{
//默认gic平台菜单
record
.
setPlatformType
(
0
);
}
record
.
setStatus
(
1
);
record
.
setStatus
(
1
);
if
(
StringUtils
.
isBlank
(
menuDTO
.
getMenuCode
()))
{
if
(
StringUtils
.
isBlank
(
menuDTO
.
getMenuCode
()))
{
//权限项没有菜单code数据,但是这样会导致不好批量上传到生产,给一个默认的数据
//权限项没有菜单code数据,但是这样会导致不好批量上传到生产,给一个默认的数据
...
@@ -104,6 +111,9 @@ public class MenuServiceImpl implements MenuService {
...
@@ -104,6 +111,9 @@ public class MenuServiceImpl implements MenuService {
@Override
@Override
public
Page
<
TabSysMenu
>
pageMenuOperationItem
(
MenuOperationItemListQO
params
)
{
public
Page
<
TabSysMenu
>
pageMenuOperationItem
(
MenuOperationItemListQO
params
)
{
PageHelper
.
startPage
(
params
.
getCurrentPage
(),
params
.
getPageSize
());
PageHelper
.
startPage
(
params
.
getCurrentPage
(),
params
.
getPageSize
());
if
(
params
.
getPlatformType
()
==
null
)
{
params
.
setPlatformType
(
0
);
}
List
<
TabSysMenu
>
list
=
tabSysMenuMapper
.
pageMenuOperationItem
(
params
);
List
<
TabSysMenu
>
list
=
tabSysMenuMapper
.
pageMenuOperationItem
(
params
);
return
(
Page
<
TabSysMenu
>)
list
;
return
(
Page
<
TabSysMenu
>)
list
;
}
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
30cb026c
...
@@ -272,6 +272,13 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -272,6 +272,13 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTreeForHaoban
(
MenuListQO
params
)
{
params
.
setIsGIC
(
null
);
List
<
TabSysMenu
>
menuList
=
this
.
menuService
.
listMenu
(
params
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
menuList
));
}
@Override
public
ServiceResponse
<
List
<
MenuAuthDepartDTO
>>
listAllAuthDepart
(
List
<
String
>
menuCodeList
)
{
public
ServiceResponse
<
List
<
MenuAuthDepartDTO
>>
listAllAuthDepart
(
List
<
String
>
menuCodeList
)
{
List
<
TabSysMenuAuthDepart
>
list
=
menuAuthDepartService
.
listAllAuthDepart
(
menuCodeList
);
List
<
TabSysMenuAuthDepart
>
list
=
menuAuthDepartService
.
listAllAuthDepart
(
menuCodeList
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
...
@@ -315,6 +322,21 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -315,6 +322,21 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
@Override
@Override
public
ServiceResponse
<
Void
>
savePageForHaoban
(
MenuDTO
menuDTO
)
{
Integer
platformType
=
menuDTO
.
getPlatformType
();
boolean
isRight
=
platformType
!=
null
&&
(
platformType
.
intValue
()
==
1
||
platformType
.
intValue
()
==
2
);
if
(!
isRight
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"菜单平台类型值非法"
);
}
if
(
platformType
.
intValue
()
==
1
)
{
menuDTO
.
setProject
(
MenuProjectConstants
.
HAO_BAN_PROJECT
);
}
else
{
menuDTO
.
setProject
(
MenuProjectConstants
.
HAO_BAN_WECHAT_PROJECT
);
}
return
savePage
(
menuDTO
,
MenuDTO
.
SavePageValid
.
class
);
}
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
,
Integer
userId
)
{
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
,
Integer
userId
)
{
ServiceResponse
<
List
<
ApplicationTokenDTO
>>
appResult
=
appTokenApiService
ServiceResponse
<
List
<
ApplicationTokenDTO
>>
appResult
=
appTokenApiService
.
listApplicationByeId
(
Long
.
valueOf
(
enterpriseId
));
.
listApplicationByeId
(
Long
.
valueOf
(
enterpriseId
));
...
@@ -536,6 +558,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -536,6 +558,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO
.
setMenuType
(
MenuTypeEnum
.
ROLE
.
getCode
());
menuDTO
.
setMenuType
(
MenuTypeEnum
.
ROLE
.
getCode
());
menuDTO
.
setMenuVersion
(
record
.
getMenuVersion
());
menuDTO
.
setMenuVersion
(
record
.
getMenuVersion
());
menuDTO
.
setMenuVersionName
(
record
.
getMenuVersionName
());
menuDTO
.
setMenuVersionName
(
record
.
getMenuVersionName
());
menuDTO
.
setPlatformType
(
params
.
getPlatformType
());
setNormalFieldValue
(
menuDTO
,
record
);
setNormalFieldValue
(
menuDTO
,
record
);
int
menuId
=
menuService
.
savePage
(
menuDTO
);
int
menuId
=
menuService
.
savePage
(
menuDTO
);
...
@@ -590,6 +613,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -590,6 +613,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO
.
setMenuName
(
params
.
getMenuName
());
menuDTO
.
setMenuName
(
params
.
getMenuName
());
menuDTO
.
setMenuId
(
params
.
getMenuId
());
menuDTO
.
setMenuId
(
params
.
getMenuId
());
menuDTO
.
setMenuType
(
MenuTypeEnum
.
ROLE
.
getCode
());
menuDTO
.
setMenuType
(
MenuTypeEnum
.
ROLE
.
getCode
());
menuDTO
.
setPlatformType
(
record
.
getPlatformType
());
setNormalFieldValue
(
menuDTO
,
record
);
setNormalFieldValue
(
menuDTO
,
record
);
menuService
.
updatePage
(
menuDTO
);
menuService
.
updatePage
(
menuDTO
);
...
@@ -859,13 +883,15 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -859,13 +883,15 @@ public class MenuApiServiceImpl implements MenuApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"code:"
+
menuDTO
.
getMenuCode
()
+
"重复"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"code:"
+
menuDTO
.
getMenuCode
()
+
"重复"
);
}
}
menuDTO
.
setPlatformType
(
record
.
getPlatformType
());
menuDTO
.
setProject
(
record
.
getProject
());
menuDTO
.
setProject
(
record
.
getProject
());
if
(!
MenuProjectConstants
.
DEFAULT_PROJECT
.
equals
(
menuDTO
.
getProject
()))
{
//兼容haoban
//如果是应用子页面、操作项
// if (!MenuProjectConstants.DEFAULT_PROJECT.equals(menuDTO.getProject())) {
if
(
StringUtils
.
isBlank
(
menuDTO
.
getMenuVersionName
()))
{
// //如果是应用子页面、操作项
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"应用版本名称不能改为空"
);
// if (StringUtils.isBlank(menuDTO.getMenuVersionName())) {
}
// return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "应用版本名称不能改为空");
}
// }
// }
setMenuVersion
(
menuDTO
);
setMenuVersion
(
menuDTO
);
setMenuAuthType
(
menuDTO
);
setMenuAuthType
(
menuDTO
);
menuService
.
updatePage
(
menuDTO
);
menuService
.
updatePage
(
menuDTO
);
...
@@ -976,6 +1002,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -976,6 +1002,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
//父级code
//父级code
menuDTO
.
setParentCode
(
parent
.
getMenuCode
());
menuDTO
.
setParentCode
(
parent
.
getMenuCode
());
menuDTO
.
setPlatformType
(
parent
.
getPlatformType
());
}
}
/**
/**
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuForHaoBanApiServiceImpl.java
0 → 100644
View file @
30cb026c
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.qo.AuthItemSaveQO
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
com.gic.auth.service.MenuApiService
;
import
com.gic.auth.service.MenuForHaoBanApiService
;
import
com.gic.enterprise.error.ErrorCode
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"menuForHaoBanApiService"
)
public
class
MenuForHaoBanApiServiceImpl
implements
MenuForHaoBanApiService
{
@Autowired
private
MenuApiService
menuApiService
;
@Override
public
ServiceResponse
<
Void
>
savePage
(
MenuDTO
menuDTO
)
{
return
menuApiService
.
savePageForHaoban
(
menuDTO
);
}
@Override
public
ServiceResponse
<
Void
>
updatePage
(
MenuDTO
menuDTO
)
{
return
menuApiService
.
updateGICPage
(
menuDTO
);
}
@Override
public
ServiceResponse
<
Void
>
deleteMenu
(
Integer
menuId
)
{
return
menuApiService
.
deleteMenu
(
menuId
);
}
@Override
public
ServiceResponse
<
Integer
>
saveChildPage
(
MenuDTO
menuDTO
)
{
return
menuApiService
.
saveGICChildPage
(
menuDTO
);
}
@Override
public
ServiceResponse
<
Void
>
updateChildPage
(
MenuDTO
menuDTO
)
{
return
menuApiService
.
updateGICChildPage
(
menuDTO
);
}
@Override
public
ServiceResponse
<
Integer
>
saveOperationItem
(
MenuDTO
menuDTO
)
{
return
menuApiService
.
saveOperationItem
(
menuDTO
);
}
@Override
public
ServiceResponse
<
Void
>
updateOperationItem
(
MenuDTO
menuDTO
)
{
return
menuApiService
.
updateOperationItem
(
menuDTO
);
}
@Override
public
ServiceResponse
<
Page
<
MenuDTO
>>
pageMenuOperationItem
(
MenuOperationItemListQO
params
)
{
if
(!
isRightPlatformType
(
params
.
getPlatformType
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"平台类型值非法"
);
}
return
menuApiService
.
pageMenuOperationItem
(
params
);
}
@Override
public
ServiceResponse
<
MenuDTO
>
getDetailById
(
Integer
menuId
)
{
return
menuApiService
.
getDetailById
(
menuId
);
}
@Override
public
ServiceResponse
<
Void
>
saveAuthItem
(
AuthItemSaveQO
params
)
{
if
(!
isRightPlatformType
(
params
.
getPlatformType
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"平台类型值非法"
);
}
return
menuApiService
.
saveAuthItem
(
params
);
}
@Override
public
ServiceResponse
<
Void
>
updateAuthItem
(
AuthItemSaveQO
params
)
{
return
menuApiService
.
updateAuthItem
(
params
);
}
@Override
public
ServiceResponse
<
List
<
AuthItemListDTO
>>
listAuthItemByMenuId
(
Integer
menuId
)
{
return
menuApiService
.
listAuthItemByMenuId
(
menuId
);
}
@Override
public
ServiceResponse
<
MenuDTO
>
getMenuByMenuCode
(
String
menuCode
)
{
return
menuApiService
.
getMenuByMenuCode
(
menuCode
);
}
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listMenu
(
String
search
,
Integer
menuType
,
Integer
platformType
)
{
if
(!
isRightPlatformType
(
platformType
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"平台类型值非法"
);
}
MenuListQO
params
=
new
MenuListQO
();
params
.
setSearch
(
search
);
params
.
setMenuType
(
menuType
);
params
.
setPlatformType
(
platformType
);
return
menuApiService
.
listMenuTreeForHaoban
(
params
);
}
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listMenuItemByParentId
(
Integer
parentId
)
{
return
menuApiService
.
listMenuItemByParentId
(
parentId
);
}
private
static
boolean
isRightPlatformType
(
Integer
platformType
)
{
return
platformType
!=
null
&&
(
platformType
.
intValue
()
==
1
||
platformType
.
intValue
()
==
2
);
}
}
gic-platform-auth-service/src/main/resources/mapper/TabSysMenuMapper.xml
View file @
30cb026c
...
@@ -23,11 +23,12 @@
...
@@ -23,11 +23,12 @@
<result
column=
"project_url_for_web"
jdbcType=
"VARCHAR"
property=
"projectUrlForWeb"
/>
<result
column=
"project_url_for_web"
jdbcType=
"VARCHAR"
property=
"projectUrlForWeb"
/>
<result
column=
"admin_only_sign"
jdbcType=
"INTEGER"
property=
"adminOnlySign"
/>
<result
column=
"admin_only_sign"
jdbcType=
"INTEGER"
property=
"adminOnlySign"
/>
<result
column=
"auth_type"
jdbcType=
"INTEGER"
property=
"authType"
/>
<result
column=
"auth_type"
jdbcType=
"INTEGER"
property=
"authType"
/>
<result
column=
"platform_type"
jdbcType=
"INTEGER"
property=
"platformType"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
menu_id, menu_name, project, menu_url, parent_id, target, icon_url, sort, status,
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,
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, auth_type
menu_version_name, project_url_for_web, admin_only_sign, auth_type
, platform_type
</sql>
</sql>
<sql
id=
"tree_filter"
>
<sql
id=
"tree_filter"
>
and menu_type != 2
and menu_type != 2
...
@@ -58,14 +59,14 @@
...
@@ -58,14 +59,14 @@
create_time, update_time, level,
create_time, update_time, level,
is_show, menu_code, parent_code,
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, auth_type)
project_url_for_web, admin_only_sign, auth_type
, platform_type
)
values (#{menuId,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
values (#{menuId,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
#{menuUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{target,jdbcType=INTEGER},
#{menuUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{target,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{level,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{level,jdbcType=INTEGER},
#{isShow,jdbcType=INTEGER}, #{menuCode,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR},
#{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}, #{authType,jdbcType=INTEGER})
#{projectUrlForWeb,jdbcType=VARCHAR}, #{adminOnlySign,jdbcType=INTEGER}, #{authType,jdbcType=INTEGER}
, #{platformType,jdbcType=INTEGER}
)
</insert>
</insert>
<insert
id=
"insertSelective"
keyProperty=
"menuId"
parameterType=
"com.gic.auth.entity.TabSysMenu"
useGeneratedKeys=
"true"
>
<insert
id=
"insertSelective"
keyProperty=
"menuId"
parameterType=
"com.gic.auth.entity.TabSysMenu"
useGeneratedKeys=
"true"
>
insert into tab_sys_menu
insert into tab_sys_menu
...
@@ -133,6 +134,9 @@
...
@@ -133,6 +134,9 @@
<if
test=
"authType != null"
>
<if
test=
"authType != null"
>
auth_type,
auth_type,
</if>
</if>
<if
test=
"platformType != null"
>
platform_type,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"menuId != null"
>
<if
test=
"menuId != null"
>
...
@@ -198,6 +202,9 @@
...
@@ -198,6 +202,9 @@
<if
test=
"authType != null"
>
<if
test=
"authType != null"
>
#{authType,jdbcType=INTEGER},
#{authType,jdbcType=INTEGER},
</if>
</if>
<if
test=
"platformType != null"
>
#{platformType,jdbcType=INTEGER},
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabSysMenu"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.auth.entity.TabSysMenu"
>
...
@@ -263,6 +270,9 @@
...
@@ -263,6 +270,9 @@
<if
test=
"authType != null"
>
<if
test=
"authType != null"
>
auth_type = #{authType,jdbcType=INTEGER},
auth_type = #{authType,jdbcType=INTEGER},
</if>
</if>
<if
test=
"platformType != null"
>
platform_type = #{platformType,jdbcType=INTEGER},
</if>
</set>
</set>
where menu_id = #{menuId,jdbcType=INTEGER}
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
</update>
...
@@ -287,7 +297,8 @@
...
@@ -287,7 +297,8 @@
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER},
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER},
auth_type = #{authType,jdbcType=INTEGER}
auth_type = #{authType,jdbcType=INTEGER},
platform_type = #{platformType,jdbcType=INTEGER}
where menu_id = #{menuId,jdbcType=INTEGER}
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
</update>
...
@@ -305,6 +316,7 @@
...
@@ -305,6 +316,7 @@
<if
test=
"isGIC == 2"
>
<if
test=
"isGIC == 2"
>
and project != 'gic'
and project != 'gic'
</if>
</if>
and platform_type = #{platformType}
<if
test=
"menuType != null"
>
<if
test=
"menuType != null"
>
and menu_type = #{menuType}
and menu_type = #{menuType}
</if>
</if>
...
@@ -379,6 +391,7 @@
...
@@ -379,6 +391,7 @@
<if
test=
"isGIC == 2"
>
<if
test=
"isGIC == 2"
>
and project != 'gic'
and project != 'gic'
</if>
</if>
and platform_type = #{platformType}
<include
refid=
"item_filter"
/>
<include
refid=
"item_filter"
/>
order by create_time desc
order by create_time desc
</select>
</select>
...
@@ -453,6 +466,7 @@
...
@@ -453,6 +466,7 @@
<if
test=
"project != null"
>
<if
test=
"project != null"
>
and project = #{project}
and project = #{project}
</if>
</if>
and platform_type = 0
<if
test=
"versionCode != null and versionCode != '' "
>
<if
test=
"versionCode != null and versionCode != '' "
>
and menu_version like concat('%_', #{versionCode}, '_%' )
and menu_version like concat('%_', #{versionCode}, '_%' )
</if>
</if>
...
@@ -474,6 +488,7 @@
...
@@ -474,6 +488,7 @@
from tab_sys_menu
from tab_sys_menu
where status=1
where status=1
and project != 'gic'
and project != 'gic'
and platform_type = 0
<include
refid=
"tree_filter"
/>
<include
refid=
"tree_filter"
/>
<if
test=
"null != projectList and projectList.size() > 0"
>
<if
test=
"null != projectList and projectList.size() > 0"
>
and project in
and project in
...
@@ -489,6 +504,7 @@
...
@@ -489,6 +504,7 @@
from tab_sys_menu
from tab_sys_menu
where status=1
where status=1
and project != 'gic'
and project != 'gic'
and platform_type = 0
<include
refid=
"tree_filter"
/>
<include
refid=
"tree_filter"
/>
<if
test=
"null != projectList and projectList.size() > 0"
>
<if
test=
"null != projectList and projectList.size() > 0"
>
and project in
and project in
...
@@ -542,6 +558,7 @@
...
@@ -542,6 +558,7 @@
where status = 1
where status = 1
and admin_only_sign = 1
and admin_only_sign = 1
and menu_type = 2
and menu_type = 2
and platform_type = 0
</select>
</select>
...
@@ -561,6 +578,7 @@
...
@@ -561,6 +578,7 @@
update tab_sys_menu set status = 0
update tab_sys_menu set status = 0
where status = 1
where status = 1
and project != 'gic'
and project != 'gic'
and platform_type = 0
and project NOT IN
and project NOT IN
<foreach
close=
")"
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
<foreach
close=
")"
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
#{item}
...
@@ -573,6 +591,7 @@
...
@@ -573,6 +591,7 @@
from tab_sys_menu_dev
from tab_sys_menu_dev
where status = 1
where status = 1
and project = #{project}
and project = #{project}
and platform_type = 0
</select>
</select>
<select
id=
"listMenuTempByMenuCode"
resultMap=
"BaseResultMap"
>
<select
id=
"listMenuTempByMenuCode"
resultMap=
"BaseResultMap"
>
...
...
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