[charter]

[3.2.0]
[车门开关失败通知司机端]
This commit is contained in:
yangyakun
2023-05-24 10:37:34 +08:00
parent d64d0d90a7
commit 27d0f6d255
2 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
package com.mogo.och.common.module.manager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
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.GsonUtils
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.biz.constant.OchCommonConst
object LanSocketManager {
private const val TAG = "LanSocket"
fun sendMsgToClient(msg: BaseDPMsg?) {
CallerLogger.d(SceneConstant.M_CHARTER_D + TAG, "sendMsgToClient" + GsonUtils.toJson(msg))
CallerTelematicManager.sendMsgToAllClients(
OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).toByteArray()
)
}
fun sendMsgToServer(msg: BaseDPMsg?) {
CallerLogger.d(SceneConstant.M_CHARTER_D + TAG, "sendMsgToServer" + GsonUtils.toJson(msg))
CallerTelematicManager.sendMsgToServer(
OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).toByteArray()
)
}
}

View File

@@ -4,6 +4,8 @@ import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg
import com.mogo.och.common.module.manager.LanSocketManager
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.voice.VoiceNotice
import io.reactivex.disposables.Disposable
@@ -32,25 +34,36 @@ object LightAirconditionDoorManager {
RxUtils.disposeSubscribe(doorStatusSubscribe)
doorStatusSubscribe = RxUtils.createSubscribe(6000) {
if (LightAirconditionDoorStatusManager.doorStatus.isOpen) {
if(!go2Open) {
if(!go2Open) {// 关门失败
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
)
sendMsg2Server("车门关闭失败")
}
}else{
if(go2Open) {
if(go2Open) {//开门失败
ToastUtils.showShort("车辆系统繁忙,稍后再试试吧~")
VoiceNotice.showNotice(
"车辆系统繁忙,稍后再试试吧~",
AIAssist.LEVEL0
)
sendMsg2Server("车门开启失败")
}
}
}
}
private fun sendMsg2Server(msg:String){
val appConnectMsg = AppConnectMsg(
isViewShow = true,
isPlay = false,
msg = msg
)
LanSocketManager.sendMsgToServer(appConnectMsg)
}
private fun canOpenOrCloseDoor(): String? {
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
return if(location.gnssSpeed<0.01){