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
9e532cdf
Commit
9e532cdf
authored
Nov 01, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账号分组接口
parent
471c788b
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
195 additions
and
21 deletions
+195
-21
TabSysAccountGroupMapper.java
...ava/com/gic/auth/dao/mapper/TabSysAccountGroupMapper.java
+1
-0
TabSysAccountGroupRelMapper.java
.../com/gic/auth/dao/mapper/TabSysAccountGroupRelMapper.java
+5
-1
TabSysUserMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
+3
-1
AccountGroupRelService.java
...ain/java/com/gic/auth/service/AccountGroupRelService.java
+13
-0
AccountGroupService.java
...c/main/java/com/gic/auth/service/AccountGroupService.java
+1
-0
UserService.java
...rvice/src/main/java/com/gic/auth/service/UserService.java
+1
-1
AccountGroupRelServiceImpl.java
...com/gic/auth/service/impl/AccountGroupRelServiceImpl.java
+12
-1
AccountGroupServiceImpl.java
...va/com/gic/auth/service/impl/AccountGroupServiceImpl.java
+1
-0
UserServiceImpl.java
.../main/java/com/gic/auth/service/impl/UserServiceImpl.java
+2
-2
AccountGroupApiServiceImpl.java
...c/auth/service/outer/impl/AccountGroupApiServiceImpl.java
+34
-14
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+12
-0
TabSysAccountGroupRelMapper.xml
...src/main/resources/mapper/TabSysAccountGroupRelMapper.xml
+18
-0
TabSysUserMapper.xml
...th-service/src/main/resources/mapper/TabSysUserMapper.xml
+10
-1
AccountGroupController.java
...a/com/gic/auth/web/controller/AccountGroupController.java
+72
-0
AccountGroupListVO.java
...src/main/java/com/gic/auth/web/vo/AccountGroupListVO.java
+10
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysAccountGroupMapper.java
View file @
9e532cdf
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
com.gic.auth.entity.TabSysAccountGroup
;
import
org.apache.ibatis.annotations.Param
;
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysAccountGroupRelMapper.java
View file @
9e532cdf
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
com.gic.auth.dto.AccountGroupRelDTO
;
import
com.gic.auth.entity.TabSysAccountGroupRel
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -118,5 +119,7 @@ public interface TabSysAccountGroupRelMapper {
* @param accountGroupId
* @return java.util.List<com.gic.auth.entity.TabSysAccountGroupRel>
*/
List
<
TabSysAccountGroupRel
>
listByAccountGroupId
(
@Param
(
"accountGroupId"
)
Integer
accountGroupId
);
List
<
TabSysAccountGroupRel
>
listByAccountGroupId
(
@Param
(
"accountGroupId"
)
Integer
accountGroupId
,
@Param
(
"type"
)
Integer
type
);
List
<
AccountGroupListDTO
>
groupByAccountGroupId
(
@Param
(
"list"
)
List
<
Integer
>
accountGroupId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
View file @
9e532cdf
...
...
@@ -105,7 +105,8 @@ public interface TabSysUserMapper {
* @Description:
* @author guojuxing
* @param userIdList
* @param search
* @return java.util.List<com.gic.auth.entity.TabSysUser>
*/
List
<
TabSysUser
>
listUserNotInIdList
(
@Param
(
"ids"
)
List
<
Integer
>
userIdList
);
List
<
TabSysUser
>
listUserNotInIdList
(
@Param
(
"ids"
)
List
<
Integer
>
userIdList
,
@Param
(
"search"
)
String
search
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/AccountGroupRelService.java
View file @
9e532cdf
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
com.gic.auth.dto.AccountGroupRelDTO
;
import
com.gic.auth.entity.TabSysAccountGroupRel
;
...
...
@@ -78,4 +79,16 @@ public interface AccountGroupRelService {
* @return java.util.List<com.gic.auth.entity.TabSysAccountGroupRel>
*/
List
<
TabSysAccountGroupRel
>
listByAccountGroupId
(
Integer
accountGroupId
);
List
<
TabSysAccountGroupRel
>
listByAccountGroupId
(
Integer
accountGroupId
,
Integer
type
);
/**
* 求分组组员数量
* @Title: groupByAccountGroupId
* @Description:
* @author guojuxing
* @param accountGroupId
* @return java.util.List<com.gic.auth.dto.AccountGroupListDTO>
*/
List
<
AccountGroupListDTO
>
groupByAccountGroupId
(
List
<
Integer
>
accountGroupId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/AccountGroupService.java
View file @
9e532cdf
package
com
.
gic
.
auth
.
service
;
import
com.gic.auth.dto.AccountGroupDTO
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
com.gic.auth.entity.TabSysAccountGroup
;
import
java.util.List
;
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/UserService.java
View file @
9e532cdf
...
...
@@ -98,5 +98,5 @@ public interface UserService {
* @param userIdList
* @return java.util.List<com.gic.auth.entity.TabSysUser>
*/
List
<
TabSysUser
>
listUserNotInIdList
(
List
<
Integer
>
userIdList
);
List
<
TabSysUser
>
listUserNotInIdList
(
List
<
Integer
>
userIdList
,
String
search
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AccountGroupRelServiceImpl.java
View file @
9e532cdf
...
...
@@ -2,6 +2,7 @@ package com.gic.auth.service.impl;
import
com.gic.auth.constant.AccountGroupMemberTypeEnum
;
import
com.gic.auth.dao.mapper.TabSysAccountGroupRelMapper
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
com.gic.auth.dto.AccountGroupRelDTO
;
import
com.gic.auth.entity.TabSysAccountGroupRel
;
import
com.gic.auth.service.AccountGroupRelService
;
...
...
@@ -62,6 +63,16 @@ public class AccountGroupRelServiceImpl implements AccountGroupRelService{
@Override
public
List
<
TabSysAccountGroupRel
>
listByAccountGroupId
(
Integer
accountGroupId
)
{
return
tabSysAccountGroupRelMapper
.
listByAccountGroupId
(
accountGroupId
);
return
tabSysAccountGroupRelMapper
.
listByAccountGroupId
(
accountGroupId
,
null
);
}
@Override
public
List
<
TabSysAccountGroupRel
>
listByAccountGroupId
(
Integer
accountGroupId
,
Integer
type
)
{
return
tabSysAccountGroupRelMapper
.
listByAccountGroupId
(
accountGroupId
,
type
);
}
@Override
public
List
<
AccountGroupListDTO
>
groupByAccountGroupId
(
List
<
Integer
>
accountGroupId
)
{
return
tabSysAccountGroupRelMapper
.
groupByAccountGroupId
(
accountGroupId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/AccountGroupServiceImpl.java
View file @
9e532cdf
...
...
@@ -3,6 +3,7 @@ package com.gic.auth.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UserServiceImpl.java
View file @
9e532cdf
...
...
@@ -106,7 +106,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public
List
<
TabSysUser
>
listUserNotInIdList
(
List
<
Integer
>
userIdList
)
{
return
tabSysUserMapper
.
listUserNotInIdList
(
userIdList
);
public
List
<
TabSysUser
>
listUserNotInIdList
(
List
<
Integer
>
userIdList
,
String
search
)
{
return
tabSysUserMapper
.
listUserNotInIdList
(
userIdList
,
search
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AccountGroupApiServiceImpl.java
View file @
9e532cdf
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
com.gic.auth.dto.AccountGroupListDTO
;
import
com.gic.auth.dto.AccountGroupRelDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -75,7 +74,24 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
public
ServiceResponse
<
List
<
AccountGroupDTO
>>
listAccountGroupByEnterpriseId
(
Integer
enterpriseId
)
{
List
<
TabSysAccountGroup
>
list
=
accountGroupService
.
listAccountGroupByEnterpriseId
(
enterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
AccountGroupDTO
.
class
,
list
));
//求分组下的组员数量值
List
<
Integer
>
accountGroupIdList
=
new
ArrayList
<>(
list
.
size
());
for
(
TabSysAccountGroup
temp
:
list
)
{
accountGroupIdList
.
add
(
temp
.
getAccountGroupId
());
}
List
<
AccountGroupListDTO
>
accountGroupListDTOList
=
accountGroupRelService
.
groupByAccountGroupId
(
accountGroupIdList
);
Map
<
String
,
Integer
>
map
=
new
HashMap
<>(
16
);
if
(
CollectionUtils
.
isNotEmpty
(
accountGroupListDTOList
))
{
for
(
AccountGroupListDTO
dto
:
accountGroupListDTOList
)
{
map
.
put
(
dto
.
getAccountGroupId
().
toString
(),
dto
.
getMemberCount
());
}
}
List
<
AccountGroupDTO
>
result
=
EntityUtil
.
changeEntityListNew
(
AccountGroupDTO
.
class
,
list
);
for
(
AccountGroupDTO
temp
:
result
)
{
temp
.
setMemberCount
(
map
.
get
(
temp
.
getAccountGroupId
().
toString
()));
}
return
ServiceResponse
.
success
(
result
);
}
return
ServiceResponse
.
success
(
new
ArrayList
<>());
}
...
...
@@ -105,7 +121,8 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
}
@Override
public
ServiceResponse
<
List
<
AccountGroupMemberDTO
>>
listNotInAccountGroupByAccountGroupId
(
Integer
accountGroupId
)
{
public
ServiceResponse
<
List
<
AccountGroupMemberDTO
>>
listNotInAccountGroupByAccountGroupId
(
Integer
accountGroupId
,
String
search
)
{
TabSysAccountGroup
record
=
accountGroupService
.
getById
(
accountGroupId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"账号分组id有误,查无数据"
);
...
...
@@ -113,13 +130,14 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
List
<
AccountGroupMemberDTO
>
result
=
new
ArrayList
<>();
List
<
TabSysAccountGroupRel
>
list
=
listByAccountGroupId
(
accountGroupId
);
//查询管理员列表
result
.
addAll
(
getMemberOfUser
(
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
(),
list
,
false
));
result
.
addAll
(
getMemberOfUser
(
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
(),
list
,
false
,
search
));
//todo 查询协作人列表
return
ServiceResponse
.
success
(
result
);
}
@Override
public
ServiceResponse
<
List
<
AccountGroupMemberDTO
>>
listInAccountGroupByAccountGroupId
(
Integer
accountGroupId
)
{
public
ServiceResponse
<
List
<
AccountGroupMemberDTO
>>
listInAccountGroupByAccountGroupId
(
Integer
accountGroupId
,
String
search
)
{
TabSysAccountGroup
record
=
accountGroupService
.
getById
(
accountGroupId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"账号分组id有误,查无数据"
);
...
...
@@ -127,7 +145,7 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
List
<
AccountGroupMemberDTO
>
result
=
new
ArrayList
<>();
List
<
TabSysAccountGroupRel
>
list
=
listByAccountGroupId
(
accountGroupId
);
//查询管理员列表
result
.
addAll
(
getMemberOfUser
(
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
(),
list
,
true
));
result
.
addAll
(
getMemberOfUser
(
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
(),
list
,
true
,
search
));
//todo 查询协作人列表
return
ServiceResponse
.
success
(
result
);
...
...
@@ -138,7 +156,8 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
public
ServiceResponse
<
Void
>
saveAccountGroupRelFetch
(
List
<
AccountGroupMemberDTO
>
list
)
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
//逻辑删除之前的数据,先删后增
accountGroupRelService
.
deleteByAccountGroupId
(
list
.
get
(
0
).
getAccountGroupId
());
//accountGroupRelService.deleteByAccountGroupId(list.get(0).getAccountGroupId());
//暂时不删除,因为是批量新增部分,而不是全部,所以不需要删除之前的数据
List
<
AccountGroupRelDTO
>
result
=
new
ArrayList
<>(
list
.
size
());
Date
now
=
new
Date
();
for
(
AccountGroupMemberDTO
dto
:
list
)
{
...
...
@@ -168,7 +187,8 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
@Override
public
ServiceResponse
<
Void
>
groupingOfCollaborator
(
List
<
Integer
>
collaboratorIdList
,
List
<
Integer
>
accountGroupId
,
Integer
enterpriseId
)
{
return
grouping
(
collaboratorIdList
,
accountGroupId
,
enterpriseId
,
AccountGroupMemberTypeEnum
.
COLLABORATOR
.
getCode
());
return
grouping
(
collaboratorIdList
,
accountGroupId
,
enterpriseId
,
AccountGroupMemberTypeEnum
.
COLLABORATOR
.
getCode
());
}
/**
...
...
@@ -202,14 +222,14 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
* @return
*/
private
List
<
AccountGroupMemberDTO
>
getMemberOfUser
(
int
type
,
List
<
TabSysAccountGroupRel
>
accountGroupRelList
,
boolean
isIn
)
{
boolean
isIn
,
String
search
)
{
List
<
Integer
>
userIdList
=
getUserIdList
(
type
,
accountGroupRelList
);
List
<
TabSysUser
>
userList
;
//查询管理员列表
if
(
isIn
)
{
userList
=
userService
.
listUserByIdList
(
userIdList
);
}
else
{
userList
=
userService
.
listUserNotInIdList
(
userIdList
);
userList
=
userService
.
listUserNotInIdList
(
userIdList
,
search
);
}
return
userToMember
(
userList
);
}
...
...
@@ -229,8 +249,8 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
return
result
;
}
private
ServiceResponse
<
Void
>
grouping
(
List
<
Integer
>
userIdList
,
List
<
Integer
>
accountGroupId
,
Integer
enterpriseId
,
int
type
)
{
private
ServiceResponse
<
Void
>
grouping
(
List
<
Integer
>
userIdList
,
List
<
Integer
>
accountGroupId
,
Integer
enterpriseId
,
int
type
)
{
//先删除
accountGroupRelService
.
deleteByUserId
(
userIdList
,
type
);
Date
now
=
new
Date
();
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
9e532cdf
...
...
@@ -319,6 +319,18 @@ public class UserApiServiceImpl implements UserApiService {
@Override
public
ServiceResponse
<
Page
<
UserListDTO
>>
pageUser
(
UserListQO
params
)
{
if
(
params
.
getAccountGroupId
()
!=
null
)
{
//查询分组下的管理员列表
List
<
TabSysAccountGroupRel
>
list
=
accountGroupRelService
.
listByAccountGroupId
(
params
.
getAccountGroupId
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
Integer
>
userIdList
=
new
ArrayList
<>(
list
.
size
());
for
(
TabSysAccountGroupRel
temp
:
list
)
{
userIdList
.
add
(
temp
.
getUserId
());
}
params
.
setUserIdList
(
userIdList
);
}
}
com
.
github
.
pagehelper
.
Page
page
=
userService
.
pageUser
(
params
);
Page
<
UserListDTO
>
resultPage
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
page
);
return
ServiceResponse
.
success
(
resultPage
);
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysAccountGroupRelMapper.xml
View file @
9e532cdf
...
...
@@ -199,6 +199,23 @@
<include
refid=
"Base_Column_List"
/>
from tab_sys_account_group_rel
where account_group_id = #{accountGroupId}
<if
test=
"type != null"
>
and type = #{type}
</if>
and status = 1
</select>
<select
id=
"groupByAccountGroupId"
resultType=
"com.gic.auth.dto.AccountGroupListDTO"
>
select account_group_id accountGroupId,
count(user_id) memberCount
from tab_sys_account_group_rel
where status = 1
<if
test=
"list != null and list.size() > 0"
>
and account_group_id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
group by account_group_id
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-service/src/main/resources/mapper/TabSysUserMapper.xml
View file @
9e532cdf
...
...
@@ -250,6 +250,12 @@
<if
test=
"resourceId != null"
>
and c.resource_id = #{resourceId}
</if>
<if
test=
"userIdList != null and userIdList.size() > 0"
>
and a.user_id in
<foreach
collection=
"userIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
GROUP BY a.user_id
...
...
@@ -272,7 +278,7 @@
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<if
test=
"null != ids"
>
<if
test=
"null != ids
and ids.size() > 0
"
>
and user_id not in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
...
...
@@ -307,6 +313,9 @@
<include
refid=
"Base_Column_List"
/>
from tab_sys_user
where status = 1
<if
test=
"search != null and search != '' "
>
and ( user_name like concat('%', #{search}, '%') or phone_number like concat('%', #{search}, '%') )
</if>
<if
test=
"ids != null and ids.size() > 0"
>
and user_id not in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/AccountGroupController.java
View file @
9e532cdf
package
com
.
gic
.
auth
.
web
.
controller
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.auth.dto.AccountGroupMemberDTO
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.gic.auth.constant.AccountGroupMemberTypeEnum
;
import
com.gic.auth.constant.SignConstants
;
import
com.gic.auth.dto.AccountGroupDTO
;
import
com.gic.auth.service.AccountGroupApiService
;
import
com.gic.auth.web.vo.AccountGroupListVO
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
@RestController
@RequestMapping
(
"/account-group"
)
@Validated
public
class
AccountGroupController
{
private
final
static
Logger
LOGGER
=
LogManager
.
getLogger
(
AccountGroupApiService
.
class
);
@Autowired
...
...
@@ -55,4 +68,63 @@ public class AccountGroupController {
public
RestResponse
sortAccountGroup
(
Integer
accountGroupId
,
Integer
sort
)
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
sort
(
accountGroupId
,
sort
));
}
/**
* 不在分组下的组员
* @Title: memberNotInGroup
* @Description:
* @author guojuxing
* @param accountGroupId
* @return com.gic.commons.webapi.reponse.RestResponse
*/
@RequestMapping
(
"/member-not-in-group"
)
public
RestResponse
memberNotInGroup
(
Integer
accountGroupId
,
String
search
)
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
listNotInAccountGroupByAccountGroupId
(
accountGroupId
,
search
));
}
@RequestMapping
(
"/member-in-group"
)
public
RestResponse
memberInGroup
(
Integer
accountGroupId
,
String
search
)
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
listInAccountGroupByAccountGroupId
(
accountGroupId
,
search
));
}
@RequestMapping
(
"/grouping"
)
public
RestResponse
grouping
(
@NotBlank
(
message
=
"账号分组ID不能为空"
)
String
accountGroupIds
,
@NotBlank
(
message
=
"组员ID不能为空"
)
String
userIds
,
@NotNull
(
message
=
"组员类型不能为空"
)
Integer
type
)
{
String
[]
accountGroupIdArr
=
accountGroupIds
.
split
(
SignConstants
.
COMMA
);
String
[]
userIdArr
=
userIds
.
split
(
SignConstants
.
COMMA
);
List
<
Integer
>
accountGroupIdList
=
new
ArrayList
<>(
accountGroupIdArr
.
length
);
for
(
String
str
:
accountGroupIdArr
)
{
accountGroupIdList
.
add
(
Integer
.
parseInt
(
str
));
}
List
<
Integer
>
userIdList
=
new
ArrayList
<>(
userIdArr
.
length
);
for
(
String
str
:
userIdArr
)
{
userIdList
.
add
(
Integer
.
parseInt
(
str
));
}
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
if
(
type
.
intValue
()
==
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
())
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
groupingOfUser
(
userIdList
,
accountGroupIdList
,
enterpriseId
));
}
else
if
(
type
.
intValue
()
==
AccountGroupMemberTypeEnum
.
COLLABORATOR
.
getCode
())
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
groupingOfCollaborator
(
userIdList
,
accountGroupIdList
,
enterpriseId
));
}
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"组员类型错误"
);
}
/**
* 批量新增组员 ,必须有 必须有分组ID、管理员/协作人ID、类型
* @Title: addGroupMember
* @Description:
* @author guojuxing
* @param memberArr
* @return com.gic.commons.webapi.reponse.RestResponse
*/
@RequestMapping
(
"/add-group-member"
)
public
RestResponse
addGroupMember
(
String
memberArr
)
{
List
<
AccountGroupMemberDTO
>
list
=
JSON
.
parseArray
(
memberArr
,
AccountGroupMemberDTO
.
class
);
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
saveAccountGroupRelFetch
(
list
));
}
}
gic-platform-auth-web/src/main/java/com/gic/auth/web/vo/AccountGroupListVO.java
View file @
9e532cdf
...
...
@@ -18,6 +18,8 @@ public class AccountGroupListVO implements Serializable{
private
Integer
enterpriseId
;
private
Integer
memberCount
;
public
Integer
getAccountGroupId
()
{
return
accountGroupId
;
}
...
...
@@ -41,4 +43,12 @@ public class AccountGroupListVO implements Serializable{
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getMemberCount
()
{
return
memberCount
;
}
public
void
setMemberCount
(
Integer
memberCount
)
{
this
.
memberCount
=
memberCount
;
}
}
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