package com.lukouguoji.module_base.bean

import androidx.databinding.ObservableBoolean
import com.lukouguoji.module_base.interfaces.ICheck
import com.lukouguoji.module_base.ktx.noNull

class GjcWaybillBean(
    // 代理人代码
    var agent: String? = null,
    // 业务类型
    var businesstype: String? = null,
    var businessType: String? = null,
    // 第一承运人
    var by1: String? = null,
    // 第二承运人
    var by2: String? = null,
    // 运单号
    var code: String? = null,
    var createdAt: String? = null,
    var createdBy: String? = null,
    var deleted: Boolean? = null,
    // 始发港
    var dep: String? = null,
    var desc: String? = null,
    // 目的港
    var dest: String? = null,
    // 第一目的站
    var dest1: String? = null,
    // 第二目的站
    var dest2: String? = null,
    // (预留)主提运单号扩展码(Default ‘0’)
    var exno: String? = null,
    var extraJson: String? = null,
    // 航班关闭时间(或退库时间)
    var fclose: String? = null,
    // 航班日期
    var fdate: String? = null,
    // 航班ID
    var fid: String? = null,
    // 航班号
    var fno: String? = null,
    // 品名
    var goods: String? = null,
    var id: String? = null,
    // 货位（库位or板箱号or平板号,RET为退库）
    var location: String? = null,
    // 货位标识（0:平板号;1:板箱;2:库位）
    var locflag: String? = null,
    // 平板车/ULD对应过磅记录的ID号(Default 0)
    var locId: String? = null,
    // 名称
    var name: String? = null,
    // 主提运单号
    var no: String? = null,
    // 操作时间
    var opdate: String? = null,
    // 操作人代码
    var opid: String? = null,
    // 操作人姓名
    var opname: String? = null,
    // 操作时间
    var organizationCode: String? = null,
    // 件数
    var pc: String? = null,
    // 主提运单前缀(承运人运单三字码)
    var prefix: String? = null,
    // 特码
    var spcode: String? = null,
    var spCode: String? = null,
    // 子码
    var subcode: String? = null,
    var updatedAt: String? = null,
    var updatedBy: String? = null,
    var version: String? = null,
    // 体积
    var volume: String? = null,
    // 货物操作凭证号
    var vouchernumber: String? = null,
    // (毛)重量
    var weight: String? = null,
    // 流水号(SEQ_StringImport.Nextval)
    var whid: String? = null
) : ICheck {

    val checked = ObservableBoolean(false)

    override fun getCheckObservable() = checked

    // 运单号
    fun getWaybillCode() = prefix.noNull() + no.noNull()

    // 是否是邮件
    fun isMail() = prefix == "000"

}