[6.7.2]
[fea] [实时系统 完成任务需要网络]
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(){}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -30,6 +31,7 @@ import com.mogo.och.weaknet.repository.db.repository.EventDb
|
||||
import com.mogo.och.weaknet.repository.RepositoryManager
|
||||
import com.mogo.och.weaknet.repository.exception.DataException
|
||||
import com.mogo.och.weaknet.repository.net.shuttlesaas.ShuttleSaasServiceManager
|
||||
import com.mogo.och.weaknet.util.ShuttleVoiceManager
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -293,6 +295,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() {
|
||||
@@ -302,6 +328,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)
|
||||
|
||||
@@ -164,16 +164,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()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
interface SwtichLineViewCallback{
|
||||
fun showRunningTaskInfo()
|
||||
fun hideLoadingAndshowRunningTaskInfo()
|
||||
fun completeTaskFail()
|
||||
}
|
||||
|
||||
override fun onLeaveStaionSuccess() {
|
||||
@@ -63,6 +64,13 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
}
|
||||
|
||||
override fun onCompleteTaskFail() {
|
||||
super.onCompleteTaskFail()
|
||||
BizLoopManager.runInMainThread{
|
||||
viewCallback?.completeTaskFail()
|
||||
}
|
||||
}
|
||||
|
||||
fun completeTask() {
|
||||
OrderModel.completeTask()
|
||||
}
|
||||
|
||||
@@ -131,6 +131,10 @@ class TaskRunningView: ConstraintLayout, TaskRunningModel.SwtichLineViewCallback
|
||||
showRunningTaskInfo()
|
||||
}
|
||||
|
||||
override fun completeTaskFail() {
|
||||
aciv_task_leave_station_slide_bg.reset()
|
||||
}
|
||||
|
||||
fun showLeaveStationView(){
|
||||
aciv_task_leave_station_slide_bg.visibility = VISIBLE
|
||||
actv_arriver_station.visibility = GONE
|
||||
|
||||
Reference in New Issue
Block a user