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
c161b251
Commit
c161b251
authored
Sep 05, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建商户:新建超级管理员接口修改
parent
92c438f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+36
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
c161b251
...
...
@@ -60,6 +60,33 @@ public class UserApiServiceImpl implements UserApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"手机号码不能重复"
);
}
//如果是普通管理员,则需要验证角色权限和资源权限
if
(
userDTO
.
getSuperAdmin
().
intValue
()
==
0
)
{
if
(
StringUtils
.
isBlank
(
userDTO
.
getUserRoleIds
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"角色权限不能为空"
);
}
if
(
StringUtils
.
isBlank
(
userDTO
.
getUserResourceIds
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"资源权限不能为空"
);
}
}
if
(
userDTO
.
getSuperAdmin
()
==
null
)
{
//默认是普通管理员
userDTO
.
setSuperAdmin
(
0
);
}
if
(
userDTO
.
getSuperAdmin
().
intValue
()
==
1
)
{
//超级官员
TabSysUser
adminUser
=
userService
.
getUserByEnterpriseId
(
userDTO
.
getEnterpriseId
());
if
(
adminUser
!=
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"已存在超级管理员,重复创建"
);
}
}
if
(
userDTO
.
getPasswordType
()
==
null
)
{
//默认自定义创建密码类型
userDTO
.
setPasswordType
(
2
);
}
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
userDTO
.
setPhoneAreaCode
(
"86"
);
}
...
...
@@ -97,6 +124,15 @@ public class UserApiServiceImpl implements UserApiService {
if
(
userService
.
isPhoneRepeat
(
userDTO
.
getUserId
(),
userDTO
.
getPhoneNumber
()))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"手机号码不能重复"
);
}
if
(
userDTO
.
getSuperAdmin
()
!=
null
&&
userDTO
.
getSuperAdmin
().
intValue
()
==
1
)
{
//超级官员
TabSysUser
adminUser
=
userService
.
getUserByEnterpriseId
(
userDTO
.
getEnterpriseId
());
if
(
adminUser
!=
null
&&
adminUser
.
getUserId
().
intValue
()
!=
tabUser
.
getUserId
().
intValue
())
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"已存在超级管理员,参数有误"
);
}
}
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
userDTO
.
setPhoneAreaCode
(
"86"
);
}
...
...
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