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
7a649a1e
Commit
7a649a1e
authored
Oct 09, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑超级管理员信息接口
parent
9acf1b6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
UserServiceImpl.java
.../main/java/com/gic/auth/service/impl/UserServiceImpl.java
+2
-0
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+20
-2
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UserServiceImpl.java
View file @
7a649a1e
...
...
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -37,6 +38,7 @@ public class UserServiceImpl implements UserService {
@Override
public
void
editUser
(
UserDTO
userDTO
)
{
TabSysUser
tabUser
=
EntityUtil
.
changeEntityNew
(
TabSysUser
.
class
,
userDTO
);
tabUser
.
setUpdateTime
(
new
Date
());
tabSysUserMapper
.
updateByPrimaryKeySelective
(
tabUser
);
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
7a649a1e
...
...
@@ -17,6 +17,7 @@ import com.gic.commons.util.PageHelperUtils;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.UserDetail
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.store.utils.valid.ValidUtil
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -139,7 +140,6 @@ public class UserApiServiceImpl implements UserApiService {
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
userDTO
.
setPhoneAreaCode
(
"86"
);
}
userDTO
.
setUpdateTime
(
new
Date
());
userService
.
editUser
(
userDTO
);
userRoleService
.
deleteByUserId
(
userDTO
.
getUserId
());
...
...
@@ -157,6 +157,24 @@ public class UserApiServiceImpl implements UserApiService {
}
@Override
public
ServiceResponse
<
Void
>
editAdmin
(
UserDTO
userDTO
)
{
//超级官员
TabSysUser
adminUser
=
userService
.
getUserByEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
());
if
(
adminUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"超级管理员不存在,操作有误"
);
}
if
(
userDTO
.
getPasswordType
().
intValue
()
==
2
)
{
//如果是自定义密码
if
(
StringUtils
.
isBlank
(
userDTO
.
getPassword
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"密码为空,操作有误"
);
}
}
userService
.
editUser
(
userDTO
);
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
UserDTO
>
getUserById
(
Integer
userId
)
{
TabSysUser
tabUser
=
userService
.
getUserById
(
userId
);
if
(
tabUser
==
null
)
{
...
...
@@ -271,7 +289,7 @@ public class UserApiServiceImpl implements UserApiService {
public
ServiceResponse
<
UserDetail
>
getUserDetail
(
String
token
)
{
String
key
=
Constants
.
TOKEN_KEY
+
token
;
Object
cache
=
RedisUtil
.
getCache
(
key
);
if
(
cache
==
null
)
{
if
(
cache
==
null
)
{
return
ServiceResponse
.
success
();
}
return
ServiceResponse
.
success
((
UserDetail
)
cache
);
...
...
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