[6.7.3]
[fix] [前台检测是否有执行的任务、loading 超时处理]
This commit is contained in:
@@ -0,0 +1,601 @@
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 4,
|
||||
"identityHash": "ab78007616874d2ef2c8ce5b4fb27869",
|
||||
"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, `msg_id` TEXT NOT NULL, `update_time` 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
|
||||
},
|
||||
{
|
||||
"fieldPath": "msgId",
|
||||
"columnName": "msg_id",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "upDateTime",
|
||||
"columnName": "update_time",
|
||||
"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, 'ab78007616874d2ef2c8ce5b4fb27869')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -457,6 +457,10 @@ object OrderModel {
|
||||
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error))
|
||||
return@execute
|
||||
}
|
||||
if(RepositoryManager.haveRunningTask()){
|
||||
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error_running))
|
||||
return@execute
|
||||
}
|
||||
MapMakerManager.removeAllMapMarkerByOwner(TAG)
|
||||
BusTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
LoginStatusManager.loginOut()
|
||||
|
||||
@@ -32,6 +32,10 @@ interface IRepository {
|
||||
|
||||
fun reportCabinEvent(context: Context?, data: ShuttleEventRequest?, callback: OchCommonServiceCallback<BaseData?>?)
|
||||
|
||||
fun haveRunningTask(): Boolean{
|
||||
return false
|
||||
}
|
||||
|
||||
fun release()
|
||||
|
||||
}
|
||||
@@ -96,6 +96,10 @@ object RepositoryManager {
|
||||
repository?.queryWriteoffCount(context,taskId,siteId,callback)
|
||||
}
|
||||
|
||||
fun haveRunningTask():Boolean{
|
||||
return repository?.haveRunningTask()?:false
|
||||
}
|
||||
|
||||
|
||||
fun haveDataWaitSyn(): Boolean {
|
||||
if(ProjectUtils.isSaas()&&AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
|
||||
@@ -337,6 +337,14 @@ class WeaknetRepository : IRepository {
|
||||
weakNetInterface?.reportCabinEvent(context,data,callback)
|
||||
}
|
||||
|
||||
override fun haveRunningTask(): Boolean {
|
||||
if(LineModel.currentTask==null){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
override fun release() {
|
||||
weakNetInterface = null
|
||||
CallerLogger.d(TAG,"重置 weakNetInterface")
|
||||
|
||||
@@ -7,10 +7,13 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.loading_biz
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.swtichLine
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.swtichTask
|
||||
@@ -34,6 +37,8 @@ class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallbac
|
||||
|
||||
private var viewModel: SwtichBizeModel?=null
|
||||
|
||||
private var queryTimeout: Disposable? = null
|
||||
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_switch_biz, this, true)
|
||||
@@ -57,9 +62,14 @@ class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallbac
|
||||
// 展示loading页面
|
||||
override fun showLoadingView(){
|
||||
startLoading = System.currentTimeMillis()
|
||||
CallerLogger.d(TAG,"开始展示 lading 时间:${startLoading}")
|
||||
loading_biz.visibility = VISIBLE
|
||||
swtichLine.visibility = GONE
|
||||
swtichTask.visibility = GONE
|
||||
queryTimeout = RxUtils.createSubscribe(10_1000) {
|
||||
OchChainLogManager.writeChainLog("Loading超时","loading 展示了10s")
|
||||
viewModel?.queryRuningTask()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +88,8 @@ class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallbac
|
||||
|
||||
// 展示选择任务页面
|
||||
override fun showSwitchTaskInfo() {
|
||||
RxUtils.disposeSubscribe(queryTimeout)
|
||||
val endLoading = System.currentTimeMillis()
|
||||
|
||||
val dex = (100-(endLoading - startLoading)).takeIf { it>=0 }?:0
|
||||
CallerLogger.d(TAG,"展示任务 lading 展示了 ${dex}毫秒")
|
||||
|
||||
@@ -93,6 +103,7 @@ class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallbac
|
||||
|
||||
// 展示选择线路页面
|
||||
override fun showSwtichLineView() {
|
||||
RxUtils.disposeSubscribe(queryTimeout)
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = (100-(endLoading - startLoading)).takeIf { it>=0 }?:0
|
||||
CallerLogger.d(TAG,"展示线路 lading 展示了 ${dex}毫秒")
|
||||
@@ -106,6 +117,7 @@ class SwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallbac
|
||||
}
|
||||
// 展示正在进行的任务
|
||||
override fun loadRunningTask() {
|
||||
RxUtils.disposeSubscribe(queryTimeout)
|
||||
val endLoading = System.currentTimeMillis()
|
||||
val dex = (100-(endLoading - startLoading)).takeIf { it>=0 }?:0
|
||||
CallerLogger.d(TAG,"展示运行中任务 lading 展示了 ${dex}毫秒")
|
||||
|
||||
@@ -36,6 +36,12 @@ class SwtichBizeModel : ViewModel(), IBusLinesCallback {
|
||||
}
|
||||
}
|
||||
|
||||
fun queryRuningTask(){
|
||||
ThreadUtils.getIoPool().execute {
|
||||
OrderModel.queryBusRoutes()
|
||||
}
|
||||
}
|
||||
|
||||
fun loadingSwitchTask(lineInfo: LineDataBean) {
|
||||
d(LineModel.TAG, "loadingSwitchTask 查询线路的任务线路信息:${lineInfo}")
|
||||
viewCallback?.showSwitchTaskByLineInfo(lineInfo)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<string name="bus_dialog_cancel">取消</string>
|
||||
|
||||
<string name="shuttle_logout_error">请在网络良好的区域完成任务信息同步后退出</string>
|
||||
<string name="shuttle_logout_error_running">请结束任务后再退出登录</string>
|
||||
|
||||
<string name="bus_no_task_tip">暂无任务</string>
|
||||
<string name="shuttle_write_off_count">核销%1$d人</string>
|
||||
|
||||
Reference in New Issue
Block a user