[5.2.9]
[charter_p] [200m 播放站点介绍]
This commit is contained in:
@@ -17,6 +17,7 @@ data class SiteInfoResponse(val data: List<SiteInfo>?) : BaseData(){
|
||||
val Wgs84Lat: Double?,//高精坐标
|
||||
val GcjLon: Double?,//高德坐标
|
||||
val GcjLat: Double?,//高德坐标
|
||||
val introduction: String?,//站点介绍
|
||||
val seq: Double?,
|
||||
val type: Int?,
|
||||
var isNear:Boolean=false,
|
||||
|
||||
@@ -23,7 +23,7 @@ class CharterPassengerConst {
|
||||
|
||||
// 到达起始点围栏
|
||||
const val ARRIVE_AT_START_STATION_DISTANCE = 15 //围栏由20m改为50m 再次改为15m
|
||||
const val ARRIVE_SOON_AT_START_STATION_DISTANCE = 100 //100米提示
|
||||
const val ARRIVE_SOON_AT_START_STATION_DISTANCE = 50 //100米提示
|
||||
const val ARRIVE_DISTANCE_4_STATION_INTRODUCE = 200 //站点介绍
|
||||
const val MIN_DISTANCE_STATION = 30 //站点选择小于30m 不能选
|
||||
|
||||
|
||||
@@ -111,7 +111,8 @@ object CharterPassengerModel {
|
||||
// 到站仅一次
|
||||
private val endKey = "arrivedLine"
|
||||
private val endKeyRequestIng = "arrivedLineRequestIng"
|
||||
private val ending100Key = "arrivingLine"
|
||||
private val ending50Key = "arrivingLine"
|
||||
private val ending200Key = "palyStationInfo"
|
||||
private val min5Speak = "min5Speak"
|
||||
|
||||
private var carTypeChageListener: IOrderChangeCallback? = null
|
||||
@@ -421,9 +422,13 @@ object CharterPassengerModel {
|
||||
checkArriveDesk(currentInfo)
|
||||
}
|
||||
if (calculateLineDistance < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && calculateLineDistance > 0) {
|
||||
d(M_BUS_P + TAG, "小于100米到站")
|
||||
d(M_BUS_P + TAG, "小于50米到站")
|
||||
arriveDestSoon()
|
||||
}
|
||||
if (calculateLineDistance < CharterPassengerConst.ARRIVE_DISTANCE_4_STATION_INTRODUCE && calculateLineDistance > 0) {
|
||||
d(M_BUS_P + TAG, "小于200米到站")
|
||||
playSiteInfomation()
|
||||
}
|
||||
}
|
||||
}
|
||||
// 启动时间校准
|
||||
@@ -713,8 +718,14 @@ object CharterPassengerModel {
|
||||
M_BUS_P + "calculateDistance",
|
||||
"最终信息:lastSumLength: ${lastSumLength}lastTime : $lastTime thread = ${Thread.currentThread().name}"
|
||||
)
|
||||
|
||||
if (lastSumLength < CharterPassengerConst.ARRIVE_DISTANCE_4_STATION_INTRODUCE && lastSumLength > 0) {
|
||||
d(M_BUS_P + TAG, "小于200米到站")
|
||||
playSiteInfomation()
|
||||
}
|
||||
|
||||
if (lastSumLength < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && lastSumLength > 0) {
|
||||
d(M_BUS_P + TAG, "小于100米到站2")
|
||||
d(M_BUS_P + TAG, "小于50米到站2")
|
||||
arriveDestSoon()
|
||||
}
|
||||
if (lastSumLength < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE && lastSumLength > 0) {
|
||||
@@ -1018,16 +1029,65 @@ object CharterPassengerModel {
|
||||
return Triple(null, null, null)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun playSiteInfomation() {
|
||||
orderInfo?.let { order ->
|
||||
order.lineId?.let { lineId ->
|
||||
order.siteId?.let { siteId ->
|
||||
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
|
||||
if (isSuccess("${siteId}$ending200Key")) {
|
||||
broadcastList["${siteId}$ending50Key"] = true
|
||||
getSiteInfo2Play(lineId,siteId,1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getSiteInfo2Play(lineId: Long, siteId: Long, size: Int) {
|
||||
if(size>3){
|
||||
return
|
||||
}
|
||||
BusPassengerServiceManager.queryLineSiteList(mContext,"$lineId",object :OchCommonServiceCallback<SiteInfoResponse>{
|
||||
override fun onSuccess(data: SiteInfoResponse?) {
|
||||
data?.data?.forEach {
|
||||
if (it.siteId==siteId) {
|
||||
if (!StringUtils.isEmpty(it.introduction)) {
|
||||
VoiceNotice.showNotice(it.introduction)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
getSiteInfo2Play(lineId,siteId,size+1)
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
getSiteInfo2Play(lineId,siteId,size+1)
|
||||
}
|
||||
|
||||
override fun onError(msg: String?) {
|
||||
super.onError(msg)
|
||||
getSiteInfo2Play(lineId,siteId,size+1)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun arriveDestSoon() {
|
||||
orderInfo?.let { order ->
|
||||
order.siteId?.let { siteId ->
|
||||
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
|
||||
if (isSuccess("${siteId}$ending100Key")) {
|
||||
if (isSuccess("${siteId}$ending50Key")) {
|
||||
val string =
|
||||
mContext.getString(R.string.charter_p_arrived_station_left_100, order.siteName)
|
||||
VoiceNotice.showNotice(string)
|
||||
broadcastList["${siteId}$ending100Key"] = true
|
||||
broadcastList["${siteId}$ending50Key"] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user