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
3efe4eda
Commit
3efe4eda
authored
4 years ago
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验电话号码唯一
parent
3d5e5f78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+10
-4
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
+8
-0
No files found.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
3efe4eda
...
...
@@ -74,13 +74,19 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
@Override
public
Response
bind
(
ParkBindInfo
info
)
{
//判断规则1:用户已绑定的车辆不超过3辆,包括已解绑但未过一个月的车辆
QueryWrapper
boundQuery
=
new
QueryWrapper
();
QueryWrapper
<
ParkBindInfo
>
boundQuery
=
new
QueryWrapper
();
boundQuery
.
eq
(
"user_id"
,
info
.
getUserId
());
boundQuery
.
eq
(
"status"
,
"1"
);
Integer
bound
=
mapper
.
selectCoun
t
(
boundQuery
);
if
(
bound
>=
3
)
{
List
<
ParkBindInfo
>
list
=
mapper
.
selectLis
t
(
boundQuery
);
if
(
list
!=
null
&&
list
.
size
()
>=
3
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
);
}
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
boolean
equals
=
list
.
get
(
0
).
getPhone
().
equals
(
info
.
getPhone
());
if
(!
equals
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
,
"当前客户手机号与历史绑定手机号不一致"
);
}
}
//规则2:客户手机号与车辆对应的车主手机号一致
PlateNumQueryReq
req
=
new
PlateNumQueryReq
();
...
...
@@ -113,7 +119,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
info
.
setUnqId
(
unqIdUtil
.
getUnqId
());
info
.
setGmtBindTime
(
new
Date
());
mapper
.
insert
(
info
);
bindCache
.
insert
(
info
);
return
ResponseGenerator
.
success
(
new
BindInfoRes
(
info
.
getUnqId
()));
}
...
...
This diff is collapsed.
Click to expand it.
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
View file @
3efe4eda
...
...
@@ -23,6 +23,14 @@ public class BindCache {
private
BindInfoMapper
mapper
;
@Caching
(
evict
=
{
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'userId:'+#info.userId"
,
condition
=
"#info!=null"
)
})
public
boolean
insert
(
ParkBindInfo
info
)
{
return
mapper
.
insert
(
info
)
>
0
;
}
/**
* 获取绑定信息
*
...
...
This diff is collapsed.
Click to expand it.
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