| | |
| | | package com.xw.yunwei.model |
| | | |
| | | import com.google.gson.annotations.SerializedName |
| | | import com.xw.yunwei.extension.dateChangePattern |
| | | import kotlin.math.min |
| | | |
| | | /** |
| | | * 常规任务详情 |
| | |
| | | */ |
| | | @SerializedName("vehicleLon") |
| | | val vehicleLon: Double? = null, |
| | | ) |
| | | ){ |
| | | //是否能够改派 |
| | | fun couldReassignment(): Boolean { |
| | | return status != 2 && taskCategory != 1 |
| | | } |
| | | |
| | | //获取显示创建事件 |
| | | fun getShowCreateTime(): String?{ |
| | | return createTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") |
| | | } |
| | | |
| | | //获取显示车身编码 |
| | | fun getShowVehicleCode(maxLength: Int): String { |
| | | return vehicleCode?.let { |
| | | if (it.isNotEmpty()) { |
| | | it.substring(0, min(it.length, maxLength)) |
| | | } else { |
| | | "" |
| | | } |
| | | } ?: "" |
| | | } |
| | | |
| | | //获取显示操作时间 |
| | | fun getShowHandleTime(): String?{ |
| | | return handleTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") |
| | | } |
| | | } |