[6.5.0][Fix]兼容概率性首次授权拿不到高德cityCode的情况

This commit is contained in:
chenfufeng
2024-07-22 14:14:02 +08:00
parent a7fcb0a8fc
commit 0a28a8dcea
2 changed files with 20 additions and 5 deletions

View File

@@ -88,7 +88,10 @@ class TravelRealityModel private constructor() {
val time = System.currentTimeMillis().toString()
val md5String = "${CROSS_DEVICE.uppercase(Locale.getDefault())}$time"
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
var cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
if (cityCode.isEmpty()) {
cityCode = "0734"
}
getNetWorkApi(HostConst.getNDEHost()).getCrossDevice(Md5Util.getMD5Result(md5String), time, "", loc.longitude, loc.latitude, cityCode)
}
}
@@ -126,7 +129,10 @@ class TravelRealityModel private constructor() {
val time = System.currentTimeMillis().toString()
val md5String = "${CITY_ROAD_RANGE.uppercase(Locale.getDefault())}$time"
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
var cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
if (cityCode.isEmpty()) {
cityCode = "0734"
}
getNetWorkApi(HostConst.getNDEHost()).getCityRoadRange(Md5Util.getMD5Result(md5String), time, loc.longitude, loc.latitude, cityCode)
}
}
@@ -150,7 +156,10 @@ class TravelRealityModel private constructor() {
val time = System.currentTimeMillis().toString()
val md5String = "${CITY_ROAD_TRACK.uppercase(Locale.getDefault())}$time"
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
var cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
if (cityCode.isEmpty()) {
cityCode = "0734"
}
getNetWorkApi(HostConst.getNDEHost()).getCityRoadTrack(Md5Util.getMD5Result(md5String), time, loc.longitude, loc.latitude, cityCode)
}
}
@@ -173,7 +182,10 @@ class TravelRealityModel private constructor() {
apiCall {
val time = System.currentTimeMillis().toString()
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
var cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
if (cityCode.isEmpty()) {
cityCode = "0734"
}
val map = mutableMapOf(
"lon" to loc.longitude,
"lat" to loc.latitude,

View File

@@ -1142,7 +1142,10 @@ class TravelRealityView @JvmOverloads constructor(
})
Log.d(TAG, "请求获取道路事件!")
// 获取道路事件
val cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
var cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
if (cityCode.isEmpty()) {
cityCode = "0734"
}
travelNetWorkModel.getEventsWithTrajRequest(
EventReqEntity(pointList, cityCode),
onSuccess = {