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 e3b9e586
authored
Sep 23, 2020
by
zhangxk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
FlowModel、BehaviorModel增加漏传的字段,
补充日志打印
1 parent
104c9f47
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletions
src/main/java/com/viontech/controller/DataController.java
src/main/java/com/viontech/model/BehaviorModel.java
src/main/java/com/viontech/model/FlowModel.java
src/main/java/com/viontech/process/ProcessService.java
src/main/java/com/viontech/controller/DataController.java
View file @
e3b9e58
...
...
@@ -25,7 +25,6 @@ public class DataController {
@PostMapping
(
"/data"
)
public
Object
receiveData
(
@RequestBody
String
dataStr
)
throws
Exception
{
log
.
info
(
"收到一条繁星发来的消息"
);
BaseModel
data
=
processService
.
process
(
dataStr
);
if
(
data
!=
null
)
{
ChannelGroup
.
broadcast
(
data
);
...
...
src/main/java/com/viontech/model/BehaviorModel.java
View file @
e3b9e58
...
...
@@ -72,6 +72,7 @@ public class BehaviorModel extends BaseModel {
buffer
.
writeIntLE
(
eventStartMillisecond
);
buffer
.
writeIntLE
(
eventEndSecond
);
buffer
.
writeIntLE
(
eventEndMillisecond
);
buffer
.
writeIntLE
(
eventCode
);
buffer
.
writeIntLE
(
laneNo
);
buffer
.
writeIntLE
(
pictureSize
);
buffer
.
writeIntLE
(
pictureWidth
);
...
...
src/main/java/com/viontech/model/FlowModel.java
View file @
e3b9e58
...
...
@@ -52,6 +52,9 @@ public class FlowModel extends BaseModel {
for
(
int
i
:
maxQueueLen
)
{
buffer
.
writeIntLE
(
i
);
}
for
(
int
i
:
occupy
)
{
buffer
.
writeIntLE
(
i
);
}
for
(
int
i
:
avgDistanceBetweenVehicle
)
{
buffer
.
writeIntLE
(
i
);
}
...
...
src/main/java/com/viontech/process/ProcessService.java
View file @
e3b9e58
...
...
@@ -36,23 +36,31 @@ public class ProcessService {
String
eventCate
=
jsonObject
.
getString
(
"event_cate"
);
String
eventType
=
jsonObject
.
getString
(
"event_type"
);
if
(
eventCate
==
null
)
{
log
.
error
(
"收到繁星发来的一条记录,但eventCate为空"
);
return
null
;
}
switch
(
eventCate
)
{
//违法
case
"traffic"
:
if
(
"vehicle"
.
equals
(
eventType
))
{
log
.
info
(
"收到繁星发来的一条违法记录"
);
log
.
warn
(
"收到繁星发来的一条违法记录"
);
return
trafficProcess
.
process
(
jsonObject
);
}
// 流量
else
if
(
"tflow"
.
equals
(
eventType
))
{
log
.
info
(
"收到繁星发来的一条交通流量记录"
);
log
.
warn
(
"收到繁星发来的一条交通流量记录"
);
return
flowProcess
.
process
(
jsonObject
);
}
return
null
;
//综治
case
"behavior"
:
log
.
info
(
"收到繁星发来的一条综治记录"
);
log
.
warn
(
"收到繁星发来的一条综治记录"
);
return
behaviorProcess
.
process
(
jsonObject
);
default
:
log
.
error
(
"收到繁星发来的一条记录,不在博康接收范围内"
);
return
null
;
}
}
...
...
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