diff --git a/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt b/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt index 7f99955966..859578973f 100644 --- a/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt +++ b/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt @@ -85,7 +85,10 @@ object LineManager : CallerBase() { M_LISTENERS.forEach { it.value.onAutopilotIdChange(oldValue,newValue) } - if(!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)&&!AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)){ + if(!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)&& + !AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)&& + !AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode) + ){ val (start, end) = getStations() if(start!=null&&end!=null){ val ochInfo = OchInfo(0, mutableListOf(start.toMogoLocation(), end.toMogoLocation())) diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/OchPhoneUtil.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/OchPhoneUtil.kt new file mode 100644 index 0000000000..8b7fa0e8bc --- /dev/null +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/OchPhoneUtil.kt @@ -0,0 +1,25 @@ +package com.mogo.och.common.module.utils + +import com.mogo.eagle.core.utilcode.util.RegexUtils + +object OchPhoneUtil { + /** + * 获取脱敏手机号 + */ + fun getPhoneWithoutMiddle(phone:String?): String { + if (!RegexUtils.isMobileExact(phone)) { + return phone?:"" + } + var tempPhone = phone + tempPhone?.let { + if (it.length > 8) { + //截取电话号码前三位 + val phoneNumPre = it.substring(0, 3) + //截取电话号码后四位 + val phoneNumFix = it.substring(7) + tempPhone = "$phoneNumPre****$phoneNumFix" + } + } + return tempPhone?:"" + } +} \ No newline at end of file diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt index 7f1bd5f27a..7316f920d0 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt @@ -274,11 +274,11 @@ object OrderModel { ?.observeOn(AndroidSchedulers.mainThread()) ?.subscribe(object : Observer { override fun onSubscribe(d: Disposable) { - d(TAG, "onSubscribe") + d(TAG, "driveToNextStation onSubscribe") } override fun onError(e: Throwable) { - d(TAG, "onError${e.printStackTrace()}") + d(TAG, "driveToNextStation onError${e.printStackTrace()}") if (e is DataException) { e.printStackTrace() } @@ -298,6 +298,7 @@ object OrderModel { } override fun onNext(data: Boolean) { + d(TAG, "driveToNextStation onComplete") if (data) { LineModel.leaveStationSuccess() isArrivedStation = false diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/TicketModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/TicketModel.kt index 51ad5a56f2..c892957e6c 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/TicketModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/TicketModel.kt @@ -24,8 +24,7 @@ import com.mogo.och.common.module.manager.socket.lan.LanSocketManager import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType import com.mogo.och.common.module.manager.socket.lan.bean.WriteOffDetialMsg import com.mogo.och.common.module.manager.socket.lan.bean.WriteOffResultMsg -import com.mogo.och.common.module.network.OchCommonServiceCallback -import com.mogo.och.weaknet.bean.response.WriteOffCountResponse +import com.mogo.och.common.module.utils.OchPhoneUtil import com.mogo.och.weaknet.bean.WriteOffPassenger import com.mogo.och.weaknet.repository.RepositoryManager import com.mogo.och.weaknet.repository.exception.DataException @@ -203,16 +202,16 @@ object TicketModel { */ private fun parseData(code:Int,msg:String,phone: String,orderNo: String){ when (code) { - 1009 -> sendMessage2Driver("车票所选乘车日期非今日", phone,1009,orderNo) - 1005 -> sendMessage2Driver("车辆未登录、或没有任务", phone,1005,orderNo) - 1006 -> sendMessage2Driver("车票路线信息与当前车辆执行任务的路线信息不符合", phone,1006,orderNo) - 1008 -> sendMessage2Driver("车票剩余可用次数为0", phone,99,orderNo) + 1009 -> sendMessage2Driver("乘车日期非今日", phone,1009,orderNo) + 1005 -> sendMessage2Driver("当前无路线任务", phone,1005,orderNo) + 1006 -> sendMessage2Driver("车票非当前路线", phone,1006,orderNo) + 1008 -> sendMessage2Driver("车票无剩余可用次数", phone,99,orderNo) 6001 -> sendMessage2Driver("二维码已过期", phone,6001,orderNo) 6002 -> sendMessage2Driver("同一订单核销间隔时间需大于2分钟", phone,6002,orderNo) - 6003 -> sendMessage2Driver("车票站点信息与当前车辆执行任务的站点信息不符合", phone,6003,orderNo) + 6003 -> sendMessage2Driver("车票非当前站点", phone,6003,orderNo) 6004 -> sendMessage2Driver("车辆未执行任务", phone,6004,orderNo) - 6005 -> sendMessage2Driver("车票站点信息与当前车辆执行任务信息不符合", phone,6005,orderNo) - 1012 -> sendMessage2Driver("当前用户下单路线非当前的车辆所属公司", phone,1012,orderNo) + 6005 -> sendMessage2Driver("车票非当前班次", phone,6005,orderNo) + 1012 -> sendMessage2Driver("车票与车辆所属租户不一致", phone,1012,orderNo) else -> { try { val tempcode=msg.toInt() @@ -233,19 +232,11 @@ object TicketModel { private fun sendMessage2Driver(message:String,phone:String,code:Int,orderNo: String){ // 发送乘客屏 通过蓝牙告知小程序 LanSocketManager.sendMsgToClient(WriteOffResultMsg(code, phone,orderNo, System.currentTimeMillis(),LineManager.lineInfos?.lineId?:0,LineManager.getStations()?.first?.siteId?.toLong()?:0L)) - val failedReason = "验票失败,${message}" + val failedReason = "核销失败,${message}" + // tts ShuttleVoiceManager.writeOffFaile(failedReason) - var tempPhone = phone - tempPhone.let { - if (it.length > 8) { - //截取电话号码前三位 - val phoneNumPre = it.substring(0, 3) - //截取电话号码后四位 - val phoneNumFix = it.substring(7) - tempPhone = "$phoneNumPre****$phoneNumFix" - } - } - val reaseonAndPhone = if(tempPhone.isNullOrEmpty()) { + val tempPhone = OchPhoneUtil.getPhoneWithoutMiddle(phone) + val reaseonAndPhone = if(tempPhone.isEmpty()) { failedReason }else{ "${failedReason};乘客:${tempPhone}" diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/writeoff/impl/WriteOffCacheRepository.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/writeoff/impl/WriteOffCacheRepository.kt index 56c053050d..f88505f3b8 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/writeoff/impl/WriteOffCacheRepository.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/writeoff/impl/WriteOffCacheRepository.kt @@ -136,6 +136,9 @@ class WriteOffCacheRepository : IWriteOffRepository { throw DataException(1009,"车票所选乘车日期非今日") } // 6、校验线路 + if(LineManager.lineInfos==null||LineManager.lineInfos?.lineId==null){ + throw DataException(1005,"车辆未登录、或没有任务") + } if(it.lineId==LineManager.lineInfos?.lineId){ lineId = it.lineId }else{ diff --git a/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/TicketModel.kt b/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/TicketModel.kt index b87d0469e2..bb43cd6c9d 100644 --- a/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/TicketModel.kt +++ b/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/TicketModel.kt @@ -126,13 +126,15 @@ object TicketModel : StateChangeListener { e.printStackTrace() CallerLogger.d(M_BUS_P + TAG, "") // 通知司机屏二维码错误 - val writeOffDetail = WriteOffDetialMsg(code = 3001, msg = "参数错误:${payload}") + val writeOffDetail = WriteOffDetialMsg(code = 3001, msg = "出示错误二维码") + OchChainLogManager.writeChainLogWriteOff("核销失败","二维码错误+参数错误:${payload}") CallerLogger.d(M_BUS_P + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(writeOffDetail)) LanSocketManager.sendMsgToServer(writeOffDetail) } }else{ // 通知司机屏二维码错误 - val writeOffDetail = WriteOffDetialMsg(code = 3001, msg = "参数错误:${payload}") + val writeOffDetail = WriteOffDetialMsg(code = 3001, msg = "出示错误二维码") + OchChainLogManager.writeChainLogWriteOff("核销失败","二维码错误+参数错误:${payload}") CallerLogger.d(M_BUS_P + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(writeOffDetail)) LanSocketManager.sendMsgToServer(writeOffDetail) } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/rodedata/OchAutomaticExplorationView.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/rodedata/OchAutomaticExplorationView.kt index 13e9127b74..e96fe8fe32 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/rodedata/OchAutomaticExplorationView.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/rodedata/OchAutomaticExplorationView.kt @@ -9,6 +9,9 @@ import com.mogo.och.data.taxi.TaxiOrderStatusEnum import com.mogo.och.unmanned.taxi.utils.order.OrderListener import com.mogo.och.unmanned.taxi.utils.order.OrderModel +/** + * 自动探查 + */ class OchAutomaticExplorationView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt index 28403aae59..fb88a7f362 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/task/itinerarycurrent/ItineraryCurrentView.kt @@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.hmi.ui.widget.ItinerarySummaryDialog import com.mogo.eagle.core.network.utils.GsonUtil import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i import com.mogo.eagle.core.utilcode.util.ClickUtils @@ -29,6 +30,7 @@ import com.mogo.och.common.module.map.ICommonNaviChangedCallback import com.mogo.och.common.module.map.MapMakerManager import com.mogo.och.common.module.utils.DateTimeUtil import com.mogo.och.common.module.utils.FlowBus +import com.mogo.och.common.module.utils.OchPhoneUtil import com.mogo.och.common.module.utils.ResourcesUtils import com.mogo.och.common.module.voice.VoiceNotice import com.mogo.och.common.module.wigets.CommonSlideView @@ -50,28 +52,55 @@ import com.mogo.och.unmanned.taxi.ui.task.TaskWithOrderUIState import com.mogo.och.unmanned.taxi.ui.task.TaxiTaskModel import com.mogo.och.unmanned.taxi.ui.task.cancleorder.CancleOrderView import com.mogo.och.unmanned.taxi.utils.TaskUtils +//演练单标识 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_type_exercise -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_type_order +// 距离目的地距离和剩余时间 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_distance_end +// 完成服务 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_end_order -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_order_phone +// 跳过乘客端验证 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_submit_task -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.cancelOrder +// 取消虚拟单 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.cancelTask +// 开始服务 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.commonSlideViewStartServer + + import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.gourp_order -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.group_itinerary_info -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.include_empty -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.naviToEnd -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.naviToStart -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.prepareTaskCountdownTv +// 前往出车点、前往送架、等待乘客、前往接驾 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.taskStatus -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.endStationName -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.startStationName +// 用户手机号 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.actv_order_phone +// 用户人数 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.orderPhoneAndNum +// 运营单标识 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.aciv_task_type_order +// 取消订单 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.cancelOrder +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.currentTaskStation + +// 展示站点信息 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.group_itinerary_info + +// 没有任务的情况下展示的 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.include_empty +// 导航到终点 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.naviToEnd +// 导航到起点 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.naviToStart +// 拉取任务倒计时 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.prepareTaskCountdownTv +// 终点名称 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.endStationName +// 起始站点名称 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.startStationName +// 途径点展示 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.pathwayPoint -import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.trajectoryType +// 途径站点标识 import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.v_bg_route_point_station_name +// 自主算路标识 +import kotlinx.android.synthetic.main.unmanned_itinerary_current.view.trajectoryType + import kotlinx.coroutines.flow.map class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineViewCallback, @@ -117,9 +146,6 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi viewModel?.uiStateFlow?.map { it.taskWithOrderUIState }?.collect { taskAndOrderUiState -> d(TAG, "uiStateFlow-initViewModelObserver: $taskAndOrderUiState") when (taskAndOrderUiState) { - is TaskWithOrderUIState.Init -> { - } - // 开始接单后 需要将车开到最近的一个站点就位,然后才能开启 无人化 流程 is TaskWithOrderUIState.TaskDriveToNearestStationTask -> { if (taskAndOrderUiState.driveToNearestStationTask != null) { @@ -163,13 +189,100 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } } + // 1、无订单 无任务 + // 2、标定单 + // 3、虚拟单 + // 4、运营单 + // 5、倒计时获取虚拟任务 + + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(ItineraryCurrentModel::class.java) + } + viewModel?.setDistanceCallback(this) + initOnClickListener() + initTaskDebugViewListener() + initViewModelObserver() + showEmptyView() + } + + private fun initOnClickListener() { + CallerLogger.d(TAG,"initOnClickListener") + naviToStart.setOnClickListener(this) + naviToEnd.setOnClickListener(this) + cancelTask.setOnClickListener(this) + + cancelOrder.setOnClickListener(this) + taskStatus.setOnClickListener(this) + commonSlideViewStartServer.setSlideListener(object :CommonSlideView.SlideListener{ + override fun slideEnd() { + d(TAG, taskStatus.text.toString()) + startOrEndService() + } + }) + actv_submit_task.onClick { + startOrEndService() + } + actv_end_order.onClick { + startOrEndService() + } + } + + override fun onClick(v: View?) { + if (!ClickUtils.isFastClick()) { + i(TAG, "view点击过快") + return + } + when (v?.id) { + + cancelOrder.id -> { + val currentWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() + if (currentWithOrder?.order != null) { + context?.let { + CancleOrderView.showDialog(it) + } + } + } + + naviToStart.id, + naviToEnd.id -> { + showNaviToEndStationFragment() + } + cancelTask.id -> { + val builder = CommonDialogStatus.Builder() + val closeLineConfirmDialog = builder + .title(ResourcesUtils.getString(R.string.common_dialog_title)) + .tips(ResourcesUtils.getString(R.string.taxi_dialog_cancle_task)) + .confirmStr(ResourcesUtils.getString(R.string.common_dialog_confirm)) + .cancelStr(ResourcesUtils.getString(R.string.common_dialog_cancel)) + .status(CommonDialogStatus.Status.ask) + .build(context) + closeLineConfirmDialog.setClickListener(object : CommonDialogStatus.ClickListener { + override fun confirm() { + viewModel?.cancleTask() + } + + override fun cancel() { + closeLineConfirmDialog.dismiss() + } + }) + closeLineConfirmDialog.show() + } + } + } + + /** * 更新拉取任务倒计时 */ private fun updatePrepareTaskDelayUI(millisInFuture: Long, isStart: Boolean) { + CallerLogger.d(TAG,"updatePrepareTaskDelayUI") DebugView.printInfoMsg("距离任务获取还有 ${DateTimeUtil.second2MMSS(millisInFuture / 1000)}") if (!isStart) { prepareTaskCountdownTv.visibility = View.GONE + currentTaskStation.visibility = View.GONE mPrepareTasCountDownTimer?.cancel() mPrepareTasCountDownTimer = null return @@ -177,31 +290,37 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi if (mPrepareTasCountDownTimer != null) { prepareTaskCountdownTv.visibility = View.GONE + currentTaskStation.visibility = View.GONE mPrepareTasCountDownTimer?.cancel() mPrepareTasCountDownTimer = null } mPrepareTasCountDownTimer = object : CountDownTimer(millisInFuture, 1000L) {// 倒计时后开启自驾 - override fun onTick(millisUntilFinished: Long) { - DebugView.printInfoMsg("距离任务获取还有 ${DateTimeUtil.second2MMSS(millisUntilFinished / 1000)}") - // 倒计时 - UiThreadHandler.post { - prepareTaskCountdownTv.visibility = View.VISIBLE - prepareTaskCountdownTv.text = - "距离任务获取还有 ${DateTimeUtil.second2MMSS(millisUntilFinished / 1000)}" + override fun onTick(millisUntilFinished: Long) { + DebugView.printInfoMsg("距离任务获取还有 ${DateTimeUtil.second2MMSS(millisUntilFinished / 1000)}") + // 倒计时 + UiThreadHandler.post { + prepareTaskCountdownTv.visibility = View.VISIBLE + prepareTaskCountdownTv.text = "距离任务获取还有 ${DateTimeUtil.second2MMSS(millisUntilFinished / 1000)}" + val taskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() + if(taskWithOrder?.currentStatus == TaskStatusEnum.CompleteTask.code){ + currentTaskStation.visibility = View.VISIBLE + currentTaskStation.text = taskWithOrder.endSite?.siteName?:"" } } - - override fun onFinish() { - //倒计时结束了... - UiThreadHandler.post { - prepareTaskCountdownTv.visibility = View.INVISIBLE - } - mPrepareTasCountDownTimer?.cancel() - } } + override fun onFinish() { + //倒计时结束了... + UiThreadHandler.post { + prepareTaskCountdownTv.visibility = View.INVISIBLE + currentTaskStation.visibility = View.INVISIBLE + } + mPrepareTasCountDownTimer?.cancel() + } + } + mPrepareTasCountDownTimer?.start() } @@ -209,6 +328,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi * 更新当前任务和订单信息 */ private fun updateViewByCurrentTaskWithOrder(taskAndOrder: QueryCurrentTaskRespBean.Result?) { + CallerLogger.d(TAG,"updateViewByCurrentTaskWithOrder") if (taskAndOrder == null) return /** * 根据任务类型判断任务显示, @@ -263,6 +383,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi // 第一个特殊任务 也是虚拟任务 private fun updateViewByDriveToNearestStationTask(driveToNearestStationTask: StartServiceRespBean.Result?) { + CallerLogger.d(TAG,"updateViewByDriveToNearestStationTask 标定单") if (driveToNearestStationTask == null) return initContainerView(true) // DriverToNearestStationTask 任务更新 @@ -292,11 +413,13 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun showEmptyView() { + CallerLogger.d(TAG,"showEmptyView") gourp_order.visibility = GONE aciv_task_type_exercise.visibility = GONE group_itinerary_info.visibility = GONE include_empty.visibility = VISIBLE prepareTaskCountdownTv.visibility = GONE + currentTaskStation.visibility = View.GONE cancelTask.visibility = View.GONE actv_end_order.visibility = GONE @@ -305,28 +428,8 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } - private fun initOnClickListener() { - naviToStart.setOnClickListener(this) - naviToEnd.setOnClickListener(this) - cancelTask.setOnClickListener(this) - - cancelOrder.setOnClickListener(this) - taskStatus.setOnClickListener(this) - commonSlideViewStartServer.setSlideListener(object :CommonSlideView.SlideListener{ - override fun slideEnd() { - d(TAG, taskStatus.text.toString()) - startOrEndService() - } - }) - actv_submit_task.onClick { - startOrEndService() - } - actv_end_order.onClick { - startOrEndService() - } - } - private fun initTaskDebugViewListener() { + CallerLogger.d(TAG,"initTaskDebugViewListener") fragment?.let { fr-> aciv_task_type_exercise.setOnLongClickListener { FlowBus.with(TaxiDriverEventConst.TaxiFragmentEvent.EVENT_TYPE_SHOW_DEBUG_VIEW) @@ -342,6 +445,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun startOrEndService() { + CallerLogger.d(TAG,"startOrEndService") val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() if (currentTaskWithOrder?.order == null) return val order = currentTaskWithOrder.order @@ -364,6 +468,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun closeOrderDialog() { + CallerLogger.d(TAG,"closeOrderDialog") val builder = CommonDialogStatus.Builder() val closeOrderDialog = builder .title(ResourcesUtils.getString(R.string.dialog_order_close_title)) @@ -384,67 +489,13 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } - override fun onAttachedToWindow() { - super.onAttachedToWindow() - viewModel = findViewTreeViewModelStoreOwner()?.let { - ViewModelProvider(it).get(ItineraryCurrentModel::class.java) - } - viewModel?.setDistanceCallback(this) - initOnClickListener() - showEmptyView() - initTaskDebugViewListener() - initViewModelObserver() - } - - override fun onClick(v: View?) { - if (!ClickUtils.isFastClick()) { - i(TAG, "view点击过快") - return - } - when (v?.id) { - - cancelOrder.id -> { - val currentWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() - if (currentWithOrder?.order != null) { - context?.let { - CancleOrderView.showDialog(it) - } - } - } - - naviToStart.id, - naviToEnd.id -> { - showNaviToEndStationFragment() - } - cancelTask.id -> { - val builder = CommonDialogStatus.Builder() - val closeLineConfirmDialog = builder - .title(ResourcesUtils.getString(R.string.common_dialog_title)) - .tips(ResourcesUtils.getString(R.string.taxi_dialog_cancle_task)) - .confirmStr(ResourcesUtils.getString(R.string.common_dialog_confirm)) - .cancelStr(ResourcesUtils.getString(R.string.common_dialog_cancel)) - .status(CommonDialogStatus.Status.ask) - .build(context) - closeLineConfirmDialog.setClickListener(object : CommonDialogStatus.ClickListener { - override fun confirm() { - viewModel?.cancleTask() - } - - override fun cancel() { - closeLineConfirmDialog.dismiss() - } - }) - closeLineConfirmDialog.show() - } - } - } - /** * 显示/隐藏 前往任务目的地的导航 * * @param isShow */ private fun showNaviToEndStationFragment() { + CallerLogger.d(TAG,"showNaviToEndStationFragment") fragment?.let { TaxiTaskModel.startNaviToEndStation(true); } @@ -456,6 +507,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi * @param hasCurrentTask */ private fun initContainerView(hasCurrentTask: Boolean) { + CallerLogger.d(TAG,"initContainerView") d( TAG, "hasCurrentTask = $hasCurrentTask" @@ -463,11 +515,13 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi if (hasCurrentTask) { include_empty.visibility = View.GONE prepareTaskCountdownTv.visibility = View.GONE + currentTaskStation.visibility = View.GONE } else { // 空页面 include_empty.visibility = View.VISIBLE // 倒计时 prepareTaskCountdownTv.visibility = View.GONE + currentTaskStation.visibility = View.GONE // 行程信息 group_itinerary_info.visibility = View.GONE // 订单信息 @@ -489,10 +543,12 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun removeAllMapMarker() { + CallerLogger.d(TAG,"removeAllMapMarker") MapMakerManager.removeAllMapMarkerByOwner(TYPE_MARKER_TAXI_ORDER) } private fun updateNextTaskFragment(result: QueryCurrentTaskRespBean.Result?) { + CallerLogger.d(TAG,"updateNextTaskFragment") fragment?.let { FlowBus.with(TaxiDriverEventConst.TabFragmentEvent.EVENT_TYPE_TASK_WITH_ORDER_CHANGED) .post(it.lifecycleScope, result) @@ -514,6 +570,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun updateOrderUI(order: OrderDetail) { + CallerLogger.d(TAG,"updateOrderUI") gourp_order.visibility = View.VISIBLE cancelOrder.visibility = if (order.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.code ) View.GONE else View.VISIBLE @@ -538,17 +595,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi order.passengerSize ) - var tempPhone = order.bookingUserPhone - tempPhone.let { - if (it.length > 8) { - //截取电话号码前三位 - val phoneNumPre = it.substring(0, 3) - //截取电话号码后四位 - val phoneNumFix = it.substring(7) - tempPhone = "$phoneNumPre****$phoneNumFix" - } - } - actv_order_phone.text = tempPhone + actv_order_phone.text = OchPhoneUtil.getPhoneWithoutMiddle(order.bookingUserPhone) orderPhoneAndNum.text = "${ order.passengerSize}人" @@ -629,7 +676,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi //展示虚拟订单 private fun updateVirtualTaskUI(taskAndOrder: QueryCurrentTaskRespBean.Result?) { - + CallerLogger.d(TAG,"updateVirtualTaskUI") if (taskAndOrder == null) return val startSite = taskAndOrder.startSite // 起点 @@ -642,6 +689,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi include_empty.visibility = View.GONE // 倒计时 prepareTaskCountdownTv.visibility = View.GONE + currentTaskStation.visibility = View.GONE // 行程信息 group_itinerary_info.visibility = View.VISIBLE // 订单信息 @@ -676,6 +724,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun updatePathwayPoint(taskType: Int, endSiteName: String?) { + CallerLogger.d(TAG,"updatePathwayPoint") if (TextUtils.isEmpty(endSiteName)) return pathwayPoint.visibility = if (taskType == TaskTypeEnum.ToOrderStartTask.code) View.VISIBLE else View.GONE @@ -683,6 +732,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun updateMapMarkers(taskAndOrder: QueryCurrentTaskRespBean.Result?) { + CallerLogger.d(TAG,"updateMapMarkers") if (taskAndOrder?.startSite != null && taskAndOrder.endSite != null ) { @@ -755,6 +805,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi isAdd: Boolean, uuid: String, lat: Double, lon: Double, resourceId: Int ) { + CallerLogger.d(TAG,"setOrRemoveMapMaker") if (isAdd) { MapMakerManager.addMapMaker(TYPE_MARKER_TAXI_ORDER, uuid, lat, lon, resourceId) } else { @@ -766,6 +817,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi * 根据任务状态计算剩余历程和时间 */ private fun updateRemainDistanceAndTime(isVoicePlay: Boolean) { + CallerLogger.d(TAG,"updateRemainDistanceAndTime") val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() ?: return d(TAG, "updateRemainDistanceAndTime ${currentTaskWithOrder.currentStatus}") if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code) { @@ -786,6 +838,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun startNaviToStation(isVoicePlay: Boolean, stationLat: Double, stationLng: Double) { + CallerLogger.d(TAG,"startNaviToStation") AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi() val gcJ02Location = OchLocationManager.getGCJ02Location() val mCurLatitude = gcJ02Location.latitude @@ -799,6 +852,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun showDialog(){ + CallerLogger.d(TAG,"showDialog") if(dialog==null&&context!=null){ } @@ -816,6 +870,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun dismissDialog(){ + CallerLogger.d(TAG,"dismissDialog") dialog?.let { if(it.isShowing){ it.dismiss() @@ -825,6 +880,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } private fun hideNaviBtns() { + CallerLogger.d(TAG,"hideNaviBtns") naviToStart.visibility = View.GONE naviToEnd.visibility = View.GONE AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi() @@ -838,10 +894,12 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } override fun onCurrentNaviDistAndTimeChanged(meters: Int, timeInSecond: Long) { + CallerLogger.d(TAG,"onCurrentNaviDistAndTimeChanged") actv_distance_end.text = TaskUtils.getCurrentTaskDistance(meters.toLong())+" "+TaskUtils.getCurrentTaskTime(timeInSecond) } override fun reInitNaviAmap(isPlay: Boolean, isRestart: Boolean) { + CallerLogger.d(TAG,"reInitNaviAmap") d(TAG, "isPlay = $isPlay, isRestart=$isRestart") if (!isRestart) { fragment?.let { @@ -875,6 +933,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } fun onNaviToEndStationByAMap(isShow: Boolean) { + CallerLogger.d(TAG,"onNaviToEndStationByAMap") val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder() ?: return fragment?.let { if (currentTaskWithOrder.currentStatus == TaskStatusEnum.StartTask.code) @@ -894,6 +953,7 @@ class ItineraryCurrentView: ConstraintLayout, ItineraryCurrentModel.SwtichLineVi } override fun onStartTaskFail() { + CallerLogger.d(TAG,"onStartTaskFail") commonSlideViewStartServer.reset() } diff --git a/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml index 53c8514f83..70044e1a21 100644 --- a/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml +++ b/OCH/taxi/unmanned-driver/src/main/res/layout/unmanned_itinerary_current.xml @@ -25,8 +25,8 @@ app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="@dimen/dp_53" android:src="@drawable/taxi_task_close" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> + android:layout_width="@dimen/dp_46" + android:layout_height="@dimen/dp_46"/> + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt index 9ac91e447f..10504d899b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt @@ -1861,6 +1861,9 @@ class TravelRealityView @JvmOverloads constructor( clearSmallSites() } else { UiThreadHandler.post { + smallSiteMarkerList?.forEach { + it.destroy() + } smallSiteMarkerList = mAMap?.addMarkers(markerOptionsList, false) } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index 9eec609a5e..e189dc8e58 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -593,7 +593,7 @@ enum class EventTypeEnumNew( //核销异常 TYPE_ABNORMAL_VERIFICATION( "ABNORMAL_VERIFICATION", - "验票失败", + "核销失败", "%s", R.drawable.icon_warning_take_over, "%s", diff --git a/gradle.properties b/gradle.properties index 14b70b5332..2759543d68 100644 --- a/gradle.properties +++ b/gradle.properties @@ -64,21 +64,21 @@ bytex.ASM_API=ASM7 LOGLIB_VERSION=1.10.18 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.7.58 +MOGO_NETWORK_VERSION=1.4.7.59 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.7.58 +MOGO_PASSPORT_VERSION=1.4.7.59 # 长链接 -MOGO_SOCKET_VERSION=1.4.7.58 +MOGO_SOCKET_VERSION=1.4.7.59 # 数据采集 -MOGO_REALTIME_VERSION=1.4.7.58 +MOGO_REALTIME_VERSION=1.4.7.59 # 直播推流 -MOGO_LIVE_VERSION=1.4.7.58 +MOGO_LIVE_VERSION=1.4.7.59 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.7.58 +MOGO_TRAFFICLIVE_VERSION=1.4.7.59 # 定位服务 -MOGO_LOCATION_VERSION=1.4.7.58 +MOGO_LOCATION_VERSION=1.4.7.59 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.7.58 +MOGO_TELEMATIC_VERSION=1.4.7.59 # 动态换肤SDK MOGO_SKIN_VERSION=1.4.7.49.19 ######## MogoAiCloudSDK Version ########