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
345c76fe
Commit
345c76fe
authored
Nov 04, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
协作人分页查询修改:分组过滤条件添加
parent
36eb1e43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
CollaboratorApiServiceImpl.java
...c/auth/service/outer/impl/CollaboratorApiServiceImpl.java
+24
-1
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+5
-4
TabSysCollaboratorMapper.xml
...ce/src/main/resources/mapper/TabSysCollaboratorMapper.xml
+6
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/CollaboratorApiServiceImpl.java
View file @
345c76fe
...
...
@@ -4,6 +4,9 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.auth.constant.AccountGroupMemberTypeEnum
;
import
com.gic.auth.entity.TabSysAccountGroupRel
;
import
com.gic.auth.service.AccountGroupRelService
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -45,6 +48,8 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
private
CollaboratorRoleRelService
collaboratorRoleRelService
;
@Autowired
private
EnterpriseApiService
enterpriseApiService
;
@Autowired
private
AccountGroupRelService
accountGroupRelService
;
@Override
public
ServiceResponse
<
Integer
>
save
(
CollaboratorDTO
dto
)
{
...
...
@@ -60,6 +65,23 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
@Override
public
ServiceResponse
<
Page
<
CollaboratorListDTO
>>
page
(
CollaboratorListQO
params
)
{
if
(
params
.
getAccountGroupId
()
!=
null
)
{
//查询分组下的管理员列表
List
<
TabSysAccountGroupRel
>
list
=
accountGroupRelService
.
listByAccountGroupId
(
params
.
getAccountGroupId
(),
AccountGroupMemberTypeEnum
.
COLLABORATOR
.
getCode
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
Integer
>
userIdList
=
new
ArrayList
<>(
list
.
size
());
for
(
TabSysAccountGroupRel
temp
:
list
)
{
userIdList
.
add
(
temp
.
getUserId
());
}
params
.
setCollaboratorIdList
(
userIdList
);
}
//如果是空的,则返回空
if
(
CollectionUtils
.
isEmpty
(
params
.
getCollaboratorIdList
()))
{
return
ServiceResponse
.
success
(
new
Page
<>());
}
}
com
.
github
.
pagehelper
.
Page
<
CollaboratorListDTO
>
page
=
collaboratorService
.
page
(
params
);
Page
<
CollaboratorListDTO
>
resultPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
);
return
ServiceResponse
.
success
(
resultPage
);
...
...
@@ -128,7 +150,8 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
}
result
.
setSubAppIdList
(
subAppList
);
}
ServiceResponse
<
EnterpriseDTO
>
enterpriseResult
=
enterpriseApiService
.
getEnterpriseById
(
record
.
getCollaborationEnterpriseId
());
ServiceResponse
<
EnterpriseDTO
>
enterpriseResult
=
enterpriseApiService
.
getEnterpriseById
(
record
.
getCollaborationEnterpriseId
());
if
(
enterpriseResult
.
isSuccess
())
{
result
.
setCollaborationEnterpriseName
(
enterpriseResult
.
getResult
().
getEnterpriseName
());
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
345c76fe
...
...
@@ -193,8 +193,7 @@ public class UserApiServiceImpl implements UserApiService {
@Override
public
ServiceResponse
<
Void
>
editAdmin
(
UserDTO
userDTO
)
{
//超级官员
TabSysUser
adminUser
=
userService
.
getUserByEnterpriseId
(
userDTO
.
getEnterpriseId
());
TabSysUser
adminUser
=
userService
.
getUserByEnterpriseId
(
userDTO
.
getEnterpriseId
());
if
(
adminUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"超级管理员不存在,操作有误"
);
}
...
...
@@ -245,7 +244,8 @@ public class UserApiServiceImpl implements UserApiService {
result
.
setUserResourceIds
(
userResourceResult
.
substring
(
0
,
userResourceResult
.
length
()
-
1
));
}
//账号分组
List
<
TabSysAccountGroupRel
>
tabSysAccountGroupRelList
=
accountGroupRelService
.
listByUserId
(
userId
,
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
());
List
<
TabSysAccountGroupRel
>
tabSysAccountGroupRelList
=
accountGroupRelService
.
listByUserId
(
userId
,
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
());
StringBuilder
accountGroupIdStr
=
new
StringBuilder
();
if
(
CollectionUtils
.
isNotEmpty
(
tabSysAccountGroupRelList
))
{
for
(
TabSysAccountGroupRel
accountGroupRel
:
tabSysAccountGroupRelList
)
{
...
...
@@ -321,7 +321,8 @@ public class UserApiServiceImpl implements UserApiService {
public
ServiceResponse
<
Page
<
UserListDTO
>>
pageUser
(
UserListQO
params
)
{
if
(
params
.
getAccountGroupId
()
!=
null
)
{
//查询分组下的管理员列表
List
<
TabSysAccountGroupRel
>
list
=
accountGroupRelService
.
listByAccountGroupId
(
params
.
getAccountGroupId
());
List
<
TabSysAccountGroupRel
>
list
=
accountGroupRelService
.
listByAccountGroupId
(
params
.
getAccountGroupId
(),
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
Integer
>
userIdList
=
new
ArrayList
<>(
list
.
size
());
for
(
TabSysAccountGroupRel
temp
:
list
)
{
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysCollaboratorMapper.xml
View file @
345c76fe
...
...
@@ -201,6 +201,12 @@
<if
test=
"status != null"
>
and a.status = #{status}
</if>
<if
test=
"collaboratorIdList != null and collaboratorIdList.size() > 0"
>
and a.collaborator_id in
<foreach
collection=
"collaboratorIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"listByCollaboratorIdList"
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