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
e8d4399a
Commit
e8d4399a
authored
Sep 06, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增管理员验证手机号码重复,不同企业可以重复
parent
81999241
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
6 deletions
+9
-6
TabSysUserMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
+2
-1
UserService.java
...rvice/src/main/java/com/gic/auth/service/UserService.java
+2
-1
UserServiceImpl.java
.../main/java/com/gic/auth/service/impl/UserServiceImpl.java
+2
-2
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+2
-2
TabSysUserMapper.xml
...th-service/src/main/resources/mapper/TabSysUserMapper.xml
+1
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysUserMapper.java
View file @
e8d4399a
...
...
@@ -61,9 +61,10 @@ public interface TabSysUserMapper {
* 手机号码查询个数
* @param phone
* @param userId
* @param enterpriseId
* @return
*/
int
countByPhone
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"userId"
)
Integer
userId
);
int
countByPhone
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
TabSysUser
selectByEnterpriseId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/UserService.java
View file @
e8d4399a
...
...
@@ -34,9 +34,10 @@ public interface UserService {
* 手机号码是否重复
* @param userId
* @param phone
* @param enterpriseId
* @return
*/
boolean
isPhoneRepeat
(
Integer
userId
,
String
phone
);
boolean
isPhoneRepeat
(
Integer
userId
,
String
phone
,
Integer
enterpriseId
);
TabSysUser
getUserByEnterpriseId
(
Integer
enterpriseId
);
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/UserServiceImpl.java
View file @
e8d4399a
...
...
@@ -46,8 +46,8 @@ public class UserServiceImpl implements UserService {
}
@Override
public
boolean
isPhoneRepeat
(
Integer
userId
,
String
phone
)
{
int
count
=
tabSysUserMapper
.
countByPhone
(
phone
,
userId
);
public
boolean
isPhoneRepeat
(
Integer
userId
,
String
phone
,
Integer
enterpriseId
)
{
int
count
=
tabSysUserMapper
.
countByPhone
(
phone
,
userId
,
enterpriseId
);
if
(
count
>
0
)
{
return
true
;
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
e8d4399a
...
...
@@ -56,7 +56,7 @@ public class UserApiServiceImpl implements UserApiService {
if
(!
paramResult
.
isSuccess
())
{
return
paramResult
;
}
if
(
userService
.
isPhoneRepeat
(
null
,
userDTO
.
getPhoneNumber
()))
{
if
(
userService
.
isPhoneRepeat
(
null
,
userDTO
.
getPhoneNumber
()
,
userDTO
.
getEnterpriseId
()
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"手机号码不能重复"
);
}
...
...
@@ -121,7 +121,7 @@ public class UserApiServiceImpl implements UserApiService {
if
(
tabUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户ID输入有误"
);
}
if
(
userService
.
isPhoneRepeat
(
userDTO
.
getUserId
(),
userDTO
.
getPhoneNumber
()))
{
if
(
userService
.
isPhoneRepeat
(
userDTO
.
getUserId
(),
userDTO
.
getPhoneNumber
()
,
tabUser
.
getEnterpriseId
()
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"手机号码不能重复"
);
}
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysUserMapper.xml
View file @
e8d4399a
...
...
@@ -193,6 +193,7 @@
<if
test=
"userId != null"
>
and user_id
<![CDATA[ <> ]]>
#{userId}
</if>
and enterprise_id = #{enterpriseId}
and phone_number = #{phone}
</select>
...
...
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