[6.0.0] code opt and update sdk of aicloud , map , plus kotlin union

This commit is contained in:
zhongchao
2023-08-25 13:30:43 +08:00
parent eff64e72dc
commit b2aeb45b0e
71 changed files with 84 additions and 126 deletions

View File

@@ -52,7 +52,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.kotlinstdlib
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler

View File

@@ -60,7 +60,7 @@ class CronTaskManager {
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
*/
private fun requestDeviceList() {
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.let { location ->
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let { location ->
disposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
.create(ICameraListServices::class.java)
.getDeviceList(location.longitude, location.latitude, 500)
@@ -80,7 +80,7 @@ class CronTaskManager {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
cameraList = it
// CallerLogger.d("$M_BIZ$TAG", "requestDeviceList返回结果为$it")
// CallerLogger.d("$M_BIZ$TAG", "requestDeviceList返回结果为$it")
}, {
it.printStackTrace()
CallerLogger.e(
@@ -88,8 +88,6 @@ class CronTaskManager {
"requestDeviceList:message is:${it.message}, cause is:${it.cause}"
)
})
}?: run {
CallerLogger.e("$M_BIZ$TAG", "CurrentLocation is null!")
}
}

View File

@@ -589,8 +589,8 @@ object MoGoChatFacade: IMoGoChatFacade {
it.cardIdAge = mySelf.get().age
it.cardIdSex = mySelf.get().sex
it.cityName = mySelf.get().city
it.lat = location?.latitude ?: 0.0
it.lon = location?.longitude ?: 0.0
it.lat = location.latitude
it.lon = location.longitude
})
if (response.code != 0 && response.code != 200) {
send(AnswerState.Error(AnswerState.CODE_ANSWER_API_REQ_FAIL, "[Answer] - ${response.msg}", mutableMapOf<String, String>().also {
@@ -818,8 +818,8 @@ object MoGoChatFacade: IMoGoChatFacade {
it.nickName = user.name
it.headImgUrl = user.icon
it.carInfo = user.brand
it.lat = location?.latitude ?: 0.0
it.lon = location?.longitude ?: 0.0
it.lat = location.latitude
it.lon = location.longitude
})
val code = response.code
if (code != 0 && code != 200) {
@@ -966,8 +966,8 @@ object MoGoChatFacade: IMoGoChatFacade {
it.cardIdAge = mySelf.get().age
it.cardIdSex = mySelf.get().sex
it.cityName = mySelf.get().city
it.lat = location?.latitude ?: 0.0
it.lon = location?.longitude ?: 0.0
it.lat = location.latitude
it.lon = location.longitude
})
if (response.code != 0 && response.code != 200) {
send(JoinState.Error(AnswerState.CODE_ANSWER_API_REQ_FAIL, "[JoinTeam] - ${response.msg}", mutableMapOf<String, String>().also {

View File

@@ -70,10 +70,8 @@ internal class ChatServiceModel {
val sn = MoGoAiCloudClientConfig.getInstance().sn
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
if (location != null) {
params.lon = location.longitude
params.lat = location.latitude
}
params.lon = location.longitude
params.lat = location.latitude
Logger.d(ChatConsts.TAG, "connectStatusParam:$params")
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = Gson().toJson(params)

View File

@@ -71,7 +71,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.kotlinstdlib
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogologlib

View File

@@ -50,7 +50,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.kotlinstdlib
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout

View File

@@ -49,7 +49,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.kotlinstdlib
implementation rootProject.ext.dependencies.androidxccorektx
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout

View File

@@ -84,17 +84,17 @@ class MapPointCloudSubscriber private constructor()
if (it.size >= 3) {
for (index in 0 until 3) {
dockerVersionCode +=
when (index) {
0 -> {
it[index].substring(it[index].lastIndex)
}
it.size - 1 -> {
it[index].substring(0, 1)
}
else -> {
it[index]
}
when (index) {
0 -> {
it[index].substring(it[index].lastIndex)
}
it.size - 1 -> {
it[index].substring(0, 1)
}
else -> {
it[index]
}
}
}
}
}

View File

@@ -19,6 +19,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_RO
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_MAP_ERROR
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_MAP_START
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST_DELAY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST_ERROR
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST_OK
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_ROUTE_MODE
@@ -209,6 +210,10 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
if (dataReceive) {
// 请求地图开始漫游
CallerMapUIServiceManager.getMapUIController()?.setRomaMode(FunctionBuildConfig.romaModeStyle)
}else{
// 保底清除策略
MapBizTrace.log("",CHAIN_CODE_ROMA_REQUEST_DELAY,TAG,mutableMapOf("delay" to true),true)
MapIdentifySubscriber.instance.clearAiCloudRoma()
}
},
{ errorMsg ->

View File

@@ -182,10 +182,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
if (gnssInfo != null
&& gnssInfo.longitude != 0.0
&& gnssInfo.latitude != 0.0
) {
if (gnssInfo.longitude != 0.0 && gnssInfo.latitude != 0.0) {
executor.get()?.updateLocation(
gnssInfo.longitude,
gnssInfo.latitude,

View File

@@ -412,7 +412,7 @@ class OverMapView @JvmOverloads constructor(
resources.getDrawable(R.drawable.transparent_background, null)
.toBitmap(AutoSizeUtils.dp2px(context, 32f), AutoSizeUtils.dp2px(context, 230f))
)
initAMapView(context)
initAMapView()
//设置全览模式
overLayerView?.setOnClickListener { displayCustomOverView() }
overLayerView?.let {
@@ -426,7 +426,7 @@ class OverMapView @JvmOverloads constructor(
}
}
private fun initAMapView(context: Context) {
private fun initAMapView() {
Log.d(TAG, "initAMapView")
mCameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel.toFloat())
mAMap = mMapView?.map

View File

@@ -57,8 +57,8 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
private val handler = Handler(Looper.getMainLooper()) {
if (it.what == 1) {
val value = it.obj as Pair<String, String>
reConnectSocket(value.first, value.second)
val value = it.obj as Pair<*, *>
reConnectSocket(value.first as String, value.second as String)
}
true
}