[2.0.0] 修复接驳乘客屏偶现路线不更新问题

This commit is contained in:
wangmingjun
2023-04-10 15:30:36 +08:00
parent 56ff6e1bc4
commit 9c0ba1f3b0
6 changed files with 38 additions and 13 deletions

View File

@@ -37,16 +37,13 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() {
}
loginCallback?.loginSuccess(data)
updateLoginLocalStatus(isLogin())
data?.data?.driverStatus?.let { updateLoginLocalStatus(it) }
}
private fun updateLoginLocalStatus(isLogin: Boolean) {
var loginCacheStatus = LoginCacheStatus(if (isLogin){
1
}else {
0
},DateTimeUtil.getCurrentTimeStamp())
private fun updateLoginLocalStatus(loginStatus: Int = 0) {
var loginCacheStatus = LoginCacheStatus(loginStatus,DateTimeUtil.getCurrentTimeStamp())
CacheDataManager.instance.putCacheData(mContext, BusCacheKey.BUS_LOGIN_STATUS_CACHE,
GsonUtils.toJson(loginCacheStatus))
}
@@ -60,7 +57,7 @@ object OchCommonLoginStatusDefaultModel : OchCommonLoginStatusModel() {
}
loginCallback?.loginFail(isLogin)
updateLoginLocalStatus(isLogin)
updateLoginLocalStatus(0)
}
}

View File

@@ -1,5 +1,7 @@
package com.mogo.och.data.bean;
import java.util.Objects;
/**
* 单个网约车小巴车站信息
*
@@ -93,6 +95,28 @@ public class BusStationBean {
this.leaving = leaving;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BusStationBean that = (BusStationBean) o;
return siteId == that.siteId
&& seq == that.seq
&& Double.compare(that.gcjLon, gcjLon) == 0
&& Double.compare(that.gcjLat, gcjLat) == 0
&& Double.compare(that.lon, lon) == 0
&& Double.compare(that.lat, lat) == 0
&& drivingStatus == that.drivingStatus
&& leaving == that.leaving
&& name.equals(that.name)
&& nameKr.equals(that.nameKr);
}
@Override
public int hashCode() {
return Objects.hash(siteId, name, nameKr, seq, gcjLon, gcjLat, lon, lat, drivingStatus, leaving);
}
@Override
public String toString() {
return "BusStationBean{" +
@@ -107,4 +131,6 @@ public class BusStationBean {
", leaving=" + leaving +
'}';
}
}

View File

@@ -273,7 +273,7 @@ public class BusPassengerModel {
clearLocalRouteResult();
return;
}
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "queryDriverSiteByCoordinate = update");
routesResult = result;
if (mRouteLineInfoCallback != null){
@@ -578,6 +578,7 @@ public class BusPassengerModel {
public void dynamicCalculateRouteInfo() {
//计算当前位置和下一站的剩余点集合
//计算剩余点总里程和时间
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "轨迹排查==mTwoStationsRouts.size() = " + mTwoStationsRouts.size());
if (mTwoStationsRouts.size() == 0){
calculateTwoStationsRoute();
}

View File

@@ -421,7 +421,7 @@ class PM2DrivingModel private constructor() {
updateLocalOrder()
return
}
d(SceneConstant.M_BUS_P+TAG, "queryDriverSiteByCoordinate= update")
routesResult = result
mDrivingInfoCallback?.updateLine(result.name, result.runningDur)
@@ -445,6 +445,7 @@ class PM2DrivingModel private constructor() {
mNextStationIndex = i + 1
return
} else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) {
d(SceneConstant.M_BUS_P+TAG,"och-rotting--arrived ")
mPreRouteIndex = 0
isGoingToNextStation = false
startOrStopCalculateRouteInfo(false)
@@ -484,7 +485,7 @@ class PM2DrivingModel private constructor() {
fun dynamicCalculateRouteInfo(){
//计算当前位置和下一站的剩余点集合
//计算剩余点总里程和时间
d(SceneConstant.M_BUS_P + TAG, "och-rotting==mTwoStationsRouts.size() = " + mTwoStationsRouts.size)
//计算当前位置和下一站的剩余点集合
//计算剩余点总里程和时间
if (mTwoStationsRouts.size == 0) {

View File

@@ -13,7 +13,7 @@
<string name="m2_over_map_style_path">m2_map_style.data</string>
<string name="m2_over_map_style_extra_path">m2_map_style_extra.data</string>
<string name="m2_p_auto_tv">Auto</string>
<string name="m2_p_auto_tv">AUTO</string>
<string name="m2_p_station_title_tv">下一站:</string>
<string name="m2_p_station_title_arrived_tv">已到站</string>
<string name="m2_p_empty_tv">暂无站点</string>

View File

@@ -79,7 +79,6 @@ import com.mogo.och.common.module.voice.VoiceNotice;
import com.mogo.och.common.module.bean.dpmsg.BusCacheKey;
import com.mogo.och.data.bean.BusTransferData;
import com.mogo.och.data.manager.cache.CacheDataManager;
import com.zhidao.socket.utils.LoginStatusUtil;
import org.jetbrains.annotations.NotNull;
@@ -829,6 +828,7 @@ public class OrderModel {
private void pushCacheTransferData(BusRoutesResult result) {
BusTransferData data = new BusTransferData(LoginStatusManager.isLogin() ? 1:0,result);
CallerLogger.INSTANCE.d(M_BUS + TAG, "pushCacheTransferData = " + GsonUtils.toJson(data));
CacheDataManager.Companion.getInstance().putCacheData(mContext,
BusCacheKey.BUS_LINE_CACHE,
GsonUtils.toJson(data));