Merge branch 'refs/heads/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.2_local
# Conflicts: # OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/LineModel.kt # OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/repository/RepositoryManager.kt # OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/taskrunning/TaskRunningModel.kt # OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/taskrunning/TaskRunningView.kt
This commit is contained in:
@@ -140,6 +140,18 @@ class CommonSlideView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun reset(){
|
||||
lottie_bg.setAnimation("slide.json")
|
||||
lottie_bg.playAnimation()
|
||||
draggableButton.setTextColor(context.getColor(R.color.white))
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationX", draggableButton.translationX,
|
||||
0f
|
||||
).apply {
|
||||
duration = 100
|
||||
}.start()
|
||||
}
|
||||
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
|
||||
@@ -27,4 +27,5 @@ public interface IBusLinesCallback {
|
||||
default void onArriveStationSuccess(){}
|
||||
|
||||
default void onCompleteTask(){}
|
||||
default void onCompleteTaskFail(){}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,9 @@ object EventModel : EventDb.EventCallback {
|
||||
}
|
||||
|
||||
private fun checkDbData() {
|
||||
SiteDb.checkData()
|
||||
BizLoopManager.runInIoThread{
|
||||
SiteDb.checkData()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.callback.IBusLinesCallback
|
||||
import com.mogo.och.weaknet.model.OrderModel.isGoingToNextStation
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskSiteDataBean
|
||||
@@ -298,6 +299,30 @@ object LineModel {
|
||||
if (e is DataException) {
|
||||
|
||||
}
|
||||
if (RepositoryManager.supportDb()) {
|
||||
isGoingToNextStation = false
|
||||
|
||||
ThirdDeviceData.endTask()
|
||||
ThirdDeviceData.sendTaskDetailsToClients()
|
||||
ShuttleVoiceManager.endOrderBus()
|
||||
// 取消自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
currentTask = null
|
||||
LineManager.setLineInfo(null)
|
||||
LineManager.setStartAndEndStation(null,null)
|
||||
stationList = mutableListOf()
|
||||
startStationIndex = 0
|
||||
mBusLinesCallbackMap.forEach {
|
||||
it.value.onCompleteTask()
|
||||
}
|
||||
val changeInfo = "taskId:${currentTask?.taskId}--lineInfo:${LineManager.lineInfos}"
|
||||
OchChainLogManager.writeChainLog("结束任务", changeInfo)
|
||||
}else{
|
||||
ToastUtils.showShort("结束任务失败请稍后再试")
|
||||
mBusLinesCallbackMap.forEach {
|
||||
it.value.onCompleteTaskFail()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
@@ -307,6 +332,13 @@ object LineModel {
|
||||
override fun onNext(data: Boolean) {
|
||||
d(TAG, "endTask onNext ${data}")
|
||||
if (data) {
|
||||
isGoingToNextStation = false
|
||||
|
||||
ThirdDeviceData.endTask()
|
||||
ThirdDeviceData.sendTaskDetailsToClients()
|
||||
ShuttleVoiceManager.endOrderBus()
|
||||
// 取消自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
currentTask = null
|
||||
LineManager.setLineInfo(null)
|
||||
LineManager.setStartAndEndStation(null,null)
|
||||
|
||||
@@ -166,16 +166,9 @@ object OrderModel {
|
||||
fun completeTask() {
|
||||
OCHThreadPoolManager.getsInstance().execute {
|
||||
d(M_BUS + TAG, "结束当前路线abortTask")
|
||||
|
||||
isGoingToNextStation = false
|
||||
|
||||
ThirdDeviceData.endTask()
|
||||
LineModel.endTask()
|
||||
ThirdDeviceData.sendTaskDetailsToClients()
|
||||
removeTipRunnables()
|
||||
ShuttleVoiceManager.endOrderBus()
|
||||
// 取消自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
LineModel.endTask()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
@@ -20,7 +21,7 @@ import io.reactivex.Observable
|
||||
|
||||
object RepositoryManager {
|
||||
|
||||
|
||||
private val TAG = "RepositoryManager"
|
||||
private var repository: IRepository?=null
|
||||
get() {
|
||||
if(field==null){
|
||||
@@ -28,22 +29,28 @@ object RepositoryManager {
|
||||
Project.SAAS -> {
|
||||
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
field = WeaknetRepository()
|
||||
CallerLogger.d(TAG,"saas shuttle 支持db")
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
field = WeaknetRepository()
|
||||
CallerLogger.d(TAG,"saas bus 支持db")
|
||||
}
|
||||
}
|
||||
Project.DALI -> {
|
||||
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
field = WeaknetRepository()
|
||||
CallerLogger.d(TAG,"dali shuttle 支持db")
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
field = NormalRepository()
|
||||
CallerLogger.d(TAG,"dali bus 不支持db")
|
||||
}
|
||||
}
|
||||
Project.MOGO -> {
|
||||
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
field = NormalRepository()
|
||||
CallerLogger.d(TAG,"mogo shuttle 不支持db")
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
field = NormalRepository()
|
||||
CallerLogger.d(TAG,"mogo bus 不支持db")
|
||||
}
|
||||
}
|
||||
else->{}
|
||||
@@ -52,33 +59,9 @@ object RepositoryManager {
|
||||
return field
|
||||
}
|
||||
|
||||
init {
|
||||
|
||||
when (ProjectUtils.getProjectType()) {
|
||||
Project.SAAS -> {
|
||||
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
repository = WeaknetRepository()
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
repository = WeaknetRepository()
|
||||
}
|
||||
}
|
||||
Project.DALI -> {
|
||||
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
repository = WeaknetRepository()
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
repository = NormalRepository()
|
||||
}
|
||||
}
|
||||
Project.MOGO -> {
|
||||
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
repository = NormalRepository()
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
repository = NormalRepository()
|
||||
}
|
||||
}
|
||||
else->{}
|
||||
}
|
||||
|
||||
fun release(){
|
||||
CallerLogger.d(TAG,"重置 repository")
|
||||
repository = null
|
||||
}
|
||||
|
||||
fun loadCurrentTaskInfo():Observable<Boolean>?{
|
||||
|
||||
@@ -34,6 +34,7 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
fun showRunningTaskInfo()
|
||||
fun hideLoadingAndshowRunningTaskInfo()
|
||||
fun smoothScrollToPosition(position:Int)
|
||||
fun completeTaskFail()
|
||||
}
|
||||
|
||||
override fun onLeaveStaionSuccess() {
|
||||
@@ -74,6 +75,13 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
}
|
||||
|
||||
override fun onCompleteTaskFail() {
|
||||
super.onCompleteTaskFail()
|
||||
BizLoopManager.runInMainThread{
|
||||
viewCallback?.completeTaskFail()
|
||||
}
|
||||
}
|
||||
|
||||
fun completeTask() {
|
||||
OrderModel.completeTask()
|
||||
}
|
||||
|
||||
@@ -132,6 +132,10 @@ class TaskRunningView: ConstraintLayout, TaskRunningModel.SwtichLineViewCallback
|
||||
showRunningTaskInfo()
|
||||
}
|
||||
|
||||
override fun completeTaskFail() {
|
||||
aciv_task_leave_station_slide_bg.reset()
|
||||
}
|
||||
|
||||
override fun smoothScrollToPosition(position: Int) {
|
||||
try {
|
||||
rl_running_task_station_list.smoothScrollToPosition(position)
|
||||
|
||||
Reference in New Issue
Block a user