Merge remote-tracking branch 'origin/qa_1.1.2' into qa_1.1.2

This commit is contained in:
tongchenfei
2020-08-17 14:34:51 +08:00
7 changed files with 33 additions and 16 deletions

View File

@@ -60,6 +60,7 @@ public class V2XConst {
public static final String V2X_ROAD_SHOW = "v2x_road_show";
public static final String V2X_ROAD_EVET = "v2x_road_event";
public static final String V2X_ROAD_EVET_HISTORY_BUTTON = "V2X_button_click";
public static final String V2X_ROAD_PRODUCE = "v2x_road_produce";
/**
* V2X 道路事件操作类型
*/

View File

@@ -31,7 +31,6 @@ import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkWindow;
import com.mogo.module.v2x.utils.FatigueDrivingUtils;
import com.mogo.module.v2x.utils.TimeUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.voice.V2XVoiceManager;
import com.mogo.service.module.IMogoModuleLifecycle;
@@ -156,8 +155,6 @@ public class V2XModuleProvider implements
}
// 刷新配置文件
refreshStrategyConfig();
// 清除V2X事件数据库中过期的数据数据有效期为24小时
V2XSQLiteUtils.clearYesterdayScenarioHistoryData();
}
/**

View File

@@ -19,6 +19,7 @@ import com.mogo.module.v2x.manager.IMoGoV2XStatusChangedListener;
import com.mogo.module.v2x.manager.V2XStatusDescriptor;
import com.mogo.module.v2x.presenter.ScenarioHistoryPresenter;
import com.mogo.module.v2x.utils.ThreadUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.view.V2XListEmptyView;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -130,6 +131,8 @@ public class V2XScenarioHistoryFragment
@Override
public void onResume() {
super.onResume();
// 清除V2X事件数据库中过期的数据数据有效期为24小时
V2XSQLiteUtils.clearYesterdayScenarioHistoryData();
mPresenter.loadHistory();
}

View File

@@ -26,6 +26,7 @@ import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.LocationUtils;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -157,6 +158,7 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
);
// Logger.w(MODULE_NAME, "V2X预警--前方数据距离:" + v2XRoadEventEntity.getDistance());
// 触发展示操作
TrackUtils.trackV2xRoadProduceEvent(1);
V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity = new V2XMessageEntity<>();
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XMessageEntity.setContent(v2XRoadEventEntity);

View File

@@ -17,6 +17,7 @@ import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.alarm.V2XAlarmServer;
import com.mogo.module.v2x.utils.TimeConstants;
import com.mogo.module.v2x.utils.TimeUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.utils.logger.Logger;
@@ -42,6 +43,7 @@ public class V2XMessageListener_401012 implements IMogoOnMessageListener<MarkerC
public void onMsgReceived(MarkerCardResult response) {
Logger.d(MODULE_NAME, "V2XMessageListener_401012==V2X服务端下发\n"
+ GsonUtil.jsonFromObject(response));
TrackUtils.trackV2xRoadProduceEvent(2);
try {
long timeSpan = TimeUtils.getTimeSpan(TimeUtils.getNowMills(), response.getMessageTime(), TimeConstants.MIN);
// 三分钟以内的消息才会提示用户

View File

@@ -132,20 +132,17 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
if (exploreWayList != null) {
for (MarkerExploreWay markerExploreWay : exploreWayList) {
// 因为目前探路卡片不支持直播,所以这里做了过滤 @李小鹏
if (!markerExploreWay.getCanLive()) {
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
MarkerLocation markerLocation = markerExploreWay.getLocation();
// 记录道路事件
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
v2XRoadEventEntity.setLocation(markerLocation);
// 探路目前只有上报拥堵
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
MarkerLocation markerLocation = markerExploreWay.getLocation();
// 记录道路事件
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
v2XRoadEventEntity.setLocation(markerLocation);
// 探路目前只有上报拥堵
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
v2XRoadEventEntity.setExpireTime(20000);
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
}
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
v2XRoadEventEntity.setExpireTime(20000);
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
}
}
}

View File

@@ -62,4 +62,19 @@ public class TrackUtils {
e.printStackTrace();
}
}
/**
* @param type type=1 短距离角度匹配
* type=2 历史轨迹匹配
*/
public static void trackV2xRoadProduceEvent(int type) {
try {
Map<String, Object> properties = new HashMap<>();
properties.put("type", type);
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_PRODUCE, properties);
} catch (Exception e) {
e.printStackTrace();
}
}
}