package com.lukouguoji.module_base.bean

import com.lukouguoji.module_base.ktx.loge
import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.toJson

/**
 * 平板车或集装器 数据类
 */
class CarOrUldBean(
    var airport: String? = "",
    var buyDate: String? = "",
    var carId: String? = "",
    var carWeight: String? = "",
    var carrier: String? = "",
    var maxVolume: String? = "",
    var maxWeight: String? = "",
    var organizationCode: String? = "",
    var producers: String? = "",
    var remark: String? = "",
    var signWeight: String? = "",
    var status: String? = "",
    var uld: String? = "",
    var uldFlag: String? = "",
    var uldType: String? = "",
    var uldWeight: String? = ""
) {

    /**
     * 用于合并数据
     */
    fun createForMerge(bean: CarOrUldBean): CarOrUldBean {
        loge("传入的 bean : ${bean.toJson()}")
        loge("当前的 bean : ${this.toJson()}")
        val carOrUldBean = CarOrUldBean()
        carOrUldBean.airport = bean.airport.noNull(airport.noNull())
        carOrUldBean.buyDate = bean.buyDate.noNull(buyDate.noNull())
        carOrUldBean.carId = bean.carId.noNull(carId.noNull())
        carOrUldBean.carWeight = bean.carWeight.noNull(carWeight.noNull())
        carOrUldBean.carrier = bean.carrier.noNull(carrier.noNull())
        carOrUldBean.maxVolume = bean.maxVolume.noNull(maxVolume.noNull())
        carOrUldBean.maxWeight = bean.maxWeight.noNull(maxWeight.noNull())
        carOrUldBean.organizationCode = bean.organizationCode.noNull(organizationCode.noNull())
        carOrUldBean.producers = bean.producers.noNull(producers.noNull())
        carOrUldBean.remark = bean.remark.noNull(remark.noNull())
        carOrUldBean.signWeight = bean.signWeight.noNull(signWeight.noNull())
        carOrUldBean.status = bean.status.noNull(status.noNull())
        carOrUldBean.uld = bean.uld.noNull(uld.noNull())
        carOrUldBean.uldFlag = bean.uldFlag.noNull(uldFlag.noNull())
        carOrUldBean.uldType = bean.uldType.noNull(uldType.noNull())
        carOrUldBean.uldWeight = bean.uldWeight.noNull(uldWeight.noNull())
        loge("合并后的 bean : ${carOrUldBean.toJson()}")
        return carOrUldBean
    }


}