Merge branch 'dev_robotaxi-d_240912_6.7.2_local' into 6.7.4_shanghai
This commit is contained in:
@@ -167,11 +167,11 @@ class LoginProvider : LoginService {
|
||||
}
|
||||
|
||||
CallerEagleBaseFunctionCall4OchManager.setOchLoginNo(loginInfo.phone)
|
||||
CallerEagleBaseFunctionCall4OchManager.setOchCarModel(Carmodel.getCarModelFromServerName(loginInfo.carModel))
|
||||
CallerEagleBaseFunctionCall4OchManager.setOchCarModel(Carmodel.getCarModelFromServerName(loginInfo.carModel,loginInfo.tenantId))
|
||||
CallerEagleBaseFunctionCall4OchManager.setOchPlateNumber(loginInfo.plateNumber)
|
||||
CallerEagleBaseFunctionCall4OchManager.updateTenantId(loginInfo.tenantId)
|
||||
|
||||
val carModel = Carmodel.getCarModelFromServerName(LoginStatusManager.getLoginInfo()?.carModel)
|
||||
val carModel = Carmodel.getCarModelFromServerName(LoginStatusManager.getLoginInfo()?.carModel,loginInfo.tenantId)
|
||||
if(this.carModel!=carModel){
|
||||
this.carModel = carModel
|
||||
LoginStatusManager.invokeCarModelChange(this.carModel)
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.och.common.module.biz.login.ILoginCallback
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import kotlinx.android.synthetic.main.common_loading_map.view.aciv_loading_map
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class LoadingMapStatusView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -36,6 +37,7 @@ class LoadingMapStatusView @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.common_loading_map, this, true)
|
||||
elevation = AutoSizeUtils.dp2px(context,30f).toFloat()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
@@ -64,10 +66,12 @@ class LoadingMapStatusView @JvmOverloads constructor(
|
||||
// 设置地图样式
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.onMapModeChanged(EnumMapUI.MAP_STYLE_DAY_VR)
|
||||
|
||||
val currentByteArray= SkinResources.getInstance().getRawResourceBytes(HdMapBuildConfig.currentCarVrIconRes)
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(currentByteArray,true)
|
||||
// val currentByteArray= SkinResources.getInstance().getRawResourceBytes(HdMapBuildConfig.currentCarVrIconRes)
|
||||
// CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(currentByteArray,true)
|
||||
|
||||
OchChainLogManager.writeChainLog("模型加载","加载地图成功、并切换模型,${LoginStatusManager.getLoginInfo()}")
|
||||
// OchChainLogManager.writeChainLog("模型加载","加载地图成功、并切换模型,${LoginStatusManager.getLoginInfo()}")
|
||||
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(HdMapBuildConfig.currentCarVrIconRes)
|
||||
|
||||
UiThreadHandler.postDelayed({ visibility = GONE },2_000,UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
@@ -84,11 +88,17 @@ class LoadingMapStatusView @JvmOverloads constructor(
|
||||
Log.d(TAG,"onCarModelChange")
|
||||
OchChainLogManager.writeChainLog("模型加载","模型修改${currentStatus}")
|
||||
if(HdMapBuildConfig.isMapLoaded){
|
||||
var currentByteArray= SkinResources.getInstance().getRawResourceBytes(HdMapBuildConfig.currentCarVrIconRes)
|
||||
// var currentByteArray= SkinResources.getInstance().getRawResourceBytes(HdMapBuildConfig.currentCarVrIconRes)
|
||||
// if (currentStatus!=null) {
|
||||
// currentByteArray= SkinResources.getInstance().getRawResourceBytes(currentStatus.rawValue)
|
||||
// }
|
||||
// CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(currentByteArray,true)
|
||||
|
||||
var currentByteArray= HdMapBuildConfig.currentCarVrIconRes
|
||||
if (currentStatus!=null) {
|
||||
currentByteArray= SkinResources.getInstance().getRawResourceBytes(currentStatus.rawValue)
|
||||
currentByteArray= currentStatus.rawValue
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(currentByteArray,true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.changeCurrentIcon(currentByteArray)
|
||||
}else{
|
||||
HdMapBuildConfig.currentCarVrIconRes = currentStatus?.rawValue?:Carmodel.B1.rawValue
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mogo.och.common.module.wigets.commonview
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import kotlinx.android.synthetic.main.common_error_view.view.tv_error_msg
|
||||
|
||||
class ErrorView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr),IMogoMapListener {
|
||||
companion object {
|
||||
const val TAG = "LoadingMapStatusView"
|
||||
}
|
||||
|
||||
private var emptyTitle:String = ""
|
||||
|
||||
var reloadLIstener:ReloadLIstener?=null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.common_error_view, this, true)
|
||||
try {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ErrorView)
|
||||
emptyTitle = typedArray.getString(R.styleable.ErrorView_error_title)?:ResourcesUtils.getString(R.string.common_error_data)
|
||||
typedArray.recycle()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
tv_error_msg.text = emptyTitle
|
||||
tv_error_msg.onClick {
|
||||
reloadLIstener?.reload()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerLogger.d(TAG,"onAttachedToWindow")
|
||||
|
||||
}
|
||||
|
||||
override fun onVisibilityAggregated(isVisible: Boolean) {
|
||||
super.onVisibilityAggregated(isVisible)
|
||||
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerLogger.d(TAG,"onDetachedFromWindow")
|
||||
}
|
||||
|
||||
interface ReloadLIstener{
|
||||
fun reload()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -19,6 +19,11 @@
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<declare-styleable name="ErrorView">
|
||||
<attr name="error_title" format="string" />
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<!--阴影布局 -->
|
||||
<declare-styleable name="ShadowLayout">
|
||||
<!-- 阴影颜色-->
|
||||
|
||||
@@ -32,4 +32,5 @@
|
||||
|
||||
<string name="common_biz_loading">加载中……</string>
|
||||
<string name="common_empty_data">暂无数据</string>
|
||||
<string name="common_error_data">重新加载</string>
|
||||
</resources>
|
||||
@@ -2,7 +2,7 @@
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 2,
|
||||
"identityHash": "66522c4500a3e7f83bfcabf98096c6bd",
|
||||
"identityHash": "2b20934a560960930f10ae5c581cbcec",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "contrail_data_table",
|
||||
@@ -141,7 +141,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "site_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `site_id` INTEGER, `line_id` INTEGER, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `introduction` TEXT, `is_play_tts` INTEGER, `md5` TEXT)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `site_id` INTEGER, `line_id` INTEGER, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `introduction` TEXT, `is_play_tts` INTEGER, `md5` TEXT, `videoList` TEXT)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -220,6 +220,12 @@
|
||||
"columnName": "md5",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "videoListDB",
|
||||
"columnName": "videoList",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
@@ -339,7 +345,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "used_task_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `line_name` TEXT, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `driving_status` INTEGER, `leaving` INTEGER, `arrived_time` INTEGER, `leave_time` INTEGER, `introduction` TEXT, `is_play_tts` INTEGER, `event_save_time` INTEGER NOT NULL)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `line_name` TEXT, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `driving_status` INTEGER, `leaving` INTEGER, `arrived_time` INTEGER, `leave_time` INTEGER, `introduction` TEXT, `is_play_tts` INTEGER, `event_save_time` INTEGER NOT NULL, `videoList` TEXT)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -454,6 +460,12 @@
|
||||
"columnName": "event_save_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "videoList",
|
||||
"columnName": "videoList",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
@@ -571,7 +583,7 @@
|
||||
"views": [],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '66522c4500a3e7f83bfcabf98096c6bd')"
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '2b20934a560960930f10ae5c581cbcec')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,589 @@
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 3,
|
||||
"identityHash": "2b20934a560960930f10ae5c581cbcec",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "contrail_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `line_id` INTEGER, `csv_file_url` TEXT, `csv_file_md5` TEXT, `txt_file_url` TEXT, `txt_file_md5` TEXT, `contrail_save_time` INTEGER, `md5` TEXT)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "csvFileUrl",
|
||||
"columnName": "csv_file_url",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "csvFileMd5",
|
||||
"columnName": "csv_file_md5",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "txtFileUrl",
|
||||
"columnName": "txt_file_url",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "txtFileMd5",
|
||||
"columnName": "txt_file_md5",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "contrailSaveTime",
|
||||
"columnName": "contrail_save_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "md5",
|
||||
"columnName": "md5",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_contrail_data_table_line_id",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"line_id"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_contrail_data_table_line_id` ON `${TABLE_NAME}` (`line_id`)"
|
||||
},
|
||||
{
|
||||
"name": "index_contrail_data_table_md5",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"md5"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_contrail_data_table_md5` ON `${TABLE_NAME}` (`md5`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "line_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `line_id` INTEGER, `line_name` TEXT, `end_station_name` TEXT, `line_get_time` INTEGER NOT NULL)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineName",
|
||||
"columnName": "line_name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "endStationName",
|
||||
"columnName": "end_station_name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "linegetTime",
|
||||
"columnName": "line_get_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_line_data_table_line_id",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"line_id"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_line_data_table_line_id` ON `${TABLE_NAME}` (`line_id`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "site_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `site_id` INTEGER, `line_id` INTEGER, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `introduction` TEXT, `is_play_tts` INTEGER, `md5` TEXT, `videoList` TEXT)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "siteId",
|
||||
"columnName": "site_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "name",
|
||||
"columnName": "name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "nameKr",
|
||||
"columnName": "name_kr",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "seq",
|
||||
"columnName": "seq",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "gcjLon",
|
||||
"columnName": "gcj_lon",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "gcjLat",
|
||||
"columnName": "gcj_lat",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lon",
|
||||
"columnName": "lon",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lat",
|
||||
"columnName": "lat",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "introduction",
|
||||
"columnName": "introduction",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "isPlayTts",
|
||||
"columnName": "is_play_tts",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "md5",
|
||||
"columnName": "md5",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "videoListDB",
|
||||
"columnName": "videoList",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_site_data_table_site_id",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"site_id"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_site_data_table_site_id` ON `${TABLE_NAME}` (`site_id`)"
|
||||
},
|
||||
{
|
||||
"name": "index_site_data_table_line_id",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"line_id"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_site_data_table_line_id` ON `${TABLE_NAME}` (`line_id`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "task_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `line_id` INTEGER, `task_data` INTEGER, `task_start_time` INTEGER, `start_time` INTEGER, `end_time` INTEGER, `task_get_time` INTEGER NOT NULL, `status` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskId",
|
||||
"columnName": "task_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskDate",
|
||||
"columnName": "task_data",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskStartTime",
|
||||
"columnName": "task_start_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "startTime",
|
||||
"columnName": "start_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "endtime",
|
||||
"columnName": "end_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskgetTime",
|
||||
"columnName": "task_get_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "status",
|
||||
"columnName": "status",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_task_data_table_task_id",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"task_id"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_task_data_table_task_id` ON `${TABLE_NAME}` (`task_id`)"
|
||||
},
|
||||
{
|
||||
"name": "index_task_data_table_line_id",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"line_id"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_task_data_table_line_id` ON `${TABLE_NAME}` (`line_id`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "used_task_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `line_name` TEXT, `name` TEXT, `name_kr` TEXT, `seq` INTEGER, `gcj_lon` REAL, `gcj_lat` REAL, `lon` REAL, `lat` REAL, `driving_status` INTEGER, `leaving` INTEGER, `arrived_time` INTEGER, `leave_time` INTEGER, `introduction` TEXT, `is_play_tts` INTEGER, `event_save_time` INTEGER NOT NULL, `videoList` TEXT)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskId",
|
||||
"columnName": "task_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "siteId",
|
||||
"columnName": "site_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineName",
|
||||
"columnName": "line_name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "name",
|
||||
"columnName": "name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "nameKr",
|
||||
"columnName": "name_kr",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "seq",
|
||||
"columnName": "seq",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "gcjLon",
|
||||
"columnName": "gcj_lon",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "gcjLat",
|
||||
"columnName": "gcj_lat",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lon",
|
||||
"columnName": "lon",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lat",
|
||||
"columnName": "lat",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "drivingStatus",
|
||||
"columnName": "driving_status",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "leaving",
|
||||
"columnName": "leaving",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "arrivedTime",
|
||||
"columnName": "arrived_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "leaveTime",
|
||||
"columnName": "leave_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "introduction",
|
||||
"columnName": "introduction",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "isPlayTts",
|
||||
"columnName": "is_play_tts",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "eventSaveTime",
|
||||
"columnName": "event_save_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "videoList",
|
||||
"columnName": "videoList",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
},
|
||||
"indices": [],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "event_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `event_type` TEXT, `lineId` INTEGER, `lineName` TEXT, `task_id` INTEGER, `task_start_time` INTEGER, `business_time` INTEGER, `write_version` INTEGER, `site_id` INTEGER, `seq` INTEGER, `driver_id` INTEGER, `event_save_time` INTEGER NOT NULL, `update_status` INTEGER NOT NULL)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "eventType",
|
||||
"columnName": "event_type",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "lineId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineName",
|
||||
"columnName": "lineName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskId",
|
||||
"columnName": "task_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskStartTime",
|
||||
"columnName": "task_start_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "businessTime",
|
||||
"columnName": "business_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "writeVersion",
|
||||
"columnName": "write_version",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "siteId",
|
||||
"columnName": "site_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "seq",
|
||||
"columnName": "seq",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "driverId",
|
||||
"columnName": "driver_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "eventSaveTime",
|
||||
"columnName": "event_save_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "updateStatus",
|
||||
"columnName": "update_status",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_event_data_table_event_save_time",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"event_save_time"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_event_data_table_event_save_time` ON `${TABLE_NAME}` (`event_save_time`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": []
|
||||
}
|
||||
],
|
||||
"views": [],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '2b20934a560960930f10ae5c581cbcec')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.mogo.och.weaknet.bean.response
|
||||
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.LineInfo
|
||||
import com.mogo.och.data.bean.SiteIntroduce
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskSiteDataBean
|
||||
import com.mogo.och.weaknet.repository.db.repository.TaskSiteDb
|
||||
@@ -50,6 +53,13 @@ class BusRoutesResponse : BaseData() {
|
||||
temp?.isPlayTts = Boolean.TRUE == taskAndsite.isPlayTts
|
||||
temp?.seq = (taskAndsite.seq ?: 0)
|
||||
temp?.siteId = if (taskAndsite.siteId == null) 0 else taskAndsite.siteId!!.toInt()
|
||||
if(!taskAndsite.videoList.isNullOrEmpty()){
|
||||
val list = GsonUtils.fromJson<List<SiteIntroduce>>(
|
||||
taskAndsite.videoList,
|
||||
object : TypeToken<List<SiteIntroduce?>?>() {}.type
|
||||
)
|
||||
temp?.videoList = list.toMutableList()
|
||||
}
|
||||
result.add(temp!!)
|
||||
// 正在进行中的任务
|
||||
if (temp!!.drivingStatus == TaskSiteDataBean.drivingStatusCurrent) {
|
||||
@@ -84,6 +94,7 @@ class BusRoutesResponse : BaseData() {
|
||||
temp.leaving = it.isLeaving
|
||||
temp.introduction = it.introduction
|
||||
temp.isPlayTts = it.isPlayTts
|
||||
temp.videoList = GsonUtils.toJson(it.videoList)
|
||||
runnintTaskAndSites.add(temp)
|
||||
}
|
||||
TaskSiteDb.addOrUpdate(*runnintTaskAndSites.toTypedArray())
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.och.weaknet.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.data.bean.SiteIntroduce
|
||||
import com.mogo.och.weaknet.repository.db.bean.ContrailDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.SiteDataBean
|
||||
@@ -67,6 +69,13 @@ data class CarExecutableTaskResponse(val data: List<Result>?) : BaseData(){
|
||||
dataInfo.siteList?.let {siteListInfo->
|
||||
siteListInfo.forEach {
|
||||
it.lineId = lineId
|
||||
val videoInfoList = mutableListOf<SiteIntroduce>()
|
||||
it.videoList?.forEach { videoInfoIt->
|
||||
videoInfoList.add(videoInfoIt)
|
||||
}
|
||||
if(videoInfoList.isNotEmpty()) {
|
||||
it.videoListDB = GsonUtils.toJson(videoInfoList)
|
||||
}
|
||||
}
|
||||
siteList.addAll(siteListInfo)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public interface IBusLinesCallback {
|
||||
default void onChangeLineIdSuccess(){}
|
||||
|
||||
default void onRefreshSuccess(long currentTimeStamp){}
|
||||
default void onRefreshSuccessWIthData(){}
|
||||
|
||||
default void onChangeLineIdFail(){}
|
||||
|
||||
|
||||
@@ -147,7 +147,12 @@ object LineModel {
|
||||
"接口信息发生变化 $lastChangeMd5 new md5${currentRequest}"
|
||||
)
|
||||
CarExecutableTaskResponse.save2Db(data)
|
||||
OrderModel.queryBusRoutes()
|
||||
RxUtils.createSubscribe(800) {
|
||||
// 等待写入数据库
|
||||
mBusLinesCallbackMap.forEach { callback ->
|
||||
callback.value.onRefreshSuccessWIthData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
@@ -215,7 +220,15 @@ object LineModel {
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
d(TAG, "commitSwitchLineId onError${e.printStackTrace()}")
|
||||
if (e is DataException) {
|
||||
if(RepositoryManager.supportDb()) {
|
||||
if (e is DataException) {
|
||||
OchChainLogManager.writeChainLog("开始任务", "${e.message}")
|
||||
ToastUtils.showShort("选择任务失败:${e.message}")
|
||||
mBusLinesCallbackMap.forEach {
|
||||
it.value.onChangeLineIdFail()
|
||||
}
|
||||
}
|
||||
}else{
|
||||
OchChainLogManager.writeChainLog("开始任务", "${e.message}")
|
||||
ToastUtils.showShort("选择任务失败:${e.message}")
|
||||
mBusLinesCallbackMap.forEach {
|
||||
|
||||
@@ -106,9 +106,14 @@ object TicketModel : IOchOnMessageListener<WriteOffPassenger>{
|
||||
firstStation.siteId.toLong(),
|
||||
object : OchCommonServiceCallback<WriteOffCountResponse> {
|
||||
override fun onSuccess(data: WriteOffCountResponse?) {
|
||||
data?.data?.let {
|
||||
emitterMain?.onNext(Pair<Int,Int>(firstStation.siteId,it))
|
||||
d(SceneConstant.M_BUS + TAG, "${firstStation.name}核销人数:${it}")
|
||||
data?.let {
|
||||
val count = if(it.data==null){
|
||||
0
|
||||
}else{
|
||||
it.data
|
||||
}
|
||||
emitterMain?.onNext(Pair<Int,Int>(firstStation.siteId,count))
|
||||
d(SceneConstant.M_BUS + TAG, "${firstStation.name}核销人数:${count}")
|
||||
OchChainLogManager.writeChainLog("核销人数","任务:${currentTask.taskId} zhan'dian")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.io.File
|
||||
//entities指定该数据库有哪些表,多张表就逗号分隔
|
||||
//version指定数据库版本号,升级时需要用到
|
||||
//数据库继承自RoomDatabase
|
||||
@Database(entities = [ContrailDataBean::class, LineDataBean::class, SiteDataBean::class, TaskDataBean::class, TaskSiteDataBean::class, EventDataBean::class], version = 2)
|
||||
@Database(entities = [ContrailDataBean::class, LineDataBean::class, SiteDataBean::class, TaskDataBean::class, TaskSiteDataBean::class, EventDataBean::class], version = 3)
|
||||
abstract class MyDataBase : RoomDatabase() {
|
||||
|
||||
override fun getOpenHelper(): SupportSQLiteOpenHelper {
|
||||
@@ -86,6 +86,7 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
AbsMogoApplication.getApp()!!.applicationContext, MyDataBase::class.java, ROOT_PATH+roomName
|
||||
)
|
||||
.addMigrations(Migration1_2(1,2))
|
||||
.addMigrations(Migration2_3(2,3))
|
||||
.build()
|
||||
}
|
||||
val ROOT_PATH = Environment.getExternalStorageDirectory().absolutePath + File.separator + "Mogo" + File.separator + "APP_cache" + File.separator //程序外部存储跟目录
|
||||
@@ -104,4 +105,10 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
database.execSQL("ALTER TABLE ${EventDataBean.evnetDataTable} ADD COLUMN driver_id INTEGER");
|
||||
}
|
||||
}
|
||||
class Migration2_3(val startVersion:Int,val endVersion:Int): Migration(startVersion,endVersion) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE ${SiteDataBean.siteDataTable} ADD COLUMN videoList TEXT");
|
||||
database.execSQL("ALTER TABLE ${TaskSiteDataBean.usedTaskDataTable} ADD COLUMN videoList TEXT");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.mogo.och.weaknet.repository.db.bean
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import androidx.room.PrimaryKey
|
||||
import com.mogo.och.data.bean.SiteIntroduce
|
||||
|
||||
@Entity(tableName = SiteDataBean.siteDataTable)
|
||||
data class SiteDataBean(
|
||||
@@ -77,14 +79,24 @@ data class SiteDataBean(
|
||||
* 除id 外其他值做的md5
|
||||
*/
|
||||
@ColumnInfo(name = "md5", typeAffinity = ColumnInfo.TEXT)
|
||||
var md5: String? = null
|
||||
var md5: String? = null,
|
||||
|
||||
/**
|
||||
* 站点视频
|
||||
*/
|
||||
@ColumnInfo(name = "videoList", typeAffinity = ColumnInfo.TEXT)
|
||||
var videoListDB: String? = null,
|
||||
|
||||
@Ignore
|
||||
var videoList:MutableList<SiteIntroduce>?=null
|
||||
) {
|
||||
companion object {
|
||||
const val siteDataTable = "site_data_table"
|
||||
const val mediaTypeVideo = 1
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "SiteDataBean(siteId=$siteId, lineId=$lineId, name=$name, nameKr=$nameKr, seq=$seq, gcjLon=$gcjLon, gcjLat=$gcjLat, lon=$lon, lat=$lat, introduction=$introduction, isPlayTts=$isPlayTts)"
|
||||
return "SiteDataBean(siteId=$siteId, lineId=$lineId, name=$name, nameKr=$nameKr, seq=$seq, gcjLon=$gcjLon, gcjLat=$gcjLat, lon=$lon, lat=$lat, introduction=$introduction, isPlayTts=$isPlayTts, videoList=$videoListDB)"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,6 +118,11 @@ data class TaskSiteDataBean(
|
||||
@ColumnInfo(name = "event_save_time", typeAffinity = ColumnInfo.INTEGER)
|
||||
var eventSaveTime: Long = System.currentTimeMillis(),
|
||||
|
||||
/**
|
||||
* 站点视频
|
||||
*/
|
||||
@ColumnInfo(name = "videoList", typeAffinity = ColumnInfo.TEXT)
|
||||
var videoList: String? = null,
|
||||
|
||||
) {
|
||||
companion object {
|
||||
@@ -148,6 +153,7 @@ data class TaskSiteDataBean(
|
||||
temp?.leaving = false
|
||||
temp?.introduction = it.introduction
|
||||
temp?.isPlayTts = it.isPlayTts
|
||||
temp?.videoList = it.videoListDB
|
||||
result.add(temp!!)
|
||||
}
|
||||
return result
|
||||
|
||||
@@ -320,7 +320,7 @@ class WeaknetRepository : IRepository {
|
||||
siteId: Long,
|
||||
callback: OchCommonServiceCallback<WriteOffCountResponse>?
|
||||
) {
|
||||
weakNetInterface?.writeOffCount(context,taskId.toString(),siteId.toString(),callback)
|
||||
weakNetInterface?.writeOffCount(context,taskId,siteId,callback)
|
||||
}
|
||||
|
||||
override fun queryCarExecutableTaskList(
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.mogo.och.weaknet.repository.net.bean.request
|
||||
|
||||
data class WriteOffCountReqBean(val sn:String,val taskId:Long,val siteId:Long)
|
||||
@@ -17,8 +17,8 @@ public interface WeakNetInterface {
|
||||
|
||||
void writeOffCount(
|
||||
Context context ,
|
||||
String taskId,
|
||||
String siteId,
|
||||
Long taskId,
|
||||
Long siteId,
|
||||
OchCommonServiceCallback<WriteOffCountResponse> callback
|
||||
);
|
||||
|
||||
|
||||
@@ -52,15 +52,15 @@ object DaliShuttleServiceManager: WeakNetInterface {
|
||||
*/
|
||||
override fun writeOffCount(
|
||||
context: Context,
|
||||
taskId: String?,
|
||||
siteId: String?,
|
||||
taskId: Long?,
|
||||
siteId: Long?,
|
||||
callback: OchCommonServiceCallback<WriteOffCountResponse>?
|
||||
) {
|
||||
mService.writeOffCount(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
taskId,
|
||||
siteId
|
||||
taskId?.toString(),
|
||||
siteId?.toString()
|
||||
)
|
||||
.transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount"))
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.och.weaknet.bean.response.BusRoutesResponse;
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse;
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest;
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
@@ -38,8 +39,8 @@ public interface ISaasBusApiService {
|
||||
* 查询当前站点核销的人数
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@GET("/och-vehicle/api/car/v2/device/writeOff")
|
||||
Observable<WriteOffCountResponse> writeOffCount(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("taskId") String taskId, @Query("siteId") String siteId);
|
||||
@POST("/och-vehicle/api/car/v2/task/site/writeOffCount")
|
||||
Observable<WriteOffCountResponse> writeOffCount(@Header ("appId") String appId, @Header("ticket") String ticket, @Body WriteOffCountReqBean writeOffCountReqBean);
|
||||
|
||||
/**
|
||||
* 同步 线路、站点、任务、自驾轨迹信息
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.cache.OchSPManager
|
||||
import com.mogo.och.common.module.network.OchCommonNet
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
@@ -15,6 +16,7 @@ import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean
|
||||
import com.mogo.och.weaknet.repository.net.weaknet.WeakNetInterface
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -52,18 +54,22 @@ object SaasBusServiceManager: WeakNetInterface {
|
||||
*/
|
||||
override fun writeOffCount(
|
||||
context: Context,
|
||||
taskId: String?,
|
||||
siteId: String?,
|
||||
taskId: Long,
|
||||
siteId: Long,
|
||||
callback: OchCommonServiceCallback<WriteOffCountResponse>?
|
||||
) {
|
||||
mService.writeOffCount(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
taskId,
|
||||
siteId
|
||||
)
|
||||
.transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount"))
|
||||
OchSPManager.getSn()?.let {
|
||||
mService.writeOffCount(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
WriteOffCountReqBean(it,taskId,
|
||||
siteId,
|
||||
)
|
||||
)
|
||||
.transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.och.weaknet.bean.response.BusRoutesResponse;
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse;
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest;
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
@@ -38,8 +39,8 @@ public interface ISaasShuttleApiService {
|
||||
* 查询当前站点核销的人数
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@GET("/och-vehicle/api/car/v2/device/writeOff")
|
||||
Observable<WriteOffCountResponse> writeOffCount(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("taskId") String taskId, @Query("siteId") String siteId);
|
||||
@POST("/och-vehicle/api/car/v2/task/site/writeOffCount")
|
||||
Observable<WriteOffCountResponse> writeOffCount(@Header ("appId") String appId, @Header("ticket") String ticket, @Body WriteOffCountReqBean writeOffCountReqBean);
|
||||
|
||||
/**
|
||||
* 同步 线路、站点、任务、自驾轨迹信息
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.cache.OchSPManager
|
||||
import com.mogo.och.common.module.network.OchCommonNet
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
@@ -15,6 +16,7 @@ import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean
|
||||
import com.mogo.och.weaknet.repository.net.weaknet.WeakNetInterface
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -52,18 +54,22 @@ object SaasShuttleServiceManager: WeakNetInterface {
|
||||
*/
|
||||
override fun writeOffCount(
|
||||
context: Context,
|
||||
taskId: String?,
|
||||
siteId: String?,
|
||||
taskId: Long,
|
||||
siteId: Long,
|
||||
callback: OchCommonServiceCallback<WriteOffCountResponse>?
|
||||
) {
|
||||
mService.writeOffCount(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
taskId,
|
||||
siteId
|
||||
)
|
||||
.transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount"))
|
||||
OchSPManager.getSn()?.let {
|
||||
mService.writeOffCount(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
WriteOffCountReqBean(
|
||||
it, taskId,
|
||||
siteId,
|
||||
)
|
||||
)
|
||||
.transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOffCount"))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +82,7 @@ object SaasShuttleServiceManager: WeakNetInterface {
|
||||
mService.queryCarExecutableTaskList(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
SharedPrefsMgr.getInstance().sn,
|
||||
OchSPManager.getSn()
|
||||
)
|
||||
.transformIoTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "queryCarExecutableTaskList"))
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
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.ActivityUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ImageUtils
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.createQRCodeWithPicture
|
||||
@@ -61,7 +62,7 @@ class QrOpenView : AppCompatImageView {
|
||||
val builder = BindQRCodeDialog.Builder()
|
||||
builder.title(ResourcesUtils.getString(R.string.bind_driver_qr_title))
|
||||
.cancelStr(ResourcesUtils.getString(R.string.qr_cancel))
|
||||
.qrBm(bmQr).build(AbsMogoApplication.getApp())!!.show()
|
||||
.qrBm(bmQr).build(ActivityUtils.getTopActivity())!!.show()
|
||||
} else {
|
||||
d(SceneConstant.M_BUS + TAG, "bmQr = null ")
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.common.module.wigets.WrapContentLinearLayoutManager
|
||||
import com.mogo.och.common.module.wigets.commonview.ErrorView
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.repository.RepositoryManager
|
||||
@@ -29,6 +30,7 @@ import kotlinx.android.synthetic.main.shuttle_wadk_task_running.view.no_order_da
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.aciv_refresh_task
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.actv_last_refresh_date
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.include_empty
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.include_errorview
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_line.view.switch_line_rv
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -99,6 +101,12 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
}
|
||||
animator?.start()
|
||||
}
|
||||
include_errorview.reloadLIstener = object :ErrorView.ReloadLIstener{
|
||||
override fun reload() {
|
||||
viewbizModel?.showSwitchLineInfo()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +114,7 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
*/
|
||||
fun loadingDatas() {
|
||||
CallerLogger.d(TAG,"加载线路去")
|
||||
viewModel?.queryBusLines()
|
||||
viewModel?.queryBusLines(true)
|
||||
viewModel?.setRefreshTime()
|
||||
}
|
||||
|
||||
@@ -132,7 +140,7 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
|
||||
}
|
||||
|
||||
override fun onBusLinesChange(data: MutableList<LineDataBean>?) {
|
||||
override fun onBusLinesChange(data: MutableList<LineDataBean>?,show:Boolean) {
|
||||
if (data.isNullOrEmpty()) {
|
||||
showNoData(true)
|
||||
}else{
|
||||
@@ -140,7 +148,9 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
mAdapter.setDataList(data)
|
||||
}
|
||||
CallerLogger.d(TAG,"加载线路成功")
|
||||
viewbizModel?.showSwitchLineInfoResult()
|
||||
if(show) {
|
||||
viewbizModel?.showSwitchLineInfoResult()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,6 +159,7 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
*/
|
||||
private fun showNoData(b: Boolean) {
|
||||
BizLoopManager.runInMainThread{
|
||||
include_errorview.visibility = View.GONE
|
||||
if (b) {
|
||||
switch_line_rv.visibility = View.GONE
|
||||
include_empty.visibility = View.VISIBLE
|
||||
@@ -171,8 +182,12 @@ class SwitchLineView: WindowRelativeLayout, SwtichLineModel.SwtichLineViewCallba
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun onBusLinesChangeFaile() {
|
||||
include_errorview.visibility = View.VISIBLE
|
||||
switch_line_rv.visibility = View.GONE
|
||||
include_empty.visibility = View.GONE
|
||||
viewbizModel?.showSwitchLineInfoResult()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
LineModel.setBusLinesCallback(TAG,this)
|
||||
}
|
||||
|
||||
fun queryBusLines() {
|
||||
fun queryBusLines(loading:Boolean) {
|
||||
LineModel.queryBusLines()
|
||||
RxUtils.disposeSubscribe(endTaskDisposable)
|
||||
RepositoryManager.queryCanUseLine()
|
||||
@@ -57,6 +57,7 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
d(LineModel.TAG, "queryBusLines onError${e.printStackTrace()}")
|
||||
viewCallback?.onBusLinesChangeFaile()
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
@@ -65,8 +66,8 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
override fun onNext(data: List<LineDataBean>) {
|
||||
d(LineModel.TAG, "queryBusLines onNext ${data}")
|
||||
viewCallback?.onBusLinesChange(data.toMutableList())
|
||||
if(ProjectUtils.isSaas()&& AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
viewCallback?.onBusLinesChange(data.toMutableList(),loading)
|
||||
if(RepositoryManager.supportDb()) {
|
||||
|
||||
}else{
|
||||
SharedPrefsMgr.getInstance().putLong(EXECUTABLECHANGETIME, DateTimeUtil.getCurrentTimeStamp())
|
||||
@@ -91,8 +92,9 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
|
||||
interface SwtichLineViewCallback{
|
||||
fun startTaskState(success: Boolean)
|
||||
fun onBusLinesChange(data: MutableList<LineDataBean>?)
|
||||
fun onBusLinesChange(data: MutableList<LineDataBean>?,show:Boolean)
|
||||
fun refreshDate(formatLongToString: String?)
|
||||
fun onBusLinesChangeFaile()
|
||||
}
|
||||
|
||||
override fun onRefreshSuccess(currentTimeStamp: Long) {
|
||||
@@ -101,6 +103,11 @@ class SwtichLineModel : ViewModel(), IBusLinesCallback {
|
||||
)
|
||||
}
|
||||
|
||||
override fun onRefreshSuccessWIthData() {
|
||||
super.onRefreshSuccessWIthData()
|
||||
queryBusLines(false)
|
||||
}
|
||||
|
||||
override fun onChangeLineIdFail() {
|
||||
viewCallback?.startTaskState(false)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
android:id="@+id/boneContainerView"
|
||||
android:layout_width="@dimen/dp_1046"
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="100dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -32,7 +31,6 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
||||
android:elevation="120dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -60,4 +60,14 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.commonview.ErrorView
|
||||
android:id="@+id/include_errorview"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.och.shuttle.weaknet.passenger.bean.response
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口请求响应结果 返回的是对应司机屏的线路信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
data class ResponseSiteIntroduce(val data: MutableList<SiteIntroduceInfo>?) : BaseData(){
|
||||
|
||||
data class SiteIntroduceInfo(val siteId:Long,val introduceList:MutableList<IntroduceInfo>)
|
||||
|
||||
data class IntroduceInfo(val type:Int,val url :String,val seq:Int)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mogo.och.shuttle.weaknet.passenger.model
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.och.common.module.biz.lansocket.IOchLanPassengerStatusListener
|
||||
import com.mogo.och.common.module.manager.download.DownloadManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.ResponseSiteIntroduce
|
||||
import com.mogo.och.shuttle.weaknet.passenger.network.PassengerServiceManager
|
||||
|
||||
open class CommonModel {
|
||||
|
||||
val connectDriverListener = object : IOchLanPassengerStatusListener {
|
||||
override fun onDriverConnectChangeListener(isConnect: Boolean) {
|
||||
super.onDriverConnectChangeListener(isConnect)
|
||||
if(isConnect){
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDriverSnChagneListner(sn: String?) {
|
||||
super.onDriverSnChagneListner(sn)
|
||||
sn?.let {
|
||||
querySiteIntroduce()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun queryDriverByLocalDriver() {
|
||||
//本地去请求司机端
|
||||
val msg = TaskDetailsMsg("task", BusinessType.shuttle)
|
||||
LanSocketManager.sendMsgToServer(msg)
|
||||
}
|
||||
|
||||
private fun querySiteIntroduce(){
|
||||
AbsMogoApplication.getApp()?.let {
|
||||
if (ProjectUtils.isSaas()) {
|
||||
PassengerServiceManager.querySiteIntroduceBySn(it,object :
|
||||
OchCommonServiceCallback<ResponseSiteIntroduce> {
|
||||
override fun onSuccess(response: ResponseSiteIntroduce?) {
|
||||
response?.let {response->
|
||||
downloadSiteIntroduce(response)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun downloadSiteIntroduce(response: ResponseSiteIntroduce) {
|
||||
response.data?.forEach {siteIntroduceInfo ->
|
||||
siteIntroduceInfo.introduceList.forEach {introduceInfo ->
|
||||
DownloadManager.downloadVideoFile(introduceInfo.url,null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,6 +13,8 @@ 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.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.och.common.module.biz.lansocket.LoginLanPassengerSocket
|
||||
import com.mogo.och.common.module.biz.media.MediaManager
|
||||
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.autopilot.location.OchLocationManager
|
||||
@@ -25,6 +27,7 @@ import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
@@ -38,7 +41,7 @@ import kotlin.math.abs
|
||||
* @date: 2023/1/31
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object LineModel{
|
||||
object LineModel:CommonModel(){
|
||||
|
||||
private var mContext: Context? = null
|
||||
|
||||
@@ -58,11 +61,7 @@ object LineModel{
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
|
||||
private fun queryDriverByLocalDriver() {
|
||||
//本地去请求司机端
|
||||
val msg = TaskDetailsMsg("task", BusinessType.shuttle)
|
||||
LanSocketManager.sendMsgToServer(msg)
|
||||
}
|
||||
|
||||
|
||||
private fun initListener() {
|
||||
//自动驾驶状态监听
|
||||
@@ -77,6 +76,8 @@ object LineModel{
|
||||
// 监听站点信息
|
||||
LanSocketManager.registerSocketMessageListener(DPMsgType.TYPE_TASK_DETAILS.type,typeTaskDetails)
|
||||
|
||||
LoginLanPassengerSocket.addListener(TAG, connectDriverListener)
|
||||
|
||||
}
|
||||
|
||||
fun releaseListener() {
|
||||
@@ -93,6 +94,8 @@ object LineModel{
|
||||
LanSocketManager.unRegisterSocketMessageListener(DPMsgType.TYPE_COMMON.type,LanSocketManager.commonListener)
|
||||
LanSocketManager.unRegisterSocketMessageListener(DPMsgType.TYPE_TASK_DETAILS.type,typeTaskDetails)
|
||||
|
||||
LoginLanPassengerSocket.removeListener(TAG)
|
||||
|
||||
}
|
||||
|
||||
fun setDrivingInfoCallback(drivingInfoCallback : DrivingInfoCallback?){
|
||||
@@ -229,6 +232,7 @@ object LineModel{
|
||||
mNextStationIndex = i + 1
|
||||
val startStation = mStations[i]
|
||||
val endStation = mStations[i + 1]
|
||||
startStationVideo(endStation)
|
||||
setTrajectoryStation(startStation, endStation, result.lineId)
|
||||
updateAutopilotControlParameters(result,i)
|
||||
return
|
||||
@@ -264,6 +268,20 @@ object LineModel{
|
||||
TrajectoryAndDistanceManager.setStationPoint(startStation, endStation, lineId.toLong())
|
||||
}
|
||||
|
||||
private fun startStationVideo(startStationInfo: BusStationBean){
|
||||
val introductionList = mutableListOf<MediaItem>()
|
||||
startStationInfo.videoList?.forEach {
|
||||
if(it.type==1) {
|
||||
introductionList.add(
|
||||
MediaItem(
|
||||
MediaItem.PrioritySite, it.url,
|
||||
MediaItem.MEDIA_TYPE_VIDEO,"","")
|
||||
)
|
||||
}
|
||||
}
|
||||
MediaManager.postSiteIntroduceInfo(introductionList)
|
||||
}
|
||||
|
||||
private fun cleanStation(type: String) {
|
||||
d(SceneConstant.M_BUS_P + TAG, "清理站点:$type")
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, -1L)
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.och.shuttle.weaknet.passenger.bean.request.PassengerWriteOffRequ
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.PassengerOperationStatusResponse
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.PassengerRoutesResponse
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.PassengerWriteOffResponse
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.ResponseSiteIntroduce
|
||||
|
||||
/**
|
||||
* Created on 2022/3/31
|
||||
@@ -65,4 +66,21 @@ object PassengerServiceManager {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "writeOff"))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询绑定行驶的小巴车路线
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@JvmStatic
|
||||
fun querySiteIntroduceBySn(
|
||||
context: Context, callback: OchCommonServiceCallback<ResponseSiteIntroduce>?
|
||||
) {
|
||||
mShuttleBusPassengerServiceApi.querySiteIntroduceBySn(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
LoginLanPassengerSocket.driverSn
|
||||
).transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "querySiteIntroduceBySn"))
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.mogo.och.shuttle.weaknet.passenger.network;
|
||||
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.request.PassengerQueryLineRequest;
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.request.PassengerWriteOffRequest;
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.PassengerOperationStatusResponse;
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.PassengerRoutesResponse;
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.PassengerWriteOffResponse;
|
||||
import com.mogo.och.shuttle.weaknet.passenger.bean.response.ResponseSiteIntroduce;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
@@ -35,4 +33,12 @@ public interface ServiceApi {
|
||||
@POST("/och-vehicle/api/car/v2/device/writeOff")
|
||||
Observable<PassengerWriteOffResponse> saaswriteOffTicket(@Header ("appId") String appId, @Header("ticket") String ticket, @Body PassengerWriteOffRequest request);
|
||||
|
||||
/**
|
||||
* 查询车辆对应站点的所有视频介绍视频
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@GET( "/och-bus-cabin/api/business/v1/querySiteIntroduceBySn" )
|
||||
Observable<ResponseSiteIntroduce> querySiteIntroduceBySn(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.och.common.module.biz.lansocket.IOchLanPassengerStatusListener
|
||||
import com.mogo.och.common.module.biz.lansocket.LoginLanPassengerSocket
|
||||
import com.mogo.och.common.module.biz.media.MediaManager
|
||||
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.autopilot.location.OchLocationManager
|
||||
@@ -33,6 +34,7 @@ import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
@@ -48,7 +50,7 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* Created on 2022/3/31
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object BusPassengerModel {
|
||||
object BusPassengerModel :CommonModel(){
|
||||
private val TAG: String = BusPassengerModel::class.java.simpleName
|
||||
private var mContext: Context? = null
|
||||
private var mADASStatusCallback: IBusPassengerADASStatusCallback? = null //Model->Presenter:自动驾驶状态相关
|
||||
@@ -72,12 +74,6 @@ object BusPassengerModel {
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
|
||||
private fun queryDriverByLocalDriver() {
|
||||
//本地去请求司机端
|
||||
val msg = TaskDetailsMsg("task", BusinessType.shuttle)
|
||||
LanSocketManager.sendMsgToServer(msg)
|
||||
}
|
||||
|
||||
fun setDriverStatusCallback(callback: IBusPassegerDriverStatusCallback?) {
|
||||
this.mDriverStatusCallback = callback
|
||||
}
|
||||
@@ -142,6 +138,7 @@ object BusPassengerModel {
|
||||
mNextStationIndex = i + 1
|
||||
val startStation = mStations[i]
|
||||
val endStation = mStations[i + 1]
|
||||
startStationVideo(endStation)
|
||||
setTrajectoryStation(startStation, endStation, result.lineId)
|
||||
updateAutopilotControlParameters(result,i)
|
||||
return
|
||||
@@ -149,7 +146,6 @@ object BusPassengerModel {
|
||||
if (i == stations.size - 1) {
|
||||
cleanStation("updatePassengerRouteInfo最后一个站点")
|
||||
}
|
||||
|
||||
isGoingToNextStation = false
|
||||
Logger.d(SceneConstant.M_BUS_P + TAG, "order = station= arrive")
|
||||
mRouteLineInfoCallback!!.updateStationsInfo(stations, i, true)
|
||||
@@ -198,15 +194,6 @@ object BusPassengerModel {
|
||||
LoginLanPassengerSocket.removeListener(TAG)
|
||||
}
|
||||
|
||||
private val connectDriverListener = object : IOchLanPassengerStatusListener{
|
||||
override fun onDriverConnectChangeListener(isConnect: Boolean) {
|
||||
super.onDriverConnectChangeListener(isConnect)
|
||||
if(isConnect){
|
||||
queryDriverByLocalDriver()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val commonListener = object : ILanMessageListener<AppConnectMsg> {
|
||||
override fun targetLan(): Class<AppConnectMsg> = AppConnectMsg::class.java
|
||||
|
||||
@@ -323,6 +310,21 @@ object BusPassengerModel {
|
||||
TrajectoryAndDistanceManager.setStationPoint(startStation, endStation, lineId.toLong())
|
||||
}
|
||||
|
||||
|
||||
private fun startStationVideo(startStationInfo: BusStationBean){
|
||||
val introductionList = mutableListOf<MediaItem>()
|
||||
startStationInfo.videoList?.forEach {
|
||||
if(it.type==1) {
|
||||
introductionList.add(
|
||||
MediaItem(
|
||||
MediaItem.PrioritySite, it.url,
|
||||
MediaItem.MEDIA_TYPE_VIDEO,"","")
|
||||
)
|
||||
}
|
||||
}
|
||||
MediaManager.postSiteIntroduceInfo(introductionList)
|
||||
}
|
||||
|
||||
private fun cleanStation(type: String) {
|
||||
d(SceneConstant.M_BUS_P + TAG, "清理站点:$type")
|
||||
TrajectoryAndDistanceManager.setStationPoint(null, null, -1L)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
android:id="@+id/boneContainerView"
|
||||
android:layout_width="@dimen/dp_1046"
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="100dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -64,7 +63,6 @@
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
||||
android:elevation="120dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -7,12 +7,14 @@ enum class Carmodel(val serverName:String,@RawRes val rawValue: Int, val resId:
|
||||
T1("E70", R.raw.chuzuche, R.drawable.icon_car_t1),
|
||||
T2("H9", R.raw.hq_h9, R.drawable.icon_car_t2),
|
||||
B1("B1", R.raw.xiaoba, R.drawable.icon_car_b1),
|
||||
B2("B2", R.raw.m2, R.drawable.icon_car_b2),
|
||||
CommonB2("B2", R.raw.m2, R.drawable.icon_car_b2),
|
||||
DeQingB2("B2", R.raw.deqing_m2, R.drawable.icon_car_b2),
|
||||
YiXinB2("B2", R.raw.yixin_m2, R.drawable.icon_car_b2),
|
||||
M1("M1", R.raw.m1, R.drawable.icon_car_m1),
|
||||
C1("C1", R.raw.huanwei, R.drawable.icon_car_c1),;
|
||||
|
||||
companion object{
|
||||
fun getCarModelFromServerName(serverName:String?): Carmodel {
|
||||
fun getCarModelFromServerName(serverName:String?,tenantId:Long): Carmodel {
|
||||
return when (serverName) {
|
||||
"E70" -> {
|
||||
T1
|
||||
@@ -29,11 +31,20 @@ enum class Carmodel(val serverName:String,@RawRes val rawValue: Int, val resId:
|
||||
"NJL6450ICEV" -> {
|
||||
B1
|
||||
}
|
||||
"B2" -> {
|
||||
B2
|
||||
}
|
||||
"M2" -> {
|
||||
B2
|
||||
"B2","M2" -> {
|
||||
when (tenantId) {
|
||||
344633089273626654,337596266395467809 -> {
|
||||
//德清
|
||||
DeQingB2
|
||||
}
|
||||
346499501671841863,337197925358633123 -> {
|
||||
//易鑫
|
||||
YiXinB2
|
||||
}
|
||||
else -> {
|
||||
CommonB2
|
||||
}
|
||||
}
|
||||
}
|
||||
"M1" -> {
|
||||
M1
|
||||
|
||||
@@ -36,7 +36,7 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
|
||||
}
|
||||
|
||||
fun getChassisLocationGCJ02(): MogoLocation {
|
||||
return mGnssInfo.clone()
|
||||
return runCatching { MogoLocation().copy(mGnssInfo, mGnssInfo.longitude, mGnssInfo.latitude) }.getOrNull() ?: MogoLocation()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
BIN
core/mogo-core-res/src/main/res/raw/deqing_m2.nt3d
Normal file
BIN
core/mogo-core-res/src/main/res/raw/deqing_m2.nt3d
Normal file
Binary file not shown.
BIN
core/mogo-core-res/src/main/res/raw/yixin_m2.nt3d
Normal file
BIN
core/mogo-core-res/src/main/res/raw/yixin_m2.nt3d
Normal file
Binary file not shown.
@@ -29,21 +29,24 @@ import java.util.TimerTask
|
||||
*/
|
||||
object MogoAnalyticUtils {
|
||||
|
||||
var network_is_available = false
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
private val runnable = object : Runnable {
|
||||
override fun run() {
|
||||
NetworkUtils.isAvailableByPingAsync("49.233.99.26", object : Utils.Consumer<Boolean> {
|
||||
override fun accept(isAvailable: Boolean) {
|
||||
network_is_available = isAvailable
|
||||
}
|
||||
})
|
||||
// 这里执行你的任务
|
||||
// 重新安排下一个任务
|
||||
handler.postDelayed(this, 5000) // 每隔5秒执行一次
|
||||
}
|
||||
}
|
||||
// var network_is_available = false
|
||||
// var network_address = "0.0.0.0"
|
||||
//
|
||||
// private val handler = Handler(Looper.getMainLooper())
|
||||
// private val runnable = object : Runnable {
|
||||
// override fun run() {
|
||||
// NetworkUtils.isAvailableByPingAsync("49.233.99.26", object : Utils.Consumer<Boolean> {
|
||||
// override fun accept(isAvailable: Boolean) {
|
||||
// network_is_available = isAvailable
|
||||
// }
|
||||
// })
|
||||
// network_address = NetworkUtils.getIPAddress(true)
|
||||
//
|
||||
// // 这里执行你的任务
|
||||
// // 重新安排下一个任务
|
||||
// handler.postDelayed(this, 5000) // 每隔5秒执行一次
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Keep
|
||||
@@ -68,8 +71,8 @@ object MogoAnalyticUtils {
|
||||
}
|
||||
Analytics.getInstance().start(context)
|
||||
|
||||
// 启动定时任务
|
||||
handler.post(runnable)
|
||||
// // 启动定时任务
|
||||
// handler.post(runnable)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,11 +94,11 @@ object MogoAnalyticUtils {
|
||||
|
||||
|
||||
// 网络状态监听
|
||||
properties["network_address"] = NetworkUtils.getIPAddress(true)
|
||||
properties["network_type"] = NetworkUtils.getNetworkType().name
|
||||
properties["network_ssid"] = NetworkUtils.getSSID()
|
||||
properties["network_wifi_enabled "] = NetworkUtils.getWifiEnabled()
|
||||
properties["network_is_available"] = network_is_available
|
||||
// properties["network_address"] = network_address
|
||||
// properties["network_type"] = NetworkUtils.getNetworkType().name
|
||||
// properties["network_ssid"] = NetworkUtils.getSSID()
|
||||
// properties["network_wifi_enabled "] = NetworkUtils.getWifiEnabled()
|
||||
// properties["network_is_available"] = network_is_available
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
properties["network_type"] = "获取设备网络状态错误"
|
||||
|
||||
@@ -80,10 +80,10 @@ MOGO_LOCATION_VERSION=1.4.7.42
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.7.42
|
||||
# 动态换肤SDK
|
||||
MOGO_SKIN_VERSION=1.4.7.49.18-debug
|
||||
MOGO_SKIN_VERSION=1.4.7.49.19-debug
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=3.4.1.22
|
||||
MAP_SDK_VERSION=3.4.1.26
|
||||
MAP_SDK_DATA_VERSION=1.0.0.9
|
||||
MAP_SDK_OPERATION_VERSION=1.1.4.1
|
||||
# websocket
|
||||
|
||||
@@ -38,6 +38,8 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
|
||||
private var voicer: String = "x4_lingxiaoying_en"
|
||||
private var voicerEntries: Array<String>? = null
|
||||
@Volatile
|
||||
private var isExpire = false
|
||||
|
||||
// 等级由低到高为0、1、2、3,默认为-1表示没有正在tts的
|
||||
private var curTtsLevel = -1
|
||||
@@ -305,6 +307,11 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
}
|
||||
curTtsEntity = null
|
||||
curTtsContent = ""
|
||||
if (error.errorCode == 11200) {
|
||||
isExpire = true
|
||||
voicer = "xiaoyan"
|
||||
updateTtsParam()
|
||||
}
|
||||
}
|
||||
|
||||
private val ttsListener = object : SynthesizerListener {
|
||||
@@ -386,10 +393,14 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
|
||||
private fun updateVoicer(language: LanguageType) {
|
||||
voicerEntries?.let {
|
||||
voicer = when (language) {
|
||||
LanguageType.ENGLISH -> it[5]
|
||||
LanguageType.KOREAN -> it[6]
|
||||
else -> it[0]
|
||||
if (!isExpire) {
|
||||
voicer = when (language) {
|
||||
LanguageType.ENGLISH -> it[5]
|
||||
LanguageType.KOREAN -> it[6]
|
||||
else -> it[0]
|
||||
}
|
||||
} else {
|
||||
voicer = "xiaoyan"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user