Commit e3b9e586 by zhangxk

FlowModel、BehaviorModel增加漏传的字段,

补充日志打印
1 parent 104c9f47
...@@ -25,7 +25,6 @@ public class DataController { ...@@ -25,7 +25,6 @@ public class DataController {
@PostMapping("/data") @PostMapping("/data")
public Object receiveData(@RequestBody String dataStr) throws Exception { public Object receiveData(@RequestBody String dataStr) throws Exception {
log.info("收到一条繁星发来的消息");
BaseModel data = processService.process(dataStr); BaseModel data = processService.process(dataStr);
if (data != null) { if (data != null) {
ChannelGroup.broadcast(data); ChannelGroup.broadcast(data);
......
...@@ -72,6 +72,7 @@ public class BehaviorModel extends BaseModel { ...@@ -72,6 +72,7 @@ public class BehaviorModel extends BaseModel {
buffer.writeIntLE(eventStartMillisecond); buffer.writeIntLE(eventStartMillisecond);
buffer.writeIntLE(eventEndSecond); buffer.writeIntLE(eventEndSecond);
buffer.writeIntLE(eventEndMillisecond); buffer.writeIntLE(eventEndMillisecond);
buffer.writeIntLE(eventCode);
buffer.writeIntLE(laneNo); buffer.writeIntLE(laneNo);
buffer.writeIntLE(pictureSize); buffer.writeIntLE(pictureSize);
buffer.writeIntLE(pictureWidth); buffer.writeIntLE(pictureWidth);
......
...@@ -52,6 +52,9 @@ public class FlowModel extends BaseModel { ...@@ -52,6 +52,9 @@ public class FlowModel extends BaseModel {
for (int i : maxQueueLen) { for (int i : maxQueueLen) {
buffer.writeIntLE(i); buffer.writeIntLE(i);
} }
for (int i : occupy) {
buffer.writeIntLE(i);
}
for (int i : avgDistanceBetweenVehicle) { for (int i : avgDistanceBetweenVehicle) {
buffer.writeIntLE(i); buffer.writeIntLE(i);
} }
......
...@@ -36,23 +36,31 @@ public class ProcessService { ...@@ -36,23 +36,31 @@ public class ProcessService {
String eventCate = jsonObject.getString("event_cate"); String eventCate = jsonObject.getString("event_cate");
String eventType = jsonObject.getString("event_type"); String eventType = jsonObject.getString("event_type");
if (eventCate == null) { if (eventCate == null) {
log.error("收到繁星发来的一条记录,但eventCate为空");
return null; return null;
} }
switch (eventCate) { switch (eventCate) {
//违法 //违法
case "traffic": case "traffic":
if ("vehicle".equals(eventType)) { if ("vehicle".equals(eventType)) {
log.info("收到繁星发来的一条违法记录");
log.warn("收到繁星发来的一条违法记录");
return trafficProcess.process(jsonObject); return trafficProcess.process(jsonObject);
} }
// 流量 // 流量
else if ("tflow".equals(eventType)) { else if ("tflow".equals(eventType)) {
log.info("收到繁星发来的一条交通流量记录");
log.warn("收到繁星发来的一条交通流量记录");
return flowProcess.process(jsonObject); return flowProcess.process(jsonObject);
} }
return null; return null;
//综治 //综治
case "behavior": case "behavior":
log.info("收到繁星发来的一条综治记录");
log.warn("收到繁星发来的一条综治记录");
return behaviorProcess.process(jsonObject); return behaviorProcess.process(jsonObject);
default: default:
log.error("收到繁星发来的一条记录,不在博康接收范围内");
return null; return null;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!