Commit e3b9e586 by zhangxk

FlowModel、BehaviorModel增加漏传的字段,

补充日志打印
1 parent 104c9f47
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!