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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 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;
...
@@ -6,6 +6,7 @@ import com.viontech.model.BaseModel;
import
com.viontech.model.BehaviorModel
;
import
com.viontech.model.BehaviorModel
;
import
com.viontech.utils.DateUtil
;
import
com.viontech.utils.DateUtil
;
import
com.viontech.utils.IntUtils
;
import
com.viontech.utils.IntUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -119,10 +120,11 @@ public class BehaviorProcess implements Process {
...
@@ -119,10 +120,11 @@ public class BehaviorProcess implements Process {
JSONObject
body
=
vehicle
.
getJSONObject
(
"body"
);
JSONObject
body
=
vehicle
.
getJSONObject
(
"body"
);
if
(
plate
!=
null
)
{
if
(
plate
!=
null
)
{
String
text
=
plate
.
getString
(
"text"
);
String
text
=
plate
.
getString
(
"text"
);
if
(
text
!=
null
&&
!
""
.
equals
(
text
))
{
if
(
StringUtils
.
isBlank
(
text
)
||
StringUtils
.
equals
(
text
,
"无牌"
)){
byte
[]
bytes
=
text
.
getBytes
(
Charset
.
forName
(
"GBK"
));
text
=
"11111111"
;
System
.
arraycopy
(
bytes
,
0
,
model
.
getLicensePlateText
(),
0
,
Math
.
min
(
bytes
.
length
,
model
.
getLicensePlateText
().
length
));
}
}
byte
[]
bytes
=
text
.
getBytes
(
Charset
.
forName
(
"GBK"
));
System
.
arraycopy
(
bytes
,
0
,
model
.
getLicensePlateText
(),
0
,
Math
.
min
(
bytes
.
length
,
model
.
getLicensePlateText
().
length
));
}
}
if
(
body
!=
null
)
{
if
(
body
!=
null
)
{
JSONObject
type
=
body
.
getJSONObject
(
"type"
);
JSONObject
type
=
body
.
getJSONObject
(
"type"
);
...
...
src/main/java/com/viontech/process/TrafficProcess.java
View file @
e80ee50
...
@@ -7,6 +7,7 @@ import com.viontech.model.BaseModel;
...
@@ -7,6 +7,7 @@ import com.viontech.model.BaseModel;
import
com.viontech.model.TrafficModel
;
import
com.viontech.model.TrafficModel
;
import
com.viontech.utils.DateUtil
;
import
com.viontech.utils.DateUtil
;
import
com.viontech.utils.IntUtils
;
import
com.viontech.utils.IntUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -146,7 +147,11 @@ public class TrafficProcess implements Process {
...
@@ -146,7 +147,11 @@ public class TrafficProcess implements Process {
JSONObject
plate
=
vehicle
.
getJSONObject
(
"plate"
);
JSONObject
plate
=
vehicle
.
getJSONObject
(
"plate"
);
// ----------------- 车牌 ------------------
// ----------------- 车牌 ------------------
if
(
plate
!=
null
)
{
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
));
System
.
arraycopy
(
text
,
0
,
model
.
getPlateText
(),
0
,
Math
.
min
(
text
.
length
,
16
));
// todo 车牌类型待实现
// todo 车牌类型待实现
model
.
setPlateType
(
1
);
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