[6.5.0]
[fea] [location 聚合]
This commit is contained in:
@@ -98,9 +98,9 @@ class LoginProvider : LoginService {
|
||||
LoginModel.queryCarStatus()
|
||||
}
|
||||
|
||||
override fun loginOut(mLatitude: Double, mLongitude: Double) {
|
||||
CallerLogger.d(tag, "loginOut mLatitude:${mLatitude}--mLongitude:${mLongitude}")
|
||||
LoginModel.logout(mLatitude, mLongitude)
|
||||
override fun loginOut() {
|
||||
CallerLogger.d(tag, "loginOut ")
|
||||
LoginModel.logout()
|
||||
}
|
||||
|
||||
override fun checkBusiness(businessType: Int): Boolean {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.och.biz.login.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager;
|
||||
|
||||
/**
|
||||
* Created by yyk on 2021/8/19
|
||||
* 登出请求参数
|
||||
@@ -17,9 +20,10 @@ public class TaxiLogoutReqBean {
|
||||
public double lat;
|
||||
public double lon;
|
||||
|
||||
public Location4Login(double lat, double lon) {
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
public Location4Login() {
|
||||
MogoLocation gcj02Location = OchLocationManager.getGCJ02Location();
|
||||
this.lat = gcj02Location.getLatitude();
|
||||
this.lon = gcj02Location.getLongitude();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -27,7 +25,7 @@ import com.mogo.och.common.module.biz.login.BusinessEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum.Companion.valueOf
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusCacheKey
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.LoginCacheStatus
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
@@ -125,7 +123,7 @@ object LoginModel {
|
||||
|
||||
fun gotoLogin(phone: String, code: String) {
|
||||
mContext?.let {
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val location = OchLocationManager.getGCJ02Location()
|
||||
val location4Login = TaxiLoginReqBean.Location4Login(location.latitude, location.longitude)
|
||||
OchCommonServiceManager.gotoLoginBycode(it, phone, code, location4Login,
|
||||
object : OchCommonServiceCallback<TaxiLoginRespBean> {
|
||||
@@ -179,9 +177,7 @@ object LoginModel {
|
||||
if (valueOf(data.data.driverStatus) == LoginStatusEnum.Login) {
|
||||
// 业务不支持 去退出登录
|
||||
if (!LoginStatusManager.checkBusiness(data.data.businessType)) {
|
||||
val mLatitude = getChassisLocationGCJ02().latitude
|
||||
val mLongitude = getChassisLocationGCJ02().longitude
|
||||
LoginStatusManager.loginOut(mLatitude, mLongitude)
|
||||
LoginStatusManager.loginOut()
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -220,8 +216,8 @@ object LoginModel {
|
||||
}
|
||||
|
||||
// 登出
|
||||
fun logout(mLatitude: Double, mLongitude: Double) {
|
||||
val location4Login = TaxiLogoutReqBean.Location4Login(mLatitude, mLongitude)
|
||||
fun logout() {
|
||||
val location4Login = TaxiLogoutReqBean.Location4Login()
|
||||
OchCommonServiceManager.logout(
|
||||
mContext!!, location4Login,
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
|
||||
@@ -25,7 +25,7 @@ interface LoginService :CommonService {
|
||||
/**
|
||||
* 登出
|
||||
*/
|
||||
fun loginOut(mLatitude:Double,mLongitude:Double)
|
||||
fun loginOut()
|
||||
fun checkBusiness(businessType: Int): Boolean
|
||||
fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
|
||||
@@ -36,8 +36,8 @@ object LoginStatusManager : CallerBase<ILoginCallback>() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun loginOut(mLatitude: Double, mLongitude: Double) {
|
||||
loginService?.loginOut(mLatitude, mLongitude)
|
||||
fun loginOut() {
|
||||
loginService?.loginOut()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.location
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
|
||||
object OchLocationManager {
|
||||
|
||||
@JvmStatic
|
||||
fun getGCJ02Location(): MogoLocation {
|
||||
return CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWgs02Location():MogoLocation {
|
||||
return CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun addGCJ02Listener(tag:String,callBackHz:Int,listener: IMoGoChassisLocationGCJ02Listener){
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(tag, callBackHz, listener)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeGCJ02Listener(tag:String){
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(tag)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeGCJ02Listener(listener: IMoGoChassisLocationGCJ02Listener){
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(listener)
|
||||
}
|
||||
@JvmStatic
|
||||
fun addWgs02Listener(tag:String,callBackHz:Int,listener: IMoGoChassisLocationWGS84Listener){
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(tag, callBackHz, listener)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeWgs02Listener(tag:String){
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(tag)
|
||||
}
|
||||
@JvmStatic
|
||||
fun removeWgs02Listener(listener: IMoGoChassisLocationWGS84Listener){
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(listener)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.och.common.module.manager.device
|
||||
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -35,7 +35,7 @@ object LightAirconditionDoorManager {
|
||||
}
|
||||
|
||||
private fun canOpenOrCloseDoor(): String? {
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val location = OchLocationManager.getGCJ02Location()
|
||||
return if(location.gnssSpeed<0.3){
|
||||
null
|
||||
}else{
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
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.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
@@ -13,6 +12,7 @@ import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutopilotAnalytics
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryCache
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
@@ -270,7 +270,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
*/
|
||||
private fun calculateDistance() {
|
||||
//mLocation gcj坐标
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let {
|
||||
OchLocationManager.getGCJ02Location().let {
|
||||
if (mRoutePoints.isNullOrEmpty() || endStationInfo.stationPoint == null) {
|
||||
d(M_OCHCOMMON + TAG, "没有轨迹或站点坐标停止计算")
|
||||
//结束距离计算
|
||||
@@ -677,23 +677,20 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
return if (redCatche.isNullOrEmpty()) {
|
||||
distanceWithStartStation()
|
||||
} else {
|
||||
val currentPoint =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
distanceWithTrajectory(redCatche,currentPoint)
|
||||
}
|
||||
|
||||
} else {
|
||||
return if (this.lineId == 0L || this.lineId == null) {
|
||||
val currentPoint =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
distanceWithTrajectory(mRoutePoints!!,currentPoint)
|
||||
} else {
|
||||
if (lineId != this.lineId) {
|
||||
// 判断距离起始站的距离
|
||||
distanceWithStartStation()
|
||||
} else {
|
||||
val currentPoint =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
distanceWithTrajectory(mRoutePoints!!,currentPoint)
|
||||
}
|
||||
}
|
||||
@@ -712,7 +709,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
if (startStationInfo.stationPoint == null) {
|
||||
return errorTypeNoneLineId
|
||||
}
|
||||
val currentPoint = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val currentPoint = OchLocationManager.getGCJ02Location()
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
currentPoint.longitude,
|
||||
currentPoint.latitude,
|
||||
|
||||
@@ -29,6 +29,7 @@ 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.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.shuttle.passenger.ui.mapdirectionview.MapDirectionViewModel
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -128,13 +129,13 @@ class MapDirectionView @JvmOverloads constructor(
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1, this)
|
||||
OchLocationManager.addGCJ02Listener(TAG, 1, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OchLocationManager.removeGCJ02Listener(TAG)
|
||||
}
|
||||
|
||||
private fun initAMapView() {
|
||||
|
||||
Reference in New Issue
Block a user