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 b576e301
authored
Sep 25, 2020
by
zhangxk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改对接车辆类型
1 parent
ab87334c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
src/main/java/com/viontech/configuration/PropertiesConfiguration.java
src/main/java/com/viontech/process/TrafficProcess.java
src/main/resources/hpys.properties
src/main/java/com/viontech/configuration/PropertiesConfiguration.java
View file @
b576e30
...
@@ -86,4 +86,21 @@ public class PropertiesConfiguration {
...
@@ -86,4 +86,21 @@ public class PropertiesConfiguration {
return
properties
;
return
properties
;
}
}
/**
* 车牌类型
* 博康的车牌类型指文安的号牌颜色
* @return
*/
@Bean
(
name
=
"plateTypeProp"
)
public
Properties
plateTypeProp
()
{
Properties
properties
=
new
Properties
();
try
(
InputStream
inputStream
=
PropertiesConfiguration
.
class
.
getResourceAsStream
(
"/hpys.properties"
))
{
properties
.
load
(
inputStream
);
}
catch
(
Exception
e
)
{
log
.
error
(
"读取 hpys.properties 失败"
,
e
);
}
return
properties
;
}
}
}
src/main/java/com/viontech/process/TrafficProcess.java
View file @
b576e30
...
@@ -33,6 +33,8 @@ public class TrafficProcess implements Process {
...
@@ -33,6 +33,8 @@ public class TrafficProcess implements Process {
@Resource
@Resource
private
Properties
eventProp
;
private
Properties
eventProp
;
@Resource
@Resource
private
Properties
plateTypeProp
;
@Resource
private
FTPClientHelper
ftpClientHelper
;
private
FTPClientHelper
ftpClientHelper
;
...
@@ -156,8 +158,9 @@ public class TrafficProcess implements Process {
...
@@ -156,8 +158,9 @@ public class TrafficProcess implements Process {
}
}
byte
[]
text
=
palteNum
.
getBytes
(
Charset
.
forName
(
"GBK"
));
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 车牌类型待实现
//车牌类型
model
.
setPlateType
(
1
);
String
colorCode
=
plateTypeProp
.
getProperty
(
plate
.
getString
(
"color_code"
),
"5"
);
model
.
setPlateType
(
Integer
.
valueOf
(
colorCode
));
JSONObject
rect
=
plate
.
getJSONObject
(
"rect"
);
JSONObject
rect
=
plate
.
getJSONObject
(
"rect"
);
if
(
rect
!=
null
)
{
if
(
rect
!=
null
)
{
Float
top
=
rect
.
getFloat
(
"top"
);
Float
top
=
rect
.
getFloat
(
"top"
);
...
...
src/main/resources/hpys.properties
0 → 100644
View file @
b576e30
0
=
5
3
=
2
5
=
4
2
=
1
9
=
5
1
=
3
6
=
5
7
=
3
\ No newline at end of file
\ No newline at end of file
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