diff --git a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt
index 57668063df..66e15fcea8 100644
--- a/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt
+++ b/OCH/mogo-och-charter-passenger/src/m1/java/com/mogo/och/bus/passenger/presenter/BusPassengerPresenter.kt
@@ -20,12 +20,16 @@ import com.mogo.och.bus.passenger.model.CharterPassengerModel
import com.mogo.och.bus.passenger.model.IOrderStatusChangeListener
import com.mogo.och.bus.passenger.model.OrderStatusEnum
import com.mogo.och.bus.passenger.ui.MainFragment
+import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
+import com.mogo.och.common.module.bean.dpmsg.DPCommonOperationMsg
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
+import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.manager.OCHM1LightAirconditionDoorStatusManager
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.common.module.utils.NumberFormatUtil
+import com.mogo.och.common.module.utils.SoundPoolHelper
import io.reactivex.disposables.Disposable
import java.util.*
@@ -86,21 +90,40 @@ class BusPassengerPresenter(view: MainFragment?) :
if (type == OchCommonConst.BUSINESS_STRING) {
val msg = GsonUtils.fromJson(
String(byteArray),
- ChangeDestMsg::class.java
- ) as ChangeDestMsg
- if (msg.type == DPMsgType.TYPE_OPEN_CLOSE_DOOR.type) {
- val doorStatus = OCHM1LightAirconditionDoorStatusManager.doorStatus
- if(doorStatus.isOpen){
- closeDoor()
- }else{
- openDoor()
+ BaseDPMsg::class.java
+ ) as BaseDPMsg
+ when (msg.type) {
+ DPMsgType.TYPE_OPEN_CLOSE_DOOR.type -> {
+ val doorStatus = OCHM1LightAirconditionDoorStatusManager.doorStatus
+ if(doorStatus.isOpen){
+ closeDoor()
+ }else{
+ openDoor()
+ }
}
+ DPMsgType.TYPE_COMMON.type -> {
+ val msg = GsonUtils.fromJson(
+ String(byteArray),
+ DPCommonOperationMsg::class.java
+ ) as DPCommonOperationMsg
+ pushOperationalToMsgBox(DateTimeUtil.getCurrentTimeStamp(),msg.msg)
+ }
+ else -> {}
}
}
}
}
}
+ fun pushOperationalToMsgBox(time : Long,content : String,type: Int = -1){
+ playDI()
+ OCHSocketMessageManager.pushAppOperationalMsgBox(time, content, type)
+ }
+
+ private fun playDI(){
+ SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(context, R.raw.m1_voice_di)
+ }
+
fun openDoor() {
val canOpenOrCloseDoor = canOpenOrCloseDoor()
if(!canOpenOrCloseDoor.isNullOrEmpty()){
diff --git a/OCH/mogo-och-charter-passenger/src/m1/res/layout/m1_main_fragment.xml b/OCH/mogo-och-charter-passenger/src/m1/res/layout/m1_main_fragment.xml
index 4bc6e8fc23..52c5eeaf30 100644
--- a/OCH/mogo-och-charter-passenger/src/m1/res/layout/m1_main_fragment.xml
+++ b/OCH/mogo-och-charter-passenger/src/m1/res/layout/m1_main_fragment.xml
@@ -37,6 +37,20 @@
app:layout_constraintTop_toTopOf="@+id/mapBizView"
app:layout_constraintBottom_toBottomOf="@+id/mapBizView" />
+
+
+
+
+
+