[2.10.0]bus司机端路线状态重置功能
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/22
|
||||
*
|
||||
* 小巴车重置路线状态请求参数
|
||||
*/
|
||||
class BusResetLineStatusRequest {
|
||||
|
||||
private String sn;
|
||||
public BusResetLineStatusRequest() {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -452,18 +452,16 @@ public class BusOrderModel {
|
||||
, new IBusServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线成功: " + o);
|
||||
isGoingToNextStation = false;
|
||||
if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
if (o.code == 0){ // 重置成功
|
||||
queryBusRoutes();
|
||||
}
|
||||
renderBusStationsStatus(o.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusResetLineStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
@@ -88,11 +89,11 @@ public class BusServiceManager {
|
||||
* @param callback
|
||||
*/
|
||||
public void resetCurrentLineStatus(Context context, int lineId, IBusServiceCallback<BusRoutesResponse> callback){
|
||||
// mService.switchLine(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
// ,MoGoAiCloudClientConfig.getInstance().getToken(),new BusResetDrivingLineRequest(lineId))
|
||||
// .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(getSubscribeImpl(context,callback,"debugResetStationStatus"));
|
||||
// TODO 需要重置接口
|
||||
mService.resetCurrentLineStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new BusResetLineStatusRequest())
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"resetCurrentLineStatus"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +204,8 @@ public class BusServiceManager {
|
||||
|
||||
public void queryBusLines(Context context, IBusServiceCallback<BusQueryLinesResponse> callback){
|
||||
mService.queryBusLines(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"queryBusLines"));
|
||||
|
||||
@@ -3,6 +3,7 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusResetLineStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
@@ -148,5 +149,9 @@ public interface IBusApiService {
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate" )
|
||||
Observable<BaseData> updateOrderRoute(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusRoutePlanningUpdateReqBean data);
|
||||
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST("/autopilot-car-hailing/operation/v1/driver/bus/line/resetStart")
|
||||
Observable<BusRoutesResponse> resetCurrentLineStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetLineStatusRequest data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user