[opt] 修改实体类造成的崩溃

This commit is contained in:
wangmingjun
2023-03-30 19:54:04 +08:00
parent e545d80418
commit 8051629a30
3 changed files with 26 additions and 19 deletions

View File

@@ -38,10 +38,8 @@ data class DPOrderClosedMsg(
): BaseDPMsg(DPMsgType.TYPE_ORDER_CLOSED.type)
data class AppConnectMsg(var isViewShow: Boolean, var isPlay: Boolean, var msg: String,
override var type: Int
): BaseDPMsg(type)
): BaseDPMsg(DPMsgType.TYPE_COMMON.type)
data class TaskDetailsMsg(
var msg: String,
override var type: Int
): BaseDPMsg(type)
): BaseDPMsg(DPMsgType.TYPE_TASK_DETAILS.type)

View File

@@ -138,8 +138,15 @@ public class BusPassengerModel {
private void queryDriverByLocalDriver() {
//本地去请求司机端
AppConnectMsg msg = new AppConnectMsg(false,false,"",
DPMsgType.TYPE_TASK_DETAILS.getType());
TaskDetailsMsg msg = new TaskDetailsMsg("");
sendMsgToServer(GsonUtils.toJson(msg));
}
private void queryLoginStatusByLocal() {
//本地去请求司机端
LoginCacheStatus msg = new LoginCacheStatus(0,
DPMsgType.TYPE_LOGIN_STATUS.getType());
sendMsgToServer(GsonUtils.toJson(msg));
}
@@ -244,11 +251,12 @@ public class BusPassengerModel {
private void clearLocalRouteResult() {
if (routesResult != null) {
routesResult = null;
mNextStationIndex = 0;
startOrStopCalculateRouteInfo(false);
if (mRouteLineInfoCallback != null){
mRouteLineInfoCallback.showNoTaskView();
}
}
mNextStationIndex = 0;
startOrStopCalculateRouteInfo(false);
if (mRouteLineInfoCallback != null){
mRouteLineInfoCallback.showNoTaskView();
}
}
@@ -378,6 +386,7 @@ public class BusPassengerModel {
return;
}
BusRoutesResult result = GsonUtils.fromJson(msg.getMsg(), BusRoutesResult.class);
if (result != null && result.getWriteVersion() > routesResult.getWriteVersion()) {
routesResult = result;
updatePassengerRouteInfo(routesResult);

View File

@@ -237,6 +237,8 @@ public class OrderModel {
}else {// 未登陆
sendLoginStatusToClient();
}
}else if (msg != null && msg.getType() == DPMsgType.TYPE_LOGIN_STATUS.getType()){
sendLoginStatusToClient();
}
}
}
@@ -265,7 +267,7 @@ public class OrderModel {
}
if (list != null && list.contains(2)){ //乘客屏
AppConnectMsg msg = new AppConnectMsg(true,false,obj.getContext(),DPMsgType.TYPE_COMMON.getType());
AppConnectMsg msg = new AppConnectMsg(true,false,obj.getContext());
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(msg).getBytes());
}
@@ -818,8 +820,7 @@ public class OrderModel {
}
private void sendTaskDetailsToClients() {
TaskDetailsMsg arrivedMsg = new TaskDetailsMsg(GsonUtils.toJson(busRoutesResult),
DPMsgType.TYPE_TASK_DETAILS.getType());
TaskDetailsMsg arrivedMsg = new TaskDetailsMsg(GsonUtils.toJson(busRoutesResult));
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(arrivedMsg).getBytes());
@@ -841,7 +842,7 @@ public class OrderModel {
private void sendArrivedStationToClient(String arriveStation) {
AppConnectMsg arrivedMsg = new AppConnectMsg(false,true,String.format(mContext
.getString(R.string.bus_arrived_station_tip),
arriveStation),DPMsgType.TYPE_COMMON.getType());
arriveStation));
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(arrivedMsg).getBytes());
}
@@ -849,7 +850,7 @@ public class OrderModel {
private void sendStartStationToClient(String nextStation) {
AppConnectMsg startMsg = new AppConnectMsg(false,true,String.format(mContext
.getString(R.string.bus_leave_station_tip),
nextStation),DPMsgType.TYPE_COMMON.getType());
nextStation));
UiThreadHandler.postDelayed(()->
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
@@ -858,15 +859,14 @@ public class OrderModel {
private void sendEndTaskToClient() {
AppConnectMsg endMsg = new AppConnectMsg(false,true,mContext
.getString(R.string.bus_end_task_tip),
DPMsgType.TYPE_COMMON.getType());
.getString(R.string.bus_end_task_tip));
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(endMsg).getBytes());
}
public void sendWriteOffNumToClient(String msg){
AppConnectMsg passengerMsg = new AppConnectMsg(false,true,msg,DPMsgType.TYPE_COMMON.getType());
AppConnectMsg passengerMsg = new AppConnectMsg(false,true,msg);
CallerTelematicManager.INSTANCE.sendMsgToAllClients(OchCommonConst.BUSINESS_STRING,
GsonUtils.toJson(passengerMsg).getBytes());