Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
extend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
park
extend
Commits
78fdba4e
Commit
78fdba4e
authored
Jun 23, 2020
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改手机号校验规则
parent
86c3ddca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+15
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
+0
-1
No files found.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
78fdba4e
...
...
@@ -82,14 +82,27 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
,
"同一用户下,最多绑定3辆车"
);
}
//规则:一个
电话号码只能对应一个客户
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
//规则:一个
客户只能绑定一个电话号码
if
(
list
!=
null
&&
!
list
.
isEmpty
()
)
{
boolean
equals
=
list
.
get
(
0
).
getPhone
().
equals
(
info
.
getPhone
());
if
(!
equals
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
,
"当前客户手机号与历史绑定手机号不一致"
);
}
}
//规则:一个电话号码只能被一个客户绑定
QueryWrapper
<
ParkBindInfo
>
phone
=
new
QueryWrapper
();
boundQuery
.
eq
(
"phone"
,
info
.
getUserId
());
boundQuery
.
eq
(
"status"
,
"1"
);
List
<
ParkBindInfo
>
phones
=
mapper
.
selectList
(
boundQuery
);
if
(
phones
!=
null
&&
!
phones
.
isEmpty
())
{
boolean
equals
=
phones
.
get
(
0
).
getPhone
().
equals
(
info
.
getPhone
());
if
(!
equals
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
,
"当前手机号已被绑定"
);
}
}
//规则2:客户手机号与车辆对应的车主手机号一致
PlateNumQueryReq
req
=
new
PlateNumQueryReq
();
req
.
setPlateNum
(
info
.
getPlateNum
());
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
View file @
78fdba4e
...
...
@@ -67,7 +67,6 @@ public class BindCache {
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
condition
=
"#unqId!=null"
),
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
condition
=
"#userId!=null"
)
})
public
boolean
unBind
(
String
unqId
,
String
userId
)
{
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
bindInfo
.
setUnqId
(
unqId
);
...
...
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