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 980edfb4
authored
Apr 20, 2021
by
zhangxk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
非机动车等违法改为事件数据对接
1 parent
d52759df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
src/main/java/com/viontech/process/TrafficProcess.java
src/main/resources/application-config.properties
src/main/resources/sjlx.properties
src/main/java/com/viontech/process/TrafficProcess.java
View file @
980edfb
...
...
@@ -10,15 +10,14 @@ import com.viontech.utils.IntUtils;
import
com.viontech.utils.VideoUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.nio.charset.Charset
;
import
java.text.ParseException
;
import
java.util.Base64
;
import
java.util.Date
;
import
java.util.Optional
;
import
java.util.Properties
;
import
java.util.*
;
@Component
@Slf4j
...
...
@@ -36,6 +35,10 @@ public class TrafficProcess implements Process {
private
Properties
plateTypeProp
;
@Resource
private
FTPClientHelper
ftpClientHelper
;
@Value
(
"${xcycle.illegal:71-xcycleinvehicle}"
)
private
String
xcycleIllegal
;
@Resource
private
BehaviorProcess
behaviorProcess
;
@Override
...
...
@@ -48,9 +51,27 @@ public class TrafficProcess implements Process {
JSONObject
lane
=
eventData
.
getJSONObject
(
"lane"
);
JSONObject
location
=
eventData
.
getJSONObject
(
"location"
);
JSONObject
illegal
=
eventData
.
getJSONObject
(
"illegal"
);
if
(
illegal
!=
null
&&
illegal
.
getInteger
(
"state"
)
==
0
)
{
if
(
illegal
==
null
||
illegal
.
getInteger
(
"state"
)
==
0
)
{
return
null
;
}
String
illegalCode
=
illegal
.
getString
(
"code"
);
//非机动车违法转为事件推送
String
[]
illegalBehavior
=
xcycleIllegal
.
split
(
","
);
Map
<
String
,
String
>
illegalBehaviorMap
=
new
HashMap
<>();
for
(
String
s
:
illegalBehavior
)
{
String
[]
split
=
s
.
split
(
"-"
);
illegalBehaviorMap
.
put
(
split
[
0
],
split
[
1
]);
}
if
(
illegalBehaviorMap
.
containsKey
(
illegalCode
)){
jsonObject
.
put
(
"event_cate"
,
"behavior"
);
jsonObject
.
put
(
"event_type"
,
illegalBehaviorMap
.
get
(
illegalCode
));
log
.
info
(
"非机动车违法数据,转为事件推送"
);
JSONObject
logs
=
JSONObject
.
parseObject
(
jsonObject
.
toJSONString
());
logs
.
remove
(
"pics"
);
logs
.
remove
(
"video"
);
log
.
info
(
"推送非机动车事件:"
+
logs
);
return
behaviorProcess
.
process
(
jsonObject
);
}
log
.
info
(
"收到繁星发来的一条违法记录"
);
JSONArray
pics
=
jsonObject
.
getJSONArray
(
"pics"
);
model
.
setSerialNum
(
IntUtils
.
next
());
...
...
src/main/resources/application-config.properties
View file @
980edfb
...
...
@@ -6,3 +6,5 @@ ftp.password=hc123456
login.username
=
admin
login.password
=
admin
xcycle.illegal
=
71-xcycleinvehicle
\ No newline at end of file
src/main/resources/sjlx.properties
View file @
980edfb
...
...
@@ -14,3 +14,4 @@ hengfu=00000027
jishui
=
0000003d
14
=
0000003e
daobantingche
=
00000062
xcycleinvehicle
=
0000000e
\ 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