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
a0981ee2
Commit
a0981ee2
authored
Jun 22, 2020
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
为绑定请求参数中的车牌颜色,增加正则校验
parent
be72e56d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+5
-5
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/request/BindInfoReq.java
+3
-1
infra/src/main/resources/sql/绑定信息建表语句.sql
+4
-2
No files found.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
a0981ee2
...
...
@@ -95,16 +95,16 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
PlateNumQueryReq
req
=
new
PlateNumQueryReq
();
req
.
setPlateNum
(
info
.
getPlateNum
());
List
<
VehicleRes
>
byPlateNum
=
vechicleCache
.
getByPlateNum
(
req
);
if
(
byPlateNum
==
null
||
byPlateNum
.
size
()==
0
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
,
"车辆信息不存在"
);
if
(
byPlateNum
==
null
||
byPlateNum
.
size
()
==
0
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
,
"车辆信息不存在"
);
}
for
(
VehicleRes
res
:
byPlateNum
)
{
if
(
info
.
getPhone
().
equals
(
res
.
getSjhm
()))
{
info
.
setPlateType
(
res
.
getHpzl
());
}
}
if
(
info
.
getPlateType
()
==
null
||
info
.
getPlateType
().
equals
(
""
))
{
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
,
"当前手机号,与车辆备案手机号不一致"
);
if
(
info
.
getPlateType
()
==
null
||
""
.
equals
(
info
.
getPlateType
()
))
{
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
,
"当前手机号,与车辆备案手机号不一致"
);
}
//规则3:判断当前车牌号是否已绑定
...
...
@@ -115,7 +115,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
queryWrapper
.
eq
(
"status"
,
"1"
);
ParkBindInfo
bindExist
=
mapper
.
selectOne
(
queryWrapper
);
if
(
bindExist
!=
null
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
,
"此车牌号已绑定"
);
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
,
"此车牌号已绑定"
);
}
else
{
info
.
setUnqId
(
UUID
.
randomUUID
().
toString
());
mapper
.
insert
(
info
);
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/request/BindInfoReq.java
View file @
a0981ee2
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Pattern
;
/**
* @author lixian
...
...
@@ -27,6 +28,7 @@ public class BindInfoReq {
* F:紫,G:绿,H:蓝,I:棕,J:黑',
*/
@NotBlank
(
message
=
"车牌颜色不能为空"
)
@Pattern
(
regexp
=
"[ABCDEFGHIJ]"
)
private
String
plateColor
;
/**
* 车牌号
...
...
@@ -38,5 +40,5 @@ public class BindInfoReq {
* 时间戳
*/
@NotNull
(
message
=
"时间戳不能为空"
)
private
Long
timestamp
;
private
Long
timestamp
;
}
infra/src/main/resources/sql/绑定信息建表语句.sql
View file @
a0981ee2
-- au
to-generated definition
-- au
to-generated definition
...
...
@@ -10,7 +10,9 @@ create table bind_info
plate_type
varchar
(
20
)
not
null
comment
'车牌类型'
,
status
varchar
(
10
)
default
'1'
null
comment
'绑定状态:0,未绑定,1,已绑定'
,
gmt_bind_time
datetime
null
comment
'绑定时间'
,
unbind_time
datetime
null
comment
'解绑时间'
unbind_time
datetime
null
comment
'解绑时间'
,
constraint
bind_info_pk
unique
(
user_id
,
unbind_time
)
)
comment
'用户车辆绑定信息'
;
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