Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
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-data-cloud
Commits
b64c9878
Commit
b64c9878
authored
Jul 09, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户批量转移分组添加全部转移逻辑
parent
e8123d70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
UserController.java
...ain/java/com/gic/cloud/web/controller/UserController.java
+20
-6
No files found.
gic-data-cloud-web/src/main/java/com/gic/cloud/web/controller/UserController.java
View file @
b64c9878
...
...
@@ -4,7 +4,9 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.cloud.service.*
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -108,12 +110,24 @@ public class UserController {
}
@RequestMapping
(
"/bulk-transfer-user-to-new-account-group"
)
public
RestResponse
bulkTransferAccountGroup
(
String
userIds
,
Integer
targetAccountGroupId
)
{
List
<
Integer
>
userIdList
=
Arrays
.
stream
(
userIds
.
split
(
","
))
.
filter
(
e
->
StringUtils
.
isNumeric
(
e
))
.
mapToInt
(
e
->
Integer
.
parseInt
(
e
))
.
boxed
()
.
collect
(
Collectors
.
toList
());
public
RestResponse
bulkTransferAccountGroup
(
String
userIds
,
Integer
targetAccountGroupId
,
boolean
isAll
)
{
List
<
Integer
>
userIdList
=
null
;
if
(
isAll
)
{
ServiceResponse
<
List
<
UserDTO
>>
result
=
userApiService
.
listUser
(
new
UserQO
()
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()));
if
(
result
.
isSuccess
())
{
List
<
UserDTO
>
userList
=
result
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
userList
))
{
userIdList
=
userList
.
stream
().
map
(
e
->
e
.
getUserId
()).
collect
(
Collectors
.
toList
());
}
}
}
else
{
userIdList
=
Arrays
.
stream
(
userIds
.
split
(
","
))
.
filter
(
e
->
StringUtils
.
isNumeric
(
e
))
.
mapToInt
(
e
->
Integer
.
parseInt
(
e
))
.
boxed
()
.
collect
(
Collectors
.
toList
());
}
return
ResultControllerUtils
.
commonResult
(
userApiService
.
bulkTransferAccountGroup
(
userIdList
,
targetAccountGroupId
));
}
}
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