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
bcaf60f4
Commit
bcaf60f4
authored
Jun 11, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!12
parents
4f933859
4296d25e
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
337 additions
and
67 deletions
+337
-67
CollaboratorApiService.java
...ain/java/com/gic/auth/service/CollaboratorApiService.java
+2
-1
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+23
-3
pom.xml
gic-platform-auth-service/pom.xml
+5
-0
TabSysMenuMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
+4
-2
MenuService.java
...rvice/src/main/java/com/gic/auth/service/MenuService.java
+4
-2
MenuServiceImpl.java
.../main/java/com/gic/auth/service/impl/MenuServiceImpl.java
+4
-4
CollaboratorApiServiceImpl.java
...c/auth/service/outer/impl/CollaboratorApiServiceImpl.java
+3
-3
MenuApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
+147
-42
dubbo-gic-platform-auth-service.xml
...ce/src/main/resources/dubbo-gic-platform-auth-service.xml
+2
-0
TabSysMenuMapper.xml
...th-service/src/main/resources/mapper/TabSysMenuMapper.xml
+12
-0
CollaboratorController.java
...a/com/gic/auth/web/controller/CollaboratorController.java
+2
-0
MenuController.java
...main/java/com/gic/auth/web/controller/MenuController.java
+3
-4
ResourceController.java
.../java/com/gic/auth/web/controller/ResourceController.java
+6
-2
RoleController.java
...main/java/com/gic/auth/web/controller/RoleController.java
+7
-3
UserController.java
...main/java/com/gic/auth/web/controller/UserController.java
+16
-1
EnterpriseSmsSignVO.java
...rc/main/java/com/gic/auth/web/vo/EnterpriseSmsSignVO.java
+97
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/CollaboratorApiService.java
View file @
bcaf60f4
...
@@ -102,9 +102,10 @@ public interface CollaboratorApiService {
...
@@ -102,9 +102,10 @@ public interface CollaboratorApiService {
* @param enterpriseId
* @param enterpriseId
* @param phone
* @param phone
* @param appId
* @param appId
* @param userId 登录用户ID
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
*/
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorOperationItem
(
Integer
enterpriseId
,
String
phone
,
String
appId
,
boolean
isSuperAdmin
);
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorOperationItem
(
Integer
enterpriseId
,
String
phone
,
String
appId
,
Integer
userId
);
/**
/**
* 查询主键ID,协作人那边授权跳转,需要主键ID
* 查询主键ID,协作人那边授权跳转,需要主键ID
...
...
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
bcaf60f4
...
@@ -5,6 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
...
@@ -5,6 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.dto.AuthItemListDTO
;
import
com.gic.auth.dto.MenuAuthDepartDTO
;
import
com.gic.auth.dto.MenuAuthDepartDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.qo.AuthItemSaveQO
;
import
com.gic.auth.qo.AuthItemSaveQO
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
import
com.gic.auth.qo.MenuOperationItemListQO
;
...
@@ -102,10 +103,10 @@ public interface MenuApiService {
...
@@ -102,10 +103,10 @@ public interface MenuApiService {
* @author guojuxing
* @author guojuxing
* @param menuIdList 协作应用权限
* @param menuIdList 协作应用权限
* @param appId 应用ID
* @param appId 应用ID
* @param
isSuperAdmin 是否是超级
管理员
* @param
userId
管理员
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
*/
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorAppOperationItem
(
List
<
Integer
>
menuIdList
,
String
appId
,
boolean
isSuperAdmin
);
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorAppOperationItem
(
List
<
Integer
>
menuIdList
,
String
appId
,
Integer
userId
);
/**
/**
* 获取登陆用户的应用菜单(页面类型)已构建成树结构
* 获取登陆用户的应用菜单(页面类型)已构建成树结构
...
@@ -221,9 +222,20 @@ public interface MenuApiService {
...
@@ -221,9 +222,20 @@ public interface MenuApiService {
* @Description:
* @Description:
* @author guojuxing
* @author guojuxing
* @param enterpriseId
* @param enterpriseId
* @param userId 登录用户的ID
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
*/
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
);
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
,
Integer
userId
);
/**
* 查询子管理员应用菜单权限数据
* @Title: listAppPageOfHasBuyForRole
* @Description:
* @author guojuxing
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuyForRole
(
Integer
enterpriseId
);
/**
/**
* 编辑gic页面
* 编辑gic页面
...
@@ -404,4 +416,12 @@ public interface MenuApiService {
...
@@ -404,4 +416,12 @@ public interface MenuApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
*/
ServiceResponse
<
Void
>
syncProductMenu
(
String
menuCode
);
ServiceResponse
<
Void
>
syncProductMenu
(
String
menuCode
);
/**
* 过滤运维用户部门职位权限
* @param resultList
* @param tabSysUser
* @return
*/
ServiceResponse
<
List
<
MenuDTO
>>
filterOperationUserDepartAuth
(
List
<
MenuDTO
>
resultList
,
UserDTO
tabSysUser
);
}
}
gic-platform-auth-service/pom.xml
View file @
bcaf60f4
...
@@ -153,6 +153,11 @@
...
@@ -153,6 +153,11 @@
<artifactId>
gic-goods-api
</artifactId>
<artifactId>
gic-goods-api
</artifactId>
<version>
${gic-goods-api}
</version>
<version>
${gic-goods-api}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic.authcenter
</groupId>
<artifactId>
gic-authcenter-api
</artifactId>
<version>
${gic-authcenter-api}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysMenuMapper.java
View file @
bcaf60f4
...
@@ -153,7 +153,9 @@ public interface TabSysMenuMapper {
...
@@ -153,7 +153,9 @@ public interface TabSysMenuMapper {
* @param versionCode gic商户基础服务版本
* @param versionCode gic商户基础服务版本
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
*/
List
<
TabSysMenu
>
listMenuTree
(
@Param
(
"project"
)
String
project
,
@Param
(
"versionCode"
)
String
versionCode
);
List
<
TabSysMenu
>
listMenuTree
(
@Param
(
"project"
)
String
project
,
@Param
(
"versionCode"
)
String
versionCode
,
@Param
(
"list"
)
List
<
Integer
>
authTypeList
);
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
List
<
TabSysMenu
>
selectByProjectList
(
@Param
(
"projectList"
)
List
<
String
>
projectList
);
...
@@ -167,7 +169,7 @@ public interface TabSysMenuMapper {
...
@@ -167,7 +169,7 @@ public interface TabSysMenuMapper {
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
*/
List
<
TabSysMenu
>
selectAppMenuByParam
(
@Param
(
"projectList"
)
List
<
String
>
projectList
,
List
<
TabSysMenu
>
selectAppMenuByParam
(
@Param
(
"projectList"
)
List
<
String
>
projectList
,
@Param
(
"versionList"
)
List
<
String
>
versionList
);
@Param
(
"versionList"
)
List
<
String
>
versionList
,
@Param
(
"authTypeList"
)
List
<
Integer
>
authTypeList
);
/**
/**
* 相同code个数
* 相同code个数
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/MenuService.java
View file @
bcaf60f4
...
@@ -123,9 +123,10 @@ public interface MenuService {
...
@@ -123,9 +123,10 @@ public interface MenuService {
* @author guojuxing
* @author guojuxing
* @param project
* @param project
* @param versionCode gic商户基础服务版本
* @param versionCode gic商户基础服务版本
* @param authTypeList 权限适用 1:管理员 2:超管可用&达摩侧 3:仅达摩侧
* @return java.util.List<com.gic.auth.dto.MenuDTO>
* @return java.util.List<com.gic.auth.dto.MenuDTO>
*/
*/
List
<
TabSysMenu
>
listMenuTree
(
String
project
,
String
versionCode
);
List
<
TabSysMenu
>
listMenuTree
(
String
project
,
String
versionCode
,
List
<
Integer
>
authTypeList
);
/**
/**
* 根据项目查询
* 根据项目查询
...
@@ -144,9 +145,10 @@ public interface MenuService {
...
@@ -144,9 +145,10 @@ public interface MenuService {
* @author guojuxing
* @author guojuxing
* @param projectList appID List
* @param projectList appID List
* @param versionList 版本/拓展包 list
* @param versionList 版本/拓展包 list
* @param authTypeList 1:普通管理员 2:超管&达摩 3:仅达摩
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
*/
List
<
TabSysMenu
>
selectAppMenuByParam
(
List
<
String
>
projectList
,
List
<
String
>
versionList
);
List
<
TabSysMenu
>
selectAppMenuByParam
(
List
<
String
>
projectList
,
List
<
String
>
versionList
,
List
<
Integer
>
authTypeList
);
/**
/**
* 是否重复页面code
* 是否重复页面code
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/MenuServiceImpl.java
View file @
bcaf60f4
...
@@ -133,8 +133,8 @@ public class MenuServiceImpl implements MenuService {
...
@@ -133,8 +133,8 @@ public class MenuServiceImpl implements MenuService {
}
}
@Override
@Override
public
List
<
TabSysMenu
>
listMenuTree
(
String
project
,
String
versionCode
)
{
public
List
<
TabSysMenu
>
listMenuTree
(
String
project
,
String
versionCode
,
List
<
Integer
>
authTypeList
)
{
return
tabSysMenuMapper
.
listMenuTree
(
project
,
versionCode
);
return
tabSysMenuMapper
.
listMenuTree
(
project
,
versionCode
,
authTypeList
);
}
}
@Override
@Override
...
@@ -143,8 +143,8 @@ public class MenuServiceImpl implements MenuService {
...
@@ -143,8 +143,8 @@ public class MenuServiceImpl implements MenuService {
}
}
@Override
@Override
public
List
<
TabSysMenu
>
selectAppMenuByParam
(
List
<
String
>
projectList
,
List
<
String
>
versionList
)
{
public
List
<
TabSysMenu
>
selectAppMenuByParam
(
List
<
String
>
projectList
,
List
<
String
>
versionList
,
List
<
Integer
>
authTypeList
)
{
return
tabSysMenuMapper
.
selectAppMenuByParam
(
projectList
,
versionList
);
return
tabSysMenuMapper
.
selectAppMenuByParam
(
projectList
,
versionList
,
authTypeList
);
}
}
@Override
@Override
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/CollaboratorApiServiceImpl.java
View file @
bcaf60f4
...
@@ -205,7 +205,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
...
@@ -205,7 +205,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
}
}
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorOperationItem
(
Integer
enterpriseId
,
String
phone
,
String
appId
,
boolean
isSuperAdmin
)
{
public
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorOperationItem
(
Integer
enterpriseId
,
String
phone
,
String
appId
,
Integer
userId
)
{
TabSysCollaborator
record
=
collaboratorService
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
TabSysCollaborator
record
=
collaboratorService
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
if
(
record
==
null
)
{
if
(
record
==
null
)
{
LOGGER
.
info
(
"协作人接口getIdByPhoneAndAppId入参数据:{}, {}, {}"
,
enterpriseId
,
phone
,
appId
);
LOGGER
.
info
(
"协作人接口getIdByPhoneAndAppId入参数据:{}, {}, {}"
,
enterpriseId
,
phone
,
appId
);
...
@@ -220,7 +220,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
...
@@ -220,7 +220,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
menuIdList
.
add
(
menu
.
getMenuId
());
menuIdList
.
add
(
menu
.
getMenuId
());
}
}
}
}
return
menuApiService
.
getCollaboratorAppOperationItem
(
menuIdList
,
appId
,
isSuperAdmin
);
return
menuApiService
.
getCollaboratorAppOperationItem
(
menuIdList
,
appId
,
userId
);
}
}
@Override
@Override
...
@@ -235,9 +235,9 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
...
@@ -235,9 +235,9 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
@Override
@Override
public
ServiceResponse
<
Void
>
deleteByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
)
{
public
ServiceResponse
<
Void
>
deleteByPhoneAndAppId
(
Integer
enterpriseId
,
String
phone
,
String
appId
)
{
LOGGER
.
info
(
"协作人接口deleteByPhoneAndAppId入参数据:{}, {}, {}"
,
enterpriseId
,
phone
,
appId
);
TabSysCollaborator
record
=
collaboratorService
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
TabSysCollaborator
record
=
collaboratorService
.
getByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
if
(
record
==
null
)
{
if
(
record
==
null
)
{
LOGGER
.
info
(
"协作人接口getIdByPhoneAndAppId入参数据:{}, {}, {}"
,
enterpriseId
,
phone
,
appId
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"参数有误,查无数据"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"参数有误,查无数据"
);
}
}
collaboratorService
.
deleteByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
collaboratorService
.
deleteByPhoneAndAppId
(
enterpriseId
,
phone
,
appId
);
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/MenuApiServiceImpl.java
View file @
bcaf60f4
...
@@ -3,8 +3,14 @@ package com.gic.auth.service.outer.impl;
...
@@ -3,8 +3,14 @@ package com.gic.auth.service.outer.impl;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.entity.*
;
import
com.gic.auth.entity.*
;
import
com.gic.auth.qo.UserMenuQO
;
import
com.gic.auth.qo.UserMenuQO
;
import
com.gic.authcenter.api.dto.GicDepartmentDTO
;
import
com.gic.authcenter.api.dto.GicPositionDTO
;
import
com.gic.authcenter.api.dto.GicUserDTO
;
import
com.gic.authcenter.api.service.GicDepartmentService
;
import
com.gic.authcenter.api.service.GicUserService
;
import
com.gic.commons.util.CollectionUtil
;
import
com.gic.commons.util.CollectionUtil
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.dto.EnterpriseResourceRelDTO
;
import
com.gic.enterprise.dto.EnterpriseResourceRelDTO
;
...
@@ -62,6 +68,10 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -62,6 +68,10 @@ public class MenuApiServiceImpl implements MenuApiService {
private
BusinessFrontResService
businessFrontResService
;
private
BusinessFrontResService
businessFrontResService
;
@Autowired
@Autowired
private
MenuAuthDepartService
menuAuthDepartService
;
private
MenuAuthDepartService
menuAuthDepartService
;
@Autowired
private
GicUserService
gicUserService
;
@Autowired
private
GicDepartmentService
gicDepartmentService
;
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listByMenuIdList
(
List
<
Integer
>
menuIdList
)
{
public
ServiceResponse
<
List
<
MenuDTO
>>
listByMenuIdList
(
List
<
Integer
>
menuIdList
)
{
...
@@ -107,12 +117,17 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -107,12 +117,17 @@ public class MenuApiServiceImpl implements MenuApiService {
if
(
StringUtils
.
isBlank
(
versionCode
))
{
if
(
StringUtils
.
isBlank
(
versionCode
))
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
return
ServiceResponse
.
success
(
new
ArrayList
<>());
}
}
//是否是运维用户
boolean
isOperationUser
=
tabSysUser
.
getLoginType
().
intValue
()
!=
0
;
List
<
MenuDTO
>
result
;
List
<
MenuDTO
>
result
;
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
List
<
TabSysMenu
>
temp
=
new
ArrayList
<>();
List
<
TabSysMenu
>
temp
=
new
ArrayList
<>();
//超级管理员
//超级管理员
MenuListQO
params
=
new
MenuListQO
();
MenuListQO
params
=
new
MenuListQO
();
if
(!
isOperationUser
)
{
params
.
setAuthTypeList
(
Arrays
.
stream
(
new
Integer
[]{
1
,
2
}).
collect
(
Collectors
.
toList
()));
}
//查询gic的菜单
//查询gic的菜单
params
.
setIsGIC
(
MenuProjectConstants
.
DEFAULT_PROJECT_CODE
);
params
.
setIsGIC
(
MenuProjectConstants
.
DEFAULT_PROJECT_CODE
);
params
.
setVersionCode
(
versionCode
);
params
.
setVersionCode
(
versionCode
);
...
@@ -168,8 +183,8 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -168,8 +183,8 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorAppOperationItem
(
List
<
Integer
>
menuIdList
,
String
appId
,
boolean
isSuperAdmin
)
{
public
ServiceResponse
<
List
<
MenuDTO
>>
getCollaboratorAppOperationItem
(
List
<
Integer
>
menuIdList
,
String
appId
,
Integer
userId
)
{
return
getAppNoAuthOperationItem
(
menuIdList
,
appId
,
isSuperAdmin
);
return
getAppNoAuthOperationItem
(
menuIdList
,
appId
,
userId
);
}
}
@Override
@Override
...
@@ -250,7 +265,8 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -250,7 +265,8 @@ public class MenuApiServiceImpl implements MenuApiService {
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTreeForRole
(
String
project
,
String
versionCode
)
{
public
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTreeForRole
(
String
project
,
String
versionCode
)
{
List
<
TabSysMenu
>
list
=
menuService
.
listMenuTree
(
project
,
versionCode
);
//普通管理员级别的菜单,给子管理员适用
List
<
TabSysMenu
>
list
=
menuService
.
listMenuTree
(
project
,
versionCode
,
Arrays
.
asList
(
1
));
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
list
));
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
list
));
}
}
...
@@ -282,7 +298,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -282,7 +298,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuy
(
Integer
enterpriseId
)
{
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
));
if
(
appResult
.
isSuccess
())
{
if
(
appResult
.
isSuccess
())
{
...
@@ -302,8 +318,32 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -302,8 +318,32 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
}
}
}
}
List
<
TabSysMenu
>
tabSysMenuList
;
if
(
userId
!=
null
)
{
//过滤运营人员部门职位权限
TabSysUser
tabSysUser
=
userService
.
getUserById
(
userId
);
if
(
tabSysUser
==
null
)
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
}
if
(
tabSysUser
.
getLoginType
().
intValue
()
!=
0
)
{
tabSysMenuList
=
filterOperationUserDepartAuth
(
menuService
.
selectAppMenuByParam
(
projectList
,
versionList
,
null
),
tabSysUser
);
}
else
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
//超级管理员,包括1和2的权限适用
tabSysMenuList
=
menuService
.
selectAppMenuByParam
(
projectList
,
versionList
,
Arrays
.
stream
(
new
Integer
[]{
1
,
2
}).
collect
(
Collectors
.
toList
()));
}
else
{
tabSysMenuList
=
menuService
.
selectAppMenuByParam
(
projectList
,
versionList
,
Arrays
.
asList
(
1
));
}
}
else
{
//过滤
tabSysMenuList
=
menuService
.
selectAppMenuByParam
(
projectList
,
versionList
,
Arrays
.
asList
(
1
));
}
List
<
MenuDTO
>
menuList
=
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
List
<
MenuDTO
>
menuList
=
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
menuService
.
selectAppMenuByParam
(
projectList
,
versionList
)
);
tabSysMenuList
);
return
ServiceResponse
.
success
(
menuList
);
return
ServiceResponse
.
success
(
menuList
);
}
else
{
}
else
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
return
ServiceResponse
.
success
(
new
ArrayList
<>());
...
@@ -313,6 +353,11 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -313,6 +353,11 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
@Override
@Override
public
ServiceResponse
<
List
<
MenuDTO
>>
listAppPageOfHasBuyForRole
(
Integer
enterpriseId
)
{
return
listAppPageOfHasBuy
(
enterpriseId
,
null
);
}
@Override
public
ServiceResponse
<
Void
>
updateGICPage
(
MenuDTO
menuDTO
)
{
public
ServiceResponse
<
Void
>
updateGICPage
(
MenuDTO
menuDTO
)
{
return
updatePage
(
menuDTO
,
MenuTypeEnum
.
PAGE
,
MenuDTO
.
SavePageValid
.
class
);
return
updatePage
(
menuDTO
,
MenuTypeEnum
.
PAGE
,
MenuDTO
.
SavePageValid
.
class
);
}
}
...
@@ -670,6 +715,13 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -670,6 +715,13 @@ public class MenuApiServiceImpl implements MenuApiService {
return
ServiceResponse
.
success
();
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
));
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
list
));
}
private
ServiceResponse
<
Void
>
savePage
(
MenuDTO
menuDTO
,
Class
clazz
)
{
private
ServiceResponse
<
Void
>
savePage
(
MenuDTO
menuDTO
,
Class
clazz
)
{
ServiceResponse
paramsValid
=
ValidParamsUtils
.
allCheckValidate
(
menuDTO
,
clazz
);
ServiceResponse
paramsValid
=
ValidParamsUtils
.
allCheckValidate
(
menuDTO
,
clazz
);
if
(!
paramsValid
.
isSuccess
())
{
if
(!
paramsValid
.
isSuccess
())
{
...
@@ -840,6 +892,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -840,6 +892,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO
.
setMenuName
(
app
.
getName
());
menuDTO
.
setMenuName
(
app
.
getName
());
menuDTO
.
setProject
(
app
.
getApplicationId
().
toString
());
menuDTO
.
setProject
(
app
.
getApplicationId
().
toString
());
setMenuVersion
(
app
.
getPropDTOList
(),
app
.
getServeExpanList
(),
menuDTO
);
setMenuVersion
(
app
.
getPropDTOList
(),
app
.
getServeExpanList
(),
menuDTO
);
// setMenuAuthType(menuDTO);
menuDTO
.
setMenuId
(
appMenu
.
get
(
app
.
getApplicationId
().
toString
()).
getMenuId
());
menuDTO
.
setMenuId
(
appMenu
.
get
(
app
.
getApplicationId
().
toString
()).
getMenuId
());
menuService
.
updatePage
(
menuDTO
);
menuService
.
updatePage
(
menuDTO
);
}
else
{
}
else
{
...
@@ -847,6 +900,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -847,6 +900,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO
.
setMenuName
(
app
.
getName
());
menuDTO
.
setMenuName
(
app
.
getName
());
menuDTO
.
setProject
(
app
.
getApplicationId
().
toString
());
menuDTO
.
setProject
(
app
.
getApplicationId
().
toString
());
setMenuVersion
(
app
.
getPropDTOList
(),
app
.
getServeExpanList
(),
menuDTO
);
setMenuVersion
(
app
.
getPropDTOList
(),
app
.
getServeExpanList
(),
menuDTO
);
// setMenuAuthType(menuDTO);
setNormalFieldValue
(
menuDTO
);
setNormalFieldValue
(
menuDTO
);
menuService
.
savePage
(
menuDTO
);
menuService
.
savePage
(
menuDTO
);
}
}
...
@@ -1044,7 +1098,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1044,7 +1098,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
/**
/**
* 查询用户拥有的权限菜单(页面、权限项)
* 查询用户拥有的权限菜单(页面、权限项)
(已经过滤登录用)
* @Title: getUserMenuList
* @Title: getUserMenuList
* @Description:
* @Description:
* @author guojuxing
* @author guojuxing
...
@@ -1052,6 +1106,8 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1052,6 +1106,8 @@ public class MenuApiServiceImpl implements MenuApiService {
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
* @return java.util.List<com.gic.auth.entity.TabSysMenu>
*/
*/
private
List
<
TabSysMenu
>
getUserMenuList
(
Integer
userId
)
{
private
List
<
TabSysMenu
>
getUserMenuList
(
Integer
userId
)
{
TabSysUser
tabSysUser
=
userService
.
getUserById
(
userId
);
//查询用户的权限集
//查询用户的权限集
List
<
UserRoleDTO
>
userRoleList
=
userRoleService
.
listUserRoleByUserId
(
userId
);
List
<
UserRoleDTO
>
userRoleList
=
userRoleService
.
listUserRoleByUserId
(
userId
);
List
<
Integer
>
roleIdList
=
new
ArrayList
<>(
userRoleList
.
size
());
List
<
Integer
>
roleIdList
=
new
ArrayList
<>(
userRoleList
.
size
());
...
@@ -1065,7 +1121,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1065,7 +1121,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuIdList
.
add
(
menuRole
.
getMenuId
());
menuIdList
.
add
(
menuRole
.
getMenuId
());
}
}
List
<
TabSysMenu
>
menuList
=
menuService
.
selectByIds
(
menuIdList
);
List
<
TabSysMenu
>
menuList
=
menuService
.
selectByIds
(
menuIdList
);
return
menuList
;
return
filterOperationUserDepartAuth
(
menuList
,
tabSysUser
)
;
}
}
/**
/**
...
@@ -1110,25 +1166,7 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1110,25 +1166,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
if
(
params
.
isOperationUser
())
{
if
(
params
.
isOperationUser
())
{
resultList
=
this
.
menuService
.
listMenu
(
menuListParams
);
resultList
=
filterOperationUserDepartAuth
(
this
.
menuService
.
listMenu
(
menuListParams
),
tabSysUser
);
//todo 运营人员的部门职位;根据手机号查询运维人员的部门职位信息
//如果是运营人员
Set
<
String
>
departPosition
=
new
HashSet
<>(
2
);
//过滤运营人员的部门职位权限
Map
<
String
,
List
<
TabSysMenuAuthDepart
>>
departMap
=
getAuthDepartMap
(
null
);
resultList
=
resultList
.
stream
().
filter
(
e
->
{
List
<
TabSysMenuAuthDepart
>
authList
=
departMap
.
get
(
e
.
getMenuCode
());
if
(
authList
==
null
)
{
//如果是空的,说明是全部权限
return
true
;
}
//验证departPosition是否存在一个于authList中
if
(
authList
.
stream
().
anyMatch
(
auth
->
departPosition
.
contains
(
auth
.
getDepartCode
()
+
"-"
+
auth
.
getPositionCode
())))
{
return
true
;
}
return
false
;
}).
collect
(
Collectors
.
toList
());
}
else
{
}
else
{
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
...
@@ -1178,6 +1216,65 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1178,6 +1216,65 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
/**
/**
* 过滤达摩侧用户的部门职位权限
* @param resultList
* @param tabSysUser
* @return
*/
private
List
<
TabSysMenu
>
filterOperationUserDepartAuth
(
List
<
TabSysMenu
>
resultList
,
TabSysUser
tabSysUser
)
{
if
(
tabSysUser
!=
null
&&
tabSysUser
.
getLoginType
().
intValue
()
!=
0
)
{
//运营人员的部门职位;根据手机号查询运维人员的部门职位信息
GicUserDTO
gicUserDTO
=
gicUserService
.
getUserByMobile
(
tabSysUser
.
getPhoneNumber
());
LOGGER
.
info
(
"运维人员的部门职位数据:{}"
,
JSON
.
toJSONString
(
gicUserDTO
));
//如果是运营人员
Set
<
String
>
departPosition
=
new
HashSet
<>(
2
);
String
departmentCode
=
gicUserDTO
.
getDepartmentCode
();
if
(
StringUtils
.
isNotBlank
(
departmentCode
))
{
if
(
StringUtils
.
isBlank
(
gicUserDTO
.
getPositionCode
()))
{
//如果职位code是空,则取下面全部的职位code
List
<
GicDepartmentDTO
>
gicDepartmentDTOList
=
gicDepartmentService
.
listAllGicDepartment
();
if
(
CollectionUtils
.
isNotEmpty
(
gicDepartmentDTOList
))
{
Map
<
String
,
List
<
GicPositionDTO
>>
departMap
=
gicDepartmentDTOList
.
stream
()
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getDepartmentCode
(),
e
->
e
.
getPositionList
()));
List
<
GicPositionDTO
>
positionList
=
departMap
.
get
(
departmentCode
);
if
(
CollectionUtils
.
isNotEmpty
(
positionList
))
{
positionList
.
forEach
(
e
->
{
departPosition
.
add
(
departmentCode
+
"-"
+
e
.
getPositionCode
());
});
}
}
}
}
//过滤运营人员的部门职位权限
Map
<
String
,
List
<
TabSysMenuAuthDepart
>>
departMap
=
getAuthDepartMap
(
null
);
return
resultList
.
stream
().
filter
(
e
->
{
if
(
e
.
getAuthType
().
intValue
()
==
1
)
{
//普通管理员的都有效,不需要判断部门职位
return
true
;
}
List
<
TabSysMenuAuthDepart
>
authList
=
departMap
.
get
(
e
.
getMenuCode
());
if
(
authList
==
null
)
{
//如果是空的,说明是全部权限
return
true
;
}
//验证departPosition是否存在一个于authList中
if
(
authList
.
stream
().
anyMatch
(
auth
->
departPosition
.
contains
(
auth
.
getDepartCode
()
+
"-"
+
auth
.
getPositionCode
())))
{
return
true
;
}
return
false
;
}).
collect
(
Collectors
.
toList
());
}
else
if
(
tabSysUser
!=
null
&&
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
//超级管理员
return
resultList
.
stream
().
filter
(
e
->
e
.
getAuthType
().
intValue
()
!=
3
).
collect
(
Collectors
.
toList
());
}
else
if
(
tabSysUser
!=
null
&&
tabSysUser
.
getSuperAdmin
().
intValue
()
==
0
)
{
//普通管理员
return
resultList
.
stream
().
filter
(
e
->
e
.
getAuthType
().
intValue
()
==
1
).
collect
(
Collectors
.
toList
());
}
return
resultList
;
}
/**
* 查询出所有的部门职位,用于过滤运营人员权限
* 查询出所有的部门职位,用于过滤运营人员权限
* @param menuCodeList
* @param menuCodeList
* @return
* @return
...
@@ -1258,9 +1355,13 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1258,9 +1355,13 @@ public class MenuApiServiceImpl implements MenuApiService {
if
(
tabSysUser
==
null
)
{
if
(
tabSysUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户不存在"
);
}
}
//添加逻辑:如果是超级管理员,直接全部有效,不存在没有权限的操作项
//添加逻辑:如果是超级管理员,直接全部有效,不存在没有权限的操作项
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
==
1
)
{
return
ServiceResponse
.
success
(
new
ArrayList
<>());
//
MenuListQO
params
=
new
MenuListQO
();
List
<
TabSysMenu
>
adminMenuList
=
filterOperationUserDepartAuth
(
menuService
.
listMenu
(
params
),
tabSysUser
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
adminMenuList
));
}
}
//用户拥有的菜单权限
//用户拥有的菜单权限
...
@@ -1268,12 +1369,12 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1268,12 +1369,12 @@ public class MenuApiServiceImpl implements MenuApiService {
List
<
MenuDTO
>
resultList
=
getNoAuthOperationItemByMenuIdList
(
menuList
,
projectCode
,
versionCode
);
List
<
MenuDTO
>
resultList
=
getNoAuthOperationItemByMenuIdList
(
menuList
,
projectCode
,
versionCode
);
//仅超管可用
//仅超管可用
if
(
tabSysUser
.
getSuperAdmin
().
intValue
()
!=
1
)
{
//
if (tabSysUser.getSuperAdmin().intValue() != 1) {
List
<
TabSysMenu
>
adminOnlyOperationItemList
=
menuService
.
listAdminOnlyOperationItem
();
//
List<TabSysMenu> adminOnlyOperationItemList = menuService.listAdminOnlyOperationItem();
if
(
CollectionUtils
.
isNotEmpty
(
adminOnlyOperationItemList
))
{
//
if (CollectionUtils.isNotEmpty(adminOnlyOperationItemList)) {
resultList
.
addAll
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
adminOnlyOperationItemList
));
//
resultList.addAll(EntityUtil.changeEntityListNew(MenuDTO.class, adminOnlyOperationItemList));
}
//
}
}
//
}
return
ServiceResponse
.
success
(
resultList
);
return
ServiceResponse
.
success
(
resultList
);
}
}
...
@@ -1326,17 +1427,21 @@ public class MenuApiServiceImpl implements MenuApiService {
...
@@ -1326,17 +1427,21 @@ public class MenuApiServiceImpl implements MenuApiService {
return
resultList
;
return
resultList
;
}
}
private
ServiceResponse
<
List
<
MenuDTO
>>
getAppNoAuthOperationItem
(
List
<
Integer
>
menuIdList
,
String
appId
,
boolean
isSuperAdmin
)
{
private
ServiceResponse
<
List
<
MenuDTO
>>
getAppNoAuthOperationItem
(
List
<
Integer
>
menuIdList
,
String
appId
,
Integer
userId
)
{
TabSysUser
tabSysUser
=
userService
.
getUserById
(
userId
);
if
(
tabSysUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户ID:"
+
userId
+
"用户不存在"
);
}
//用户拥有的菜单权限
//用户拥有的菜单权限
List
<
TabSysMenu
>
menuList
=
menuService
.
selectByIds
(
menuIdList
);
List
<
TabSysMenu
>
menuList
=
filterOperationUserDepartAuth
(
menuService
.
selectByIds
(
menuIdList
),
tabSysUser
);
List
<
MenuDTO
>
resultList
=
getNoAuthOperationItemByMenuIdList
(
menuList
,
MenuProjectConstants
.
APP_PROJECT_CODE
,
""
);
List
<
MenuDTO
>
resultList
=
getNoAuthOperationItemByMenuIdList
(
menuList
,
MenuProjectConstants
.
APP_PROJECT_CODE
,
""
);
//仅超管可用
//
//仅超管可用
if
(!
isSuperAdmin
)
{
//
if (!isSuperAdmin) {
List
<
TabSysMenu
>
adminOnlyOperationItemList
=
menuService
.
listAdminOnlyOperationItem
();
//
List<TabSysMenu> adminOnlyOperationItemList = menuService.listAdminOnlyOperationItem();
if
(
CollectionUtils
.
isNotEmpty
(
adminOnlyOperationItemList
))
{
//
if (CollectionUtils.isNotEmpty(adminOnlyOperationItemList)) {
resultList
.
addAll
(
EntityUtil
.
changeEntityListNew
(
MenuDTO
.
class
,
adminOnlyOperationItemList
));
//
resultList.addAll(EntityUtil.changeEntityListNew(MenuDTO.class, adminOnlyOperationItemList));
}
//
}
}
//
}
//过滤应用
//过滤应用
List
<
MenuDTO
>
tempResult
=
new
ArrayList
<>();
List
<
MenuDTO
>
tempResult
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
resultList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
resultList
))
{
...
...
gic-platform-auth-service/src/main/resources/dubbo-gic-platform-auth-service.xml
View file @
bcaf60f4
...
@@ -69,4 +69,6 @@
...
@@ -69,4 +69,6 @@
<dubbo:reference
interface=
"com.gic.member.config.api.service.AuthorizationEnterConfApiService"
id=
"authorizationEnterConfApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.member.config.api.service.AuthorizationEnterConfApiService"
id=
"authorizationEnterConfApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.goods.api.service.GoodsRightsSelectorApiService"
id=
"goodsRightsSelectorApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.goods.api.service.GoodsRightsSelectorApiService"
id=
"goodsRightsSelectorApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.authcenter.api.service.GicUserService"
id=
"gicUserService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.authcenter.api.service.GicDepartmentService"
id=
"gicDepartmentService"
timeout=
"6000"
/>
</beans>
</beans>
gic-platform-auth-service/src/main/resources/mapper/TabSysMenuMapper.xml
View file @
bcaf60f4
...
@@ -456,6 +456,12 @@
...
@@ -456,6 +456,12 @@
<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>
<if
test=
"null != list and list.size() > 0"
>
and auth_type in
<foreach
close=
")"
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
<include
refid=
"tree_filter"
/>
<include
refid=
"tree_filter"
/>
order by level,sort
order by level,sort
...
@@ -497,6 +503,12 @@
...
@@ -497,6 +503,12 @@
</foreach>
</foreach>
)
)
</if>
</if>
<if
test=
"null != authTypeList and authTypeList.size() > 0"
>
and auth_type in
<foreach
close=
")"
collection=
"authTypeList"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
</select>
</select>
<select
id=
"countByMenuCode"
resultType=
"int"
>
<select
id=
"countByMenuCode"
resultType=
"int"
>
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/CollaboratorController.java
View file @
bcaf60f4
...
@@ -152,6 +152,8 @@ public class CollaboratorController extends DownloadUtils{
...
@@ -152,6 +152,8 @@ public class CollaboratorController extends DownloadUtils{
MenuListQO
params
=
new
MenuListQO
();
MenuListQO
params
=
new
MenuListQO
();
params
.
setProject
(
appId
);
params
.
setProject
(
appId
);
params
.
setIsGIC
(
MenuProjectConstants
.
APP_PROJECT_CODE
);
params
.
setIsGIC
(
MenuProjectConstants
.
APP_PROJECT_CODE
);
//普通管理员
params
.
setAuthTypeList
(
Arrays
.
asList
(
1
));
ServiceResponse
<
List
<
MenuDTO
>>
appMenuList
=
menuApiService
.
listMenuTree
(
params
);
ServiceResponse
<
List
<
MenuDTO
>>
appMenuList
=
menuApiService
.
listMenuTree
(
params
);
if
(
appMenuList
.
isSuccess
())
{
if
(
appMenuList
.
isSuccess
())
{
return
RestResponse
.
success
(
changePageListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
appMenuList
.
getResult
()));
return
RestResponse
.
success
(
changePageListToTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
appMenuList
.
getResult
()));
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/MenuController.java
View file @
bcaf60f4
...
@@ -133,9 +133,8 @@ public class MenuController {
...
@@ -133,9 +133,8 @@ public class MenuController {
LOGGER
.
info
(
"查询登录用户的协作应用的操作项参数:{}-{}"
,
appId
,
menuCode
);
LOGGER
.
info
(
"查询登录用户的协作应用的操作项参数:{}-{}"
,
appId
,
menuCode
);
UserDetail
userDetail
=
UserDetailUtils
.
getUserDetail
();
UserDetail
userDetail
=
UserDetailUtils
.
getUserDetail
();
appId
=
getAppId
(
appId
,
menuCode
);
appId
=
getAppId
(
appId
,
menuCode
);
boolean
isSuperAdmin
=
userDetail
.
getUserInfo
().
getSuperAdmin
().
intValue
()
==
1
;
ServiceResponse
<
List
<
MenuDTO
>>
userMenu
=
this
.
collaboratorApiService
.
getCollaboratorOperationItem
(
ServiceResponse
<
List
<
MenuDTO
>>
userMenu
=
this
.
collaboratorApiService
.
getCollaboratorOperationItem
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserInfo
().
getPhoneNumber
(),
appId
,
isSuperAdmin
);
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserInfo
().
getPhoneNumber
(),
appId
,
userDetail
.
getUserId
()
);
return
ResultControllerUtils
.
commonResult
(
userMenu
,
UserOperationItemAuthVO
.
class
);
return
ResultControllerUtils
.
commonResult
(
userMenu
,
UserOperationItemAuthVO
.
class
);
}
}
...
@@ -209,7 +208,7 @@ public class MenuController {
...
@@ -209,7 +208,7 @@ public class MenuController {
boolean
isSuperAdmin
=
userDetail
.
getUserInfo
().
getSuperAdmin
().
intValue
()
==
1
;
boolean
isSuperAdmin
=
userDetail
.
getUserInfo
().
getSuperAdmin
().
intValue
()
==
1
;
ServiceResponse
<
List
<
MenuDTO
>>
result
;
ServiceResponse
<
List
<
MenuDTO
>>
result
;
if
(
isSuperAdmin
)
{
if
(
isSuperAdmin
)
{
result
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
result
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()
,
userDetail
.
getUserId
()
);
}
else
{
}
else
{
//权限控制
//权限控制
result
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
null
,
result
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
null
,
...
@@ -268,7 +267,7 @@ public class MenuController {
...
@@ -268,7 +267,7 @@ public class MenuController {
}
}
ServiceResponse
<
List
<
MenuDTO
>>
appResult
;
ServiceResponse
<
List
<
MenuDTO
>>
appResult
;
if
(
isSuperAdmin
)
{
if
(
isSuperAdmin
)
{
appResult
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
appResult
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()
,
userDetail
.
getUserId
()
);
}
else
{
}
else
{
//权限控制
//权限控制
appResult
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
appResult
=
menuApiService
.
getUserMenuOfAppNotTree
(
userDetail
.
getEnterpriseId
(),
userDetail
.
getUserId
(),
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/ResourceController.java
View file @
bcaf60f4
...
@@ -68,9 +68,13 @@ public class ResourceController {
...
@@ -68,9 +68,13 @@ public class ResourceController {
@RequestMapping
(
"/list-sms-sign"
)
@RequestMapping
(
"/list-sms-sign"
)
public
RestResponse
listSmsSign
(
String
search
)
{
public
RestResponse
listSmsSign
(
String
search
)
{
ServiceResponse
<
List
<
EnterpriseSmsSignDTO
>>
serviceR
esponse
=
smsApiService
ServiceResponse
<
List
<
EnterpriseSmsSignDTO
>>
r
esponse
=
smsApiService
.
listSignByEnterprise
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
search
);
.
listSignByEnterprise
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
search
);
return
ResultControllerUtils
.
commonResult
(
serviceResponse
);
if
(
response
.
isSuccess
())
{
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
EnterpriseSmsSignVO
.
class
,
response
.
getResult
()));
}
else
{
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
}
}
@RequestMapping
(
"/save-resource"
)
@RequestMapping
(
"/save-resource"
)
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/RoleController.java
View file @
bcaf60f4
...
@@ -72,7 +72,7 @@ public class RoleController {
...
@@ -72,7 +72,7 @@ public class RoleController {
//app已购买应用
//app已购买应用
ServiceResponse
<
List
<
MenuDTO
>>
appResult
=
menuApiService
ServiceResponse
<
List
<
MenuDTO
>>
appResult
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
.
listAppPageOfHasBuy
ForRole
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
//过滤商户基础应用
//过滤商户基础应用
List
<
MenuDTO
>
appMenuList
=
appResult
.
getResult
();
List
<
MenuDTO
>
appMenuList
=
appResult
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
appMenuList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
appMenuList
))
{
...
@@ -133,7 +133,7 @@ public class RoleController {
...
@@ -133,7 +133,7 @@ public class RoleController {
}
}
/**
/**
* 查询列表数据
* 查询
授权子管理菜单权限
列表数据
* @Title: updateAppPage
* @Title: updateAppPage
* @Description:
* @Description:
* @author guojuxing
* @author guojuxing
...
@@ -149,10 +149,14 @@ public class RoleController {
...
@@ -149,10 +149,14 @@ public class RoleController {
return
EnterpriseRestResponse
.
failure
(
result
);
return
EnterpriseRestResponse
.
failure
(
result
);
}
}
/**
* 查询授权子管理员应用菜单权限数据
* @return
*/
@RequestMapping
(
"/list-app-menu-tree"
)
@RequestMapping
(
"/list-app-menu-tree"
)
public
RestResponse
listAppMenuTree
()
{
public
RestResponse
listAppMenuTree
()
{
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
ServiceResponse
<
List
<
MenuDTO
>>
result
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
.
listAppPageOfHasBuy
ForRole
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
result
.
isSuccess
())
{
if
(
result
.
isSuccess
())
{
List
<
MenuDTO
>
menuList
=
result
.
getResult
();
List
<
MenuDTO
>
menuList
=
result
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
menuList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
menuList
))
{
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UserController.java
View file @
bcaf60f4
...
@@ -145,7 +145,13 @@ public class UserController {
...
@@ -145,7 +145,13 @@ public class UserController {
*/
*/
@RequestMapping
(
"/get-login-user"
)
@RequestMapping
(
"/get-login-user"
)
public
RestResponse
getLoginUser
()
{
public
RestResponse
getLoginUser
()
{
LoginUserVO
vo
=
EntityUtil
.
changeEntityNew
(
LoginUserVO
.
class
,
UserDetailUtils
.
getUserDetail
().
getUserInfo
());
LoginUserVO
vo
;
ServiceResponse
<
UserDTO
>
userResult
=
userApiService
.
getUserInfoById
(
UserDetailUtils
.
getUserDetail
().
getUserId
());
if
(
userResult
.
isSuccess
())
{
vo
=
EntityUtil
.
changeEntityNew
(
LoginUserVO
.
class
,
userResult
.
getResult
());
}
else
{
vo
=
new
LoginUserVO
();
}
//商户logo
//商户logo
EnterpriseInfo
enterpriseInfo
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
();
EnterpriseInfo
enterpriseInfo
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
();
vo
.
setLogo
(
enterpriseInfo
.
getLogo
());
vo
.
setLogo
(
enterpriseInfo
.
getLogo
());
...
@@ -263,6 +269,15 @@ public class UserController {
...
@@ -263,6 +269,15 @@ public class UserController {
return
ResultControllerUtils
.
commonResult
(
userApiService
.
listGicUser
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()),
UserOfGicVO
.
class
);
return
ResultControllerUtils
.
commonResult
(
userApiService
.
listGicUser
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()),
UserOfGicVO
.
class
);
}
}
@RequestMapping
(
"/edit-user-name"
)
public
RestResponse
editUserName
(
String
name
)
{
return
OperationResultUtils
.
operationResult
(
userApiService
.
updateOperationUser
(
UserDetailUtils
.
getUserDetail
().
getUserId
(),
name
),
"修改用户名称"
,
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getPhoneNumber
());
}
/**
/**
* 逻辑删除用户对应分组数据
* 逻辑删除用户对应分组数据
*
*
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/vo/EnterpriseSmsSignVO.java
0 → 100644
View file @
bcaf60f4
package
com
.
gic
.
auth
.
web
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author zhiwj
* @Description:
* @date 2020-06-10 16:37
*/
public
class
EnterpriseSmsSignVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
664328628311397146L
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
signId
;
private
Integer
enterpriseId
;
private
String
smsSignId
;
private
String
smsSignText
;
private
String
smsAppid
;
private
Integer
useType
;
private
Date
createTime
;
private
Date
updateTime
;
private
Integer
deleteFlag
;
public
Long
getSignId
()
{
return
signId
;
}
public
void
setSignId
(
Long
signId
)
{
this
.
signId
=
signId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getSmsSignId
()
{
return
smsSignId
;
}
public
void
setSmsSignId
(
String
smsSignId
)
{
this
.
smsSignId
=
smsSignId
;
}
public
String
getSmsSignText
()
{
return
smsSignText
;
}
public
void
setSmsSignText
(
String
smsSignText
)
{
this
.
smsSignText
=
smsSignText
;
}
public
String
getSmsAppid
()
{
return
smsAppid
;
}
public
void
setSmsAppid
(
String
smsAppid
)
{
this
.
smsAppid
=
smsAppid
;
}
public
Integer
getUseType
()
{
return
useType
;
}
public
void
setUseType
(
Integer
useType
)
{
this
.
useType
=
useType
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
}
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