feat: opt 收运检查 列表
This commit is contained in:
@@ -2,6 +2,9 @@ package com.lukouguoji.module_base.bean
|
||||
|
||||
import androidx.databinding.ObservableBoolean
|
||||
import com.lukouguoji.module_base.interfaces.ICheck
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import dev.utils.DevFinal
|
||||
import dev.utils.common.DateUtils
|
||||
|
||||
/**
|
||||
* 国际出港收运检查数据Bean
|
||||
@@ -74,4 +77,32 @@ class GjcInspectionBean : ICheck {
|
||||
else -> "#9E9E9E" // 灰色-未审核
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 预计起飞时间 - 仅时分格式 (HH:mm)
|
||||
*/
|
||||
val scheduledTackOffHM: String
|
||||
get() {
|
||||
return DateUtils.parseString(
|
||||
scheduledTackOff,
|
||||
DevFinal.TIME.yyyyMMddHHmmss_HYPHEN,
|
||||
"HH:mm"
|
||||
).noNull(scheduledTackOff)
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证预计起飞时间是否为次日
|
||||
*/
|
||||
fun verifyScheduledTackOffNextDay(): Boolean {
|
||||
if (fdate.isEmpty() || scheduledTackOff.isEmpty()) {
|
||||
return false
|
||||
}
|
||||
return try {
|
||||
val calendarFDate = DateUtils.getCalendar(fdate, DevFinal.TIME.yyyyMMdd_HYPHEN)
|
||||
val calendarTakeOff = DateUtils.getCalendar(scheduledTackOff, DevFinal.TIME.yyyyMMddHHmmss_HYPHEN)
|
||||
DateUtils.getDay(calendarTakeOff) > DateUtils.getDay(calendarFDate)
|
||||
} catch (e: Exception) {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View"/>
|
||||
|
||||
<variable
|
||||
name="bean"
|
||||
type="com.lukouguoji.module_base.bean.GjcInspectionBean" />
|
||||
@@ -67,7 +69,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
@@ -88,7 +90,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
@@ -180,7 +182,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
@@ -201,7 +203,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
@@ -213,9 +215,18 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.scheduledTackOff}"
|
||||
android:text="@{bean.scheduledTackOffHM}"
|
||||
tools:text="09:12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDayPlus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="+1"
|
||||
android:textColor="@color/text_red"
|
||||
android:visibility="@{bean.verifyScheduledTackOffNextDay() ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- 业务类型 -->
|
||||
|
||||
Reference in New Issue
Block a user