[自主算路验证] feat: 增加自主算路验证模式流程关键节点日志,优化相关布局UI,增加模式互斥相关逻辑;
This commit is contained in:
@@ -16,10 +16,14 @@ import android.widget.TextView
|
||||
import androidx.lifecycle.ProcessLifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.function.main.MainMoGoApplication
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.taxi.R
|
||||
@@ -30,6 +34,8 @@ import com.mogo.och.taxi.constant.TaskStatusEnum
|
||||
import com.mogo.och.taxi.constant.TaskTypeEnum
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
|
||||
import com.mogo.och.taxi.ui.task.TaxiTaskModel
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.btnContainer
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentBusinessModeTextView
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentCarStatus
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentDataTimestamps
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentLineId
|
||||
@@ -39,6 +45,7 @@ import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajecto
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentStatus
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentTaskType
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogHistoryTextView
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogTitleTextView
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderEndSiteInfo
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderNo
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderPreLoadLines
|
||||
@@ -46,13 +53,15 @@ import kotlinx.android.synthetic.main.taxi_debug_order.view.orderStartSiteInfo
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderStatus
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.taskEndSite
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.taskStartSite
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.unmanedTaskOrderContainer
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
public class DebugView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr, defStyleRes), ITaxiTaskWithOrderCallback {
|
||||
) : LinearLayout(context, attrs, defStyleAttr, defStyleRes), ITaxiTaskWithOrderCallback,
|
||||
IMogoStatusChangedListener {
|
||||
companion object {
|
||||
const val TAG = "DebugView"
|
||||
private const val ANALYTICS_EVENT_TYPE_DRIVER_UNMANNED_OPERATION_PROCESS_KEY_NODE_LOG =
|
||||
@@ -67,7 +76,7 @@ public class DebugView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
fun printWarnMsg(msg: String) {
|
||||
printMsg("Warn $msg", MainMoGoApplication.getApp().getColor(R.color.background_warn))
|
||||
printMsg("Warn $msg", MainMoGoApplication.getApp().getColor(R.color.background_debug))
|
||||
trackEvent("Warn", msg)
|
||||
}
|
||||
|
||||
@@ -104,7 +113,10 @@ public class DebugView @JvmOverloads constructor(
|
||||
val map: MutableMap<String, Any> = HashMap()
|
||||
map["level"] = level
|
||||
map["msg"] = msg
|
||||
MogoAnalyticUtils.track(ANALYTICS_EVENT_TYPE_DRIVER_UNMANNED_OPERATION_PROCESS_KEY_NODE_LOG, map)
|
||||
MogoAnalyticUtils.track(
|
||||
ANALYTICS_EVENT_TYPE_DRIVER_UNMANNED_OPERATION_PROCESS_KEY_NODE_LOG,
|
||||
map
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,9 +140,11 @@ public class DebugView @JvmOverloads constructor(
|
||||
init {
|
||||
initBroadcastReceiver()
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_debug_order, this, true)
|
||||
debugLogHistoryTextView.setMovementMethod(ScrollingMovementMethod.getInstance())
|
||||
debugLogHistoryTextView.movementMethod = ScrollingMovementMethod.getInstance()
|
||||
visibility = GONE
|
||||
logHistoryTextView = debugLogHistoryTextView
|
||||
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initBroadcastReceiver() {
|
||||
@@ -142,8 +156,7 @@ public class DebugView @JvmOverloads constructor(
|
||||
fun toggleOrderDebugView() {
|
||||
visibility = if (visibility == View.VISIBLE) View.GONE
|
||||
else View.VISIBLE
|
||||
val data = TaxiTaskModel.getCurrentTaskWithOrder()
|
||||
initViewByData(data)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initTaskWithOrderDataListener() {
|
||||
@@ -154,17 +167,49 @@ public class DebugView @JvmOverloads constructor(
|
||||
TaxiTaskModel.removeTaskWithOrderListener(TAG)
|
||||
}
|
||||
|
||||
private fun initCurrentBusinessModeListener() {
|
||||
MogoStatusManager.getInstance()
|
||||
.registerStatusChangedListener(
|
||||
TAG, StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE, this
|
||||
)
|
||||
}
|
||||
|
||||
private fun removeCurrentBusinessModeListener() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE,
|
||||
this
|
||||
)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initTaskWithOrderDataListener()
|
||||
initCurrentBusinessModeListener()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
removeTaskWithOrderDataListener()
|
||||
removeCurrentBusinessModeListener()
|
||||
}
|
||||
|
||||
private fun initViewByData(data: QueryCurrentTaskRespBean.Result?) {
|
||||
private fun initView() {
|
||||
initCurrentBusinessMode()
|
||||
initViewByTaskData(TaxiTaskModel.getCurrentTaskWithOrder())
|
||||
initDebugLogTextViewTitle()
|
||||
}
|
||||
|
||||
private fun initCurrentBusinessMode() {
|
||||
val isRoutingVerifyMode =
|
||||
MogoStatusManager.getInstance().isTaxiUnmanedDriverLineRoutingVerifyMode
|
||||
currentBusinessModeTextView.text =
|
||||
"当前业务模式:${if (isRoutingVerifyMode) "自主算路验证模式" else "无人化运营流程模式"}"
|
||||
}
|
||||
|
||||
private fun initViewByTaskData(data: QueryCurrentTaskRespBean.Result?) {
|
||||
//release包下隐藏Mock按钮,避免司机误操作
|
||||
btnContainer.visibility = if (AppUtils.isAppDebug()) View.INVISIBLE else View.VISIBLE
|
||||
val curContrail = TaxiTaskModel.getCurrentTaskTrajectory()
|
||||
currentDataTimestamps.text = "【当前数据返回时间】${currentDateTimeString()}"
|
||||
currentCarStatus.text =
|
||||
@@ -194,9 +239,16 @@ public class DebugView @JvmOverloads constructor(
|
||||
"【当前任务Stop信息】StopMd5=${curContrail?.txtFileMd5}, StopDPQPMd5=${curContrail?.txtFileMd5DPQP}"
|
||||
}
|
||||
|
||||
private fun initDebugLogTextViewTitle() {
|
||||
val isRoutingVerifyMode =
|
||||
MogoStatusManager.getInstance().isTaxiUnmanedDriverLineRoutingVerifyMode
|
||||
debugLogTitleTextView.text =
|
||||
if (isRoutingVerifyMode) "自主算路验证模式关键节点日志(司机端)" else "无人化运营流程关键节点日志(司机端)"
|
||||
}
|
||||
|
||||
override fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?) {
|
||||
d(TAG, "onTaskWithOrderDataChanged")
|
||||
initViewByData(taskWithOrder)
|
||||
initViewByTaskData(taskWithOrder)
|
||||
}
|
||||
|
||||
override fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result?) {
|
||||
@@ -234,4 +286,16 @@ public class DebugView @JvmOverloads constructor(
|
||||
|
||||
override fun onTaskTripInfoLocalCalculateChanged(meters: Long, timeInSecond: Long) {
|
||||
}
|
||||
|
||||
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
|
||||
if (StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE == descriptor) {
|
||||
UiThreadHandler.post {
|
||||
initCurrentBusinessMode()
|
||||
initDebugLogTextViewTitle()
|
||||
unmanedTaskOrderContainer.visibility = if (isTrue) View.GONE else View.VISIBLE
|
||||
debugLogHistoryTextView.maxLines = if (isTrue) 30 else 15
|
||||
}
|
||||
printInfoMsg("[当前业务模式变化] afterValue=${if (isTrue) "自主算路验证模式" else "无人化运营流程模式"}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import com.mogo.och.common.module.utils.FlowBus
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.bean.GrayLineBean
|
||||
import com.mogo.och.taxi.constant.TaxiDriverEventConst
|
||||
import com.mogo.och.taxi.ui.debug.DebugView
|
||||
import kotlinx.android.synthetic.main.routing_choose_task_activity.btnChooseLineSubmit
|
||||
import kotlinx.android.synthetic.main.routing_choose_task_activity.btnClose
|
||||
import kotlinx.android.synthetic.main.routing_choose_task_activity.chooseLineListView
|
||||
@@ -94,7 +95,7 @@ class TaxiRoutingChooseLineActivity : AppCompatActivity() {
|
||||
ToastUtils.showLong("请先选择任务")
|
||||
return@setOnClickListener
|
||||
}
|
||||
ToastUtils.showLong("当前选择的路线contrailId:$mCurrentChosenPosition")
|
||||
DebugView.printInfoMsg("[选择灰度任务] 当前选择 mCurrentChosenPosition=$mCurrentChosenPosition, ")
|
||||
mLoadingDialog.showLoading()
|
||||
val chosenItem = mRoutingLineList[mCurrentChosenPosition]
|
||||
mViewModel.sendUiIntent(
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.och.taxi.base.IUiIntent
|
||||
import com.mogo.och.taxi.bean.GrayLineBean
|
||||
import com.mogo.och.taxi.bean.StartGrayAndQueryContrailRsp
|
||||
import com.mogo.och.taxi.callback.ITaxiRoutingCallback
|
||||
import com.mogo.och.taxi.ui.debug.DebugView
|
||||
|
||||
class TaxiRoutingChooseLineViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRoutingUiIntent>(),
|
||||
ITaxiRoutingCallback {
|
||||
@@ -47,6 +48,7 @@ class TaxiRoutingChooseLineViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRou
|
||||
|
||||
override fun onQueryRoutingGrayLineListFailed(errorStr: String) {
|
||||
ToastUtils.showShort(errorStr)
|
||||
DebugView.printErrorMsg("[查询灰度任务] 失败, error=$errorStr")
|
||||
sendUiState {
|
||||
copy(
|
||||
routingUiState = RoutingUIState.Init
|
||||
@@ -57,6 +59,7 @@ class TaxiRoutingChooseLineViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRou
|
||||
override fun onStartGrayTaskAndQueryContrailSuccess(data: StartGrayAndQueryContrailRsp) {
|
||||
if (data.taskId == -1L) {
|
||||
onStartGrayTaskAndQueryContrailFailed("开始任务失败, 请稍后重试")
|
||||
DebugView.printErrorMsg("[开始灰度任务] 开始任务失败, 请稍后重试")
|
||||
return
|
||||
}
|
||||
sendUiState {
|
||||
@@ -79,6 +82,7 @@ class TaxiRoutingChooseLineViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRou
|
||||
|
||||
override fun onStartGrayTaskAndQueryContrailFailed(errorStr: String) {
|
||||
ToastUtils.showShort(errorStr)
|
||||
DebugView.printErrorMsg("[开始灰度任务&查询轨迹详情] 操作失败, 请稍后重试")
|
||||
sendUiState {
|
||||
copy(
|
||||
routingUiState = RoutingUIState.HideChooseLineLoading(
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
||||
import com.mogo.eagle.core.function.main.MainMoGoApplication
|
||||
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.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel
|
||||
import com.mogo.och.common.module.map.ICommonNaviChangedCallback
|
||||
@@ -23,6 +22,7 @@ import kotlinx.android.synthetic.main.routing_fragment.btnChooseTask
|
||||
import kotlinx.android.synthetic.main.routing_fragment.btnFinishTask
|
||||
import kotlinx.android.synthetic.main.routing_fragment.btnStartTask
|
||||
import kotlinx.android.synthetic.main.routing_fragment.btnSummitIssue
|
||||
import kotlinx.android.synthetic.main.routing_fragment.endPoint
|
||||
import kotlinx.android.synthetic.main.routing_fragment.endStationName
|
||||
import kotlinx.android.synthetic.main.routing_fragment.finishSubmitIssueGroup
|
||||
import kotlinx.android.synthetic.main.routing_fragment.headerTitleContainer
|
||||
@@ -30,6 +30,7 @@ import kotlinx.android.synthetic.main.routing_fragment.mCurrentTaskLayout
|
||||
import kotlinx.android.synthetic.main.routing_fragment.naviToEnd
|
||||
import kotlinx.android.synthetic.main.routing_fragment.naviToStart
|
||||
import kotlinx.android.synthetic.main.routing_fragment.noDataContainer
|
||||
import kotlinx.android.synthetic.main.routing_fragment.startPoint
|
||||
import kotlinx.android.synthetic.main.routing_fragment.startStationName
|
||||
import kotlinx.android.synthetic.main.routing_fragment.taskTitleTv
|
||||
import kotlinx.android.synthetic.main.routing_fragment.taskTripInfo
|
||||
@@ -74,7 +75,6 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
private fun initEventBus() {
|
||||
FlowBus.with<RoutingUIState.RoutingTask>(TaxiDriverEventConst.RoutingActivityEvent.EVENT_TYPE_GET_CHOSEN_LINE_TASK)
|
||||
.register(this) { task ->
|
||||
ToastUtils.showLong("接收到taskId:${task.grayId}")
|
||||
mViewModel.sendUiIntent(TaxiRoutingUiIntent.ShowRoutingTask(task))
|
||||
}
|
||||
}
|
||||
@@ -144,6 +144,8 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
|
||||
naviToStart.visibility = View.VISIBLE
|
||||
naviToEnd.visibility = View.INVISIBLE
|
||||
updateStartAndEndStationPointByStatus(false)
|
||||
updateCurrentTaskTripInfo(0,0)
|
||||
|
||||
data.grayLineBean?.startSite?.also {
|
||||
initStartNaviToStationParam(
|
||||
@@ -181,6 +183,9 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
|
||||
naviToStart.visibility = View.INVISIBLE
|
||||
naviToEnd.visibility = View.VISIBLE
|
||||
updateStartAndEndStationPointByStatus(true)
|
||||
updateCurrentTaskTripInfo(0,0)
|
||||
|
||||
routingTask.grayLineBean?.endSite?.also {
|
||||
initStartNaviToStationParam(
|
||||
false,
|
||||
@@ -193,6 +198,16 @@ class TaxiRoutingFragment : BaseFragment(), ICommonNaviChangedCallback {
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateStartAndEndStationPointByStatus(isGoingToStation: Boolean) {
|
||||
if (isGoingToStation) {// 即将到达的站点
|
||||
startPoint.setImageResource(R.drawable.taxi_driver_circle_blue_big)
|
||||
endPoint.setImageResource(R.drawable.taxi_driver_circle_green_big)
|
||||
} else {// 到达站点 或 已经经过的站点
|
||||
startPoint.setImageResource(R.drawable.taxi_driver_circle_green_big)
|
||||
endPoint.setImageResource(R.drawable.taxi_driver_circle_blue_big)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showFeedbackDialog(grayId: Long) {
|
||||
if (mFeedbackDialog == null) {
|
||||
val builder: TaxiRoutingFeedbackDialog.Builder = TaxiRoutingFeedbackDialog.Builder()
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.och.taxi.base.IUiIntent
|
||||
import com.mogo.och.taxi.bean.GrayLineBean
|
||||
import com.mogo.och.taxi.bean.StartGrayAndQueryContrailRsp
|
||||
import com.mogo.och.taxi.callback.ITaxiRoutingCallback
|
||||
import com.mogo.och.taxi.ui.debug.DebugView
|
||||
|
||||
class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRoutingUiIntent>(),
|
||||
ITaxiRoutingCallback {
|
||||
@@ -33,11 +34,13 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
override fun handleIntent(intent: IUiIntent) {
|
||||
when (intent) {
|
||||
is TaxiRoutingUiIntent.StartChooseLineAction -> {
|
||||
DebugView.printInfoMsg("[选择任务] 跳转到选择任务列表")
|
||||
val intent = Intent(mContext, TaxiRoutingChooseLineActivity::class.java)
|
||||
mContext?.startActivity(intent)
|
||||
}
|
||||
|
||||
is TaxiRoutingUiIntent.ShowRoutingTask -> {
|
||||
DebugView.printInfoMsg("[选择任务] 展示当前选择任务,刷新UI")
|
||||
val task = intent.routingTask
|
||||
sendUiState {
|
||||
copy(
|
||||
@@ -51,12 +54,15 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
}
|
||||
|
||||
is TaxiRoutingUiIntent.StartTaskAction -> {
|
||||
DebugView.printInfoMsg("[开始任务] 准备开始任务")
|
||||
val grayLineBean = intent.routingTask.grayLineBean
|
||||
val contrailBean = intent.routingTask.contrailBean
|
||||
if (grayLineBean == null || contrailBean == null) {
|
||||
ToastUtils.showShort("灰度线路或轨迹信息异常,请稍后再试")
|
||||
DebugView.printErrorMsg("[开始任务] 灰度线路或轨迹信息异常,请稍后再试")
|
||||
return
|
||||
}
|
||||
DebugView.printInfoMsg("[启自驾] 准备启动自驾")
|
||||
TaxiRoutingModel.startAutoPilot(grayLineBean!!, contrailBean!!)
|
||||
sendUiState {
|
||||
copy(
|
||||
@@ -66,6 +72,7 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
}
|
||||
|
||||
is TaxiRoutingUiIntent.SubmitGrayLineIssueLocation -> {
|
||||
DebugView.printInfoMsg("[上报打点] 准备上报打点")
|
||||
val grayId = intent.grayId
|
||||
val currentLocation =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
@@ -77,6 +84,7 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
}
|
||||
|
||||
is TaxiRoutingUiIntent.ShowFeedbackDialog -> {
|
||||
DebugView.printInfoMsg("[结束任务] 展示结束任务弹框")
|
||||
sendUiState {
|
||||
copy(
|
||||
routingUiState = RoutingUIState.ShowFeedbackDialog(
|
||||
@@ -88,6 +96,7 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
}
|
||||
|
||||
is TaxiRoutingUiIntent.SubmitEndTask -> {
|
||||
DebugView.printInfoMsg("[结束任务] 准备结束任务,grayId=${intent.grayId}, type=${intent.type.name}")
|
||||
TaxiRoutingModel.endGrayTask(intent.grayId, intent.type)
|
||||
}
|
||||
}
|
||||
@@ -106,11 +115,11 @@ class TaxiRoutingFragmentViewModel : BaseViewModel<TaxiRoutingUiState, TaxiRouti
|
||||
}
|
||||
|
||||
override fun onSubmitGrayLineIssueLocationSuccess() {
|
||||
ToastUtils.showShort("上报问题打点成功")
|
||||
ToastUtils.showShort("问题记录成功")
|
||||
}
|
||||
|
||||
override fun onSubmitGrayLineIssueLocationFailed(errorStr: String) {
|
||||
ToastUtils.showShort("上报问题打点失败:$errorStr")
|
||||
ToastUtils.showShort("问题记录失败:$errorStr")
|
||||
}
|
||||
|
||||
override fun onSubmitEndTaskSuccess() {
|
||||
|
||||
@@ -67,6 +67,7 @@ object TaxiRoutingModel {
|
||||
}
|
||||
|
||||
fun queryRoutingGrayLineList() {
|
||||
DebugView.printInfoMsg("[查询灰度路线] 准备发送请求,sn=${MoGoAiCloudClientConfig.getInstance().sn}")
|
||||
TaxiRoutingServiceManager.queryRoutingGrayLineList(mContext,
|
||||
object : OchCommonServiceCallback<QueryGrayContrailListRsp> {
|
||||
override fun onSuccess(data: QueryGrayContrailListRsp) {
|
||||
@@ -74,6 +75,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"queryRoutingGrayLineList onSuccess: data=${GsonUtils.toJson(data)}"
|
||||
)
|
||||
DebugView.printInfoMsg("[查询灰度路线] 请求success,dataSize=${data?.data?.size}")
|
||||
val result = mutableListOf<GrayLineBean>()
|
||||
data.data?.also {
|
||||
result.addAll(it)
|
||||
@@ -89,6 +91,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"queryRoutingGrayLineList onFail: code=$code, msg=$msg"
|
||||
)
|
||||
DebugView.printErrorMsg("[查询灰度路线] 请求fail, code=$code, msg=$msg, sn=${MoGoAiCloudClientConfig.getInstance().sn}")
|
||||
ToastUtils.showShort("查询灰度线路列表异常, 请稍后重试, code=$code")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
@@ -108,8 +111,9 @@ object TaxiRoutingModel {
|
||||
}
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"queryRoutingGrayLineList onError, msg=$hintStr"
|
||||
"queryRoutingGrayLineList onError, msg=$hintStr, sn=${MoGoAiCloudClientConfig.getInstance().sn}"
|
||||
)
|
||||
DebugView.printErrorMsg("[查询灰度路线] 请求error, msg=$hintStr")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onQueryRoutingGrayLineListFailed(hintStr)
|
||||
@@ -119,6 +123,7 @@ object TaxiRoutingModel {
|
||||
}
|
||||
|
||||
fun startGrayTaskAndQueryRoutingContrail(contrailId: Long, grayLineBean: GrayLineBean) {
|
||||
DebugView.printInfoMsg("[开始灰度任务&查询轨迹详情] 准备发送请求,contrailId=${contrailId}, lineId=${grayLineBean.lineId}")
|
||||
TaxiRoutingServiceManager.startGrayTaskAndQueryRoutingContrail(
|
||||
mContext,
|
||||
sn = MoGoAiCloudClientConfig.getInstance().sn,
|
||||
@@ -134,6 +139,7 @@ object TaxiRoutingModel {
|
||||
)
|
||||
}"
|
||||
)
|
||||
DebugView.printInfoMsg("[开始灰度任务&查询轨迹详情] 请求success,taskId=${data.taskId}, contrailId=${contrailId}, lineId=${grayLineBean.lineId}")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartGrayTaskAndQueryContrailSuccess(data)
|
||||
@@ -145,6 +151,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"startGrayTaskAndQueryRoutingContrail onFail: code=$code, msg=$msg"
|
||||
)
|
||||
DebugView.printErrorMsg("[开始灰度任务&查询轨迹详情] 请求fail, code=$code, msg=$msg, contrailId=${contrailId}, lineId=${grayLineBean.lineId}")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartGrayTaskAndQueryContrailFailed(
|
||||
@@ -163,8 +170,9 @@ object TaxiRoutingModel {
|
||||
}
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"startGrayTaskAndQueryRoutingContrail onError, msg=$hintStr"
|
||||
"startGrayTaskAndQueryRoutingContrail onError, msg=$hintStr, contrailId=${contrailId}, lineId=${grayLineBean.lineId}"
|
||||
)
|
||||
DebugView.printErrorMsg("[开始灰度任务&查询轨迹详情] 请求error, msg=$hintStr")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartGrayTaskAndQueryContrailFailed(hintStr)
|
||||
@@ -175,6 +183,7 @@ object TaxiRoutingModel {
|
||||
}
|
||||
|
||||
fun submitGrayLineIssueLocation(grayId: Long, gcjLon: Double, gcjLat: Double) {
|
||||
DebugView.printInfoMsg("[上报打点] 准备发送请求,grayId=$grayId, gcjLon=$gcjLon, gcjLat=$gcjLat")
|
||||
val submit = SubmitGrayLineIssueLocationReq(grayId, gcjLon, gcjLat)
|
||||
TaxiRoutingServiceManager.submitGrayLineIssueLocation(
|
||||
mContext,
|
||||
@@ -189,6 +198,7 @@ object TaxiRoutingModel {
|
||||
)
|
||||
}"
|
||||
)
|
||||
DebugView.printInfoMsg("[上报打点] 准备success,grayId=$grayId, gcjLon=$gcjLon, gcjLat=$gcjLat")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onSubmitGrayLineIssueLocationSuccess()
|
||||
@@ -200,6 +210,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"submitGrayLineIssueLocation onFail: code=$code, msg=$msg"
|
||||
)
|
||||
DebugView.printErrorMsg("[上报打点] 请求fail, code=$code, msg=$msg, grayId=$grayId")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onSubmitGrayLineIssueLocationFailed(
|
||||
@@ -220,6 +231,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"submitGrayLineIssueLocation onError, msg=$hintStr"
|
||||
)
|
||||
DebugView.printErrorMsg("[上报打点] 请求error, msg=$hintStr, grayId=$grayId")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onSubmitGrayLineIssueLocationFailed(hintStr)
|
||||
@@ -230,6 +242,7 @@ object TaxiRoutingModel {
|
||||
}
|
||||
|
||||
fun endGrayTask(grayId: Long, type: EndGrayTaskFeedbackType) {
|
||||
DebugView.printInfoMsg("[结束灰度任务] 准备发送请求,grayId=$grayId, type=${type.type}, typeName=${type.name}")
|
||||
val submit = EndGrayContrailTaskReq(grayId, type.type)
|
||||
TaxiRoutingServiceManager.endGrayTask(
|
||||
mContext,
|
||||
@@ -244,6 +257,7 @@ object TaxiRoutingModel {
|
||||
)
|
||||
}"
|
||||
)
|
||||
DebugView.printInfoMsg("[结束灰度任务] 请求success,grayId=$grayId, type=${type.type}, typeName=${type.name}")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onSubmitEndTaskSuccess()
|
||||
@@ -255,6 +269,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"endGrayTask onFail: code=$code, msg=$msg"
|
||||
)
|
||||
DebugView.printErrorMsg("[结束灰度任务] 请求fail, code=$code, msg=$msg, grayId=$grayId, type=${type.type}, typeName=${type.name}")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onSubmitEndTaskFailed(
|
||||
@@ -275,6 +290,7 @@ object TaxiRoutingModel {
|
||||
TAG,
|
||||
"endGrayTask onError, msg=$hintStr"
|
||||
)
|
||||
DebugView.printErrorMsg("[结束灰度任务] 请求error, msg=$hintStr, grayId=$grayId, type=${type.type}, typeName=${type.name}")
|
||||
mTaxiRoutingCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onSubmitEndTaskFailed(hintStr)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="54dp" />
|
||||
<gradient
|
||||
android:startColor="#80323C6F"
|
||||
android:endColor="#80323C6F"
|
||||
android:angle="315"
|
||||
/>
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/taxi_operation_status_bg_disabled" android:state_enabled="false" />
|
||||
<item android:drawable="@drawable/taxi_operation_status_bg" android:state_enabled="true"/>
|
||||
</selector>
|
||||
@@ -7,48 +7,55 @@
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:background="@drawable/routing_choose_line_shape_select_line_item_bg_normal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/switchLineNameTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:ellipsize="end"
|
||||
android:gravity="left|center_vertical"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_default="spread"
|
||||
tools:text="线路名称线路名称线路" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/todayVerifyNumTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:layout_marginEnd="79dp"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:gravity="left|center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="本车今日已验证:1次" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/switchLineNameTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/historyVerifyNumTextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/todayVerifyNumTextView"
|
||||
tools:text="线路名称线路名称线路" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/switchLineNameTextView"
|
||||
tools:text="本车今日已验证:1次" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/historyVerifyNumTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_80"
|
||||
android:layout_marginBottom="@dimen/dp_35"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:gravity="right|center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/taxi_color_ccb9c3e9"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/todayVerifyNumTextView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/todayVerifyNumTextView"
|
||||
app:layout_constraintTop_toTopOf="@+id/todayVerifyNumTextView"
|
||||
tools:text="路线累计反馈0可用,1不可用" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -17,16 +17,19 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<com.mogo.och.common.module.wigets.MarqueeTextView
|
||||
android:id="@+id/taskTitleTv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_132"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_width="@dimen/dp_420"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_45"
|
||||
android:layout_marginBottom="@dimen/dp_45"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center_vertical"
|
||||
android:text="灰度路线123456"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:singleLine="true"
|
||||
android:text="路线name路线name"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_46"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
android:layout_height="102dp"
|
||||
android:layout_marginLeft="48dp"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:background="@drawable/taxi_operation_status_bg"
|
||||
android:background="@drawable/taxi_operation_status_bg_selector_new"
|
||||
android:drawableLeft="@drawable/shape_size_operation_out"
|
||||
android:drawablePadding="10dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/orderDebugContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
<TextView
|
||||
android:id="@+id/currentBusinessModeTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前业务模式:"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/unmanedTaskOrderContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btnContainer"
|
||||
@@ -77,6 +87,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/unmanedTaskOrderInfoDetailContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
@@ -199,6 +210,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/debugLogTitleTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
|
||||
Reference in New Issue
Block a user