Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
recv_data_longhua
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e80ee508
authored
Sep 23, 2020
by
zhangxk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改车牌未识别时,设置为11111111
1 parent
366d81b8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
src/main/java/com/viontech/process/BehaviorProcess.java
src/main/java/com/viontech/process/TrafficProcess.java
src/main/java/com/viontech/process/BehaviorProcess.java
View file @
e80ee50
...
...
@@ -6,6 +6,7 @@ import com.viontech.model.BaseModel;
import
com.viontech.model.BehaviorModel
;
import
com.viontech.utils.DateUtil
;
import
com.viontech.utils.IntUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
...
...
@@ -119,11 +120,12 @@ public class BehaviorProcess implements Process {
JSONObject
body
=
vehicle
.
getJSONObject
(
"body"
);
if
(
plate
!=
null
)
{
String
text
=
plate
.
getString
(
"text"
);
if
(
text
!=
null
&&
!
""
.
equals
(
text
))
{
if
(
StringUtils
.
isBlank
(
text
)
||
StringUtils
.
equals
(
text
,
"无牌"
)){
text
=
"11111111"
;
}
byte
[]
bytes
=
text
.
getBytes
(
Charset
.
forName
(
"GBK"
));
System
.
arraycopy
(
bytes
,
0
,
model
.
getLicensePlateText
(),
0
,
Math
.
min
(
bytes
.
length
,
model
.
getLicensePlateText
().
length
));
}
}
if
(
body
!=
null
)
{
JSONObject
type
=
body
.
getJSONObject
(
"type"
);
JSONObject
color
=
body
.
getJSONObject
(
"color"
);
...
...
src/main/java/com/viontech/process/TrafficProcess.java
View file @
e80ee50
...
...
@@ -7,6 +7,7 @@ import com.viontech.model.BaseModel;
import
com.viontech.model.TrafficModel
;
import
com.viontech.utils.DateUtil
;
import
com.viontech.utils.IntUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
...
...
@@ -146,7 +147,11 @@ public class TrafficProcess implements Process {
JSONObject
plate
=
vehicle
.
getJSONObject
(
"plate"
);
// ----------------- 车牌 ------------------
if
(
plate
!=
null
)
{
byte
[]
text
=
plate
.
getString
(
"text"
).
getBytes
(
Charset
.
forName
(
"GBK"
));
String
palteNum
=
plate
.
getString
(
"text"
);
if
(
StringUtils
.
isBlank
(
palteNum
)
||
StringUtils
.
equals
(
palteNum
,
"无牌"
)){
palteNum
=
"11111111"
;
}
byte
[]
text
=
palteNum
.
getBytes
(
Charset
.
forName
(
"GBK"
));
System
.
arraycopy
(
text
,
0
,
model
.
getPlateText
(),
0
,
Math
.
min
(
text
.
length
,
16
));
// todo 车牌类型待实现
model
.
setPlateType
(
1
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment