package com.lukouguoji.module_base.bean

import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.ktx.noNull

data class GjcBoxDetailsBean(
    var eqmUld: ULDBean? = null,
    var flatCar: FlatcarBean? = null,
    var gjcLoading: GjcLoadingBean? = null,
    var isAdd: String? = null,
    var pc: String? = null,
    var totalWeight: String? = null,
    var warehousePclistDTOList: List<WarehousePclistDTO>? = null
)


data class GjcLoadingBean(
    var agentCode: String? = null,
    var boardtype: String? = null,
    var cargotype: String? = null,
    var cargoweight: String? = null,
    var carid: String? = null,
    var carrier: String? = null,
    var cflag: String? = null,
    var dest: String? = null,
    var emptyuld: String? = null,
    var fclose: String? = null,
    var fdate: String? = null,
    var fid: String? = null,
    var fno: String? = null,
    var locId: String? = null,
    var location: String? = null,
    var mailpc: String? = null,
    var mailvolume: String? = null,
    var mailweight: String? = null,
    var mawbNo: String? = null,
    var maxvolume: String? = null,
    var maxweight: String? = null,
    var movID: String? = null,
    var netweight: 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 priority: String? = null,
    var remark: String? = null,
    var reviewDate: String? = null,
    var reviewWeight: String? = null,
    var reviewer: String? = null,
    var spCode: String? = null,
    var uld: String? = null,
    var uldflag: String? = null,
    var uldweight: String? = null,
    var volume: Double? = null
)

data class WarehousePclistDTO(
    var agent: 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: String? = null,
    var dep: String? = null,
    var desc: String? = null,
    var dest: String? = null,
    var dest1: String? = null,
    var dest2: String? = null,
    var exno: String? = null,
    var extraJson: String? = null,
    var fclose: String? = null,
    var fdate: String? = null,
    var fid: String? = null,
    var fno: String? = null,
    var goods: String? = null,
    var id: String? = null,
    var locId: String? = null,
    var location: String? = null,
    var locflag: 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 subcode: String? = null,
    var updatedAt: String? = null,
    var updatedBy: String? = null,
    var version: String? = null,
    var volume: Double? = null,
    var vouchernumber: String? = null,
    var weight: String? = null,
    var whid: String? = null,
    var pclist: PcListBean? = PcListBean(),
) {
    fun toGjcWaybillBean(): GjcWaybillBean {
        return NetApply.gson.fromJson(
            NetApply.gson.toJson(this),
            GjcWaybillBean::class.java
        )
    }

    fun toGjcBoxAddListBean(): GjcBoxAddListBean {
        val bean = GjcBoxAddListBean(toGjcWaybillBean())
        pclist?.let {
            bean.pcID = it.pcID.noNull()
            if (!it.list.isNullOrEmpty()) {
                it.list?.split(",")?.forEach { k ->
                    bean.jianList.add(JianBean(k.toInt().toString(), k))
                }
            }
        }
        return bean
    }
}

class PcListBean(
    var list: String? = "",
    var locId: Any? = Any(),
    var no: Any? = Any(),
    var organizationcode: Any? = Any(),
    var pcID: String? = "",
    var prefix: Any? = Any()
)