[6.4.4]
[bus review]
This commit is contained in:
@@ -1,86 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/23
|
||||
* <p>
|
||||
* 小巴订单
|
||||
*/
|
||||
public class BusOrderBean {
|
||||
|
||||
/**
|
||||
* orderNo number
|
||||
* passengerPhone string 下单用户电话
|
||||
* startStationId integer 开始站点
|
||||
* startStationName string
|
||||
* endStationId integer 结束站点
|
||||
* endStationName string
|
||||
*/
|
||||
|
||||
private String orderNo;
|
||||
private String passengerPhone;
|
||||
private int startStationId;//乘客上车点
|
||||
private String startStationName;
|
||||
private String endStationName;
|
||||
private int endStationId;//乘客下车点
|
||||
|
||||
public void setOrderNo(String orderNo) {
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
public void setPassengerPhone(String passengerPhone) {
|
||||
this.passengerPhone = passengerPhone;
|
||||
}
|
||||
|
||||
public void setStartStationId(int startStationId) {
|
||||
this.startStationId = startStationId;
|
||||
}
|
||||
|
||||
public void setStartStationName(String startStationName) {
|
||||
this.startStationName = startStationName;
|
||||
}
|
||||
|
||||
public void setEndStationName(String endStationName) {
|
||||
this.endStationName = endStationName;
|
||||
}
|
||||
|
||||
public void setEndStationId(int endStationId) {
|
||||
this.endStationId = endStationId;
|
||||
}
|
||||
|
||||
public String getOrderNo() {
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public String getPassengerPhone() {
|
||||
return passengerPhone;
|
||||
}
|
||||
|
||||
public int getStartStationId() {
|
||||
return startStationId;
|
||||
}
|
||||
|
||||
public String getStartStationName() {
|
||||
return startStationName;
|
||||
}
|
||||
|
||||
public String getEndStationName() {
|
||||
return endStationName;
|
||||
}
|
||||
|
||||
public int getEndStationId() {
|
||||
return endStationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusOrderBean{" +
|
||||
"orderNo=" + orderNo +
|
||||
", passengerPhone='" + passengerPhone + '\'' +
|
||||
", startStationId=" + startStationId +
|
||||
", startStationName='" + startStationName + '\'' +
|
||||
", endStationName='" + endStationName + '\'' +
|
||||
", endStationId=" + endStationId +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/19
|
||||
*/
|
||||
public class BusOrdersResponse extends BaseData {
|
||||
public Result data;
|
||||
public static class Result{
|
||||
public List<BusOrderBean> orders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusOrdersResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/19
|
||||
*/
|
||||
public class BusQueryWriteOffPassengersResponse extends BaseData {
|
||||
public List<WriteOffPassenger> data;
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询核销乘客
|
||||
*/
|
||||
public class BusWriteOffPassengersQueryRequest {
|
||||
|
||||
private String sn;
|
||||
private int taskId;
|
||||
private int siteId;
|
||||
private long verificationTime;
|
||||
public BusWriteOffPassengersQueryRequest(int taskId, int siteId,long prePassengerTime) {
|
||||
this.sn = SharedPrefsMgr.getInstance().getSn();
|
||||
this.taskId = taskId;
|
||||
this.siteId = siteId;
|
||||
this.verificationTime = prePassengerTime;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/19
|
||||
*/
|
||||
public static class BusOrdersResponse extends BaseData {
|
||||
public com.mogo.och.bus.bean.BusOrdersResponse.Result data;
|
||||
public static class Result{
|
||||
public List<BusOrderBean> orders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusOrdersResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public static class BusRoutesResponse extends BaseData {
|
||||
private BusRoutesResult data;
|
||||
|
||||
public BusRoutesResult getResult() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setResult(BusRoutesResult data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusRoutesResponse{" +
|
||||
"data=" + data +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public static class BusStationBean {
|
||||
private int siteId;
|
||||
private String name;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private boolean leaving;
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
public double getGcjLat() {
|
||||
return gcjLat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public int getDrivingStatus() {
|
||||
return drivingStatus;
|
||||
}
|
||||
|
||||
public boolean isLeaving() {
|
||||
return leaving;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setGcjLon(double gcjLon) {
|
||||
this.gcjLon = gcjLon;
|
||||
}
|
||||
|
||||
public void setGcjLat(double gcjLat) {
|
||||
this.gcjLat = gcjLat;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setDrivingStatus(int drivingStatus) {
|
||||
this.drivingStatus = drivingStatus;
|
||||
}
|
||||
|
||||
public void setLeaving(boolean leaving) {
|
||||
this.leaving = leaving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusStationBean{" +
|
||||
"siteId=" + siteId +
|
||||
", name='" + name + '\'' +
|
||||
", seq=" + seq +
|
||||
", gcjLon=" + gcjLon +
|
||||
", gcjLat=" + gcjLat +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", leaving=" + leaving +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr;
|
||||
|
||||
/**
|
||||
* 查询下车乘客请求参数
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class QueryLeaveAwayPassengersRequest {
|
||||
private String sn;
|
||||
private int seq; //站点在线路中的序号
|
||||
private int siteId; //站点id
|
||||
|
||||
public QueryLeaveAwayPassengersRequest(int seq, int siteId) {
|
||||
this.sn = SharedPrefsMgr.getInstance().getSn();
|
||||
this.seq = seq;
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/26
|
||||
*
|
||||
* 到站查询下车乘客
|
||||
*/
|
||||
class QueryLeaveAwayPassengersResponse extends BaseData {
|
||||
|
||||
public Result data;
|
||||
|
||||
public static class Result {
|
||||
|
||||
public List< LeaveAwayPassenger > orders;
|
||||
}
|
||||
|
||||
public static class LeaveAwayPassenger {
|
||||
/**
|
||||
* orderNo: 订单no
|
||||
* orderStatus: 订单状态
|
||||
* orderType:订单类型:0及时,1预约
|
||||
* bookingTime:预计用车时间
|
||||
* businessType:订单运营类型 9:taxi,10:bus
|
||||
* startSiteId: 起点站点id
|
||||
* userPhone: 乘客联系方式
|
||||
* startSitePoint:开始站点坐标
|
||||
* startSiteAddr:开始地址
|
||||
* endSiteId:结束站点id
|
||||
* endSitePoint:结束站点坐标
|
||||
* carNumber:车牌号
|
||||
* createTime: 创建时间
|
||||
* startTime:开始时间
|
||||
* startSiteGcjPoint:高精坐标
|
||||
* endSiteGcjPoint:
|
||||
*/
|
||||
//todo 目前是需要乘客电话来通知乘客下车 目前后台没有乘客信息userPhone
|
||||
public String orderNo;
|
||||
public int orderStatus;
|
||||
public int orderType;
|
||||
public long bookingTime;
|
||||
public int businessType;
|
||||
public int startSiteId;
|
||||
public String passengerPhone;
|
||||
public List<Double> startSitePoint;
|
||||
public String startSiteAddr;
|
||||
public int endSiteId;
|
||||
public List<Double> endSitePoint;
|
||||
public String carNumber;
|
||||
public long createTime;
|
||||
public long startTime;
|
||||
public List< Double > startSiteGcjPoint;
|
||||
public List< Double > endSiteGcjPoint;
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,6 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
* Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等)
|
||||
*/
|
||||
public interface IBusControllerStatusCallback {
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
//开始开启自动驾驶
|
||||
void startOpenAutopilot();
|
||||
}
|
||||
|
||||
@@ -100,14 +100,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatusTv = findViewById(R.id.bus_autopolot_btn_tv);
|
||||
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
|
||||
|
||||
// mTrafficLightView = findViewById(R.id.bus_traffic_light_view);
|
||||
// CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
|
||||
|
||||
// tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
|
||||
tvArrived = findViewById(R.id.module_mogo_och_arrived_tv);
|
||||
|
||||
// mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc);
|
||||
|
||||
|
||||
FrameLayout flSpeed = findViewById(R.id.fl_speed);
|
||||
if (flSpeed != null) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.constant.BusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -53,7 +52,6 @@ import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.AppConnectMsg;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager;
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback;
|
||||
@@ -105,8 +103,6 @@ public class OrderModel {
|
||||
private boolean isGoingToNextStation = false;
|
||||
// 运营类型
|
||||
private static final int VEHICLE_TYPE = 10;
|
||||
private static final int MSG_QUERY_BUS_STATION = 1001;
|
||||
private static final long QUERY_BUS_STATION_DELAY = 5000;
|
||||
|
||||
private IRefreshBusStationsCallback refreshBusStationsCallback;
|
||||
private ISlidePannelHideCallback slidePanelHideCallback;
|
||||
@@ -119,14 +115,6 @@ public class OrderModel {
|
||||
//0: 代表没有启动过 1代表是启动第一次,当>=1 代表是重试 每次到站/路线结束清空置为0
|
||||
private volatile int firstStartAutopilot = 0;
|
||||
|
||||
private final Handler handler = new Handler(msg -> {
|
||||
if (msg.what == MSG_QUERY_BUS_STATION) {
|
||||
queryBusRoutes();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
private OrderModel() {
|
||||
}
|
||||
|
||||
@@ -299,7 +287,6 @@ public class OrderModel {
|
||||
public void release() {
|
||||
|
||||
startOrStopOrderLoop(false);
|
||||
//startOrStopQueryPassengerWriteOff(false);
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
@@ -339,9 +326,6 @@ public class OrderModel {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
|
||||
}
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
if (isGoingToNextStation && !isArrivedStation) {
|
||||
@@ -1009,13 +993,6 @@ public class OrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 延时查询站点信心
|
||||
*/
|
||||
private void queryBusStationDelay() {
|
||||
handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地
|
||||
*/
|
||||
@@ -1059,7 +1036,6 @@ public class OrderModel {
|
||||
clearBusStationDatas();
|
||||
queryBusRoutes();// 重新获取任务
|
||||
removeTipRunnables();
|
||||
// startOrStopQueryPassengerWriteOff(false);
|
||||
ttsEndTask();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package com.mogo.och.bus.net;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.BusCloseTaskRequest;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryWriteOffPassengersResponse;
|
||||
import com.mogo.och.bus.bean.BusWriteOffPassengersQueryRequest;
|
||||
import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.bus.bean.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.bean.BusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.BusUpdateSiteStatusRequest;
|
||||
|
||||
@@ -38,9 +33,7 @@ public interface IBascApiService {
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
// @POST( "/autopilot-car-hailing/line/v2/lineDataWithDriver/query" )
|
||||
@POST( "/autopilot-car-hailing/line/v2/driver/bus/lineDataWithDriver/query" )
|
||||
// @POST( "/mock/268/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
|
||||
Observable<BusRoutesResponse> queryBusRoutes(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusQueryLineStationsRequest request);
|
||||
|
||||
/**
|
||||
@@ -58,10 +51,7 @@ public interface IBascApiService {
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/car/v2/bus/driving/away")
|
||||
// @POST("/autopilot-car-hailing/car/v2/driver/bus/driving/away")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/leave")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/away")
|
||||
Observable<BaseData> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
/**
|
||||
@@ -70,37 +60,16 @@ public interface IBascApiService {
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/order/v2/bus/driving/attachSite")
|
||||
// @POST("/autopilot-car-hailing/order/v2/driver/bus/driving/attachSite")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/arrive")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/attachSite")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 到站查询下车乘客
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/order/v2/bus/driving/siteArrivedOrders")
|
||||
@POST("/autopilot-car-hailing/order/v2/driver/bus/driving/siteArrivedOrders")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
|
||||
Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Header ("appId") String appId,@Header("ticket") String ticket,@Body QueryLeaveAwayPassengersRequest request);
|
||||
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @GET("/autopilot-car-hailing/order/v2/bus/servicingOrders/query")
|
||||
@GET("/autopilot-car-hailing/order/v2/driver/bus/servicingOrders/query")
|
||||
// @GET("/mock/268/autopilot-car-hailing/bus/api/servicingOrders/query")
|
||||
Observable<BusOrdersResponse> queryBusOrders(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @POST( "/autopilot-car-hailing/location/v2/driver/heartbeat" )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/heartbeat" )
|
||||
Observable<BaseData> runCarHeartbeat(@Header ("appId") String appId,@Header("ticket") String ticket,@Body CarHeartbeatReqBean data);
|
||||
|
||||
@@ -125,6 +94,13 @@ public interface IBascApiService {
|
||||
Observable<BusQueryLineTaskResponse> queryBusTaskByLineId(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("lineId") String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 上传轨迹信息
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@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);
|
||||
@@ -149,16 +125,5 @@ public interface IBascApiService {
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/endTask")
|
||||
Observable<BaseData> endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
|
||||
/**
|
||||
* 查询核销乘客,目前不再使用,改为后台下发核销的乘客
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST("/autopilot-car-hailing/operation/v1/driver/order/verificationResult")
|
||||
Observable<BusQueryWriteOffPassengersResponse> queryWriteOffPassengers(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusWriteOffPassengersQueryRequest data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,12 @@ package com.mogo.och.bus.net;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.BusCloseTaskRequest;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryWriteOffPassengersResponse;
|
||||
import com.mogo.och.bus.bean.BusResetDrivingLineRequest;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.BusUpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusWriteOffPassengersQueryRequest;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
@@ -34,12 +27,8 @@ import retrofit2.http.Query;
|
||||
public interface ISAASApiService {
|
||||
/**
|
||||
* 根据车机坐标获取所在区域全部站点信息
|
||||
*
|
||||
* @param request 请求参数
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
// @POST( "/autopilot-car-hailing/line/v2/driver/bus/lineDataWithDriver/query" )
|
||||
@GET( "/och-bus-cabin/api/business/v1/driver/bus/lineDataWithDriver/query" )
|
||||
Observable<BusRoutesResponse> queryBusRoutes(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
@@ -49,64 +38,28 @@ public interface ISAASApiService {
|
||||
* 开始路线
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
// @POST( "/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/startTask" )
|
||||
@POST( "/och-bus-cabin/cab/flow/v1/bus/driver/startTask" )
|
||||
Observable<BusRoutesResponse> switchLine(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetDrivingLineRequest request);
|
||||
|
||||
/**
|
||||
* 离站,通知服务器
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/leave")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/leave")
|
||||
Observable<BaseData> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
/**
|
||||
* 到站 更新到站信息
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/arrive")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/arrive")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 到站查询下车乘客
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/order/v2/driver/bus/driving/siteArrivedOrders")
|
||||
@POST("/och-bus-cabin/api/business/v1/siteArrivedOrders")
|
||||
Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Header ("appId") String appId,@Header("ticket") String ticket,@Body QueryLeaveAwayPassengersRequest request);
|
||||
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @GET("/autopilot-car-hailing/order/v2/driver/bus/servicingOrders/query")
|
||||
@GET("/och-bus-cabin/api/business/v1/servicingOrders/query")
|
||||
Observable<BusOrdersResponse> queryBusOrders(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/heartbeat" )
|
||||
Observable<BaseData> runCarHeartbeat(@Header ("appId") String appId,@Header("ticket") String ticket,@Body CarHeartbeatReqBean data);
|
||||
|
||||
/**
|
||||
* 查询车辆配置的所有路线
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @GET("/autopilot-car-hailing/line/v2/driver/bus/bindLine/query")
|
||||
@GET("/och-bus-cabin/api/business/v1/driver/BusBindLine")
|
||||
Observable<BusQueryLinesResponse> queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
@@ -118,11 +71,13 @@ public interface ISAASApiService {
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @GET("/autopilot-car-hailing/line/v2/driver/bus/task/query")
|
||||
@GET("/och-bus-cabin/api/business/v1/driver/bus/task/query")
|
||||
Observable<BusQueryLineTaskResponse> queryBusTaskByLineId(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("lineId") String lineId);
|
||||
|
||||
|
||||
/**
|
||||
* 上传轨迹信息
|
||||
*/
|
||||
@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);
|
||||
@@ -135,7 +90,6 @@ public interface ISAASApiService {
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/abortTask")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/abortTask")
|
||||
Observable<BaseData> abortTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
|
||||
@@ -147,19 +101,8 @@ public interface ISAASApiService {
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/endTask")
|
||||
@POST("/och-bus-cabin/cab/flow/v1/bus/driver/endTask")
|
||||
Observable<BaseData> endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
|
||||
/**
|
||||
* 查询核销乘客,目前不再使用,改为后台下发核销的乘客
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST("/autopilot-car-hailing/operation/v1/driver/order/verificationResult")
|
||||
Observable<BusQueryWriteOffPassengersResponse> queryWriteOffPassengers(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusWriteOffPassengersQueryRequest data);
|
||||
}
|
||||
|
||||
|
||||
@@ -209,77 +209,6 @@ object OrderServiceManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询下车乘客
|
||||
* @param context
|
||||
* @param seq
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryStationLeaveAwayPassengers(
|
||||
context: Context,
|
||||
seq: Int,
|
||||
siteId: Int,
|
||||
callback: OchCommonServiceCallback<QueryLeaveAwayPassengersResponse>?
|
||||
) {
|
||||
M_SERVICE.queryStationLeaveAwayPassengers(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
QueryLeaveAwayPassengersRequest(seq, siteId)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryStationLeaveAwayPassengers"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前到站点核销乘客
|
||||
* @param context
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryStationWriteOffPassengers(
|
||||
context: Context,
|
||||
taskId: Int,
|
||||
siteId: Int,
|
||||
prePassengerTime: Long,
|
||||
callback: OchCommonServiceCallback<BusQueryWriteOffPassengersResponse>?
|
||||
) {
|
||||
M_SERVICE.queryWriteOffPassengers(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
BusWriteOffPassengersQueryRequest(taskId, siteId, prePassengerTime)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryStationWriteOffPassengers"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小巴车订单
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryBusOrders(context: Context, callback: OchCommonServiceCallback<BusOrdersResponse>?) {
|
||||
if (DebugConfig.getProjectFlavor().contains("saas")){
|
||||
M_SAAS_SERVICE.queryBusOrders(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
SharedPrefsMgr.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryBusOrders"))
|
||||
}else{
|
||||
M_SERVICE.queryBusOrders(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
SharedPrefsMgr.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryBusOrders"))
|
||||
}
|
||||
}
|
||||
@JvmStatic
|
||||
fun queryBusLines(context: Context, callback: OchCommonServiceCallback<BusQueryLinesResponse>?) {
|
||||
if (DebugConfig.getProjectFlavor().contains("saas")){
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.mogo.och.bus.presenter;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
@@ -11,7 +9,6 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -35,15 +32,12 @@ import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.zhjt.mogo.adas.data.AdasConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* 网约车小巴
|
||||
@@ -240,11 +234,6 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startOpenAutopilot() {
|
||||
//非美化模式下启动动画
|
||||
|
||||
@@ -65,27 +65,6 @@ public interface IBascApiService {
|
||||
@POST("/och-shuttle-cabin/api/flow/v1/driver/arrive")
|
||||
Observable<BaseData> arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 到站查询下车乘客
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/och-shuttle-cabin/api/business/v1/driver/siteArrivedOrders")
|
||||
Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Header ("appId") String appId,@Header("ticket") String ticket,@Body QueryLeaveAwayPassengersRequest request);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param sn
|
||||
* @return todo 修改结构
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@GET("/och-shuttle-cabin/api/business/v1/driver/servicingOrders/query")
|
||||
Observable<BusOrdersResponse> queryBusOrders(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 查询车辆配置的所有路线
|
||||
* @param appId
|
||||
|
||||
@@ -151,44 +151,6 @@ object OrderServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "arriveSiteStation"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询下车乘客
|
||||
* @param context
|
||||
* @param seq
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryStationLeaveAwayPassengers(
|
||||
context: Context,
|
||||
seq: Int,
|
||||
siteId: Int,
|
||||
callback: OchCommonServiceCallback<QueryLeaveAwayPassengersResponse>?
|
||||
) {
|
||||
mService.queryStationLeaveAwayPassengers(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
QueryLeaveAwayPassengersRequest(seq, siteId)
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryStationLeaveAwayPassengers"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小巴车订单
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun queryBusOrders(context: Context, callback: OchCommonServiceCallback<BusOrdersResponse>?) {
|
||||
mService.queryBusOrders(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
SharedPrefsMgr.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryBusOrders"))
|
||||
}
|
||||
@JvmStatic
|
||||
fun queryBusLines(context: Context, callback: OchCommonServiceCallback<BusQueryLinesResponse>?) {
|
||||
mService.queryBusLines(
|
||||
|
||||
@@ -28,9 +28,6 @@ class BusPassengerConst {
|
||||
//接驳/B2平均速度 bus的平均里程:10km/h
|
||||
const val SHUTTLE_AVERAGE_SPEED = 10
|
||||
|
||||
// 订单总里程
|
||||
const val BUS_SP_KEY_ORDER_SUM_DIS = "BUS_SP_KEY_ORDER_SUM_DIS"
|
||||
|
||||
const val QUERY_BUS_P_STATION_DELAY = 3 * 1000L
|
||||
|
||||
const val ARRIVE_DISTANCE_4_STATION_INTRODUCE = 200 //站点介绍
|
||||
|
||||
@@ -6,5 +6,4 @@ package com.mogo.och.shuttle.passenger.callback;
|
||||
*/
|
||||
public interface IBusPassegerDriverStatusCallback {
|
||||
void changeOperationStatus(boolean changeStatus);
|
||||
void updatePlateNumber(String plateNumber);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ package com.mogo.och.shuttle.passenger.callback;
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IBusPassengerADASStatusCallback {
|
||||
// 自动驾驶触发的已到达目的地:暂未用到
|
||||
void onAutopilotArriveEnd();
|
||||
|
||||
// 自动驾驶可用状态
|
||||
void onAutopilotEnable();
|
||||
|
||||
@@ -5,5 +5,5 @@ package com.mogo.och.shuttle.passenger.callback;
|
||||
*/
|
||||
public interface IBusPassengerAutopilotPlanningCallback {
|
||||
void routePlanningToNextStationChanged(long meters, long timeInSecond);
|
||||
void updateTotalDistance();
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
* Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等)
|
||||
*/
|
||||
public interface IBusPassengerControllerStatusCallback {
|
||||
// 是否vr map模式
|
||||
void onVRModeChanged(boolean isVRMode);
|
||||
// 自车定位
|
||||
void onCarLocationChanged(MogoLocation location);
|
||||
}
|
||||
|
||||
@@ -15,20 +15,17 @@ import androidx.annotation.Nullable;
|
||||
|
||||
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
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.Logger;
|
||||
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.StringUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.shuttle.passenger.R;
|
||||
@@ -46,13 +43,8 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
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;
|
||||
@@ -65,34 +57,21 @@ import com.mogo.och.shuttle.passenger.constant.BusPassengerConst;
|
||||
import com.mogo.och.shuttle.passenger.network.BusPassengerModelLoopManager;
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
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 com.zhjt.mogo.adas.data.AdasConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
public class BusPassengerModel {
|
||||
private static final String TAG = BusPassengerModel.class.getSimpleName();
|
||||
|
||||
private volatile List<MogoLocation> mRoutePoints = new ArrayList<>();
|
||||
// 1s内只接受一次轨迹
|
||||
private volatile Disposable globalPathTruncation;
|
||||
private static final class SingletonHolder {
|
||||
private static final BusPassengerModel INSTANCE = new BusPassengerModel();
|
||||
}
|
||||
@@ -109,13 +88,10 @@ public class BusPassengerModel {
|
||||
private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态
|
||||
private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新
|
||||
|
||||
private MogoLocation mLocation = null;
|
||||
|
||||
private BusRoutesResult routesResult = null;
|
||||
|
||||
List<BusStationBean> mStations = new ArrayList<>();
|
||||
private int mNextStationIndex = 0;// 要到达站的index
|
||||
private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
|
||||
|
||||
private volatile boolean isGoingToNextStation = false;
|
||||
|
||||
@@ -170,7 +146,6 @@ public class BusPassengerModel {
|
||||
if (mDriverStatusCallback != null) {
|
||||
CallerLogger.d( M_BUS_P + TAG, "queryDriverOperationStatus = %s", data.data.plateNumber );
|
||||
mDriverStatusCallback.changeOperationStatus(data.data.driverStatus == 1);
|
||||
mDriverStatusCallback.updatePlateNumber(data.data.plateNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +227,6 @@ public class BusPassengerModel {
|
||||
}
|
||||
mNextStationIndex = 0;
|
||||
cleanStation("queryDriverSiteByCoordinate");
|
||||
mRoutePoints.clear();
|
||||
if (mRouteLineInfoCallback != null){
|
||||
mRouteLineInfoCallback.showNoTaskView();
|
||||
}
|
||||
@@ -279,9 +253,6 @@ public class BusPassengerModel {
|
||||
Logger.d(M_BUS_P + TAG, "order = station= leave");
|
||||
isGoingToNextStation = true;
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
|
||||
if(mNextStationIndex != i+1){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
mNextStationIndex = i+1;
|
||||
BusStationBean startStation = mStations.get(i);
|
||||
BusStationBean endStation = mStations.get(i+1);
|
||||
@@ -333,14 +304,11 @@ public class BusPassengerModel {
|
||||
private void initListeners() {
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 3,mMapLocationListener);
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
|
||||
//监听司机端消息
|
||||
CallerTelematicListenerManager.INSTANCE.addListener(TAG,mReceivedMsgListener);
|
||||
@@ -350,7 +318,6 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
// 注销定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.removeListener(TAG);
|
||||
@@ -358,8 +325,7 @@ public class BusPassengerModel {
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010);
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
|
||||
|
||||
@@ -459,48 +425,17 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
// VR mode变更回调
|
||||
private final IMogoStatusChangedListener mMogoStatusChangedListener = (descriptor, isTrue) -> {
|
||||
if (StatusDescriptor.VR_MODE == descriptor) {
|
||||
if (mControllerStatusCallbackMap.size() > 0) {
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onVRModeChanged(isTrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
mLocation = gnssInfo;
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onCarLocationChanged(gnssInfo);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSsmReceiveTimeout(boolean isTimeout) {
|
||||
// IMoGoAutopilotStatusListener.super.onSsmReceiveTimeout(isTimeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
|
||||
//IMoGoAutopilotStatusListener.super.onSystemStatus(statusInf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
|
||||
// TODO: 2023/6/19 mingjun
|
||||
}
|
||||
private final IOchAutopilotStatusListener mGoAutopilotStatusListener = new IOchAutopilotStatusListener(){
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(int state) {
|
||||
@@ -516,142 +451,16 @@ public class BusPassengerModel {
|
||||
}
|
||||
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
mTwoStationsRouts.clear();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
mTwoStationsRouts.clear();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
}else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
mTwoStationsRouts.clear();
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(@NonNull AdasConstants.IpcConnectionStatus status, @Nullable String reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
private boolean arriveAtEnd = false; //乘客app专用字段
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest(@NonNull MessagePad.BasicInfoReq basicInfoReq) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
arriveAtEnd = true;
|
||||
}
|
||||
|
||||
// TODO: 2022/3/31
|
||||
if (DebugConfig.isDebug()) {
|
||||
// ToastUtils.showShort("到达目的地");
|
||||
}
|
||||
if (mADASStatusCallback != null){
|
||||
mADASStatusCallback.onAutopilotArriveEnd();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener(){
|
||||
|
||||
@Override
|
||||
public synchronized void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
|
||||
// CallerLogger.d(M_BUS_P + TAG, "onAutopilotRotting = "
|
||||
// + GsonUtil.jsonFromObject(routeList));
|
||||
if(routeList == null){
|
||||
return;
|
||||
}
|
||||
List<MessagePad.Location> routePoints = routeList.getWayPointsList();
|
||||
|
||||
if(globalPathTruncation!=null&&!globalPathTruncation.isDisposed()){
|
||||
CallerLogger.d(M_BUS_P + TAG, "1s内不可以接受轨迹");
|
||||
return;
|
||||
}
|
||||
|
||||
globalPathTruncation = RxUtils.INSTANCE.createSubscribe(1_000, () -> {
|
||||
CallerLogger.d(M_BUS_P + TAG, "可以接受轨迹");
|
||||
return null;
|
||||
});
|
||||
CallerLogger.d(M_BUS_P + TAG, "接受轨迹中");
|
||||
if (null != routePoints && routePoints.size() > 0){
|
||||
updateRoutePoints(routePoints);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public synchronized void updateRoutePoints(List<MessagePad.Location> routePoints){
|
||||
mRoutePoints.clear();
|
||||
List<MogoLocation> latLngModels = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterWgsToGcjLocations(mContext,routePoints);
|
||||
mRoutePoints.addAll(latLngModels);
|
||||
calculateTwoStationsRoute();
|
||||
}
|
||||
|
||||
private void calculateTwoStationsRoute(){
|
||||
//找出前往站对应的轨迹点,拿出两站点的集合
|
||||
CallerLogger.d(M_BUS_P + TAG, "mRoutePoints.size() = " + mRoutePoints.size());
|
||||
if (mRoutePoints.size() > 0) {
|
||||
if (mStations.size() > 1){ //两个站点及以上要计算两个站点间的轨迹路线
|
||||
if (mNextStationIndex <= mStations.size()-1 && mNextStationIndex - 1 >=0){
|
||||
mTwoStationsRouts.clear();
|
||||
BusStationBean stationNext = mStations.get(mNextStationIndex);
|
||||
BusStationBean stationCur = mStations.get(mNextStationIndex - 1);
|
||||
//当前站在轨迹中对应的点
|
||||
int currentRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(0
|
||||
,mRoutePoints
|
||||
,stationCur.getGcjLon(),stationCur.getGcjLat());
|
||||
//要前往的站在轨迹中对应的点
|
||||
int nextRouteIndex = CoordinateCalculateRouteUtil.getArrivedPointIndexNew(currentRouteIndex
|
||||
,mRoutePoints
|
||||
,stationNext.getGcjLon(),stationNext.getGcjLat());
|
||||
CallerLogger.d(M_BUS_P + TAG, "轨迹排查==currentRouteIndex = " + currentRouteIndex
|
||||
+ ", nextRouteIndex = " + nextRouteIndex);
|
||||
if (currentRouteIndex < nextRouteIndex){ //如果找到的next在起点的轨迹前面,直接舍弃这个轨迹,不显示
|
||||
mTwoStationsRouts.addAll(mRoutePoints.subList(currentRouteIndex,nextRouteIndex + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
// else { //只有两个站点的时候整个路线就是两个站点之间的轨迹
|
||||
// mTwoStationsRouts.clear();
|
||||
// mTwoStationsRouts.addAll(mRoutePoints);
|
||||
// }
|
||||
if (mTwoStationsRouts.size() > 0){
|
||||
float sumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(mTwoStationsRouts);
|
||||
SharedPrefsMgr.getInstance().putInt(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS,(int) sumLength);
|
||||
if (mAutopilotPlanningCallback != null){
|
||||
mAutopilotPlanningCallback.updateTotalDistance();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getAverageSpeed(){
|
||||
return BusPassengerConst.SHUTTLE_AVERAGE_SPEED;
|
||||
}
|
||||
|
||||
public void loopRouteAndWipe() {
|
||||
|
||||
}
|
||||
|
||||
private void startOrStopOrderLoop(boolean start) {
|
||||
CallerLogger.d(M_BUS_P + TAG, "startOrStopOrderLoop() " + start);
|
||||
if (start) {
|
||||
|
||||
@@ -67,12 +67,6 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
BusPassengerModel.getInstance().setMoGoAutopilotPlanningListener(null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveEnd() {
|
||||
// mView.showOverviewFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotEnable() {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@@ -112,11 +106,6 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVRModeChanged(boolean isVRMode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@@ -141,11 +130,6 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePlateNumber(String plateNumber) {
|
||||
// runOnUIThread(() -> mView.updatePlateNum(plateNumber));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLineInfo(String lineName) {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@@ -205,9 +189,4 @@ public class BaseBusPassengerPresenter extends Presenter<BusPassengerRouteFragme
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTotalDistance() {
|
||||
// runOnUIThread(() -> mView.setProgressBarMax());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,11 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
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.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils;
|
||||
import com.mogo.och.shuttle.passenger.R;
|
||||
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;
|
||||
import com.mogo.och.common.module.wigets.mapdirectionview.MapDirectionView;
|
||||
@@ -98,8 +96,6 @@ public class BusPassengerRouteFragment extends
|
||||
mCurrentArriveTip = findViewById(R.id.bus_p_cur_station_tip);
|
||||
mSpeakArrivedIv = findViewById(R.id.speak_arrived_iv);
|
||||
|
||||
// mOperationTime = findViewById(R.id.line_operation_time_tv);
|
||||
|
||||
mRouteInfoView = findViewById(R.id.bus_p_line_cl);
|
||||
mStationsListRv = findViewById(R.id.bus_p_line_stations_rl);
|
||||
|
||||
@@ -107,8 +103,6 @@ public class BusPassengerRouteFragment extends
|
||||
mStationsListRv.setLayoutManager(manager);
|
||||
mAdapter = new BusPassengerLineStationsAdapter(getContext(), mStationsList);
|
||||
mStationsListRv.setAdapter(mAdapter);
|
||||
|
||||
// mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -230,8 +224,6 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
|
||||
if (currentStationIndex == 0 && isArrived){ //到达始发站且并未出发, 恢复站点marker 清楚路径 清空路径点
|
||||
SharedPrefsMgr.getInstance()
|
||||
.remove(BusPassengerConst.BUS_SP_KEY_ORDER_SUM_DIS);
|
||||
clearMapView();
|
||||
}
|
||||
|
||||
|
||||
@@ -316,7 +316,6 @@ class PM2DrivingModel private constructor() {
|
||||
mDrivingInfoCallback?.changeOperationStatus(data.data.driverStatus == 1)
|
||||
}
|
||||
operationStatus = data.data as PassengerOperationStatusResponse.Result
|
||||
// mDrivingInfoCallback?.updatePlateNumber(data.data.plateNumber)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
@@ -325,7 +324,6 @@ class PM2DrivingModel private constructor() {
|
||||
} else {
|
||||
ToastUtils.showShort(mContext!!.getString(R.string.request_error_tip))
|
||||
}
|
||||
// queryDriverOperationDelay()
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user