Merge branch 'dev_robobus-d_240116_6.2.8' into 'master'
Dev robobus d 240116 6.2.8 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!858
This commit is contained in:
@@ -6,8 +6,11 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.och.bus.passenger.passenger.ui.widget.M2StatusBarView;
|
||||
import com.mogo.och.bus.passenger.ui.BusPStatusBarView;
|
||||
|
||||
/**
|
||||
@@ -17,13 +20,18 @@ import com.mogo.och.bus.passenger.ui.BusPStatusBarView;
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
|
||||
public class BusPStatusViewManager implements IStatusViewLayout {
|
||||
public class StatusViewManager implements IStatusViewLayout {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getStatusView(Context context) {
|
||||
return new BusPStatusBarView(context);
|
||||
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
|
||||
return new M2StatusBarView(context);
|
||||
} else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
return new BusPStatusBarView(context);
|
||||
}
|
||||
return new BusPStatusBarView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.och.bus.passenger.passenger.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.och.bus.passenger.passenger.ui.widget.M2StatusBarView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-06
|
||||
* <p>
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
|
||||
public class M2StatusViewManager implements IStatusViewLayout {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getStatusView(Context context) {
|
||||
return new M2StatusBarView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
<!--魔方连接状态 蓝牙-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2BlueToothView
|
||||
<com.mogo.och.bus.passenger.passenger.ui.widget.M2BlueToothView
|
||||
android:id="@+id/blueToothView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -12,5 +12,7 @@ enum class DPMsgType(val type: Int) {
|
||||
TYPE_TASK_DETAILS(4), //路线任务详情
|
||||
TYPE_LOGIN_STATUS(5), //login status
|
||||
TYPE_ARRIVEDEST_STATUS(6), //到站通知 status
|
||||
TYPE_ORDER_CLOSED_BY_M1_STATUS(7) //到站通知 status
|
||||
TYPE_ORDER_CLOSED_BY_M1_STATUS(7), //到站通知 status
|
||||
TYPE_WRITEOFF_INFO(8), //核销信息
|
||||
TYPE_WRITEOFF_DEVICES_INFO(9) //核销设备信息
|
||||
}
|
||||
@@ -83,3 +83,17 @@ data class AppConnectMsg(
|
||||
data class TaskDetailsMsg(
|
||||
var msg: String?,
|
||||
): BaseDPMsg(DPMsgType.TYPE_TASK_DETAILS.type)
|
||||
|
||||
data class WriteOffMsg(
|
||||
val isScuccess: Boolean?,
|
||||
val phone: String?,
|
||||
val ticketSize: Int?,
|
||||
val ticketName:String?,
|
||||
val failedReason:String?,
|
||||
val orderNo: String?
|
||||
): BaseDPMsg(DPMsgType.TYPE_WRITEOFF_INFO.type)
|
||||
|
||||
data class WriteOffDevicesMsg(
|
||||
val isConnectScanner: Boolean?,
|
||||
val reason:String?
|
||||
): BaseDPMsg(DPMsgType.TYPE_WRITEOFF_DEVICES_INFO.type)
|
||||
|
||||
@@ -14,5 +14,8 @@ public interface OchCommonServiceCallback< T > {
|
||||
|
||||
default void onError() {
|
||||
|
||||
}
|
||||
default void onError(String msg) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class OchCommonSubscribeImpl<T : BaseData>(
|
||||
override fun onError(e: Throwable) {
|
||||
super.onError(e)
|
||||
CallerLogger.e("$flavorTag$TAG", "$apiName: onError() ${e.message}")
|
||||
callback?.onError()
|
||||
callback?.onError("$apiName: onError() ${e.message}")
|
||||
}
|
||||
|
||||
override fun onError(message: String, code: Int) {
|
||||
|
||||
@@ -40,9 +40,7 @@ object MediaDataSourceManager {
|
||||
|
||||
private var mRetryCount = 0
|
||||
|
||||
private val mNetworkService: IMediaNetworkApi =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getEagleMisUrl())
|
||||
.create(IMediaNetworkApi::class.java)
|
||||
private var mNetworkService: IMediaNetworkApi?=null
|
||||
|
||||
private var driverSnCache = ""
|
||||
|
||||
@@ -78,6 +76,7 @@ object MediaDataSourceManager {
|
||||
val isSassProject = isSassProject()
|
||||
MediaPlayLogger.printInfoLog("init, 初始化环境 isSassProject=$isSassProject")
|
||||
if (isSassProject) {
|
||||
mNetworkService = MoGoRetrofitFactory.getInstance(OchCommonConst.getEagleMisUrl()).create(IMediaNetworkApi::class.java)
|
||||
MediaPlayLogger.printInfoLog("init, 开始检查后台配置数据")
|
||||
startGetMediaDataSourceLoop()
|
||||
} else {
|
||||
@@ -183,10 +182,10 @@ object MediaDataSourceManager {
|
||||
|
||||
private fun getMediaDataFromMis(callback: OchCommonServiceCallback<MediaDataResp>) {
|
||||
MediaPlayLogger.printInfoLog("getMediaDataFromMis:准备发送请求,driverSn=$driverSn")
|
||||
mNetworkService.queryMediaDataFromMis(
|
||||
sn = driverSn,
|
||||
screenType = "2",
|
||||
).transformTry().subscribe(OchCommonSubscribeImpl(context, callback, "getMediaDataFromMis"))
|
||||
mNetworkService
|
||||
?.queryMediaDataFromMis(sn = driverSn, screenType = "2",)
|
||||
?.transformTry()
|
||||
?.subscribe(OchCommonSubscribeImpl(context, callback, "getMediaDataFromMis"))
|
||||
}
|
||||
|
||||
private fun getMediaDataFromLocalConfig(): List<MediaItem> {
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
package com.mogo.och.common.module.wigets.media
|
||||
|
||||
import android.Manifest
|
||||
import android.app.ActivityOptions
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.Display
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
|
||||
class MediaPlayerActivity : AppCompatActivity() {
|
||||
|
||||
private val TAG = "MediaPlayerActivity"
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_video_player)
|
||||
@@ -15,4 +29,74 @@ class MediaPlayerActivity : AppCompatActivity() {
|
||||
.commitAllowingStateLoss()
|
||||
BarUtils.hideStatusBarAndSticky(this.window)
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
i(SceneConstant.M_BUS_P + TAG, "onResume")
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
i(SceneConstant.M_BUS_P + TAG, "onResume")
|
||||
checkPermissionSelf()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
i(SceneConstant.M_BUS_P + TAG, "onResume")
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
i(SceneConstant.M_BUS_P + TAG, "onResume")
|
||||
}
|
||||
|
||||
fun checkPermissionSelf(){
|
||||
i(SceneConstant.M_BUS_P + TAG, "checkPermissionSelf")
|
||||
val isAllGranted: Boolean = checkPermissionAllGranted(
|
||||
arrayOf<String>(
|
||||
Manifest.permission.RECORD_AUDIO, // Manifest.permission.CAMERA,
|
||||
Manifest.permission.BLUETOOTH,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.ACCESS_LOCATION_EXTRA_COMMANDS,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
)
|
||||
)
|
||||
if (isAllGranted&&Settings.canDrawOverlays(this)) {
|
||||
restartActivity()
|
||||
return
|
||||
}
|
||||
RxUtils.createSubscribe {
|
||||
checkPermissionSelf()
|
||||
}
|
||||
}
|
||||
|
||||
fun restartActivity(){
|
||||
val activityList = ActivityUtils.getActivityList()
|
||||
activityList.forEach {
|
||||
if (it is MainLauncherActivity) {
|
||||
i(SceneConstant.M_BUS_P + TAG, "restartActivity")
|
||||
val options = ActivityOptions.makeBasic()
|
||||
options.launchDisplayId = Display.INVALID_DISPLAY
|
||||
val intent = Intent(this, MainLauncherActivity::class.java)
|
||||
startActivity(intent, options.toBundle())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkPermissionAllGranted(permissions: Array<String>): Boolean {
|
||||
for (permission in permissions) {
|
||||
if (ContextCompat.checkSelfPermission(
|
||||
this,
|
||||
permission
|
||||
) != PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
// 只要有一个权限没有被授予, 则直接返回 false
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class MediaPlayerFragment :
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
imageVideoRotationView.setPause()
|
||||
//imageVideoRotationView.setPause()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -24,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = BusConst.PATH)
|
||||
public class BusProvider implements IMogoOCH {
|
||||
public class BusProvider implements IMoGoFunctionProvider {
|
||||
|
||||
private static final String TAG = "BusProvider";
|
||||
|
||||
@@ -32,14 +33,6 @@ public class BusProvider implements IMogoOCH {
|
||||
private int containerId;
|
||||
private FragmentActivity activity;
|
||||
|
||||
/**
|
||||
* 进入鹰眼模式,设置手势缩放地图失效
|
||||
*/
|
||||
private void stepIntoVrMode() {
|
||||
CallerLogger.d(M_BUS + TAG, "进入vr模式");
|
||||
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
@@ -71,11 +64,6 @@ public class BusProvider implements IMogoOCH {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCoverage(FragmentActivity activity, int containerId) {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFunctionName() {
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.mogo.och.bus;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/15
|
||||
*
|
||||
* 网约车抽象接口
|
||||
*/
|
||||
interface IMogoOCH extends IMoGoFunctionProvider {
|
||||
|
||||
/**
|
||||
* 初始化网约车容器
|
||||
*
|
||||
* @param activity
|
||||
* @param containerId 容器ID
|
||||
*/
|
||||
void createCoverage(FragmentActivity activity, @IdRes int containerId);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import java.io.Serializable;
|
||||
public class WriteOffPassenger implements Serializable {
|
||||
public String phone;
|
||||
public String orderNo;
|
||||
public String ticketName;
|
||||
public int passengerSize;
|
||||
public long writeOffTime;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,12 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg;
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
@@ -33,6 +38,8 @@ import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType;
|
||||
import com.mogo.och.common.module.bean.dpmsg.LoginCacheStatus;
|
||||
import com.mogo.och.common.module.bean.dpmsg.TaskDetailsMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffDevicesMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffMsg;
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.data.SystemMsg;
|
||||
@@ -177,9 +184,10 @@ public class OrderModel {
|
||||
OCHSocketMessageManager.msgMonitorType,
|
||||
mMogoOnMessageListener);
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客
|
||||
OCHSocketMessageManager.msgWriteOffPassengerType,
|
||||
mWriteOffPassengeOnMessageListener);
|
||||
// OCHSocketMessageManager.INSTANCE.registerSocketMessageListener(//监听核销乘客
|
||||
// OCHSocketMessageManager.msgWriteOffPassengerType,
|
||||
// mWriteOffPassengeOnMessageListener);
|
||||
TicketModel.INSTANCE.load();
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
|
||||
|
||||
@@ -241,8 +249,10 @@ public class OrderModel {
|
||||
if (OchCommonConst.BUSINESS_STRING == type){
|
||||
CallerLogger.d(M_BUS + BaseDPMsg.TAG,new String(byteArray));
|
||||
BaseDPMsg msg = GsonUtils.fromJson(new String(byteArray),BaseDPMsg.class);
|
||||
if (msg!=null && msg.getType() == DPMsgType.TYPE_TASK_DETAILS.getType()){
|
||||
sendTaskDetailsToClients();
|
||||
if(msg!=null) {
|
||||
if (msg.getType() == DPMsgType.TYPE_TASK_DETAILS.getType()) {
|
||||
sendTaskDetailsToClients();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,23 +289,23 @@ public class OrderModel {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoOnMessageListener<WriteOffPassenger> mWriteOffPassengeOnMessageListener =
|
||||
new IMogoOnMessageListener<WriteOffPassenger>() {
|
||||
@Override
|
||||
public Class<WriteOffPassenger> target() {
|
||||
return WriteOffPassenger.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(WriteOffPassenger passenger) {
|
||||
//进行播报
|
||||
CallerLogger.i(M_BUS + TAG,"passenger = "+ GsonUtil.jsonFromObject(passenger));
|
||||
if (passenger != null && passenger.passengerSize == 0) return;
|
||||
if (mPassengerCallback != null){
|
||||
mPassengerCallback.playPassenger(passenger);
|
||||
}
|
||||
}
|
||||
};
|
||||
// private final IMogoOnMessageListener<WriteOffPassenger> mWriteOffPassengeOnMessageListener =
|
||||
// new IMogoOnMessageListener<WriteOffPassenger>() {
|
||||
// @Override
|
||||
// public Class<WriteOffPassenger> target() {
|
||||
// return WriteOffPassenger.class;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onMsgReceived(WriteOffPassenger passenger) {
|
||||
// //进行播报
|
||||
// CallerLogger.i(M_BUS + TAG,"passenger = "+ GsonUtil.jsonFromObject(passenger));
|
||||
// if (passenger != null && passenger.passengerSize == 0) return;
|
||||
// if (mPassengerCallback != null){
|
||||
// mPassengerCallback.playPassenger(passenger);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
public void setAdasStatusCallback(IBusADASStatusCallback callback){
|
||||
this.mADASStatusCallback = callback;
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.mogo.och.bus.model
|
||||
|
||||
import com.elegant.network.utils.GsonUtil
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
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.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.bus.bean.WriteOffPassenger
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffDevicesMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffMsg
|
||||
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.voice.VoiceNotice.showNotice
|
||||
|
||||
object TicketModel : IReceivedMsgListener, IMogoOnMessageListener<WriteOffPassenger> {
|
||||
|
||||
private val TAG = "TicketModel"
|
||||
|
||||
init {
|
||||
|
||||
//监听乘客屏发来的消息
|
||||
CallerTelematicListenerManager.addListener(TAG, this)
|
||||
OCHSocketMessageManager.registerSocketMessageListener( //监听核销乘客
|
||||
OCHSocketMessageManager.msgWriteOffPassengerType,
|
||||
this
|
||||
)
|
||||
}
|
||||
|
||||
fun load(){
|
||||
|
||||
}
|
||||
|
||||
// 收到局域网的核验信息
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
if (OchCommonConst.BUSINESS_STRING == type) {
|
||||
d(SceneConstant.M_BUS + TAG, "局域网核验"+String(byteArray))
|
||||
val msg = GsonUtils.fromJson(String(byteArray), BaseDPMsg::class.java)
|
||||
if (msg != null) {
|
||||
if (msg.type == DPMsgType.TYPE_WRITEOFF_INFO.type) {
|
||||
val writeOffMsg = GsonUtils.fromJson(String(byteArray), WriteOffMsg::class.java)
|
||||
receiveWrteOffInfo(writeOffMsg)
|
||||
} else if (msg.type == DPMsgType.TYPE_WRITEOFF_DEVICES_INFO.type) {
|
||||
val writeOffMsg = GsonUtils.fromJson(String(byteArray), WriteOffDevicesMsg::class.java)
|
||||
receiveWrteOffDevicesInfo(writeOffMsg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun target(): Class<WriteOffPassenger> {
|
||||
return WriteOffPassenger::class.java
|
||||
}
|
||||
|
||||
// 收到服务器的核验信息
|
||||
override fun onMsgReceived(passenger: WriteOffPassenger?) {
|
||||
//进行播报
|
||||
i(SceneConstant.M_BUS + TAG, "后台socket 核验:passenger = " + GsonUtil.jsonFromObject(passenger))
|
||||
if(passenger==null||passenger.passengerSize==0){
|
||||
return
|
||||
}
|
||||
playPassenger(
|
||||
passenger.passengerSize,
|
||||
passenger.phone ?: "",
|
||||
passenger.ticketName?:"",
|
||||
passenger.orderNo?:""
|
||||
)
|
||||
}
|
||||
|
||||
private fun receiveWrteOffInfo(writeOffMsg: WriteOffMsg?) {
|
||||
if(writeOffMsg!=null) {
|
||||
if (writeOffMsg.isScuccess != null) {
|
||||
if (writeOffMsg.isScuccess == true) { // 核验成功
|
||||
if(writeOffMsg.ticketSize==null||writeOffMsg.ticketSize==0){
|
||||
return
|
||||
}
|
||||
// playPassenger(
|
||||
// writeOffMsg.ticketSize?:0,
|
||||
// writeOffMsg.phone ?: "",
|
||||
// writeOffMsg.ticketName ?: "",
|
||||
// writeOffMsg.orderNo?:""
|
||||
// )
|
||||
} else { // 核验失败
|
||||
showNotice("验票失败,${writeOffMsg.failedReason ?: ""}", AIAssist.LEVEL3)
|
||||
saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X, V2XMsg(
|
||||
EventTypeEnumNew.TYPE_ABNORMAL_VERIFICATION.poiType,
|
||||
writeOffMsg.failedReason ?: "",
|
||||
EventTypeEnumNew.TYPE_ABNORMAL_VERIFICATION.tts,
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun receiveWrteOffDevicesInfo(writeOffMsg: WriteOffDevicesMsg) {
|
||||
if (writeOffMsg.isConnectScanner != null) {
|
||||
val reason = if (writeOffMsg.reason == null) "" else writeOffMsg.reason!!
|
||||
if (writeOffMsg.isConnectScanner==true) { // 链接成功
|
||||
saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_DEVICE_STATUS_NORMAL.poiType,
|
||||
reason,
|
||||
EventTypeEnumNew.TYPE_DEVICE_STATUS_NORMAL.tts,
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
} else { // 核验失败
|
||||
saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_DEVICE_STATUS_ABNORMAL.poiType,
|
||||
reason,
|
||||
EventTypeEnumNew.TYPE_DEVICE_STATUS_ABNORMAL.tts,
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun playPassenger(ticketSize: Int,phone:String,ticketName:String,orderNo:String) {
|
||||
|
||||
if (ticketSize > 1) { //多人播报 "x人" ---》x人核验通过
|
||||
showNotice(ticketSize.toString() + "人核验通过", AIAssist.LEVEL3)
|
||||
OrderModel.getInstance().sendWriteOffNumToClient(ticketSize.toString() + "人核验通过")
|
||||
} else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过"
|
||||
showNotice("核验通过", AIAssist.LEVEL3)
|
||||
OrderModel.getInstance().sendWriteOffNumToClient("核验通过")
|
||||
}
|
||||
|
||||
var tempPhone = phone
|
||||
if (tempPhone.length > 8) {
|
||||
//截取电话号码前三位
|
||||
val phoneNumPre = tempPhone.substring(0, 3)
|
||||
//截取电话号码后四位
|
||||
val phoneNumFix = tempPhone.substring(7)
|
||||
tempPhone = "$phoneNumPre****$phoneNumFix"
|
||||
}
|
||||
val content = "${ticketSize}张 $ticketName $tempPhone"
|
||||
saveMsgBox(MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_VERIFICATION_SUCCESSFUL.poiType,
|
||||
content,
|
||||
EventTypeEnumNew.TYPE_VERIFICATION_SUCCESSFUL.tts,
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,10 +62,16 @@ class SwitchLineAdapter(
|
||||
line.taskList,
|
||||
object : SwitchLineTaskAdapter.TaskItemClickListener {
|
||||
override fun onItemClick(position: Int,isCheck:Boolean) {
|
||||
if(isCheck) {
|
||||
checkLineId = line.lineId
|
||||
checkTaskId = line.taskList[position].id
|
||||
}else{
|
||||
try {
|
||||
if(isCheck) {
|
||||
checkLineId = line.lineId
|
||||
checkTaskId = line.taskList[position].id
|
||||
}else{
|
||||
checkLineId=-1
|
||||
checkTaskId=-1
|
||||
}
|
||||
}catch (e:Exception){
|
||||
e.printStackTrace()
|
||||
checkLineId=-1
|
||||
checkTaskId=-1
|
||||
}
|
||||
|
||||
@@ -86,6 +86,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
// 串口链接
|
||||
implementation rootProject.ext.dependencies.serialport
|
||||
implementation project(":OCH:common:common")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
implementation project(':core:mogo-core-res')
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
|
||||
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
|
||||
import com.mogo.och.common.module.wigets.media.MediaPlayerActivity
|
||||
import com.mogo.och.shuttle.passenger.model.TicketModel
|
||||
import com.mogo.och.shuttle.passenger.ui.BusPassengerRouteFragment
|
||||
import com.mogo.och.shuttle.passenger.ui.PM2BaseFragment
|
||||
|
||||
@@ -37,6 +38,7 @@ class MogoOCHShuttlePassenger : IMoGoFunctionProvider {
|
||||
MultiDisplayUtils.startActWithSecond(it, MediaPlayerActivity::class.java)
|
||||
}
|
||||
}
|
||||
TicketModel.load()
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
package com.mogo.och.shuttle.passenger.bean.request;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -7,10 +7,10 @@ public
|
||||
*
|
||||
* 根据车机行驶线路站点信息
|
||||
*/
|
||||
class BusPassengerQueryLineRequest {
|
||||
class PassengerQueryLineRequest {
|
||||
|
||||
private String sn;
|
||||
public BusPassengerQueryLineRequest(String sn) {
|
||||
public PassengerQueryLineRequest(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.mogo.och.shuttle.passenger.bean.request;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/22
|
||||
*
|
||||
* 根据车机行驶线路站点信息
|
||||
*/
|
||||
class PassengerWriteOffRequest {
|
||||
|
||||
private String sn;
|
||||
private String orderNo;
|
||||
private String uid;
|
||||
|
||||
public PassengerWriteOffRequest(String orderNo, String uid) {
|
||||
this.orderNo = orderNo;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public PassengerWriteOffRequest(String sn, String orderNo, String uid) {
|
||||
this.sn = sn;
|
||||
this.orderNo = orderNo;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getOrderNo() {
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public void setOrderNo(String orderNo) {
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
package com.mogo.och.shuttle.passenger.bean.response;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
*
|
||||
* 小巴车运营状态返回参数
|
||||
*/
|
||||
public class PM2OperationStatusResponse extends BaseData {
|
||||
public class PassengerOperationStatusResponse extends BaseData {
|
||||
|
||||
public Result data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
package com.mogo.och.shuttle.passenger.bean.response;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
@@ -8,7 +8,7 @@ import com.mogo.och.data.bean.BusRoutesResult;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class PM2RoutesResponse extends BaseData {
|
||||
public class PassengerRoutesResponse extends BaseData {
|
||||
private BusRoutesResult data;
|
||||
|
||||
public BusRoutesResult getResult() {
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.och.shuttle.passenger.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
|
||||
data class PassengerWriteOffResponse(val data: Result?) : BaseData(){
|
||||
data class Result(
|
||||
val phone: String?,
|
||||
val ticketSize: Int?,
|
||||
val ticketName: String?,
|
||||
val remainingTimes: Long?
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.mogo.och.shuttle.passenger.manager.scnner
|
||||
|
||||
import android.text.TextUtils
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
|
||||
object ScannerChainLogManager {
|
||||
|
||||
private val TAG = ScannerChainLogManager::class.java.simpleName
|
||||
|
||||
const val EVENT_KEY_INFE_WITH_CHANGE = "event_key_och_scanner_info"
|
||||
|
||||
/**
|
||||
* @param Info 事件
|
||||
* @param changeInfo 数据
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_OCH,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_OCH,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_OCH_COMMON_DISTANCE,
|
||||
paramIndexes = [0,1]
|
||||
)
|
||||
@JvmStatic
|
||||
fun writeChainLog(info: String, changeInfo: String,upload:Boolean = true,eventID:String=EVENT_KEY_INFE_WITH_CHANGE) {
|
||||
try {
|
||||
d(SceneConstant.M_OCHCOMMON + TAG, info+changeInfo)
|
||||
if(upload) {
|
||||
val plateNum = AppConfigInfo.plateNumber
|
||||
val params = HashMap<String, Any>()
|
||||
params["sn"] = SharedPrefsMgr.getInstance().sn
|
||||
params["env"] = DebugConfig.getNetMode()
|
||||
params["plate_number"] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
|
||||
params["time"] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss)
|
||||
params[info] = changeInfo
|
||||
MogoAnalyticUtils.track(eventID, params)
|
||||
}
|
||||
}catch (e:Exception){
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
package com.mogo.och.shuttle.passenger.manager.scnner
|
||||
|
||||
import android.net.Uri
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
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.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffDevicesMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffMsg
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.support.serialport.client.SerialPortManager
|
||||
import com.mogo.support.serialport.client.SerialPortManager.SERVICE_STATE
|
||||
import com.mogo.support.serialport.client.listener.OnDeviceVerificationListener
|
||||
import com.mogo.support.serialport.client.listener.OnSerialPortListener
|
||||
import com.mogo.support.serialport.common.verification.UnpackStatus
|
||||
import com.mogo.support.serialport.common.verification.data.VerificationActiveData
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
object ScannerManager : OnSerialPortListener, OnDeviceVerificationListener(), IReceivedMsgListener {
|
||||
|
||||
private val TAG = "ScannerManager"
|
||||
|
||||
private var serialPortManager = SerialPortManager()
|
||||
|
||||
private val stateChanageListeners: ConcurrentHashMap<String, StateChangeListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
private var driverSn:String by Delegates.observable("") { _, oldV, newV ->
|
||||
if (oldV != newV) {
|
||||
// sn 发生了改变 需要向司机屏推送当前链接的状态
|
||||
sendScannerState()
|
||||
}
|
||||
}
|
||||
|
||||
private var bindStatus: BindStatus by Delegates.observable(BindStatus.NOTHING) { _, oldV, newV ->
|
||||
if (oldV != newV) {
|
||||
try {
|
||||
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "状态发生变化old:${oldV}_new:${newV}")
|
||||
if(newV!=BindStatus.BIND_SUCCEED) {
|
||||
dispatchMsg(newV)
|
||||
}
|
||||
if (stateChanageListeners.size > 0) {
|
||||
stateChanageListeners.forEach {
|
||||
it.value.stateChange(newV, openStatus)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
CallerLogger.e(SceneConstant.M_OCHCOMMON + TAG, "扫码枪bind错误")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var openStatus: OpenStatus by Delegates.observable(OpenStatus.Unopen) { _, oldV, newV ->
|
||||
if (oldV != newV) {
|
||||
try {
|
||||
if (stateChanageListeners.size > 0) {
|
||||
stateChanageListeners.forEach {
|
||||
it.value.stateChange(bindStatus, newV)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
CallerLogger.e(SceneConstant.M_OCHCOMMON + TAG, "扫码枪open错误")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
//监听司机端消息
|
||||
CallerTelematicListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun addStateChangeListener(tag: String, listener: StateChangeListener) {
|
||||
if (stateChanageListeners.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
stateChanageListeners[tag] = listener
|
||||
}
|
||||
|
||||
fun bindService() {
|
||||
serialPortManager.bindService(AbsMogoApplication.getApp(), this)//绑定服务
|
||||
}
|
||||
|
||||
override fun onServiceState(serviceState: Int) {
|
||||
ScannerChainLogManager.writeChainLog(TAG+"bindStatus","绑定服务结果:serviceState:${serviceState}")
|
||||
when (serviceState) {
|
||||
SERVICE_STATE.BIND_SUCCEED -> {
|
||||
CallerLogger.d(M_BUS_P + TAG, "服务绑定成功")
|
||||
bindStatus = BindStatus.BIND_SUCCEED
|
||||
serialPortManager.openVerificationDevice(this)
|
||||
}
|
||||
SERVICE_STATE.BIND_FAILURE_UNINSTALLED -> {
|
||||
CallerLogger.d(M_BUS_P + TAG, "服务绑定失败:未安装串口服务端APP")
|
||||
bindStatus = BindStatus.BIND_FAILURE_UNINSTALLED
|
||||
}
|
||||
SERVICE_STATE.BIND_FAILURE_NO_PERMISSION_NOT_FOUND -> {
|
||||
CallerLogger.d(M_BUS_P + TAG, "服务绑定失败:没有绑定权限或找不到服务(如果是此状态,基本上安装后就可以找到,主要就是权限问题)")
|
||||
bindStatus = BindStatus.BIND_FAILURE_NO_PERMISSION_NOT_FOUND
|
||||
}
|
||||
SERVICE_STATE.EXCEPTION -> {
|
||||
CallerLogger.d(M_BUS_P + TAG, "服务被异常销毁")
|
||||
bindStatus = BindStatus.EXCEPTION
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
// 查询串口
|
||||
override fun onFindSerialPort(paths: Array<out String>?) {
|
||||
CallerLogger.d(M_BUS_P + TAG, "$paths")
|
||||
ScannerChainLogManager.writeChainLog(TAG+"onFindSerialPort","查询串口:${paths}")
|
||||
if(paths==null) {
|
||||
bindStatus = BindStatus.BIND_FAILURE_NO_PERMISSION_NOT_FOUND
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSerialPortState(
|
||||
path: String?,
|
||||
isOpen: Boolean,
|
||||
throwableMessage: String?
|
||||
) {
|
||||
CallerLogger.d(
|
||||
M_BUS_P + TAG,
|
||||
"path ${path}---isOpen${isOpen}--throwableMessage${throwableMessage}"
|
||||
)
|
||||
ScannerChainLogManager.writeChainLog(TAG+"onSerialPortState","扫码枪是否打开:path${path}_isOpen${isOpen}_throwableMessage${throwableMessage}")
|
||||
openStatus = if (isOpen) {
|
||||
sendMessage2Driver(true,"扫码枪打开成功")
|
||||
OpenStatus.Open
|
||||
} else {
|
||||
sendMessage2Driver(false,"扫码枪打开错误:${throwableMessage}_${path}")
|
||||
OpenStatus.Unopen
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActiveDataReceive(data: VerificationActiveData?) {
|
||||
ScannerChainLogManager.writeChainLog(TAG+"onActiveDataReceive","扫码结果:data:${data}")
|
||||
data?.let {
|
||||
if(data.unpackStatus==UnpackStatus.SUCCEED){
|
||||
"数据类型${it.dataType.name}"
|
||||
CallerLogger.d(M_BUS_P + TAG, "data $it")
|
||||
if(!StringUtils.isEmpty(it.payload)){
|
||||
parseParams(it.payload)
|
||||
}else{
|
||||
CallerLogger.d(M_BUS_P + TAG, "数据错误")
|
||||
sendMessage2DriverWriteOffInfo("扫码数据为空")
|
||||
}
|
||||
}else{
|
||||
sendMessage2DriverWriteOffInfo("解包失败")
|
||||
CallerLogger.d(M_BUS_P + TAG, "解包失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseParams(payload: String?) {
|
||||
val parse = Uri.parse("${OchCommonConst.getShuttleUrl()}?${payload}")
|
||||
val queryParameterNames = parse.queryParameterNames
|
||||
val mutableMapOf = mutableMapOf<String, Any>()
|
||||
queryParameterNames.forEach {
|
||||
val queryParameter = parse.getQueryParameter(it)
|
||||
if(it!=null&&queryParameter!=null){
|
||||
mutableMapOf[it] = queryParameter
|
||||
}
|
||||
}
|
||||
if(mutableMapOf.isNotEmpty()){
|
||||
if (stateChanageListeners.size > 0) {
|
||||
stateChanageListeners.forEach {
|
||||
it.value.parseData(mutableMapOf,payload)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
sendMessage2DriverWriteOffInfo("扫码参数数据为空:${payload}")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isConnectScanner 是否打开设备
|
||||
*/
|
||||
private fun sendMessage2Driver(isConnectScanner:Boolean,message:String){
|
||||
val msg = WriteOffDevicesMsg(isConnectScanner, message)
|
||||
CallerLogger.d(M_BUS_P + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
if(driverSn.isNotEmpty()) {
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开设备后数据异常
|
||||
*/
|
||||
private fun sendMessage2DriverWriteOffInfo(message:String){
|
||||
val msg = WriteOffMsg(false, "", 0, "", message,"")
|
||||
CallerLogger.d(M_BUS_P + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
}
|
||||
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
|
||||
}
|
||||
|
||||
override fun onReceivedServerSn(sn: String?) {
|
||||
Logger.d(M_BUS_P + TAG, "司机屏sn:$sn")
|
||||
driverSn = sn?:""
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接司机屏后向司机屏同步扫码枪状态
|
||||
*/
|
||||
private fun sendScannerState() {
|
||||
if(bindStatus==BindStatus.BIND_SUCCEED&& openStatus==OpenStatus.Open){
|
||||
sendMessage2Driver(true,"扫码枪打开状态")
|
||||
}else{
|
||||
if(bindStatus==BindStatus.BIND_SUCCEED&& openStatus==OpenStatus.Unopen){
|
||||
sendMessage2Driver(false,"绑定成功、打开失败")
|
||||
}else{
|
||||
dispatchMsg(bindStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun dispatchMsg(newV: BindStatus) {
|
||||
when (newV) {
|
||||
BindStatus.BIND_FAILURE_UNINSTALLED -> {
|
||||
// 服务绑定失败:未安装串口服务端APP
|
||||
sendMessage2Driver(false,"服务绑定失败:未安装串口服务端APP")
|
||||
}
|
||||
BindStatus.BIND_FAILURE_NO_PERMISSION_NOT_FOUND -> {
|
||||
// 服务绑定失败:没有绑定权限或找不到服务(如果是此状态,基本上安装后就可以找到,主要就是权限问题)
|
||||
sendMessage2Driver(false,"服务绑定失败:没有绑定权限或找不到服务")
|
||||
}
|
||||
BindStatus.EXCEPTION -> {
|
||||
// 扫码枪open错误
|
||||
sendMessage2Driver(false,"扫码枪打开错误")
|
||||
}
|
||||
BindStatus.NOTHING -> {}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
enum class BindStatus {
|
||||
BIND_SUCCEED, BIND_FAILURE_UNINSTALLED ,BIND_FAILURE_NO_PERMISSION_NOT_FOUND,EXCEPTION,NOTHING
|
||||
}
|
||||
|
||||
enum class OpenStatus {
|
||||
Open, Unopen
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.och.shuttle.passenger.manager.scnner
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.och.common.module.R
|
||||
|
||||
class ScannerStateView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : AppCompatImageView(context, attrs, defStyleAttr), StateChangeListener {
|
||||
private val TAG = "ScannerStateView"
|
||||
|
||||
init {
|
||||
setImageResource(R.drawable.driver_connect_statis)
|
||||
ScannerManager.addStateChangeListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun stateChange(newBindValue: BindStatus, newOpentValue: OpenStatus) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "newBindValue = $newBindValue newOpentValue = $newOpentValue")
|
||||
when (newOpentValue) {
|
||||
OpenStatus.Open -> {
|
||||
//成功打开
|
||||
visibility = View.GONE
|
||||
}
|
||||
OpenStatus.Unopen -> {
|
||||
// 打开失败
|
||||
setImageResource(R.drawable.driver_connect_statis)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.mogo.och.shuttle.passenger.manager.scnner
|
||||
|
||||
interface StateChangeListener {
|
||||
fun stateChange(newBindValue:BindStatus,newOpentValue:OpenStatus){}
|
||||
fun parseData(params: MutableMap<String, Any>, payload: String?){}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.mogo.och.shuttle.passenger.model
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
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.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.common.module.bean.dpmsg.WriteOffMsg
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.shuttle.passenger.bean.request.PassengerWriteOffRequest
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerWriteOffResponse
|
||||
import com.mogo.och.shuttle.passenger.manager.scnner.ScannerChainLogManager
|
||||
import com.mogo.och.shuttle.passenger.manager.scnner.ScannerManager
|
||||
import com.mogo.och.shuttle.passenger.manager.scnner.StateChangeListener
|
||||
import com.mogo.och.shuttle.passenger.network.PassengerServiceManager
|
||||
|
||||
object TicketModel : StateChangeListener {
|
||||
|
||||
private const val TAG = "TicketModel"
|
||||
|
||||
init {
|
||||
ScannerManager.bindService()
|
||||
ScannerManager.addStateChangeListener(TAG, this)
|
||||
}
|
||||
|
||||
fun load(){
|
||||
|
||||
}
|
||||
|
||||
override fun parseData(params: MutableMap<String, Any>, payload: String?) {
|
||||
val orderNo = params["orderNo"]
|
||||
val uid = params["uid"]
|
||||
if(orderNo is String && uid is String){
|
||||
writeOffTicket(orderNo,uid)
|
||||
}else{
|
||||
// 通知司机屏二维码错误
|
||||
sendMessage2Driver("参数错误:${payload}")
|
||||
}
|
||||
}
|
||||
|
||||
private fun writeOffTicket(orderNo: String, uid: String) {
|
||||
val passengerWriteOffRequest = PassengerWriteOffRequest(orderNo, uid)
|
||||
PassengerServiceManager.writeOffTicket(AbsMogoApplication.getApp(),
|
||||
passengerWriteOffRequest,
|
||||
object : OchCommonServiceCallback<PassengerWriteOffResponse> {
|
||||
override fun onSuccess(data: PassengerWriteOffResponse?) {
|
||||
if (data?.data == null) return
|
||||
val ticketInfo =
|
||||
"核销成功:票种名称:${data.data.ticketName},车票数量:${data.data.ticketSize},预留手机号:${data.data.phone},时间:${data.data.remainingTimes}"
|
||||
CallerLogger.d(M_BUS_P + TAG, ticketInfo)
|
||||
sendMessage2DriverSuccess(data.data,orderNo)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
CallerLogger.d(M_BUS_P + TAG, "核销失败 ${code}-----${msg}")
|
||||
when (code) {
|
||||
6002 -> {sendMessage2Driver("同一订单核销间隔时间需大于5分钟")}
|
||||
1009 -> {sendMessage2Driver("车票所选乘车日期非今日")}
|
||||
1005 -> {sendMessage2Driver("车辆未登录、或没有任务")}
|
||||
1006 -> {sendMessage2Driver("车票路线信息与当前车辆执行任务的路线信息不符合")}
|
||||
1008 -> {sendMessage2Driver("车票剩余可用次数为0")}
|
||||
6001 -> {sendMessage2Driver("二维码已过期")}
|
||||
1012 -> {sendMessage2Driver("当前用户下单路线非当前的车辆所属公司")}
|
||||
else -> {
|
||||
when (msg) {
|
||||
"6002" -> {sendMessage2Driver("同一订单核销间隔时间需大于5分钟")}
|
||||
"1009" -> {sendMessage2Driver("车票所选乘车日期非今日")}
|
||||
"1005" -> {sendMessage2Driver("车辆未登录、或没有任务")}
|
||||
"1006" -> {sendMessage2Driver("车票路线信息与当前车辆执行任务的路线信息不符合")}
|
||||
"1008" -> {sendMessage2Driver("车票剩余可用次数为0")}
|
||||
"6001" -> {sendMessage2Driver("二维码已过期")}
|
||||
"1012" -> {sendMessage2Driver("当前用户下单路线非当前的车辆所属公司")}
|
||||
else -> {
|
||||
sendMessage2Driver(msg?:"")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(message: String) {
|
||||
ScannerChainLogManager.writeChainLog(TAG +"onError","/och-vehicle/api/scanner/device/writeOff接口请求错误orderNo:${orderNo}__uid:${uid}__reaseon:${message}")
|
||||
sendMessage2Driver("网络错误")
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun sendMessage2Driver(message:String){
|
||||
val msg = WriteOffMsg(false, "", 0, "", message,"")
|
||||
CallerLogger.d(M_BUS_P + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
ScannerChainLogManager.writeChainLog(TAG +"sendMessage2Driver","核验失败:message:${message}")
|
||||
}
|
||||
private fun sendMessage2DriverSuccess(message: PassengerWriteOffResponse.Result,orderNo: String){
|
||||
val msg = WriteOffMsg(true, message.phone, message.ticketSize, message.ticketName, "",orderNo)
|
||||
CallerLogger.d(M_BUS_P + TAG, "sendTaskDetailsToClients = " + GsonUtils.toJson(msg))
|
||||
CallerTelematicManager.sendMsgToServer(
|
||||
OchCommonConst.BUSINESS_STRING,
|
||||
GsonUtils.toJson(msg).toByteArray()
|
||||
)
|
||||
ScannerChainLogManager.writeChainLog(TAG +"sendMessage2DriverSuccess","核验成功:message:${message}")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,27 +2,34 @@ package com.mogo.och.shuttle.passenger.network
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerRoutesResponse
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerQueryLineRequest
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerOperationStatusResponse
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
import com.mogo.och.shuttle.passenger.bean.request.PassengerQueryLineRequest
|
||||
import com.mogo.och.shuttle.passenger.bean.request.PassengerWriteOffRequest
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerOperationStatusResponse
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerRoutesResponse
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerWriteOffResponse
|
||||
import com.mogo.och.shuttle.passenger.manager.scnner.ScannerChainLogManager
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
object BusPassengerServiceManager {
|
||||
object PassengerServiceManager {
|
||||
|
||||
private var driverSnCache = ""
|
||||
|
||||
private val TAG = "PassengerServiceManager"
|
||||
|
||||
private var mShuttleBusPassengerServiceApi =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(
|
||||
ShettlePassengerServiceApi::class.java)
|
||||
ServiceApi::class.java)
|
||||
|
||||
/**
|
||||
* 获取Bus司机端的sn
|
||||
@@ -44,12 +51,12 @@ object BusPassengerServiceManager {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryDriverSiteByCoordinate(
|
||||
context: Context, callback: OchCommonServiceCallback<BusPassengerRoutesResponse>?
|
||||
context: Context, callback: OchCommonServiceCallback<PassengerRoutesResponse>?
|
||||
) {
|
||||
mShuttleBusPassengerServiceApi.queryDriverSiteByCoordinate(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
BusPassengerQueryLineRequest(
|
||||
PassengerQueryLineRequest(
|
||||
driverAppSn
|
||||
)
|
||||
).transformTry()
|
||||
@@ -64,7 +71,7 @@ object BusPassengerServiceManager {
|
||||
@JvmStatic
|
||||
fun queryDriverOperationStatus(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<BusPassengerOperationStatusResponse>?
|
||||
callback: OchCommonServiceCallback<PassengerOperationStatusResponse>?
|
||||
) {
|
||||
mShuttleBusPassengerServiceApi.queryDriverOperationStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
@@ -75,4 +82,31 @@ object BusPassengerServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverOperationStatus"))
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询司机端出车收车状态,以及车牌号
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun writeOffTicket(
|
||||
context: Context,
|
||||
ticketInfo: PassengerWriteOffRequest,
|
||||
callback: OchCommonServiceCallback<PassengerWriteOffResponse>?,
|
||||
) {
|
||||
ticketInfo.sn = driverAppSn
|
||||
if(StringUtils.isEmpty(driverAppSn)){
|
||||
ToastUtils.showShort("请链接司机屏${ticketInfo.uid}")
|
||||
ScannerChainLogManager.writeChainLog(TAG +"onError","无司机屏sn请处理")
|
||||
return
|
||||
}
|
||||
mShuttleBusPassengerServiceApi.writeOffTicket(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
ticketInfo
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOff"))
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.och.shuttle.passenger.network;
|
||||
|
||||
import com.mogo.och.shuttle.passenger.bean.request.PassengerQueryLineRequest;
|
||||
import com.mogo.och.shuttle.passenger.bean.request.PassengerWriteOffRequest;
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerOperationStatusResponse;
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerRoutesResponse;
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerWriteOffResponse;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*
|
||||
* Bus乘客端接口定义
|
||||
*/
|
||||
public interface ServiceApi {
|
||||
/**
|
||||
* 查询bus司机端绑定路线
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-shuttle-cabin/api/business/v1/passenger/lineDataWithDriver/query" )
|
||||
Observable<PassengerRoutesResponse> queryDriverSiteByCoordinate(@Header("appId") String appId, @Header("ticket") String ticket, @Body PassengerQueryLineRequest request);
|
||||
|
||||
/**
|
||||
* 查询司机端的登陆状态
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @GET("/autopilot-car-hailing/car/v2/driver/bus/passenger/takeOrderStatus/query")
|
||||
@GET("/och-shuttle-cabin/api/business/v1/passenger/loginStatus")
|
||||
Observable<PassengerOperationStatusResponse> queryDriverOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 查询司机端的登陆状态
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/och-vehicle/api/scanner/device/writeOff")
|
||||
Observable<PassengerWriteOffResponse> writeOffTicket(@Header ("appId") String appId, @Header("ticket") String ticket, @Body PassengerWriteOffRequest request);
|
||||
}
|
||||
@@ -3,6 +3,9 @@ package com.mogo.och.shuttle.passenger.provider;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.och.shuttle.passenger.ui.BusPStatusBarView;
|
||||
import com.mogo.och.shuttle.passenger.ui.widget.M2StatusBarView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -17,13 +20,16 @@ import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
|
||||
public class M2StatusViewManager implements IStatusViewLayout {
|
||||
|
||||
|
||||
public class StatusViewManager implements IStatusViewLayout {
|
||||
@NonNull
|
||||
@Override
|
||||
public View getStatusView(Context context) {
|
||||
return new M2StatusBarView(context);
|
||||
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
|
||||
return new M2StatusBarView(context);
|
||||
} else if (AppIdentityModeUtils.isJL(FunctionBuildConfig.appIdentityMode)) {
|
||||
return new BusPStatusBarView(context);
|
||||
}
|
||||
return new BusPStatusBarView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/22
|
||||
*
|
||||
* 小巴车运营状态返回参数
|
||||
*/
|
||||
public class BusPassengerOperationStatusResponse extends BaseData {
|
||||
|
||||
public Result data;
|
||||
|
||||
public static class Result {
|
||||
private String sn; //司机屏sn
|
||||
private String phone; //司机手机号
|
||||
public String plateNumber; //车牌号
|
||||
public int driverStatus;//0:已收车,1:已出车
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果 返回的是对应司机屏的线路信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BusPassengerRoutesResponse extends BaseData {
|
||||
private BusRoutesResult data;
|
||||
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusRoutesResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口返回接口数据封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BusPassengerRoutesResult {
|
||||
private List<BusPassengerStation> sites;
|
||||
private int lineId;
|
||||
private String name; //线路名称
|
||||
private int lineType; //线路类型,0:环形
|
||||
private String description;
|
||||
private int status;
|
||||
private String runningDur; //运营时间
|
||||
private long taskTime; //线路时间班次
|
||||
private long writeVersion;//更新时间戳
|
||||
|
||||
public List<BusPassengerStation> getSites() {
|
||||
return sites;
|
||||
}
|
||||
|
||||
public int getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getLineType() {
|
||||
return lineType;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getRunningDur() {
|
||||
return runningDur;
|
||||
}
|
||||
|
||||
public long getWriteVersion() {
|
||||
return writeVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusPassengerRoutesResult{" +
|
||||
"sites=" + sites +
|
||||
", lineId=" + lineId +
|
||||
", name='" + name + '\'' +
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", writeVersion="+ writeVersion+
|
||||
", runningDur='" + runningDur + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
BusPassengerRoutesResult that = (BusPassengerRoutesResult) o;
|
||||
return lineId == that.lineId
|
||||
&& lineType == that.lineType
|
||||
&& status == that.status
|
||||
&& sites.equals(that.sites)
|
||||
&& name.equals(that.name)
|
||||
&& runningDur.equals(that.runningDur);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sites, lineId, name, lineType, description, status, runningDur);
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
* @author wangmingjun
|
||||
*/
|
||||
public class BusPassengerStation {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private String cityCode;
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private double gcjLon; //高德坐标
|
||||
private double gcjLat; //高德坐标
|
||||
private int businessType; //站点类型,9:taxi,10:bus
|
||||
private int status;
|
||||
private int siteId;
|
||||
private int seq;
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
|
||||
private boolean leaving;
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setBusinessType(int businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setDrivingStatus(int drivingStatus) {
|
||||
this.drivingStatus = drivingStatus;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
public double getGcjLat() {
|
||||
return gcjLat;
|
||||
}
|
||||
|
||||
public int getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public int getDrivingStatus() {
|
||||
return drivingStatus;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setIfStop(int ifStop) {
|
||||
this.ifStop = ifStop;
|
||||
}
|
||||
|
||||
public int getIfStop() {
|
||||
return ifStop;
|
||||
}
|
||||
|
||||
public void setLeaving(boolean leaving) {
|
||||
this.leaving = leaving;
|
||||
}
|
||||
|
||||
public boolean isLeaving() {
|
||||
return leaving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusStation{" +
|
||||
"name='" + name + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", businessType=" + businessType +
|
||||
", status=" + status +
|
||||
", siteId=" + siteId +
|
||||
", seq=" + seq +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", ifStop=" + ifStop +
|
||||
", leaving=" + leaving +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
BusPassengerStation that = (BusPassengerStation) o;
|
||||
return Double.compare(that.lon, lon) == 0
|
||||
&& Double.compare(that.lat, lat) == 0
|
||||
&& Double.compare(that.gcjLon, gcjLon) == 0
|
||||
&& Double.compare(that.gcjLat, gcjLat) == 0
|
||||
&& businessType == that.businessType
|
||||
&& status == that.status
|
||||
&& siteId == that.siteId
|
||||
&& seq == that.seq
|
||||
&& drivingStatus == that.drivingStatus
|
||||
&& ifStop == that.ifStop
|
||||
&& leaving == that.leaving
|
||||
&& Objects.equals(name, that.name)
|
||||
&& Objects.equals(cityCode, that.cityCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, description, cityCode, lon, lat, gcjLon, gcjLat, businessType, status, siteId, seq, drivingStatus, ifStop, leaving);
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.shuttle.passenger.R;
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerOperationStatusResponse;
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerRoutesResponse;
|
||||
import com.mogo.och.common.module.bean.dpmsg.AppConnectMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.BaseDPMsg;
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType;
|
||||
@@ -52,6 +50,8 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerOperationStatusResponse;
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerRoutesResponse;
|
||||
import com.mogo.och.shuttle.passenger.callback.IBusPassegerDriverStatusCallback;
|
||||
import com.mogo.och.shuttle.passenger.callback.IBusPassengerADASStatusCallback;
|
||||
import com.mogo.och.shuttle.passenger.callback.IBusPassengerAutopilotPlanningCallback;
|
||||
@@ -59,7 +59,6 @@ import com.mogo.och.shuttle.passenger.callback.IBusPassengerControllerStatusCall
|
||||
import com.mogo.och.shuttle.passenger.callback.IBusPassengerRouteLineInfoCallback;
|
||||
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.shuttle.passenger.network.BusPassengerModelLoopManager;
|
||||
import com.mogo.och.shuttle.passenger.network.BusPassengerServiceManager;
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
@@ -67,6 +66,7 @@ import com.mogo.och.common.module.utils.RxUtils;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.data.bean.BusTransferData;
|
||||
import com.mogo.och.shuttle.passenger.network.PassengerServiceManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -166,10 +166,10 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
private void queryDriverOperationStatus() {
|
||||
BusPassengerServiceManager.queryDriverOperationStatus(mContext
|
||||
, new OchCommonServiceCallback<BusPassengerOperationStatusResponse>() {
|
||||
PassengerServiceManager.queryDriverOperationStatus(mContext
|
||||
, new OchCommonServiceCallback<PassengerOperationStatusResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusPassengerOperationStatusResponse data) {
|
||||
public void onSuccess(PassengerOperationStatusResponse data) {
|
||||
if (data == null || data.data == null) return;
|
||||
if (mDriverStatusCallback != null) {
|
||||
CallerLogger.d( M_BUS_P + TAG, "queryDriverOperationStatus = %s", data.data.plateNumber );
|
||||
@@ -196,10 +196,10 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
public void queryDriverSiteByCoordinate(){
|
||||
BusPassengerServiceManager.queryDriverSiteByCoordinate(mContext
|
||||
, new OchCommonServiceCallback<BusPassengerRoutesResponse>() {
|
||||
PassengerServiceManager.queryDriverSiteByCoordinate(mContext
|
||||
, new OchCommonServiceCallback<PassengerRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusPassengerRoutesResponse data) {
|
||||
public void onSuccess(PassengerRoutesResponse data) {
|
||||
if ( data == null || data.getResult() == null) {
|
||||
CallerLogger.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = null");
|
||||
clearLocalRouteResult();
|
||||
@@ -225,18 +225,18 @@ public class BusPassengerModel {
|
||||
@Override
|
||||
public void onError() {
|
||||
CallerLogger.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = onError ="
|
||||
+ ", sn = " +BusPassengerServiceManager.INSTANCE.getDriverAppSn());
|
||||
+ ", sn = " +PassengerServiceManager.INSTANCE.getDriverAppSn());
|
||||
queryDriverByLocalDriver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
CallerLogger.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = %s", msg
|
||||
+ ", sn = " +BusPassengerServiceManager.INSTANCE.getDriverAppSn());
|
||||
+ ", sn = " +PassengerServiceManager.INSTANCE.getDriverAppSn());
|
||||
if (code == 1003){
|
||||
queryDriverOperationDelay();
|
||||
}
|
||||
if (BusPassengerServiceManager.INSTANCE.getDriverAppSn().isEmpty()){
|
||||
if (PassengerServiceManager.INSTANCE.getDriverAppSn().isEmpty()){
|
||||
//此处拦截是为了防止过程中乘客屏和司机端断连,拿不到司机端sn, 造成请求失败去刷新了界面
|
||||
return;
|
||||
}
|
||||
@@ -402,6 +402,7 @@ public class BusPassengerModel {
|
||||
|
||||
@Override
|
||||
public void onReceivedServerSn(@Nullable String sn) {
|
||||
Logger.d(SceneConstant.M_BUS_P + TAG, "司机屏sn:"+sn );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,8 +33,6 @@ public class BusPassengerModelLoopManager {
|
||||
}
|
||||
|
||||
private Disposable mQueryLineDisposable; //心跳轮询
|
||||
private CompositeDisposable mRouteWipeDisposable;
|
||||
private CompositeDisposable mCalculateRouteDisposable; //每隔2s计算一次剩余里程和时间
|
||||
|
||||
public void startQueryDriverLineLoop() {
|
||||
if (mQueryLineDisposable != null && !mQueryLineDisposable.isDisposed()) {
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.network;
|
||||
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerOperationStatusResponse;
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerQueryLineRequest;
|
||||
import com.mogo.och.shuttle.passenger.bean.BusPassengerRoutesResponse;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*
|
||||
* Bus乘客端接口定义
|
||||
*/
|
||||
interface ShettlePassengerServiceApi {
|
||||
/**
|
||||
* 查询bus司机端绑定路线
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-shuttle-cabin/api/business/v1/passenger/lineDataWithDriver/query" )
|
||||
Observable<BusPassengerRoutesResponse> queryDriverSiteByCoordinate(@Header("appId") String appId, @Header("ticket") String ticket, @Body BusPassengerQueryLineRequest request);
|
||||
|
||||
/**
|
||||
* 查询司机端的登陆状态
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @GET("/autopilot-car-hailing/car/v2/driver/bus/passenger/takeOrderStatus/query")
|
||||
@GET("/och-shuttle-cabin/api/business/v1/passenger/loginStatus")
|
||||
Observable<BusPassengerOperationStatusResponse> queryDriverOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.och.shuttle.passenger.ui.BusPStatusBarView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-06
|
||||
* <p>
|
||||
* 根据优先级控制显示 window view.
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
|
||||
public class B1StatusViewManager implements IStatusViewLayout {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getStatusView(Context context) {
|
||||
return new BusPStatusBarView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.och.shuttle.passenger.R;
|
||||
import com.mogo.och.shuttle.passenger.adapter.BusPassengerLineStationsAdapter;
|
||||
import com.mogo.och.shuttle.passenger.ui.adapter.BusPassengerLineStationsAdapter;
|
||||
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.shuttle.passenger.presenter.BaseBusPassengerPresenter;
|
||||
import com.mogo.och.shuttle.passenger.ui.layoutmanager.CenterLayoutManager;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.och.shuttle.passenger.adapter;
|
||||
package com.mogo.och.shuttle.passenger.ui.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/22
|
||||
*
|
||||
* 根据车机行驶线路站点信息
|
||||
*/
|
||||
class PM2QueryLineRequest {
|
||||
|
||||
private String sn;
|
||||
public PM2QueryLineRequest(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口返回接口数据封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class PM2RoutesResult {
|
||||
private List<PM2Station> sites;
|
||||
private int lineId;
|
||||
private String name; //线路名称
|
||||
private int lineType; //线路类型,0:环形
|
||||
private String description;
|
||||
private int status;
|
||||
private String runningDur; //运营时间
|
||||
private long taskTime; //线路时间班次
|
||||
|
||||
public List<PM2Station> getSites() {
|
||||
return sites;
|
||||
}
|
||||
|
||||
public int getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getLineType() {
|
||||
return lineType;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getRunningDur() {
|
||||
return runningDur;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusPassengerRoutesResult{" +
|
||||
"sites=" + sites +
|
||||
", lineId=" + lineId +
|
||||
", name='" + name + '\'' +
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", runningDur='" + runningDur + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
PM2RoutesResult that = (PM2RoutesResult) o;
|
||||
return lineId == that.lineId
|
||||
&& lineType == that.lineType
|
||||
&& status == that.status
|
||||
&& sites.equals(that.sites)
|
||||
&& name.equals(that.name)
|
||||
&& runningDur.equals(that.runningDur);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sites, lineId, name, lineType, description, status, runningDur);
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.bean;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
* @author wangmingjun
|
||||
*/
|
||||
public class PM2Station {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private String cityCode;
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private double gcjLon; //高德坐标
|
||||
private double gcjLat; //高德坐标
|
||||
private int businessType; //站点类型,9:taxi,10:bus
|
||||
private int status;
|
||||
private int siteId;
|
||||
private int seq;
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
|
||||
private boolean leaving;
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setBusinessType(int businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setDrivingStatus(int drivingStatus) {
|
||||
this.drivingStatus = drivingStatus;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
public double getGcjLat() {
|
||||
return gcjLat;
|
||||
}
|
||||
|
||||
public int getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public int getDrivingStatus() {
|
||||
return drivingStatus;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setIfStop(int ifStop) {
|
||||
this.ifStop = ifStop;
|
||||
}
|
||||
|
||||
public int getIfStop() {
|
||||
return ifStop;
|
||||
}
|
||||
|
||||
public void setLeaving(boolean leaving) {
|
||||
this.leaving = leaving;
|
||||
}
|
||||
|
||||
public boolean isLeaving() {
|
||||
return leaving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OchBusStation{" +
|
||||
"name='" + name + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", businessType=" + businessType +
|
||||
", status=" + status +
|
||||
", siteId=" + siteId +
|
||||
", seq=" + seq +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", ifStop=" + ifStop +
|
||||
", leaving=" + leaving +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
PM2Station that = (PM2Station) o;
|
||||
return Double.compare(that.lon, lon) == 0
|
||||
&& Double.compare(that.lat, lat) == 0
|
||||
&& Double.compare(that.gcjLon, gcjLon) == 0
|
||||
&& Double.compare(that.gcjLat, gcjLat) == 0
|
||||
&& businessType == that.businessType
|
||||
&& status == that.status
|
||||
&& siteId == that.siteId
|
||||
&& seq == that.seq
|
||||
&& drivingStatus == that.drivingStatus
|
||||
&& ifStop == that.ifStop
|
||||
&& leaving == that.leaving
|
||||
&& Objects.equals(name, that.name)
|
||||
&& Objects.equals(cityCode, that.cityCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, description, cityCode, lon, lat, gcjLon, gcjLat, businessType, status, siteId, seq, drivingStatus, ifStop, leaving);
|
||||
}
|
||||
}
|
||||
@@ -33,11 +33,8 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.shuttle.passenger.R
|
||||
import com.mogo.och.shuttle.passenger.constant.BusPassengerConst
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2OperationStatusResponse
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2RoutesResponse
|
||||
import com.mogo.och.shuttle.passenger.callback.AutoPilotStatusCallback
|
||||
import com.mogo.och.shuttle.passenger.callback.DrivingInfoCallback
|
||||
import com.mogo.och.shuttle.passenger.model.PM2ServiceManager.driverAppSn
|
||||
import com.mogo.och.shuttle.passenger.network.PM2ModelLoopManager
|
||||
import com.mogo.och.common.module.bean.dpmsg.*
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.pushAppOperationalMsgBox
|
||||
@@ -49,6 +46,9 @@ import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerOperationStatusResponse
|
||||
import com.mogo.och.shuttle.passenger.bean.response.PassengerRoutesResponse
|
||||
import com.mogo.och.shuttle.passenger.network.PassengerServiceManager
|
||||
import io.reactivex.disposables.Disposable
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import kotlin.math.abs
|
||||
@@ -78,7 +78,7 @@ class PM2DrivingModel private constructor() {
|
||||
private var mDrivingInfoCallback: DrivingInfoCallback? = null //行程信息
|
||||
private var mAutoStatusCallback: AutoPilotStatusCallback? = null //自动驾驶状态
|
||||
|
||||
private var operationStatus: PM2OperationStatusResponse.Result? = null
|
||||
private var operationStatus: PassengerOperationStatusResponse.Result? = null
|
||||
|
||||
@Volatile
|
||||
private var globalPathTruncation: Disposable? = null
|
||||
@@ -328,17 +328,17 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
private fun queryDriverOperationStatus() {
|
||||
mContext?.let {
|
||||
PM2ServiceManager.queryDriverOperationStatus(
|
||||
PassengerServiceManager.queryDriverOperationStatus(
|
||||
it,
|
||||
object : OchCommonServiceCallback<PM2OperationStatusResponse> {
|
||||
override fun onSuccess(data: PM2OperationStatusResponse?) {
|
||||
object : OchCommonServiceCallback<PassengerOperationStatusResponse> {
|
||||
override fun onSuccess(data: PassengerOperationStatusResponse?) {
|
||||
if (data?.data == null) return
|
||||
if (data.data.driverStatus != operationStatus?.driverStatus
|
||||
|| data.data.plateNumber != operationStatus?.plateNumber){
|
||||
d(SceneConstant.M_BUS_P+TAG, "queryDriverOperationStatus ===== 车牌或者登陆状态有变更")
|
||||
mDrivingInfoCallback?.changeOperationStatus(data.data.driverStatus == 1)
|
||||
}
|
||||
operationStatus = data.data as PM2OperationStatusResponse.Result
|
||||
operationStatus = data.data as PassengerOperationStatusResponse.Result
|
||||
// mDrivingInfoCallback?.updatePlateNumber(data.data.plateNumber)
|
||||
}
|
||||
|
||||
@@ -362,9 +362,9 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
fun queryDriverSiteByCoordinate(){
|
||||
mContext?.let {
|
||||
PM2ServiceManager.queryDriverSiteByCoordinate(it,
|
||||
object : OchCommonServiceCallback<PM2RoutesResponse>{
|
||||
override fun onSuccess(data: PM2RoutesResponse?) {
|
||||
PassengerServiceManager.queryDriverSiteByCoordinate(it,
|
||||
object : OchCommonServiceCallback<PassengerRoutesResponse>{
|
||||
override fun onSuccess(data: PassengerRoutesResponse?) {
|
||||
|
||||
if (data == null || data.result == null){
|
||||
if (routesResult != null) {
|
||||
@@ -396,7 +396,7 @@ class PM2DrivingModel private constructor() {
|
||||
CallerLogger.d(
|
||||
SceneConstant.Companion.M_BUS_P + TAG,
|
||||
"queryDriverSiteByCoordinate = onError ="
|
||||
+ ", sn = " + driverAppSn
|
||||
+ ", sn = " + PassengerServiceManager.driverAppSn
|
||||
)
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
@@ -406,7 +406,7 @@ class PM2DrivingModel private constructor() {
|
||||
if (code == 1003){
|
||||
queryDriverOperationDelay()
|
||||
}
|
||||
if (PM2ServiceManager.driverAppSn.isEmpty()){
|
||||
if (PassengerServiceManager.driverAppSn.isEmpty()){
|
||||
return
|
||||
}
|
||||
if (code == 1003) {
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.model
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getServerToken
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2OperationStatusResponse
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2QueryLineRequest
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2RoutesResponse
|
||||
import com.mogo.och.shuttle.passenger.network.PM2ServiceApi
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
object PM2ServiceManager {
|
||||
|
||||
private var mBusPassengerServiceApi =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getShuttleUrl()).create(PM2ServiceApi::class.java)
|
||||
|
||||
private var driverSnCache = ""
|
||||
/**
|
||||
* 获取Bus司机端的sn
|
||||
* @return
|
||||
*/
|
||||
public val driverAppSn: String
|
||||
get(){
|
||||
val serverToken = getServerToken()
|
||||
if (serverToken != driverSnCache && serverToken.isNotEmpty()) {
|
||||
driverSnCache = serverToken
|
||||
}
|
||||
return driverSnCache
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询绑定行驶的小巴车路线
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryDriverSiteByCoordinate(
|
||||
context: Context, callback: OchCommonServiceCallback<PM2RoutesResponse>?
|
||||
) {
|
||||
mBusPassengerServiceApi.queryDriverSiteByCoordinate(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
PM2QueryLineRequest(
|
||||
driverAppSn
|
||||
)
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverSiteByCoordinate=sn =$driverAppSn"))
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询司机端出车收车状态,以及车牌号
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryDriverOperationStatus(
|
||||
context: Context,
|
||||
callback: OchCommonServiceCallback<PM2OperationStatusResponse>?
|
||||
) {
|
||||
mBusPassengerServiceApi.queryDriverOperationStatus(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
driverAppSn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverOperationStatus=sn =$driverAppSn"))
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.och.shuttle.passenger.network;
|
||||
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2OperationStatusResponse;
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2QueryLineRequest;
|
||||
import com.mogo.och.shuttle.passenger.bean.PM2RoutesResponse;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*
|
||||
* Bus乘客端接口定义
|
||||
*/
|
||||
public interface PM2ServiceApi {
|
||||
/**
|
||||
* 查询bus司机端绑定路线
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-shuttle-cabin/api/business/v1/passenger/lineDataWithDriver/query" )
|
||||
Observable<PM2RoutesResponse> queryDriverSiteByCoordinate(@Header("appId") String appId, @Header("ticket") String ticket, @Body PM2QueryLineRequest request);
|
||||
|
||||
/**
|
||||
* 查询司机端的登陆状态
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @GET("/autopilot-car-hailing/car/v2/driver/bus/passenger/takeOrderStatus/query")
|
||||
@GET("/och-shuttle-cabin/api/business/v1/passenger/loginStatus")
|
||||
Observable<PM2OperationStatusResponse> queryDriverOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="
|
||||
M 9.5,6.5
|
||||
v0,3 h-3,0 v-3 H9.5M11,
|
||||
5H5v6h6V5L11,
|
||||
5zM9.5,
|
||||
14.5v3h-3v-3H9.5M11,
|
||||
13H5v6h6V13L11,
|
||||
13zM17.5,
|
||||
6.5v3h-3v-3H17.5M19,
|
||||
5h-6v6h6V5L19,
|
||||
5zM13,
|
||||
13h1.5v1.5H13V13zM14.5,
|
||||
14.5H16V16h-1.5V14.5zM16,
|
||||
13h1.5v1.5H16V13zM13,
|
||||
16h1.5v1.5H13V16zM14.5,
|
||||
17.5H16V19h-1.5V17.5zM16,
|
||||
16h1.5v1.5H16V16zM17.5,
|
||||
14.5H19V16h-1.5V14.5zM17.5,
|
||||
17.5H19V19h-1.5V17.5zM22,
|
||||
7h-2V4h-3V2h5V7zM22,
|
||||
22v-5h-2v3h-3v2H22zM2,
|
||||
22h5v-2H4v-3H2V22zM2,
|
||||
2v5h2V4h3V2H2z"
|
||||
/>
|
||||
</vector>
|
||||
@@ -16,12 +16,6 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<com.mogo.och.shuttle.passenger.ui.BusPStatusBarView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
|
||||
@@ -8,6 +8,17 @@
|
||||
tools:ignore="MissingDefaultResource"
|
||||
android:background="@drawable/shuttle_p_jl_bg_status_bar">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/status_bar_logo"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:src="@drawable/shuttle_p_jl_status_bar_logo"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="@dimen/dp_94"
|
||||
android:layout_height="@dimen/dp_25"/>
|
||||
|
||||
<!--Wifi状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.WifiStateView
|
||||
android:id="@+id/wifiStateView"
|
||||
@@ -15,7 +26,7 @@
|
||||
android:layout_height="@dimen/dp_28"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/status_bar_logo"
|
||||
app:layout_constraintStart_toEndOf="@+id/status_bar_logo"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
@@ -31,18 +42,15 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/status_bar_logo"
|
||||
<com.mogo.och.shuttle.passenger.manager.scnner.ScannerStateView
|
||||
android:id="@+id/scannerStateView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:src="@drawable/shuttle_p_jl_status_bar_logo"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="@dimen/dp_94"
|
||||
android:layout_height="@dimen/dp_25"/>
|
||||
|
||||
|
||||
app:layout_constraintStart_toEndOf="@+id/wifiStateView"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@drawable/driver_connect_statis"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40"/>
|
||||
|
||||
</merge>
|
||||
@@ -19,7 +19,7 @@
|
||||
android:layout_marginStart="@dimen/dp_40" />
|
||||
|
||||
<!--魔方连接状态 蓝牙-->
|
||||
<com.mogo.och.bus.passenger.ui.widget.M2BlueToothView
|
||||
<com.mogo.och.shuttle.passenger.ui.widget.M2BlueToothView
|
||||
android:id="@+id/blueToothView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -30,6 +30,17 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_32" />
|
||||
|
||||
<com.mogo.och.shuttle.passenger.manager.scnner.ScannerStateView
|
||||
android:id="@+id/scannerStateView"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/blueToothView"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:src="@drawable/driver_connect_statis"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_40"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
|
||||
@@ -214,6 +214,41 @@ public class ViewPressedStateLancet {
|
||||
}
|
||||
}
|
||||
|
||||
@TargetClass(value = "android.view.View", scope = Scope.ALL)
|
||||
@TargetMethod(methodName = "setBackgroundResource")
|
||||
@ReplaceInvoke
|
||||
public static void setBackgroundResource(View view, int resId) {
|
||||
if (view == null) {
|
||||
return;
|
||||
}
|
||||
if (!view.isLongClickable() && !view.isClickable()) {
|
||||
view.setBackgroundResource(resId);
|
||||
return;
|
||||
}
|
||||
float alpha = getAlpha(view);
|
||||
if (alpha >= 0) {
|
||||
Drawable drawable = null;
|
||||
try {
|
||||
drawable = ContextCompat.getDrawable(view.getContext(), resId);
|
||||
} catch (Throwable ignore) {}
|
||||
Drawable replaced = checkAndReplaceDrawable(drawable, alpha);
|
||||
if (replaced != null) {
|
||||
view.setTag(R.id.click_pressed_attr_replaced, drawable);
|
||||
int paddingLeft = view.getPaddingLeft();
|
||||
int paddingRight = view.getPaddingRight();
|
||||
int paddingTop = view.getPaddingTop();
|
||||
int paddingBottom = view.getPaddingBottom();
|
||||
view.setBackground(replaced);
|
||||
view.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
|
||||
} else {
|
||||
view.setBackground(drawable);
|
||||
}
|
||||
} else {
|
||||
view.setBackgroundResource(resId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@TargetClass(value = "android.widget.ImageView", scope = Scope.ALL)
|
||||
@TargetMethod(methodName = "setImageDrawable")
|
||||
@ReplaceInvoke
|
||||
|
||||
@@ -214,7 +214,10 @@ ext {
|
||||
lancetx_compiler_lib : "com.mogo.eagle.core.lancetx:runtime:1.0.5",
|
||||
|
||||
//========================= autosize ======================
|
||||
androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
|
||||
androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
|
||||
|
||||
//========================= 扫码机 ======================
|
||||
serialport : 'com.mogo.support.serialport:client:1.0.0-alpha5',
|
||||
|
||||
thread_opt : "com.mogo.thread.opt:lib:10.10.2",
|
||||
|
||||
|
||||
@@ -18,10 +18,13 @@ import com.zhjt.mogo_core_function_devatools.upgrade.provider.db.vo.UpgradeRecor
|
||||
import com.zhjt.service.chain.*
|
||||
import java.util.TreeMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_UPGRADE_TYPE_API)
|
||||
class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
|
||||
private val isDownloading by lazy { AtomicBoolean(false) }
|
||||
|
||||
override fun init(context: Context?) {}
|
||||
|
||||
override suspend fun recordUpgradeRecord(sn: String, mac: String, type: String?, isSupportPatch: Boolean) {
|
||||
@@ -80,6 +83,8 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
} finally {
|
||||
isDownloading.set(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +105,8 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_failed" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
} finally {
|
||||
isDownloading.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,6 +117,8 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_success" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
} finally {
|
||||
isDownloading.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,6 +306,10 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
} == null
|
||||
}
|
||||
|
||||
override fun isDownloading(): Boolean {
|
||||
return isDownloading.get()
|
||||
}
|
||||
|
||||
private fun getType(type: Int): Type = if (type == 0) FULL else PATCH
|
||||
|
||||
|
||||
|
||||
@@ -206,6 +206,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
holder.clV2XLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
if(v2XMsg.type== EventTypeEnumNew.TYPE_VERIFICATION_SUCCESSFUL.poiType||v2XMsg.type == EventTypeEnumNew.TYPE_DEVICE_STATUS_NORMAL.poiType){
|
||||
holder.itemView.setBackgroundResource(R.drawable.bg_temp_v2x_success)
|
||||
}else{
|
||||
holder.itemView.setBackgroundResource(R.drawable.bg_msg_box_v2x)
|
||||
}
|
||||
if(v2XMsg.communicationType.isNullOrEmpty()){
|
||||
holder.tvV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}else{
|
||||
|
||||
@@ -620,6 +620,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
if(v2XMsg.type== EventTypeEnumNew.TYPE_VERIFICATION_SUCCESSFUL.poiType||v2XMsg.type == EventTypeEnumNew.TYPE_DEVICE_STATUS_NORMAL.poiType){
|
||||
holder.itemView.setBackgroundResource(R.drawable.bg_temp_v2x_success)
|
||||
}else{
|
||||
holder.itemView.setBackgroundResource(R.drawable.bg_msg_box_v2x)
|
||||
}
|
||||
if(v2XMsg.communicationType.isNullOrEmpty()){
|
||||
holder.tvV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}else{
|
||||
|
||||
@@ -69,15 +69,25 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
verticalLineView = findViewById(R.id.view_vertical_line)
|
||||
confirmForceTv = findViewById(R.id.tv_upgrade_confirm_force)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
confirmTv?.onClick {
|
||||
val provider = CallerDevaToolsManager.upgradeProvider()
|
||||
if (provider?.isDownloading() == true) {
|
||||
ToastUtils.showShort("正在下载最新版本,请稍候再试...")
|
||||
return@onClick
|
||||
}
|
||||
downloadApp()
|
||||
}
|
||||
|
||||
cancelTv?.setOnClickListener {
|
||||
cancelTv?.onClick {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
confirmForceTv?.setOnClickListener {
|
||||
confirmForceTv?.onClick {
|
||||
val provider = CallerDevaToolsManager.upgradeProvider()
|
||||
if (provider?.isDownloading() == true) {
|
||||
ToastUtils.showShort("正在下载最新版本,请稍候再试...")
|
||||
return@onClick
|
||||
}
|
||||
downloadApp()
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
import kotlinx.android.synthetic.main.view_system_version.view.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
@@ -69,6 +71,11 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
//鹰眼版本视图点击事件
|
||||
ivPadVersion.setOnClickListener {
|
||||
hmiAction("$M_HMI$$TAG", "pad version view clicked")
|
||||
val provider = CallerDevaToolsManager.upgradeProvider()
|
||||
if (provider?.isDownloading() == true) {
|
||||
ToastUtils.showShort("正在下载最新版本,请稍候再试...")
|
||||
return@setOnClickListener
|
||||
}
|
||||
CallerDevaToolsManager.queryAppUpgrade()
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//ActivityUtils.setDefaultL(this);
|
||||
CallerLogger.i(M_HMI + TAG, "onResume");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,12 +79,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
CallerLogger.i(M_HMI + TAG, "onPause");
|
||||
mIsHomeKeyDown = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
CallerLogger.i(M_HMI + TAG, "onStop");
|
||||
IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this);
|
||||
//ActivityLifecycleManager.getInstance().setAppActive(false);
|
||||
}
|
||||
@@ -161,6 +164,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallerLogger.i(M_HMI + TAG, "onDestroy");
|
||||
stopCountDown();
|
||||
try {
|
||||
// acc off 之后会出现进程还在,但是页面被杀的情况,这个直接杀掉进程,然后让整个进程重启
|
||||
@@ -182,6 +186,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
CallerLogger.i(M_HMI + TAG, "onKeyDown");
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (currentTimeMillis - lastKeyDownTimeMillis < 2000) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#53000000" />
|
||||
<corners android:radius="@dimen/dp_24" />
|
||||
|
||||
</shape>
|
||||
@@ -551,6 +551,45 @@ enum class EventTypeEnumNew(
|
||||
"可能应急停车,注意随时接管!"
|
||||
),
|
||||
|
||||
//核销成功
|
||||
TYPE_VERIFICATION_SUCCESSFUL(
|
||||
"VERIFICATION_SUCCESSFUL",
|
||||
"验票成功",
|
||||
"%s张%s票(如全程票)",
|
||||
R.drawable.icon_warning_v2x_verification_successful,
|
||||
"%s张%s票(如全程票)",
|
||||
"%s张%s票(如全程票)"
|
||||
),
|
||||
|
||||
//核销异常
|
||||
TYPE_ABNORMAL_VERIFICATION(
|
||||
"ABNORMAL_VERIFICATION",
|
||||
"验票失败",
|
||||
"%s",
|
||||
R.drawable.icon_warning_take_over,
|
||||
"%s",
|
||||
"%s"
|
||||
),
|
||||
|
||||
//设备状态正常
|
||||
TYPE_DEVICE_STATUS_NORMAL(
|
||||
"DEVICE_STATUS_NORMAL",
|
||||
"核销设备正常",
|
||||
"详情%s",
|
||||
R.drawable.icon_warning_v2x_verification_successful,
|
||||
"详情%s",
|
||||
"详情%s"
|
||||
),
|
||||
//设备状态异常
|
||||
TYPE_DEVICE_STATUS_ABNORMAL(
|
||||
"DEVICE_STATUS_ABNORMAL",
|
||||
"核销设备异常",
|
||||
"详情%s",
|
||||
R.drawable.icon_default,
|
||||
"详情%s",
|
||||
"详情%s"
|
||||
),
|
||||
|
||||
TYPE_VIP_IDENTIFICATION_PASS("20022", "VIP通行", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您变为绿灯", "VIP车辆优先通行,已为您变为绿灯"),
|
||||
TYPE_VIP_IDENTIFICATION_EXTEND("20023", "VIP通行", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您延长绿灯", "VIP车辆优先通行,已为您延长绿灯"),
|
||||
TYPE_VIP_ERROR_IDENTIFICATION("20024", "VIP通行", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"),
|
||||
@@ -890,6 +929,22 @@ enum class EventTypeEnumNew(
|
||||
TYPE_EXCEPTION_EXIT_PARALLEL_DRIVING.poiType->{
|
||||
TYPE_EXCEPTION_EXIT_PARALLEL_DRIVING.poiTypeStr
|
||||
}
|
||||
//核销成功
|
||||
TYPE_VERIFICATION_SUCCESSFUL.poiType ->{
|
||||
TYPE_VERIFICATION_SUCCESSFUL.poiTypeStr
|
||||
}
|
||||
//核销异常
|
||||
TYPE_ABNORMAL_VERIFICATION.poiType ->{
|
||||
TYPE_ABNORMAL_VERIFICATION.poiTypeStr
|
||||
}
|
||||
//设备状态正常
|
||||
TYPE_DEVICE_STATUS_NORMAL.poiType ->{
|
||||
TYPE_DEVICE_STATUS_NORMAL.poiTypeStr
|
||||
}
|
||||
//设备状态异常
|
||||
TYPE_DEVICE_STATUS_ABNORMAL.poiType ->{
|
||||
TYPE_DEVICE_STATUS_ABNORMAL.poiTypeStr
|
||||
}
|
||||
//机动车
|
||||
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType ->{
|
||||
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiTypeStr
|
||||
@@ -1189,6 +1244,22 @@ enum class EventTypeEnumNew(
|
||||
TYPE_EXCEPTION_EXIT_PARALLEL_DRIVING.poiType->{
|
||||
R.drawable.icon_warning_take_over
|
||||
}
|
||||
//核销成功
|
||||
TYPE_VERIFICATION_SUCCESSFUL.poiType->{
|
||||
R.drawable.icon_warning_v2x_verification_successful
|
||||
}
|
||||
//核销异常
|
||||
TYPE_ABNORMAL_VERIFICATION.poiType->{
|
||||
R.drawable.icon_warning_take_over
|
||||
}
|
||||
//设备状态正常
|
||||
TYPE_DEVICE_STATUS_NORMAL.poiType->{
|
||||
R.drawable.icon_warning_v2x_verification_successful
|
||||
}
|
||||
//设备状态异常
|
||||
TYPE_DEVICE_STATUS_ABNORMAL.poiType->{
|
||||
R.drawable.icon_default
|
||||
}
|
||||
//机动车
|
||||
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType -> {
|
||||
R.drawable.icon_warning_v2x_motorcycle_collision
|
||||
|
||||
@@ -49,4 +49,6 @@ interface IMoGoUpgradeProvider: IProvider {
|
||||
suspend fun hasUpgradeRecord(): Boolean
|
||||
|
||||
suspend fun isNeedGoPatchUpgrade(): Boolean
|
||||
|
||||
fun isDownloading(): Boolean
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
@@ -150,28 +150,28 @@ MATRIX_VERSION=2.0.8
|
||||
# 测试模式司机端版本号
|
||||
NOOP_DRIVER_VERSION=3.2.0
|
||||
# 公交模式司机端版本号
|
||||
BUS_DRIVER_VERSION=6.2.6
|
||||
BUS_DRIVER_VERSION=6.2.8
|
||||
# 公交模式乘客端端版本号
|
||||
BUS_PASSENGER_VERSION=5.2.6
|
||||
BUS_PASSENGER_VERSION=5.2.8
|
||||
# 接驳模式司机端版本号
|
||||
SHUTTLE_DRIVER_VERSION=6.2.6
|
||||
SHUTTLE_DRIVER_VERSION=6.2.8
|
||||
# 接驳模式乘客端端版本号
|
||||
SHUTTLE_PASSENGER_VERSION=5.2.6
|
||||
SHUTTLE_PASSENGER_VERSION=5.2.8
|
||||
# 出租车模式司机端版本号
|
||||
TAXI_DRIVER_VERSION=6.2.6
|
||||
TAXI_DRIVER_VERSION=6.2.8
|
||||
# 出租车模式乘客端端版本号
|
||||
TAXI_PASSENGER_VERSION=5.2.6
|
||||
TAXI_PASSENGER_VERSION=5.2.8
|
||||
|
||||
# 出租车模式司机端版本号
|
||||
TAXIUNMANNED_DRIVER_VERSION=6.2.6
|
||||
TAXIUNMANNED_DRIVER_VERSION=6.2.8
|
||||
# 出租车模式乘客端端版本号
|
||||
TAXIUNMANNED_PASSENGER_VERSION=5.2.6
|
||||
TAXIUNMANNED_PASSENGER_VERSION=5.2.8
|
||||
|
||||
# 包车模式司机端版本号
|
||||
CHARTER_DRIVER_VERSION=6.2.6
|
||||
CHARTER_DRIVER_VERSION=6.2.8
|
||||
# 包车模式乘客端端版本号
|
||||
CHARTER_PASSENGER_VERSION=5.2.6
|
||||
CHARTER_PASSENGER_VERSION=5.2.8
|
||||
# 支持云控清扫车模式司机端版本号
|
||||
SWEEPERCLOUD_DRIVER_VERSION=6.2.6
|
||||
SWEEPERCLOUD_DRIVER_VERSION=6.2.8
|
||||
# 清扫车模式司机端版本号
|
||||
SWEEPEROPERATE_DRIVER_VERSION=6.2.6
|
||||
SWEEPEROPERATE_DRIVER_VERSION=6.2.8
|
||||
|
||||
Reference in New Issue
Block a user