[8.1.0]
[routing] [正式业务]
This commit is contained in:
@@ -2,7 +2,6 @@ package com.mogo.och.charter.passenger.model
|
||||
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.utilcode.util.TAG
|
||||
import com.mogo.och.common.module.manager.audition.AuditionManager
|
||||
import com.mogo.och.common.module.manager.audition.PlayState
|
||||
import com.mogo.och.bridge.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
@@ -11,6 +10,9 @@ import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
object MusicModel : IOchAutopilotStatusListener, IOrderStatusChangeListener {
|
||||
|
||||
private const val TAG = "MusicModel"
|
||||
|
||||
init {
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,this)
|
||||
//自动驾驶状态监听
|
||||
|
||||
@@ -432,7 +432,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
)
|
||||
}
|
||||
|
||||
if (endStation?.passPoints?.isNotEmpty() == true &&
|
||||
if (endStation?.passPoints?.isNotEmpty() == true ||
|
||||
endStation?.blackPoints?.isNotEmpty() == true
|
||||
) {
|
||||
val (wayLatLons, blackLatLons) = endStation!!.getWayBlackLatLons()
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.och.bridge.trajectory.TrajectoryCache
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import com.mogo.och.bridge.utils.CoordinateCalculateRouteUtil
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -127,6 +128,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
d(M_OCHCOMMON + TAG, "onAutopilotRotting: 收到轨迹")
|
||||
globalPathResp?.wayPointsList?.let {
|
||||
if (it.size > 0) {
|
||||
OchChainLogManager.writeChainLogTrajectory("轨迹监控","收到轨迹信息轨迹个数${it.size}第一个点${it[0]}最后一个点:${it.last()} 轨迹id:${globalPathResp.lineId}")
|
||||
d(
|
||||
M_OCHCOMMON + TAG,
|
||||
"收到轨迹:轨迹个数${it.size}第一个点${it[0]}最后一个点:${it.last()} 轨迹id:${globalPathResp.lineId}"
|
||||
@@ -192,6 +194,7 @@ object TrajectoryAndDistanceManager : IMoGoPlanningRottingListener {
|
||||
M_OCHCOMMON + TAG,
|
||||
"线路id:${lineId}设置站点:开始站点${startStationInfo}、结束站点:${endStationInfo}"
|
||||
)
|
||||
OchChainLogManager.writeChainLogTrajectory("轨迹监控","设置站点:线路id:${lineId}设置站点:开始站点${startStationInfo}、结束站点:${endStationInfo}")
|
||||
if (startStationInfo == null || endStationInfo == null || lineId == -1L) {
|
||||
this.endStationInfo.index = null
|
||||
this.endStationInfo.distance = null
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.och.offline.repository.db.repository
|
||||
import androidx.room.Transaction
|
||||
import com.mogo.eagle.core.network.utils.digest.DigestUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.TAG
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.offline.repository.db.bean.SiteDataBean
|
||||
@@ -13,6 +12,8 @@ import com.mogo.och.offline.repository.db.dao.SiteDataDao
|
||||
|
||||
object SiteDb: IDbRepository {
|
||||
|
||||
private val TAG = "SiteDb"
|
||||
|
||||
private var siteDataDao: SiteDataDao? = null
|
||||
get() {
|
||||
if(field==null){
|
||||
|
||||
@@ -0,0 +1,861 @@
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 7,
|
||||
"identityHash": "74e6f2a37be355d3c235b4a0b837cf5d",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "contrail_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `line_id` INTEGER, `contrail_id` INTEGER, `csv_file_url` TEXT, `csv_file_md5` TEXT, `txt_file_url` TEXT, `txt_file_md5` TEXT, `contrail_save_time` INTEGER, `md5` TEXT, `source` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "contrailId",
|
||||
"columnName": "contrail_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
|
||||
},
|
||||
{
|
||||
"fieldPath": "source",
|
||||
"columnName": "source",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"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": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"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": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"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, `shifts_id` INTEGER, `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": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"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, `shifts_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": "shiftsId",
|
||||
"columnName": "shifts_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": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"indices": [],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "event_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `event_type` TEXT, `shifts_id` INTEGER, `lineId` INTEGER, `task_date` 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, `update_time` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "eventType",
|
||||
"columnName": "event_type",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "lineId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskDate",
|
||||
"columnName": "task_date",
|
||||
"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": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "upDateTime",
|
||||
"columnName": "update_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"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": []
|
||||
},
|
||||
{
|
||||
"tableName": "writeoff_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `msg_id` TEXT, `expiry_time` INTEGER, `booking_time` INTEGER, `type` INTEGER, `shifts_id` INTEGER, `task_id` INTEGER, `task_date` INTEGER, `line_id` INTEGER, `site_id` INTEGER, `driver_id` INTEGER, `available_times` INTEGER, `order_no` TEXT, `uid` TEXT, `seq` TEXT, `business_time` INTEGER, `tick_size` INTEGER, `tick_name` TEXT, `event_save_time` INTEGER NOT NULL, `update_status` INTEGER NOT NULL, `update_time` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "msgId",
|
||||
"columnName": "msg_id",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "expiryTime",
|
||||
"columnName": "expiry_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "bookingTime",
|
||||
"columnName": "booking_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "type",
|
||||
"columnName": "type",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "shiftsId",
|
||||
"columnName": "shifts_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskId",
|
||||
"columnName": "task_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "taskDate",
|
||||
"columnName": "task_date",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "siteId",
|
||||
"columnName": "site_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "driverId",
|
||||
"columnName": "driver_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "availableTimes",
|
||||
"columnName": "available_times",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "orderNo",
|
||||
"columnName": "order_no",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "uid",
|
||||
"columnName": "uid",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "phone",
|
||||
"columnName": "seq",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "businessTime",
|
||||
"columnName": "business_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "ticketSize",
|
||||
"columnName": "tick_size",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "ticketName",
|
||||
"columnName": "tick_name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "eventSaveTime",
|
||||
"columnName": "event_save_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "updateStatus",
|
||||
"columnName": "update_status",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "upDateTime",
|
||||
"columnName": "update_time",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_writeoff_data_table_event_save_time",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"event_save_time"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_writeoff_data_table_event_save_time` ON `${TABLE_NAME}` (`event_save_time`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": []
|
||||
},
|
||||
{
|
||||
"tableName": "point_data_table",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `line_id` INTEGER, `contrail_id` INTEGER, `site_id` INTEGER, `md5` TEXT, `seq` INTEGER, `point_type` INTEGER, `longitude` REAL, `latitude` REAL, `sub_seq` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lineId",
|
||||
"columnName": "line_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "contrailId",
|
||||
"columnName": "contrail_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "siteId",
|
||||
"columnName": "site_id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "md5",
|
||||
"columnName": "md5",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "seq",
|
||||
"columnName": "seq",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "pointType",
|
||||
"columnName": "point_type",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "longitude",
|
||||
"columnName": "longitude",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "latitude",
|
||||
"columnName": "latitude",
|
||||
"affinity": "REAL",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "subSeq",
|
||||
"columnName": "sub_seq",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"indices": [],
|
||||
"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, '74e6f2a37be355d3c235b4a0b837cf5d')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.och.weaknet.bean.request
|
||||
|
||||
/**
|
||||
* 通过lineid 获取轨迹id
|
||||
*/
|
||||
data class QueryPointRequest(val businessType: Int,val lineIds:MutableList<Long>){
|
||||
companion object{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,9 @@ 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.PointDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskSiteDataBean
|
||||
import com.mogo.och.weaknet.repository.db.repository.PointDb
|
||||
import com.mogo.och.weaknet.repository.db.repository.TaskSiteDb
|
||||
import java.lang.Boolean
|
||||
import kotlin.String
|
||||
@@ -30,7 +32,7 @@ class BusRoutesResponse : BaseData() {
|
||||
|
||||
companion object {
|
||||
|
||||
fun db2Beans(runnintTaskAndSites: List<TaskSiteDataBean>?): Pair<MutableList<BusStationBean>,Int> {
|
||||
fun db2Beans(runnintTaskAndSites: List<TaskSiteDataBean>?, lineId: Long?): Pair<MutableList<BusStationBean>,Int> {
|
||||
val result = mutableListOf<BusStationBean>()
|
||||
var temp: BusStationBean? = null
|
||||
var currentStationIndex = -1
|
||||
@@ -39,6 +41,7 @@ class BusRoutesResponse : BaseData() {
|
||||
LineManager.setLineInfo(lineInfo)
|
||||
return Pair(result,currentStationIndex)
|
||||
}
|
||||
val points = PointDb.queryPointByLineId(lineId)
|
||||
runnintTaskAndSites.forEachIndexed { index, taskAndsite ->
|
||||
temp = BusStationBean()
|
||||
temp?.drivingStatus = (taskAndsite.drivingStatus ?: 0)
|
||||
@@ -53,6 +56,27 @@ 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()
|
||||
points?.let {
|
||||
val sitePoint = it.filter {
|
||||
it.siteId?.toInt() == temp?.siteId
|
||||
}
|
||||
val tempPassPoints = mutableListOf<BusStationBean>()
|
||||
val tempblackPoints = mutableListOf<BusStationBean>()
|
||||
sitePoint.forEach { point->
|
||||
when (point.pointType) {
|
||||
PointDataBean.pointTypePass -> {
|
||||
tempPassPoints.add(point.toStation())
|
||||
}
|
||||
PointDataBean.pointTypeBlack -> {
|
||||
tempblackPoints.add(point.toStation())
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
temp?.passPoints = tempPassPoints
|
||||
temp?.blackPoints = tempblackPoints
|
||||
}
|
||||
|
||||
if(!taskAndsite.videoList.isNullOrEmpty()){
|
||||
try {
|
||||
val list = GsonUtils.fromJson<List<SiteIntroduce>>(
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.mogo.och.weaknet.bean.response
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
|
||||
class PointsResponse : BaseData() {
|
||||
var data: MutableList<PointResponse>?=null
|
||||
}
|
||||
|
||||
data class Point(
|
||||
val latitude: Double,
|
||||
val longitude: Double,
|
||||
val pointType: Int,
|
||||
val segment: Int
|
||||
)
|
||||
|
||||
data class Black(
|
||||
val latitude: Double,
|
||||
val longitude: Double,
|
||||
val pointType: Int,
|
||||
val segment: Int
|
||||
)
|
||||
|
||||
data class PointResponse(
|
||||
val businessType: Int,
|
||||
val contrailId: Long,
|
||||
val contrailSaveTime: Long,
|
||||
val csvFileMd5: String,
|
||||
val csvFileUrl: String,
|
||||
val lineId: Long,
|
||||
val lineName: String,
|
||||
val segmentPointList: List<SegmentPoint>,
|
||||
val source: Int,
|
||||
val txtFileMd5: String,
|
||||
val txtFileUrl: String
|
||||
)
|
||||
|
||||
data class SegmentPoint(
|
||||
val blackList: List<Black>,
|
||||
val pointList: List<Point>,
|
||||
val segment: Int?
|
||||
)
|
||||
@@ -58,24 +58,13 @@ object LineModel {
|
||||
|
||||
const val TAG = "${M_BUS}BusLineModel"
|
||||
|
||||
private val context = AbsMogoApplication.getApp()
|
||||
|
||||
// 判断接口是否变化
|
||||
private const val EXECUTABLECHANGEMD5 = "EXECUTABLECHANGEMD5"
|
||||
|
||||
// 展示上一次刷新时间
|
||||
const val EXECUTABLECHANGETIME = "executablechangetime"
|
||||
|
||||
var currentTask: TaskDataBean?=null
|
||||
|
||||
// 当前任务的站点列表
|
||||
var stationList:MutableList<BusStationBean>? = mutableListOf()
|
||||
|
||||
private var startTaskDisposable: Disposable?=null
|
||||
|
||||
private val isRequesting = AtomicBoolean(false)
|
||||
private var startTaskDisposable:Disposable?=null
|
||||
|
||||
private var queryCarInfo: Disposable? = null
|
||||
|
||||
// 当前站点
|
||||
@JvmStatic
|
||||
@@ -86,7 +75,7 @@ object LineModel {
|
||||
d(TAG,"init")
|
||||
mContext = AbsMogoApplication.getApp()
|
||||
EventModel.load()
|
||||
queryCarExecutableTaskList(true)
|
||||
SynchDataModel.queryCarExecutableTaskList(true)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@@ -94,10 +83,11 @@ object LineModel {
|
||||
fun release() {
|
||||
d(TAG,"release")
|
||||
mContext = null
|
||||
isRequesting.set(false)
|
||||
|
||||
SynchDataModel.release()
|
||||
EventModel.release()
|
||||
mBusLinesCallbackMap.clear()
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@@ -110,99 +100,12 @@ object LineModel {
|
||||
mBusLinesCallbackMap[tag] = callback
|
||||
}
|
||||
|
||||
fun refreshTask() {
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarExecutableTaskList(false)
|
||||
fun getBusLinesCallbackMap(): MutableMap<String, IBusLinesCallback> {
|
||||
return mBusLinesCallbackMap
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步基础信息
|
||||
*/
|
||||
private fun queryCarExecutableTaskList(isBackground:Boolean) {
|
||||
if(isRequesting.get()){
|
||||
d(TAG,"正在同步请稍等")
|
||||
val lastUpdateTime = SharedPrefsMgr.getInstance().getLong(EXECUTABLECHANGETIME, 0)
|
||||
mBusLinesCallbackMap.forEach { callback ->
|
||||
callback.value.onRefreshSuccess(lastUpdateTime)
|
||||
}
|
||||
return
|
||||
}
|
||||
isRequesting.set(true)
|
||||
d(TAG,"开始同步数据")
|
||||
RepositoryManager.queryCarExecutableTaskList(
|
||||
object : OchCommonServiceCallback<CarExecutableTaskResponse> {
|
||||
override fun onSuccess(data: CarExecutableTaskResponse) {
|
||||
isRequesting.set(false)
|
||||
d(TAG,"同步数据成功")
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarInfo = RxUtils.createSubscribe(60_000) {
|
||||
queryCarExecutableTaskList(true)
|
||||
}
|
||||
// 第一次过滤 请求返回值的md5
|
||||
val currentRequest = DigestUtils.md5Hex(data.data.toString())
|
||||
val lastChangeMd5 = SharedPrefsMgr.getInstance().getString(EXECUTABLECHANGEMD5)
|
||||
val lastUpdateTime = SharedPrefsMgr.getInstance().getLong(EXECUTABLECHANGETIME, 0)
|
||||
val currentTimeStamp = DateTimeUtil.getCurrentTimeStamp()
|
||||
|
||||
SharedPrefsMgr.getInstance().putLong(EXECUTABLECHANGETIME, currentTimeStamp)
|
||||
val sameDay = DateTimeUtil.isSameDay(currentTimeStamp, lastUpdateTime)
|
||||
mBusLinesCallbackMap.forEach { callback ->
|
||||
callback.value.onRefreshSuccess(currentTimeStamp)
|
||||
}
|
||||
if (isBackground) {
|
||||
if (currentRequest == lastChangeMd5 && sameDay) {
|
||||
return
|
||||
}
|
||||
}
|
||||
SharedPrefsMgr.getInstance().putString(EXECUTABLECHANGEMD5, currentRequest)
|
||||
OchChainLogManager.writeChainLog(
|
||||
"数据发生变化",
|
||||
"接口信息发生变化 $lastChangeMd5 new md5${currentRequest}"
|
||||
)
|
||||
val startTime = System.currentTimeMillis()
|
||||
CarExecutableTaskResponse.save2Db(data)
|
||||
d(TAG,"更新数据耗时${System.currentTimeMillis()-startTime}")
|
||||
RxUtils.createSubscribe(800) {
|
||||
// 等待写入数据库
|
||||
mBusLinesCallbackMap.forEach { callback ->
|
||||
callback.value.onRefreshSuccessWIthData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
isRequesting.set(false)
|
||||
d(TAG,"同步数据失败 onError")
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarInfo = RxUtils.createSubscribe(60_000) {
|
||||
queryCarExecutableTaskList(true)
|
||||
}
|
||||
if (!isBackground) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(ResourcesUtils.getString(R.string.network_error_tip))
|
||||
} else {
|
||||
ToastUtils.showShort(ResourcesUtils.getString(R.string.request_error_tip))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, failMsg: String) {
|
||||
isRequesting.set(false)
|
||||
d(TAG,"同步数据失败 onFail")
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarInfo = RxUtils.createSubscribe(60_000) {
|
||||
queryCarExecutableTaskList(true)
|
||||
}
|
||||
if (!isBackground) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试")
|
||||
} else {
|
||||
ToastUtils.showShort(failMsg)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
fun refreshTask() {
|
||||
SynchDataModel.queryCarExecutableTaskList(false)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.mogo.och.weaknet.model
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.network.utils.digest.DigestUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.RepositoryManager
|
||||
import com.mogo.och.weaknet.repository.db.repository.PointDb
|
||||
import io.reactivex.Observer
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
object SynchDataModel {
|
||||
|
||||
private const val TAG = "SynchDataModel"
|
||||
|
||||
private val isRequesting = AtomicBoolean(false)
|
||||
|
||||
// 展示上一次刷新时间
|
||||
const val EXECUTABLECHANGETIME = "executablechangetime"
|
||||
|
||||
private var queryCarInfo: Disposable? = null
|
||||
|
||||
// 判断接口是否变化
|
||||
private const val EXECUTABLECHANGEMD5 = "EXECUTABLECHANGEMD5"
|
||||
|
||||
/**
|
||||
* 同步基础信息
|
||||
*/
|
||||
fun queryCarExecutableTaskList(isBackground:Boolean) {
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
if(isRequesting.get()){
|
||||
d(TAG,"正在同步请稍等")
|
||||
val lastUpdateTime = SharedPrefsMgr.getInstance().getLong(EXECUTABLECHANGETIME, 0)
|
||||
LineModel.getBusLinesCallbackMap().forEach { callback ->
|
||||
callback.value.onRefreshSuccess(lastUpdateTime)
|
||||
}
|
||||
return
|
||||
}
|
||||
isRequesting.set(true)
|
||||
d(TAG,"开始同步数据")
|
||||
RepositoryManager.queryCarExecutableTaskList(
|
||||
object : OchCommonServiceCallback<CarExecutableTaskResponse> {
|
||||
override fun onSuccess(data: CarExecutableTaskResponse) {
|
||||
isRequesting.set(false)
|
||||
d(TAG,"同步数据成功")
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarInfo = RxUtils.createSubscribe(60_000) {
|
||||
queryCarExecutableTaskList(true)
|
||||
}
|
||||
// 第一次过滤 请求返回值的md5
|
||||
val currentRequest = DigestUtils.md5Hex(data.data.toString())
|
||||
val lastChangeMd5 = SharedPrefsMgr.getInstance().getString(EXECUTABLECHANGEMD5)
|
||||
val lastUpdateTime = SharedPrefsMgr.getInstance().getLong(EXECUTABLECHANGETIME, 0)
|
||||
val currentTimeStamp = DateTimeUtil.getCurrentTimeStamp()
|
||||
|
||||
SharedPrefsMgr.getInstance().putLong(EXECUTABLECHANGETIME, currentTimeStamp)
|
||||
val sameDay = DateTimeUtil.isSameDay(currentTimeStamp, lastUpdateTime)
|
||||
LineModel.getBusLinesCallbackMap().forEach { callback ->
|
||||
callback.value.onRefreshSuccess(currentTimeStamp)
|
||||
}
|
||||
if (isBackground) {
|
||||
if (currentRequest == lastChangeMd5 && sameDay) {
|
||||
return
|
||||
}
|
||||
}
|
||||
SharedPrefsMgr.getInstance().putString(EXECUTABLECHANGEMD5, currentRequest)
|
||||
OchChainLogManager.writeChainLog(
|
||||
"数据发生变化",
|
||||
"接口信息发生变化 $lastChangeMd5 new md5${currentRequest}"
|
||||
)
|
||||
val startTime = System.currentTimeMillis()
|
||||
CarExecutableTaskResponse.save2Db(data)
|
||||
d(TAG,"更新数据耗时${System.currentTimeMillis()-startTime}")
|
||||
RxUtils.createSubscribe(800) {
|
||||
// 等待写入数据库
|
||||
LineModel.getBusLinesCallbackMap().forEach { callback ->
|
||||
callback.value.onRefreshSuccessWIthData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
isRequesting.set(false)
|
||||
d(TAG,"同步数据失败 onError")
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarInfo = RxUtils.createSubscribe(60_000) {
|
||||
queryCarExecutableTaskList(true)
|
||||
}
|
||||
if (!isBackground) {
|
||||
if (!NetworkUtils.isConnected(AbsMogoApplication.getApp())) {
|
||||
ToastUtils.showShort(ResourcesUtils.getString(R.string.network_error_tip))
|
||||
} else {
|
||||
ToastUtils.showShort(ResourcesUtils.getString(R.string.request_error_tip))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, failMsg: String) {
|
||||
isRequesting.set(false)
|
||||
d(TAG,"同步数据失败 onFail")
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
queryCarInfo = RxUtils.createSubscribe(60_000) {
|
||||
queryCarExecutableTaskList(true)
|
||||
}
|
||||
if (!isBackground) {
|
||||
if (!NetworkUtils.isConnected(AbsMogoApplication.getApp())) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试")
|
||||
} else {
|
||||
ToastUtils.showShort(failMsg)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private val waitSysData = mutableSetOf<Long>()
|
||||
private val isRequestingContrainInfo = AtomicBoolean(false)
|
||||
|
||||
|
||||
fun synContraiInfo(needUpdatePoint: MutableList<Long>) {
|
||||
|
||||
waitSysData.addAll(needUpdatePoint)
|
||||
if(isRequestingContrainInfo.get()){
|
||||
// 正在请求
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","正在同步轨迹请稍等 ")
|
||||
return
|
||||
}
|
||||
isRequestingContrainInfo.set(true)
|
||||
|
||||
val lines = mutableListOf<Long>()
|
||||
waitSysData.forEach {
|
||||
lines.add(it)
|
||||
}
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","轨迹变更需同步禁行点和途径点 线路:${lines}")
|
||||
RepositoryManager.queryPointFromNet(lines)
|
||||
?.subscribeOn(Schedulers.io())
|
||||
?.observeOn(Schedulers.io())
|
||||
?.subscribe(object : Observer<List<PointResponse>> {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
d(TAG, "queryPointsByLinesId onSubscribe")
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
d(TAG, "同步轨迹 onError${e.printStackTrace()} 同步轨迹失败 5s种后重试 线路:${lines}")
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","同步轨迹失败 5s种后重试 线路:${lines}")
|
||||
RxUtils.createSubscribe(5_000){
|
||||
synContraiInfo(needUpdatePoint)
|
||||
}
|
||||
isRequestingContrainInfo.set(false)
|
||||
}
|
||||
|
||||
override fun onComplete() {
|
||||
d(TAG, "endTask onComplete")
|
||||
}
|
||||
|
||||
override fun onNext(data: List<PointResponse>) {
|
||||
try {
|
||||
PointDb.addOrUpdate(data)
|
||||
for (datum in data) {
|
||||
waitSysData.remove(datum.lineId)
|
||||
}
|
||||
isRequestingContrainInfo.set(false)
|
||||
if(waitSysData.isNotEmpty()){
|
||||
synContraiInfo(needUpdatePoint)
|
||||
}
|
||||
OchChainLogManager.writeChainLogNet(false,"同步轨迹","网络请求重构 轨迹信息${data}")
|
||||
d(TAG, "同步轨迹网络成功")
|
||||
}catch (e:Exception){
|
||||
OchChainLogManager.writeChainLogDb("同步轨迹","同步轨迹时报错 轨迹信息${data} 错误信息${e.message}")
|
||||
synContraiInfo(needUpdatePoint)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun release() {
|
||||
isRequesting.set(false)
|
||||
RxUtils.disposeSubscribe(queryCarInfo)
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.mogo.och.weaknet.bean.WaitUploadLine
|
||||
import com.mogo.och.weaknet.bean.WriteOffPassenger
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.db.MyDataBase
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean
|
||||
@@ -183,6 +184,13 @@ object RepositoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun queryPointFromNet(lines: MutableList<Long>): Observable<MutableList<PointResponse>>? {
|
||||
if (lineRepository is WeaknetRepository) {
|
||||
return lineRepository?.queryPointsByLineIds(lines)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun reportCabinEvent(
|
||||
context: Context?,
|
||||
data: ShuttleEventRequest?,
|
||||
|
||||
@@ -6,16 +6,17 @@ import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.env.Project
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.och.weaknet.repository.db.bean.ContrailDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.EventDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.PointDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.SiteDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskSiteDataBean
|
||||
@@ -23,17 +24,22 @@ import com.mogo.och.weaknet.repository.db.bean.WriteOffDataBean
|
||||
import com.mogo.och.weaknet.repository.db.dao.EventDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.ContrailDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.LineDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.PointDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.SiteDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.TaskDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.TaskSiteDataDao
|
||||
import com.mogo.och.weaknet.repository.db.dao.WriteOffDataDao
|
||||
import java.io.File
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
//注解Database告诉系统这是Room数据库对象
|
||||
//entities指定该数据库有哪些表,多张表就逗号分隔
|
||||
//version指定数据库版本号,升级时需要用到
|
||||
//数据库继承自RoomDatabase
|
||||
@Database(entities = [ContrailDataBean::class, LineDataBean::class, SiteDataBean::class, TaskDataBean::class, TaskSiteDataBean::class, EventDataBean::class, WriteOffDataBean::class], version = 6)
|
||||
@Database(entities = [ContrailDataBean::class, LineDataBean::class,
|
||||
SiteDataBean::class, TaskDataBean::class, TaskSiteDataBean::class,
|
||||
EventDataBean::class, WriteOffDataBean::class,PointDataBean::class
|
||||
], version = 7)
|
||||
abstract class MyDataBase : RoomDatabase() {
|
||||
|
||||
private val dbRepositorys = mutableListOf<IDbRepository>()
|
||||
@@ -53,12 +59,18 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
abstract val contrailDataDao: ContrailDataDao?
|
||||
abstract val eventDataDao: EventDataDao?
|
||||
abstract val lineDataDao: LineDataDao?
|
||||
abstract val pointDataDao: PointDataDao?
|
||||
abstract val siteDataDao: SiteDataDao?
|
||||
abstract val taskDataDao: TaskDataDao?
|
||||
abstract val taskSiteDataDao: TaskSiteDataDao?
|
||||
abstract val writeOffDataDao: WriteOffDataDao?
|
||||
|
||||
companion object {
|
||||
|
||||
|
||||
private val TAG = "MyDataBase"
|
||||
|
||||
|
||||
private val MIGRATION_1_2 = object : Migration(1, 2) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("ALTER TABLE ${EventDataBean.tableName} ADD COLUMN driver_id INTEGER");
|
||||
@@ -95,6 +107,15 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
}
|
||||
}
|
||||
|
||||
private val MIGRATION_6_7 = object : Migration(6, 7) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS `${PointDataBean.tableName}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `line_id` INTEGER, `contrail_id` INTEGER, `site_id` INTEGER, `md5` TEXT, `seq` INTEGER, `point_type` INTEGER, `longitude` REAL, `latitude` REAL, `sub_seq` INTEGER)")
|
||||
database.execSQL("ALTER TABLE ${PointDataBean.tableName} ADD COLUMN contrail_id INTEGER")
|
||||
database.execSQL("ALTER TABLE ${PointDataBean.tableName} ADD COLUMN source INTEGER")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun getDBName():MyDataBase{
|
||||
val roomName = when (ProjectUtils.getProjectType()) {
|
||||
@@ -142,7 +163,9 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
.addMigrations(MIGRATION_3_4)
|
||||
.addMigrations(MIGRATION_4_5)
|
||||
.addMigrations(MIGRATION_5_6)
|
||||
.addMigrations(MIGRATION_6_7)
|
||||
.fallbackToDestructiveMigration()
|
||||
.setQueryCallback({ sqlQuery, bindArgs -> CallerLogger.d(TAG,"sql:$sqlQuery--->参数:$bindArgs") }, Executors.newSingleThreadExecutor())
|
||||
.build()
|
||||
}
|
||||
val ROOT_PATH = Environment.getExternalStorageDirectory().absolutePath + File.separator + "Mogo" + File.separator + "APP_cache" + File.separator //程序外部存储跟目录
|
||||
|
||||
@@ -18,6 +18,12 @@ data class ContrailDataBean(
|
||||
@ColumnInfo(name = "line_id", typeAffinity = ColumnInfo.INTEGER, index = true)
|
||||
var lineId: Long? = null,
|
||||
|
||||
/**
|
||||
* 轨迹id
|
||||
*/
|
||||
@ColumnInfo(name = "contrail_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var contrailId: Long? = null,
|
||||
|
||||
/**
|
||||
* csv格式的轨迹文件
|
||||
*/
|
||||
@@ -54,9 +60,17 @@ data class ContrailDataBean(
|
||||
@ColumnInfo(name = "md5", typeAffinity = ColumnInfo.TEXT, index = true)
|
||||
var md5: String? = null,
|
||||
|
||||
/**
|
||||
* 轨迹id
|
||||
*/
|
||||
@ColumnInfo(name = "source", typeAffinity = ColumnInfo.INTEGER)
|
||||
var source: Int? = null,
|
||||
|
||||
|
||||
) {
|
||||
companion object {
|
||||
const val tableName: String = "contrail_data_table"
|
||||
const val SOURCETYPEROUTING = 2
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.mogo.och.weaknet.repository.db.bean
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
|
||||
@Entity(tableName = PointDataBean.tableName)
|
||||
data class PointDataBean(
|
||||
|
||||
@PrimaryKey(autoGenerate = true) var id: Int = 0,
|
||||
|
||||
/**
|
||||
* 点所属线路Id
|
||||
*/
|
||||
@ColumnInfo(name = "line_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var lineId: Long? = null,
|
||||
|
||||
/**
|
||||
* 轨迹id
|
||||
*/
|
||||
@ColumnInfo(name = "contrail_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var contrailId: Long? = null,
|
||||
|
||||
/**
|
||||
* A--B--C--D
|
||||
* A--B 的途径点 siteId = B.id
|
||||
* B--C 的途径点 siteId = C.id
|
||||
* C--D 的途径点 siteId = D.id
|
||||
*/
|
||||
@ColumnInfo(name = "site_id", typeAffinity = ColumnInfo.INTEGER)
|
||||
var siteId: Long? = null,
|
||||
|
||||
/**
|
||||
* ContrailDataBean 表格中的md5值
|
||||
*/
|
||||
@ColumnInfo(name = "md5", typeAffinity = ColumnInfo.TEXT)
|
||||
var md5: String? = null,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 排队组
|
||||
*/
|
||||
@ColumnInfo(name = "seq", typeAffinity = ColumnInfo.INTEGER)
|
||||
var seq: Int? = null,
|
||||
|
||||
/**
|
||||
* 点的类型
|
||||
*/
|
||||
@ColumnInfo(name = "point_type", typeAffinity = ColumnInfo.INTEGER)
|
||||
var pointType: Int? = null,
|
||||
|
||||
/**
|
||||
* 高精坐标
|
||||
*/
|
||||
@ColumnInfo(name = "longitude", typeAffinity = ColumnInfo.REAL)
|
||||
var longitude: Double? = null,
|
||||
|
||||
/**
|
||||
* 高精坐标
|
||||
*/
|
||||
@ColumnInfo(name = "latitude", typeAffinity = ColumnInfo.REAL)
|
||||
var latitude: Double? = null,
|
||||
|
||||
/**
|
||||
* 组内排序
|
||||
*/
|
||||
@ColumnInfo(name = "sub_seq", typeAffinity = ColumnInfo.INTEGER)
|
||||
var subSeq: Int? = null,
|
||||
|
||||
) {
|
||||
fun toStation(): BusStationBean {
|
||||
val temp = BusStationBean()
|
||||
temp.lat = latitude?:0.0
|
||||
temp.lon = longitude?:0.0
|
||||
temp.pointType = pointType?:pointTypePass
|
||||
temp.isLeaving = true
|
||||
return temp
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val tableName = "point_data_table"
|
||||
const val pointTypePass = 1
|
||||
const val pointTypeBlack = 2
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,8 @@ interface ContrailDataDao {
|
||||
queryContrailByLineId.first()
|
||||
}
|
||||
}
|
||||
|
||||
@Query("UPDATE ${ContrailDataBean.tableName} SET contrail_id = :contrailId ,source = :source WHERE line_id = :lineId")
|
||||
fun updateIdAndSource(contrailId: Long, source: Int, lineId: Long)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.och.weaknet.repository.db.dao
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Delete
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import androidx.room.Transaction
|
||||
import com.mogo.och.weaknet.repository.db.bean.PointDataBean
|
||||
|
||||
@Dao
|
||||
interface PointDataDao {
|
||||
//插入数据
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insert(vararg lineDataBean: PointDataBean)
|
||||
|
||||
//插入数据
|
||||
@Transaction
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insertTra(vararg lineDataBean: PointDataBean)
|
||||
|
||||
|
||||
//删除数据
|
||||
@Delete
|
||||
fun delete(vararg lineDataBean: PointDataBean)
|
||||
|
||||
|
||||
// 线路删除时同步删除所属轨迹信息
|
||||
@Transaction
|
||||
@Query("DELETE FROM ${PointDataBean.tableName} WHERE line_id in (:lineId)")
|
||||
fun deleteByLineIdTra(lineId: List<Long>)
|
||||
|
||||
@Transaction
|
||||
@Query("DELETE FROM ${PointDataBean.tableName} WHERE line_id in (:lineId)")
|
||||
fun deleteByLineId(lineId: List<Long>)
|
||||
|
||||
@Query("SELECT * FROM ${PointDataBean.tableName} WHERE line_id = :lineId")
|
||||
fun queryPointByLineId(lineId: Long) : List<PointDataBean>?
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.mogo.och.weaknet.repository.db.repository
|
||||
|
||||
import com.mogo.eagle.core.network.utils.digest.DigestUtils
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.weaknet.model.SynchDataModel
|
||||
import com.mogo.och.weaknet.repository.RepositoryManager
|
||||
import com.mogo.och.weaknet.repository.db.IDbRepository
|
||||
import com.mogo.och.weaknet.repository.db.MyDataBase
|
||||
import com.mogo.och.weaknet.repository.db.bean.ContrailDataBean
|
||||
@@ -26,6 +28,7 @@ object ContraiDb : IDbRepository {
|
||||
val runnable = Runnable {
|
||||
// 校验数据个数
|
||||
contrailDao?.let { contrailDao->
|
||||
val needUpdatePoint = mutableListOf<Long>()
|
||||
contrailDatalist.forEach {
|
||||
val md5Source = it.toString()
|
||||
val md5Hex = DigestUtils.md5Hex(md5Source)
|
||||
@@ -33,6 +36,7 @@ object ContraiDb : IDbRepository {
|
||||
if(queryContrailByMd5.isNullOrEmpty()){// 没有值或者值有变化
|
||||
val needUpdate = contrailDao.queryContrailByLineIdOne(it.lineId!!)
|
||||
it.md5 = md5Hex
|
||||
needUpdatePoint.add(it.lineId!!)
|
||||
if(needUpdate!=null){// 更新
|
||||
it.id = needUpdate.id
|
||||
contrailDao.update(it.csvFileUrl?:"",it.csvFileMd5?:"",it.txtFileUrl?:"",it.txtFileMd5?:"",System.currentTimeMillis(),md5Hex,needUpdate.id)
|
||||
@@ -41,6 +45,9 @@ object ContraiDb : IDbRepository {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(needUpdatePoint.isNotEmpty()){
|
||||
SynchDataModel.synContraiInfo(needUpdatePoint)
|
||||
}
|
||||
}
|
||||
}
|
||||
BizLoopManager.runInIoThread(runnable)
|
||||
@@ -75,4 +82,10 @@ object ContraiDb : IDbRepository {
|
||||
addOrUpdate(mutableListOf(runningLine))
|
||||
}
|
||||
|
||||
fun upDateIdAndsource(contrailId: Long?, source: Int?, lineId: Long?) {
|
||||
if(contrailId!=null&&source!=null&&lineId!=null){
|
||||
contrailDao?.updateIdAndSource(contrailId,source,lineId)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.mogo.och.weaknet.repository.db.repository
|
||||
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.db.IDbRepository
|
||||
import com.mogo.och.weaknet.repository.db.MyDataBase
|
||||
import com.mogo.och.weaknet.repository.db.bean.ContrailDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.PointDataBean
|
||||
import com.mogo.och.weaknet.repository.db.dao.PointDataDao
|
||||
|
||||
object PointDb: IDbRepository {
|
||||
|
||||
private var pointDao: PointDataDao?=null
|
||||
get() {
|
||||
if(field==null){
|
||||
field = MyDataBase.instance?.pointDataDao
|
||||
register()
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
|
||||
override fun release() {
|
||||
pointDao = null
|
||||
}
|
||||
|
||||
fun queryPointByLineId(lineId: Long?): List<PointDataBean>? {
|
||||
lineId?.let {
|
||||
return pointDao?.queryPointByLineId(lineId)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun addOrUpdate(serverDataList:List<PointResponse>) {
|
||||
val contaiBeans = mutableListOf<PointDataBean>()
|
||||
val needDelete = mutableListOf<Long>()
|
||||
val needUpdateLineInfos = mutableListOf<ContrailDataBean>()
|
||||
|
||||
serverDataList.forEach { contrailInfo ->
|
||||
val lineId = contrailInfo.lineId
|
||||
val siteList = SiteDb.querySiteByLineId(lineId)
|
||||
val contraiBean = ContraiDb.queryAutopilotInfoByLineid(lineId)
|
||||
|
||||
contraiBean?.let {
|
||||
contraiBean.source = contrailInfo.source
|
||||
contraiBean.contrailId = contrailInfo.contrailId
|
||||
needUpdateLineInfos.add(contraiBean)
|
||||
}
|
||||
|
||||
val segmentPointList = contrailInfo.segmentPointList
|
||||
needDelete.add(lineId)
|
||||
segmentPointList.forEachIndexed { index, segmentPoint ->
|
||||
val siteIndex = segmentPoint.segment
|
||||
siteList?.let { siteListTemp->
|
||||
siteIndex?.let {siteIndexTemp->
|
||||
// 途径点和禁行点所有站点
|
||||
val siteDataBean = siteListTemp[siteIndexTemp]
|
||||
segmentPoint.pointList?.forEachIndexed { index, point ->
|
||||
val pointTemp = PointDataBean()
|
||||
pointTemp.lineId = lineId
|
||||
pointTemp.contrailId = contrailInfo.contrailId
|
||||
pointTemp.siteId = siteDataBean.siteId
|
||||
pointTemp.md5 = contraiBean?.md5?:""
|
||||
pointTemp.seq = siteIndex
|
||||
pointTemp.pointType = PointDataBean.pointTypePass
|
||||
pointTemp.longitude = point.longitude
|
||||
pointTemp.latitude = point.latitude
|
||||
pointTemp.subSeq = index
|
||||
contaiBeans.add(pointTemp)
|
||||
}
|
||||
segmentPoint.blackList?.forEachIndexed { index, black ->
|
||||
val pointTemp = PointDataBean()
|
||||
pointTemp.lineId = lineId
|
||||
pointTemp.contrailId = contrailInfo.contrailId
|
||||
pointTemp.siteId = siteDataBean.siteId
|
||||
pointTemp.md5 = contraiBean?.md5?:""
|
||||
pointTemp.seq = siteIndex
|
||||
pointTemp.pointType = PointDataBean.pointTypeBlack
|
||||
pointTemp.longitude = black.longitude
|
||||
pointTemp.latitude = black.latitude
|
||||
pointTemp.subSeq = index
|
||||
contaiBeans.add(pointTemp)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(needUpdateLineInfos.size<100){
|
||||
needUpdateLineInfos.forEach {
|
||||
ContraiDb.upDateIdAndsource(it.contrailId,it.source,it.lineId)
|
||||
}
|
||||
}else{
|
||||
MyDataBase.instance?.runInTransaction{
|
||||
needUpdateLineInfos.forEach {
|
||||
ContraiDb.upDateIdAndsource(it.contrailId,it.source,it.lineId)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(needDelete.size<100) {
|
||||
pointDao?.deleteByLineId(needDelete)
|
||||
}else{
|
||||
pointDao?.deleteByLineIdTra(needDelete)
|
||||
}
|
||||
if(contaiBeans.size<100) {
|
||||
pointDao?.insert(*contaiBeans.toTypedArray())
|
||||
}else{
|
||||
pointDao?.insertTra(*contaiBeans.toTypedArray())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.mogo.och.weaknet.repository.db.repository
|
||||
import androidx.room.Transaction
|
||||
import com.mogo.eagle.core.network.utils.digest.DigestUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.TAG
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.weaknet.repository.db.IDbRepository
|
||||
@@ -13,6 +12,8 @@ import com.mogo.och.weaknet.repository.db.dao.SiteDataDao
|
||||
|
||||
object SiteDb: IDbRepository {
|
||||
|
||||
private const val TAG = "SiteDb"
|
||||
|
||||
private var siteDataDao: SiteDataDao? = null
|
||||
get() {
|
||||
if(field==null){
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean
|
||||
import io.reactivex.Observable
|
||||
@@ -44,4 +45,6 @@ interface ILineRepository {
|
||||
fun release()
|
||||
fun endTaskByOther(taskId: Long) {}
|
||||
|
||||
fun queryPointsByLineIds(lines: MutableList<Long>): Observable<MutableList<PointResponse>>?
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import com.mogo.och.data.bean.ContraiInfo
|
||||
import com.mogo.och.data.bean.LineInfo
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean
|
||||
@@ -184,6 +185,10 @@ class NormalRepository: ILineRepository {
|
||||
|
||||
}
|
||||
|
||||
override fun queryPointsByLineIds(lines: MutableList<Long>): Observable<MutableList<PointResponse>>? {
|
||||
return Observable.just(ArrayList<PointResponse>())
|
||||
}
|
||||
|
||||
override fun reportCabinEvent(
|
||||
context: Context?,
|
||||
data: ShuttleEventRequest?,
|
||||
|
||||
@@ -16,12 +16,15 @@ import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.data.bean.ContraiInfo
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.BusRoutesResponse
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.constant.BusConst
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.model.LineModel.currentTask
|
||||
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.TaskDataBean
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskSiteDataBean
|
||||
@@ -102,7 +105,7 @@ class WeaknetRepository : ILineRepository {
|
||||
TaskSiteDb.deleteErrorData(it)
|
||||
return@flatMap loadServerRuningTask(1)
|
||||
}
|
||||
val db2Beans = BusRoutesResponse.db2Beans(runnintTaskAndSites)
|
||||
val db2Beans = BusRoutesResponse.db2Beans(runnintTaskAndSites,currentTask!!.lineId)
|
||||
LineModel.stationList = db2Beans.first
|
||||
LineModel.startStationIndex = db2Beans.second
|
||||
LineModel.stationList?.let { stationlist->
|
||||
@@ -123,7 +126,7 @@ class WeaknetRepository : ILineRepository {
|
||||
OchChainLogManager.writeChainLogAutopilot("轨迹错误",this.toString())
|
||||
CallerLogger.d(TAG,"轨迹错误,$this")
|
||||
}
|
||||
LineManager.setContraiInfo(ContraiInfo(lineId!!,csvFileUrl!!,csvFileMd5!!,txtFileUrl!!,txtFileMd5!!,contrailSaveTime!!))
|
||||
LineManager.setContraiInfo(ContraiInfo(lineId!!,csvFileUrl!!,csvFileMd5!!,txtFileUrl!!,txtFileMd5!!,contrailSaveTime!!, source = source?: ContrailDataBean.SOURCETYPEROUTING))
|
||||
}
|
||||
}
|
||||
return@flatMap Observable.just(true)
|
||||
@@ -479,6 +482,11 @@ class WeaknetRepository : ILineRepository {
|
||||
weakNetInterface?.queryCarExecutableTaskList(context,ochCommonServiceCallback)
|
||||
}
|
||||
|
||||
override fun queryPointsByLineIds(lines: MutableList<Long>): Observable<MutableList<PointResponse>>? {
|
||||
val request = QueryPointRequest(LoginStatusManager.getOchBizInfo()?.businessType?:0,lines)
|
||||
return weakNetInterface?.queryPointsByLinesId(context,request)
|
||||
}
|
||||
|
||||
override fun reportCabinEvent(
|
||||
context: Context?,
|
||||
data: ShuttleEventRequest?,
|
||||
|
||||
@@ -4,9 +4,11 @@ import android.content.Context;
|
||||
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest;
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest;
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse;
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean;
|
||||
import com.mogo.och.weaknet.repository.db.bean.TaskDataBean;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.PassengerWriteOffRequest;
|
||||
@@ -60,4 +62,8 @@ public interface NetInterface {
|
||||
default void queryCarExecutableTaskList(Context context , OchCommonServiceCallback<CarExecutableTaskResponse> callback){}
|
||||
|
||||
default void reportCabinEvent(Context context , ShuttleEventRequest data , OchCommonServiceCallback<BaseData> callback){}
|
||||
|
||||
default Observable<List<PointResponse>> queryPointsByLinesId(Context context, QueryPointRequest data){
|
||||
return Observable.just(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.mogo.och.weaknet.repository.net.project.saas.bus;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest;
|
||||
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.PointsResponse;
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.PassengerWriteOffRequest;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean;
|
||||
@@ -65,5 +67,9 @@ public interface ISaasBusApiService {
|
||||
@POST( "/och-vehicle/cabin/reportCabinEvent" )
|
||||
Observable<BaseData> reportCabinEvent(@Header ("appId") String appId, @Header("ticket") String ticket, @Body ShuttleEventRequest request);
|
||||
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-contrail/contrail/queryCabinContrailByLines" )
|
||||
Observable<PointsResponse> queryCabinContrailByLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Body QueryPointRequest request);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,10 @@ import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.network.interceptor.transformIoTry
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.net.NetInterface
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -20,11 +22,12 @@ import io.reactivex.Observable
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/20
|
||||
*/
|
||||
object SaasBusServiceManager: NetInterface {
|
||||
object SaasBusServiceManager : NetInterface {
|
||||
|
||||
private val mService: ISaasBusApiService = MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
|
||||
ISaasBusApiService::class.java
|
||||
)
|
||||
private val mService: ISaasBusApiService =
|
||||
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(
|
||||
ISaasBusApiService::class.java
|
||||
)
|
||||
|
||||
|
||||
/**
|
||||
@@ -34,14 +37,14 @@ object SaasBusServiceManager: NetInterface {
|
||||
*/
|
||||
override fun queryBusRoutes(): Observable<BusRoutesResult?>? {
|
||||
//获取当前高德坐标
|
||||
return mService.queryBusRoutes(
|
||||
return mService.queryBusRoutes(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
SharedPrefsMgr.getInstance().getSn()
|
||||
) .transformIoTry()
|
||||
.flatMap(OchCommonNet("queryBusRoutes",false))
|
||||
).transformIoTry()
|
||||
.flatMap(OchCommonNet("queryBusRoutes", false))
|
||||
.flatMap {
|
||||
Observable.just(it.data?:BusRoutesResult())
|
||||
Observable.just(it.data ?: BusRoutesResult())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,5 +80,21 @@ object SaasBusServiceManager: NetInterface {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "reportCabinEvent"))
|
||||
}
|
||||
|
||||
override fun queryPointsByLinesId(
|
||||
context: Context?,
|
||||
data: QueryPointRequest?
|
||||
): Observable<MutableList<PointResponse>>? {
|
||||
return mService.queryCabinContrailByLines(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
data,
|
||||
)
|
||||
.transformIoTry()
|
||||
.flatMap(OchCommonNet("queryPointsByLinesId", false))
|
||||
.flatMap {
|
||||
Observable.just(it.data ?: mutableListOf())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,9 +2,11 @@ package com.mogo.och.weaknet.repository.net.project.saas.scheduled;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest;
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest;
|
||||
import com.mogo.och.weaknet.bean.response.BusRoutesResponse;
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse;
|
||||
import com.mogo.och.weaknet.bean.response.PointsResponse;
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.PassengerWriteOffRequest;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean;
|
||||
@@ -65,5 +67,9 @@ public interface ISaasScheduledApiService {
|
||||
@POST( "/och-vehicle/cabin/reportCabinEvent" )
|
||||
Observable<BaseData> reportCabinEvent(@Header ("appId") String appId, @Header("ticket") String ticket, @Body ShuttleEventRequest request);
|
||||
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-contrail/contrail/queryCabinContrailByLines" )
|
||||
Observable<PointsResponse> queryCabinContrailByLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Body QueryPointRequest request);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,10 @@ import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.network.interceptor.transformIoTry
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.net.NetInterface
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -77,5 +79,21 @@ object SaasScheduledServiceManager: NetInterface {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "reportCabinEvent"))
|
||||
}
|
||||
|
||||
override fun queryPointsByLinesId(
|
||||
context: Context?,
|
||||
data: QueryPointRequest?
|
||||
): Observable<MutableList<PointResponse>>? {
|
||||
return mService.queryCabinContrailByLines(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
data,
|
||||
)
|
||||
.transformIoTry()
|
||||
.flatMap(OchCommonNet("queryPointsByLinesId",false))
|
||||
.flatMap {
|
||||
Observable.just(it.data?: mutableListOf())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,9 +2,11 @@ package com.mogo.och.weaknet.repository.net.project.saas.shuttle;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest;
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest;
|
||||
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.PointsResponse;
|
||||
import com.mogo.och.weaknet.bean.response.WriteOffCountResponse;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.PassengerWriteOffRequest;
|
||||
import com.mogo.och.weaknet.repository.net.bean.request.WriteOffCountReqBean;
|
||||
@@ -65,5 +67,9 @@ public interface ISaasShuttleApiService {
|
||||
@POST( "/och-vehicle/cabin/reportCabinEvent" )
|
||||
Observable<BaseData> reportCabinEvent(@Header ("appId") String appId, @Header("ticket") String ticket, @Body ShuttleEventRequest request);
|
||||
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/och-contrail/contrail/queryCabinContrailByLines" )
|
||||
Observable<PointsResponse> queryCabinContrailByLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Body QueryPointRequest request);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,10 @@ import com.mogo.och.common.module.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.network.interceptor.transformIoTry
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.weaknet.bean.request.BusQueryLineStationsRequest
|
||||
import com.mogo.och.weaknet.bean.request.QueryPointRequest
|
||||
import com.mogo.och.weaknet.bean.response.CarExecutableTaskResponse
|
||||
import com.mogo.och.weaknet.bean.request.ShuttleEventRequest
|
||||
import com.mogo.och.weaknet.bean.response.PointResponse
|
||||
import com.mogo.och.weaknet.repository.net.NetInterface
|
||||
import io.reactivex.Observable
|
||||
|
||||
@@ -77,5 +79,21 @@ object SaasShuttleServiceManager: NetInterface {
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "reportCabinEvent"))
|
||||
}
|
||||
|
||||
override fun queryPointsByLinesId(
|
||||
context: Context?,
|
||||
data: QueryPointRequest?
|
||||
): Observable<MutableList<PointResponse>>? {
|
||||
return mService.queryCabinContrailByLines(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
SharedPrefsMgr.getInstance().token,
|
||||
data,
|
||||
)
|
||||
.transformIoTry()
|
||||
.flatMap(OchCommonNet("queryPointsByLinesId",false))
|
||||
.flatMap {
|
||||
Observable.just(it.data?: mutableListOf())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.weaknet.callback.IBusLinesCallback
|
||||
import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.model.LineModel.EXECUTABLECHANGETIME
|
||||
import com.mogo.och.weaknet.model.SynchDataModel.EXECUTABLECHANGETIME
|
||||
import com.mogo.och.weaknet.repository.RepositoryManager
|
||||
import com.mogo.och.weaknet.repository.db.bean.LineDataBean
|
||||
import io.reactivex.Observer
|
||||
|
||||
@@ -80,6 +80,7 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac
|
||||
viewModel?.arriveStation()
|
||||
}
|
||||
actv_complete_task.onClick {
|
||||
CallerLogger.d(TAG,"启动自驾参数:${LineManager.initAutopilotControlParameters()}")
|
||||
val builder = CommonDialogStatus.Builder()
|
||||
val closeLineConfirmDialog = builder
|
||||
.title(ResourcesUtils.getString(R.string.bus_dialog_title))
|
||||
|
||||
@@ -88,7 +88,7 @@ object BusTrajectoryManager : ITrajectoryListListener {
|
||||
"下发轨迹报错:没有轨迹或线路信息 contraiInfo:${LineManager.contraiInfo} lineInfos:${LineManager.lineInfos}"
|
||||
)
|
||||
} else {
|
||||
mAutopilotControlParameters = LineManager.initAutopilotControlParameters()
|
||||
mAutopilotControlParameters = LineManager.initAutopilotControlParametersFromContrai()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import androidx.core.app.ActivityCompat
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.TAG
|
||||
import com.mogo.eagle.core.utilcode.util.TimeTransformUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
@@ -52,6 +51,8 @@ import java.lang.reflect.Constructor
|
||||
*/
|
||||
class ConsultVideoPlayer : StandardGSYVideoPlayer {
|
||||
|
||||
private val TAG = "ConsultVideoPlayer"
|
||||
|
||||
private lateinit var start: ImageView
|
||||
lateinit var coverImage: ImageView
|
||||
private lateinit var currentTimeTextView: TextView
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-Xmx6144m
|
||||
org.gradle.jvmargs=-Xmx10240m
|
||||
#开启gradle缓存
|
||||
org.gradle.caching=true
|
||||
android.enableBuildCache=true
|
||||
|
||||
Reference in New Issue
Block a user