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
2e28a5f9
Commit
2e28a5f9
authored
Jul 08, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户web
parent
98694188
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
243 additions
and
1 deletions
+243
-1
UserController.java
...ain/java/com/gic/cloud/web/controller/UserController.java
+42
-1
AccountGroupVO.java
...eb/src/main/java/com/gic/cloud/web/vo/AccountGroupVO.java
+63
-0
UserVO.java
...-cloud-web/src/main/java/com/gic/cloud/web/vo/UserVO.java
+138
-0
No files found.
gic-data-cloud-web/src/main/java/com/gic/cloud/web/controller/UserController.java
View file @
2e28a5f9
package
com
.
gic
.
cloud
.
web
.
controller
;
import
com.gic.cloud.dto.AccountGroupDTO
;
import
com.gic.cloud.dto.UserDTO
;
import
com.gic.cloud.qo.UserQO
;
import
com.gic.cloud.service.AccountGroupApiService
;
import
com.gic.cloud.service.UserApiService
;
import
com.gic.cloud.web.vo.AccountGroupVO
;
import
com.gic.cloud.web.vo.UserVO
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
(
"/user"
)
public
class
UserController
{
...
...
@@ -24,6 +33,7 @@ public class UserController {
@RequestMapping
(
"/save-account-group"
)
public
RestResponse
saveAccountGroup
(
AccountGroupDTO
dto
)
{
dto
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
saveAccountGroup
(
dto
));
}
...
...
@@ -40,11 +50,42 @@ public class UserController {
@RequestMapping
(
"/list-account-group"
)
public
RestResponse
listAccountGroup
()
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
listAccountGroupOfCountMember
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()));
.
listAccountGroupOfCountMember
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
())
,
AccountGroupVO
.
class
);
}
@RequestMapping
(
"/delete-account-group"
)
public
RestResponse
deleteAccountGroup
(
Integer
accountGroupId
)
{
return
ResultControllerUtils
.
commonResult
(
accountGroupApiService
.
deleteAccountGroup
(
accountGroupId
));
}
@RequestMapping
(
"/save-user"
)
public
RestResponse
saveUser
(
UserDTO
dto
)
{
dto
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
return
ResultControllerUtils
.
commonResult
(
userApiService
.
saveUser
(
dto
));
}
@RequestMapping
(
"/edit-user"
)
public
RestResponse
editUser
(
UserDTO
dto
)
{
return
ResultControllerUtils
.
commonResult
(
userApiService
.
editUser
(
dto
));
}
@RequestMapping
(
"/delete-user"
)
public
RestResponse
deleteUser
(
Integer
userId
)
{
return
ResultControllerUtils
.
commonResult
(
userApiService
.
deleteUser
(
userId
));
}
@RequestMapping
(
"/page-user"
)
public
RestResponse
pageUser
(
UserQO
userQO
)
{
return
ResultControllerUtils
.
commonPageResult
(
userApiService
.
pageUser
(
userQO
),
UserVO
.
class
);
}
@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
());
return
ResultControllerUtils
.
commonResult
(
userApiService
.
bulkTransferAccountGroup
(
userIdList
,
targetAccountGroupId
));
}
}
gic-data-cloud-web/src/main/java/com/gic/cloud/web/vo/AccountGroupVO.java
0 → 100644
View file @
2e28a5f9
package
com
.
gic
.
cloud
.
web
.
vo
;
import
java.io.Serializable
;
public
class
AccountGroupVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2326242081989824390L
;
/**
* ID
*/
private
Integer
accountGroupId
;
/**
* 账号名称
*/
private
String
accountGroupName
;
/**
* 排序
*/
private
Integer
sort
;
/**
* 用户个数
*/
private
Integer
memberCount
;
public
Integer
getAccountGroupId
()
{
return
accountGroupId
;
}
public
AccountGroupVO
setAccountGroupId
(
Integer
accountGroupId
)
{
this
.
accountGroupId
=
accountGroupId
;
return
this
;
}
public
String
getAccountGroupName
()
{
return
accountGroupName
;
}
public
AccountGroupVO
setAccountGroupName
(
String
accountGroupName
)
{
this
.
accountGroupName
=
accountGroupName
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
AccountGroupVO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
Integer
getMemberCount
()
{
return
memberCount
;
}
public
AccountGroupVO
setMemberCount
(
Integer
memberCount
)
{
this
.
memberCount
=
memberCount
;
return
this
;
}
}
gic-data-cloud-web/src/main/java/com/gic/cloud/web/vo/UserVO.java
0 → 100644
View file @
2e28a5f9
package
com
.
gic
.
cloud
.
web
.
vo
;
import
java.io.Serializable
;
public
class
UserVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3942964711245259430L
;
/**
* ID
*/
private
Integer
userId
;
/**
* 名称
*/
private
String
userName
;
/**
* 手机号
*/
private
String
phone
;
/**
* 手机号区号
*/
private
String
nationCode
;
/**
* 账号分组ID
*/
private
Integer
accountGroupId
;
/**
* 数据权限集ID
*/
private
Integer
dataAuthId
;
/**
* 功能权限集ID
*/
private
Integer
functionAuthId
;
private
String
accountGroupName
;
private
String
dataAuthName
;
private
String
functionAuthName
;
public
Integer
getUserId
()
{
return
userId
;
}
public
UserVO
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
return
this
;
}
public
String
getUserName
()
{
return
userName
;
}
public
UserVO
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
return
this
;
}
public
String
getPhone
()
{
return
phone
;
}
public
UserVO
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
return
this
;
}
public
String
getNationCode
()
{
return
nationCode
;
}
public
UserVO
setNationCode
(
String
nationCode
)
{
this
.
nationCode
=
nationCode
;
return
this
;
}
public
Integer
getAccountGroupId
()
{
return
accountGroupId
;
}
public
UserVO
setAccountGroupId
(
Integer
accountGroupId
)
{
this
.
accountGroupId
=
accountGroupId
;
return
this
;
}
public
Integer
getDataAuthId
()
{
return
dataAuthId
;
}
public
UserVO
setDataAuthId
(
Integer
dataAuthId
)
{
this
.
dataAuthId
=
dataAuthId
;
return
this
;
}
public
Integer
getFunctionAuthId
()
{
return
functionAuthId
;
}
public
UserVO
setFunctionAuthId
(
Integer
functionAuthId
)
{
this
.
functionAuthId
=
functionAuthId
;
return
this
;
}
public
String
getAccountGroupName
()
{
return
accountGroupName
;
}
public
UserVO
setAccountGroupName
(
String
accountGroupName
)
{
this
.
accountGroupName
=
accountGroupName
;
return
this
;
}
public
String
getDataAuthName
()
{
return
dataAuthName
;
}
public
UserVO
setDataAuthName
(
String
dataAuthName
)
{
this
.
dataAuthName
=
dataAuthName
;
return
this
;
}
public
String
getFunctionAuthName
()
{
return
functionAuthName
;
}
public
UserVO
setFunctionAuthName
(
String
functionAuthName
)
{
this
.
functionAuthName
=
functionAuthName
;
return
this
;
}
}
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