[8.3.0] 订单埋点
This commit is contained in:
@@ -10,6 +10,8 @@ public class CharterAnalyticsManager implements IOchEventKey {
|
||||
private static final String EVENT_KEY_RESTART_AUTOPILOT = "event_key_och_charter_restart_autopilot";
|
||||
// 埋点key:开始服务开启自动驾驶(成功/失败)
|
||||
private static final String EVENT_KEY_START_SERVICE = "event_key_och_charter_start_service";
|
||||
//埋点key:订单结束
|
||||
private static final String EVENT_KEY_STOP_SERVICE = "event_key_och_charter_stop_service";
|
||||
// 埋点key:开启自动驾驶前已识别的异常,会导致无法开启自驾
|
||||
private static final String EVENT_KEY_AP_UNABLE_START_REASON = "event_key_och_charter_ap_unable_start_reason";
|
||||
// 埋点key:点击启动自驾
|
||||
@@ -47,4 +49,9 @@ public class CharterAnalyticsManager implements IOchEventKey {
|
||||
return EVENT_KEY_CLICK_START_AUTOPILOT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventKeyCompleteTask() {
|
||||
return EVENT_KEY_STOP_SERVICE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
|
||||
} else if (statistics.status == 0) {
|
||||
//启动自驾成功
|
||||
failureCallback.onStartAutopilotSuccess(statistics.source.toString());
|
||||
LineManager.INSTANCE.triggerStartServiceEvent(true, 2, statistics.source.toString());
|
||||
LineManager.INSTANCE.triggerStartServiceEvent(true, 2, statistics.source.toString(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +33,12 @@ public interface IOchEventKey {
|
||||
// 无人化taxiPa event_key_och_taxi_passenger_click_start_autopilot
|
||||
String getEventKeyClickStartAutopilot();
|
||||
|
||||
// 无人化taxi event_key_unmanned_taxi_stop_service *
|
||||
// bus event_key_och_bus_stop_service *
|
||||
// shuttle event_key_och_bus_stop_service *
|
||||
// charter event_key_och_charter_stop_service
|
||||
// taxi event_key_och_taxi_stop_service * 这个没有注释跟上面一样没删
|
||||
// 无人化taxiPa event_key_unmanned_taxi_stop_service
|
||||
String getEventKeyCompleteTask();
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ import android.text.TextUtils
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
@@ -33,6 +36,10 @@ object OchAutopilotAnalytics {
|
||||
private const val EVENT_PARAM_MAP_ORIGINAL_DATA = "map_original_data" // 域控原始状态信息
|
||||
private const val EVENT_PARAM_AUTOPILOT_STATE = "autopilot_state" //原始的自动驾驶状态
|
||||
private const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
|
||||
private const val EVENT_PARAM_SLIDE_START = "slide_start" // 1:非首站滑动出发自动下发命令 0:接管点击启动按钮启动
|
||||
private const val EVENT_PARAM_SLIDE_STOP = "slide_stop" // 1:单程结束(订单完成正常滑动结束) 0:订单未完成结束(点击结束按钮结束)
|
||||
private const val EVENT_PARAM_LATITUDE = "latitude"
|
||||
private const val EVENT_PARAM_LONGITUDE = "longitude"
|
||||
private const val EVENT_PARAM_START_RESULT_SOURCE = "start_autopilot_source" // true/false
|
||||
private const val EVENT_PARAM_START_FAILURE_CODE = "start_autopilot_failure_code" // 启动自驾失败code
|
||||
private const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因
|
||||
@@ -177,7 +184,8 @@ object OchAutopilotAnalytics {
|
||||
orderId:String?,
|
||||
triggerDate: Long,
|
||||
type:String? = "",
|
||||
source:Int = 0
|
||||
source:Int = 0,
|
||||
isSlideAutoStart: Boolean = false
|
||||
) {
|
||||
OchChainLogManager.writeChainLogAutopilot("自驾流程","send:${send}_${restart}_${startName}_${endName}_${lineId}_${orderId}_${source}_${triggerDate}")
|
||||
mStartAutopilotKey = if (restart) getEventKeyRestartService() else getEventKeyStartService()
|
||||
@@ -193,7 +201,13 @@ object OchAutopilotAnalytics {
|
||||
return
|
||||
}
|
||||
// 开启成功,上报埋点
|
||||
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_CODE] = ""
|
||||
if(restart){
|
||||
mStartAutopilotParams[EVENT_PARAM_SLIDE_START] = if (isSlideAutoStart) 1 else 0
|
||||
}
|
||||
mStartAutopilotParams[EVENT_PARAM_LINE_ID] = lineId
|
||||
mStartAutopilotParams[EVENT_PARAM_LATITUDE] = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude
|
||||
mStartAutopilotParams[EVENT_PARAM_LONGITUDE] = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
|
||||
mStartAutopilotParams["product_type"] = AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode).name
|
||||
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_MSG] = ""
|
||||
mStartAutopilotParams[EVENT_PARAM_START_RESULT] = true
|
||||
mStartAutopilotParams[EVENT_PARAM_AUTOPILOT_FROM] = type?:""
|
||||
@@ -206,6 +220,12 @@ object OchAutopilotAnalytics {
|
||||
OchChainLogManager.writeChainLogAutopilot("启动自驾成功",mStartAutopilotParams.toString(),false)
|
||||
clearStartAutopilotParams() //清空参数数据,防止误传
|
||||
} else {
|
||||
if(restart){
|
||||
mStartAutopilotParams[EVENT_PARAM_SLIDE_START] = if (isSlideAutoStart) 1 else 0
|
||||
}
|
||||
mStartAutopilotParams[EVENT_PARAM_LATITUDE] = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude
|
||||
mStartAutopilotParams[EVENT_PARAM_LONGITUDE] = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
|
||||
mStartAutopilotParams["product_type"] = AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode).name
|
||||
mStartAutopilotParams[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
// 外部点击时间
|
||||
mStartAutopilotParams[EVENT_PARAM_CLICK_TIME] = DateTimeUtils.getTimeText(triggerDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
@@ -277,6 +297,24 @@ object OchAutopilotAnalytics {
|
||||
OchChainLogManager.writeChainLogAutopilot("用户点击启动自驾的时间",params.toString(),false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单结束
|
||||
*/
|
||||
fun triggerCompleteTask(triggerDate: Long, isSlideStop: Boolean, lineId: Int) {
|
||||
val params = HashMap<String, Any>()
|
||||
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
|
||||
params[EVENT_PARAM_CLICK_TIME] = DateTimeUtils.getTimeText(triggerDate,DateTimeUtils.yyyy_MM_dd_HH_mm_ss_SSS)
|
||||
params[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
|
||||
params[EVENT_PARAM_SLIDE_STOP] = if (isSlideStop) 1 else 0
|
||||
params[EVENT_PARAM_LINE_ID] = lineId
|
||||
params[EVENT_PARAM_LATITUDE] = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude
|
||||
params[EVENT_PARAM_LONGITUDE] = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
|
||||
params["product_type"] = AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode).name
|
||||
OchChainLogManager.addCommonParams(params)
|
||||
MogoAnalyticUtils.track(getEventKeyCompleteTask(), params)
|
||||
OchChainLogManager.writeChainLogAutopilot("订单结束",params.toString(),false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消自驾15s等待
|
||||
*/
|
||||
@@ -336,4 +374,17 @@ object OchAutopilotAnalytics {
|
||||
return ochEventKey!!.getEventKeyClickStartAutopilot()
|
||||
}
|
||||
|
||||
|
||||
// 无人化taxi event_key_unmanned_taxi_stop_service *
|
||||
// bus event_key_och_bus_stop_service *
|
||||
// shuttle event_key_och_bus_stop_service *
|
||||
// charter event_key_och_charter_stop_service
|
||||
// taxi event_key_och_taxi_stop_service * 这个没有注释跟上面一样没删
|
||||
// 无人化taxiPa event_key_unmanned_taxi_stop_service
|
||||
fun getEventKeyCompleteTask(): String{
|
||||
if(ochEventKey ==null){
|
||||
throw InitException("请设置停止任务埋点key")
|
||||
}
|
||||
return ochEventKey!!.getEventKeyCompleteTask()
|
||||
}
|
||||
}
|
||||
@@ -533,7 +533,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
|
||||
|
||||
// 启动自动驾驶
|
||||
fun startAutopilot() {
|
||||
fun startAutopilot(isSlideAutoStart: Boolean = false) {
|
||||
|
||||
if (startStation == null || endStation == null) {
|
||||
// ToastUtils.showShort("未设置起始或终点站点")
|
||||
@@ -597,7 +597,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
return
|
||||
}
|
||||
|
||||
triggerStartServiceEvent(false, 0, "")
|
||||
triggerStartServiceEvent(false, 0, "" ,isSlideAutoStart)
|
||||
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
@@ -634,7 +634,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
* 1: 通过can消息发送自驾状态确定启动自驾成功
|
||||
* 2:通过FSM 反馈确定启动自驾成功
|
||||
*/
|
||||
fun triggerStartServiceEvent(send: Boolean, source: Int, type: String) {
|
||||
fun triggerStartServiceEvent(send: Boolean, source: Int, type: String, isSlideAutoStart: Boolean = false) {
|
||||
getStationsWithLine { start, end, lineInfo ->
|
||||
OchAutopilotAnalytics.triggerStartAutopilotEvent(
|
||||
isFirstStartAutopilot,
|
||||
@@ -645,7 +645,8 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
"",
|
||||
System.currentTimeMillis(),
|
||||
type,
|
||||
source
|
||||
source,
|
||||
isSlideAutoStart
|
||||
)
|
||||
if (send) {// 启动自驾成功回调
|
||||
teleIsFirstStartAutopilot = false
|
||||
@@ -657,6 +658,11 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
fun triggerCompleteTask(isSlideStop: Boolean) {
|
||||
getStationsWithLine { start, end, lineInfo ->
|
||||
OchAutopilotAnalytics.triggerCompleteTask(System.currentTimeMillis(), isSlideStop, lineInfo.lineId.toInt())
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun invokeStartAutopilotTimeOut() {
|
||||
|
||||
@@ -19,6 +19,8 @@ public class BusAnalyticsManager implements IOchEventKey {
|
||||
private static final String EVENT_KEY_RESTART_AUTOPILOT = "event_key_och_bus_restart_autopilot";
|
||||
// 埋点key:开始服务开启自动驾驶(成功/失败)
|
||||
private static final String EVENT_KEY_START_SERVICE = "event_key_och_bus_start_service";
|
||||
//埋点key:订单结束
|
||||
private static final String EVENT_KEY_STOP_SERVICE = "event_key_och_bus_stop_service";
|
||||
// 埋点key:点击启动自驾
|
||||
private static final String EVENT_KEY_CLICK_START_AUTOPILOT = "event_key_och_shuttle_click_start_autopilot";
|
||||
|
||||
@@ -54,4 +56,9 @@ public class BusAnalyticsManager implements IOchEventKey {
|
||||
return EVENT_KEY_CLICK_START_AUTOPILOT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventKeyCompleteTask() {
|
||||
return EVENT_KEY_STOP_SERVICE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -239,8 +239,9 @@ object LineModel {
|
||||
)
|
||||
}
|
||||
|
||||
fun endTask() {
|
||||
fun endTask(isSlideStop: Boolean) {
|
||||
currentTask?.getLineIdAndName { shiftsId, taskId, taskTime, taskDate ->
|
||||
LineManager.triggerCompleteTask(isSlideStop)
|
||||
RepositoryManager.endTask(shiftsId,taskId)
|
||||
?.subscribeOn(Schedulers.io())
|
||||
?.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
@@ -232,13 +232,14 @@ object OrderModel {
|
||||
|
||||
/**
|
||||
* 重置路线站点状态--结束路线,当前路线恢复到始发站
|
||||
* @param isSlideStop true:单程结束(订单完成正常滑动结束) false:订单未完成结束(点击结束按钮结束)
|
||||
*/
|
||||
@JvmStatic
|
||||
fun completeTask() {
|
||||
fun completeTask(isSlideStop: Boolean) {
|
||||
OCHThreadPoolManager.getsInstance().execute {
|
||||
d(TAG, "结束当前路线abortTask")
|
||||
removeTipRunnables()
|
||||
LineModel.endTask()
|
||||
LineModel.endTask(isSlideStop)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +248,7 @@ object OrderModel {
|
||||
isGoingToNextStation = true
|
||||
if (CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
) {
|
||||
LineManager.startAutopilot()
|
||||
LineManager.startAutopilot(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +280,7 @@ object OrderModel {
|
||||
fun driveToNextStation() {
|
||||
if (LineModel.isLastStation()==true) {
|
||||
// 当前站是最后一站,结束当前行程
|
||||
completeTask()
|
||||
completeTask(true)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
}
|
||||
|
||||
fun completeTask() {
|
||||
OrderModel.completeTask()
|
||||
OrderModel.completeTask(false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,9 @@ object BusAnalyticsManager : IOchEventKey {
|
||||
// 埋点key:开始服务开启自动驾驶(成功/失败)
|
||||
private const val EVENT_KEY_START_SERVICE = "event_key_och_bus_start_service"
|
||||
|
||||
//埋点key:订单结束
|
||||
private const val EVENT_KEY_STOP_SERVICE = "event_key_och_bus_stop_service"
|
||||
|
||||
// 埋点key:点击启动自驾
|
||||
private const val EVENT_KEY_CLICK_START_AUTOPILOT = "event_key_och_shuttle_click_start_autopilot"
|
||||
|
||||
@@ -39,4 +42,8 @@ object BusAnalyticsManager : IOchEventKey {
|
||||
override fun getEventKeyClickStartAutopilot(): String {
|
||||
return EVENT_KEY_CLICK_START_AUTOPILOT
|
||||
}
|
||||
|
||||
override fun getEventKeyCompleteTask(): String? {
|
||||
return EVENT_KEY_STOP_SERVICE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ public class TaxiAnalyticsManager implements IOchEventKey {
|
||||
private static final String EVENT_KEY_RESTART_AUTOPILOT = "event_key_unmanned_taxi_restart_autopilot";
|
||||
// 埋点key:开始服务开启自动驾驶(成功/失败)
|
||||
private static final String EVENT_KEY_START_SERVICE = "event_key_unmanned_taxi_start_service";
|
||||
//埋点key:订单结束
|
||||
private static final String EVENT_KEY_STOP_SERVICE = "event_key_unmanned_taxi_stop_service";
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final TaxiAnalyticsManager INSTANCE = new TaxiAnalyticsManager();
|
||||
@@ -53,5 +55,10 @@ public class TaxiAnalyticsManager implements IOchEventKey {
|
||||
return EVENT_KEY_CLICK_START_AUTOPILOT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventKeyCompleteTask() {
|
||||
return EVENT_KEY_STOP_SERVICE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,5 +25,9 @@ object TaxiPassengerAnalyticsManager: IOchEventKey {
|
||||
return "event_key_och_taxi_passenger_click_start_autopilot"
|
||||
}
|
||||
|
||||
override fun getEventKeyCompleteTask(): String {
|
||||
return "event_key_unmanned_taxi_stop_service"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user