[8.3.0][站点临时禁用] 数据库增加站点标志,修改任务站点item
This commit is contained in:
@@ -35,6 +35,10 @@ open class BusStationBean {
|
||||
var isPlayTts: Boolean = false
|
||||
var pointType: Int = 0 // 1:途径点 2:禁行点 3:站点
|
||||
var videoList: List<SiteIntroduce>? = null
|
||||
/**
|
||||
* 站点标志 0:未赋值/默认值,与1结果一致 1:正常停靠 2:临时不停靠
|
||||
*/
|
||||
var tag: Int = 0
|
||||
|
||||
var passPoints: List<BusStationBean>? = null // 用于算路的经停点
|
||||
var blackPoints: List<BusStationBean>? = null // 用于算路的黑名單點
|
||||
@@ -58,6 +62,7 @@ open class BusStationBean {
|
||||
&& nameKr == that.nameKr
|
||||
&& introduction == that.introduction
|
||||
&& videoList == that.videoList
|
||||
&& tag == that.tag
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
@@ -75,6 +80,7 @@ open class BusStationBean {
|
||||
result = 31 * result + java.lang.Boolean.hashCode(isPlayTts)
|
||||
result = 31 * result + pointType
|
||||
result = 31 * result + Objects.hashCode(videoList)
|
||||
result = 31 * result + tag
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -94,6 +100,7 @@ open class BusStationBean {
|
||||
", isPlayTts=" + isPlayTts +
|
||||
", pointType=" + pointType +
|
||||
", videoList=" + videoList +
|
||||
", tag=" + tag +
|
||||
'}'
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 8,
|
||||
"identityHash": "50810f785aa35be38cad3a202c2f809f",
|
||||
"identityHash": "761be9c0c9726513939d5788d36c9c1d",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "contrail_data_table",
|
||||
@@ -370,7 +370,7 @@
|
||||
},
|
||||
{
|
||||
"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)",
|
||||
"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, `tag` INTEGER NOT NULL DEFAULT 0)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -497,6 +497,13 @@
|
||||
"columnName": "videoList",
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "tag",
|
||||
"columnName": "tag",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true,
|
||||
"defaultValue": "0"
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
@@ -862,7 +869,7 @@
|
||||
"views": [],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '50810f785aa35be38cad3a202c2f809f')"
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '761be9c0c9726513939d5788d36c9c1d')"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ class BusRoutesResponse : BaseData() {
|
||||
temp?.nameKr = taskAndsite.nameKr
|
||||
temp?.isPlayTts = Boolean.TRUE == taskAndsite.isPlayTts
|
||||
temp?.seq = (taskAndsite.seq ?: 0)
|
||||
temp?.tag = taskAndsite.tag
|
||||
temp?.siteId = if (taskAndsite.siteId == null) 0 else taskAndsite.siteId!!.toInt()
|
||||
points?.let { pointList->
|
||||
val sitePoint = pointList.filter {
|
||||
|
||||
@@ -124,7 +124,8 @@ abstract class MyDataBase : RoomDatabase() {
|
||||
if (dbFileName == "shuttle_db") {
|
||||
// 新增tag字段:int类型,非空,默认值0
|
||||
db.execSQL("ALTER TABLE ${SiteDataBean.tableName} ADD COLUMN tag INTEGER NOT NULL DEFAULT 0")
|
||||
CallerLogger.d(TAG, "shuttle_db:给${SiteDataBean.tableName}新增tag字段成功")
|
||||
db.execSQL("ALTER TABLE ${TaskSiteDataBean.tableName} ADD COLUMN tag INTEGER NOT NULL DEFAULT 0")
|
||||
CallerLogger.d(TAG, "shuttle_db:给${SiteDataBean.tableName}、${TaskSiteDataBean.tableName}新增tag字段成功")
|
||||
} else {
|
||||
CallerLogger.d(TAG, "非shuttle_db,跳过tag字段新增")
|
||||
}
|
||||
|
||||
@@ -131,6 +131,11 @@ data class TaskSiteDataBean(
|
||||
@ColumnInfo(name = "videoList", typeAffinity = ColumnInfo.TEXT)
|
||||
var videoList: String? = null,
|
||||
|
||||
/**
|
||||
* 站点标志 0:未赋值/默认值,与1结果一致 1:正常停靠 2:临时不停靠
|
||||
*/
|
||||
@ColumnInfo(name = "tag", typeAffinity = ColumnInfo.INTEGER, defaultValue = "0")
|
||||
var tag: Int = 0,
|
||||
) {
|
||||
companion object {
|
||||
/**
|
||||
@@ -162,6 +167,7 @@ data class TaskSiteDataBean(
|
||||
temp?.introduction = it.introduction
|
||||
temp?.isPlayTts = it.isPlayTts
|
||||
temp?.videoList = it.videoListDB
|
||||
temp?.tag = it.tag
|
||||
result.add(temp!!)
|
||||
}
|
||||
return result
|
||||
|
||||
@@ -101,6 +101,18 @@ class TaskRunningAdapter(
|
||||
holder.actvWriteOffCount.visibility = View.GONE
|
||||
holder.acivStationHead.setImageResource(R.drawable.bus_runnint_task_middle)
|
||||
}
|
||||
holder.stationStatus.visibility = if (line.tag == 2) {
|
||||
holder.actvStationName.setTextSize(
|
||||
TypedValue.COMPLEX_UNIT_PX,
|
||||
AutoSizeUtils.dp2px(mContext, 40f).toFloat()
|
||||
)
|
||||
holder.actvStationName.setTextColor(ResourcesUtils.getColor(R.color.bus_color_4dffffff))
|
||||
holder.actvWriteOffCount.visibility = View.GONE
|
||||
holder.acivStationHead.setImageResource(R.drawable.bus_switch_line_adapter_point_pass)
|
||||
View.VISIBLE
|
||||
}else{
|
||||
View.GONE
|
||||
}
|
||||
|
||||
when (currentPosition) {
|
||||
0 -> {
|
||||
@@ -256,6 +268,7 @@ class TaskRunningAdapter(
|
||||
val actvStationName: AppCompatTextView = itemView.findViewById(R.id.actv_station_name)//站点名称
|
||||
val acivStationHead: AppCompatImageView =
|
||||
itemView.findViewById(R.id.aciv_station_head)//普通站点标识 不是起始和终点坐标
|
||||
val stationStatus: AppCompatTextView = itemView.findViewById(R.id.station_status)//站点状态
|
||||
val acivStationHeadBig: AppCompatImageView =
|
||||
itemView.findViewById(R.id.aciv_station_head_big)//起始和终点坐标标识
|
||||
val actvWriteOffCount: WriteOffView =
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="16dp" />
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#0056FF"
|
||||
android:startColor="#029DFF"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -87,5 +87,22 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/station_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
android:background="@drawable/bus_station_status_bg"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="临时不停"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user