Browse Source

修改事件检测器上报方向

develop
王兴琳 4 months ago
parent
commit
e623f78e4d
  1. 30
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

30
zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

@ -1,6 +1,7 @@
package com.zc.business.message.device.handler;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.NamedThreadFactory;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -300,24 +301,19 @@ public class DeviceMessageHandler {
Integer relatedLaneNo = data.getInteger("relatedLaneNo");
String stakeMarkDescription = data.getString("stakeMarkDescription");
String direction = UniversalEnum.EMPTY_STRING.getValue();
String[] arr = stakeMarkDescription.split(UniversalEnum.BLANK_SPACE.getValue());
String direction ;
//方向
if (arr[UniversalEnum.TWO.getNumber()] != null) {
if (arr[UniversalEnum.TWO.getNumber()].equals(UniversalEnum.Up.getValue())) {
direction = arr[UniversalEnum.ZERO.getNumber()] + UniversalEnum.BLANK_SPACE.getValue() + arr[UniversalEnum.ONE.getNumber()] + UniversalEnum.BLANK_SPACE.getValue() + UniversalEnum.DIRECTION_OF_HEZE.getValue() + UniversalEnum.BLANK_SPACE.getValue();
if (warningSubclass.equals(UniversalEnum.FOUR_SEVEN.getValue())) {
if (relatedLaneNo == UniversalEnum.FIVE.getNumber()) {
relatedLaneNo = UniversalEnum.ZERO.getNumber();
}
}
}
if (arr[UniversalEnum.TWO.getNumber()].equals(UniversalEnum.GO_DOWN.getValue())) {
direction = arr[UniversalEnum.ZERO.getNumber()] + UniversalEnum.BLANK_SPACE.getValue() + arr[UniversalEnum.ONE.getNumber()] + UniversalEnum.BLANK_SPACE.getValue() + UniversalEnum.DIRECTION_OF_JINAN.getValue() + UniversalEnum.BLANK_SPACE.getValue();
if (warningSubclass.equals(UniversalEnum.FOUR_SEVEN.getValue())) {
relatedLaneNo = data.getInteger("relatedLaneNo") - UniversalEnum.ONE.getNumber();
}
}
int string = Integer.parseInt(data.getString("direction"));
if (string==UniversalEnum.ONE.getNumber()){
direction=UniversalEnum.DIRECTION_OF_HEZE.getValue();
}else {
direction=UniversalEnum.DIRECTION_OF_JINAN.getValue();
}
if(relatedLaneNo==UniversalEnum.ONE.getNumber() || relatedLaneNo==UniversalEnum.SIX.getNumber()){
relatedLaneNo=UniversalEnum.ZERO.getNumber();
}
dcWarning.setLane(String.valueOf(relatedLaneNo));

Loading…
Cancel
Save