package cn.muchinfo.rma.global.data

import android.os.Parcel
import android.os.Parcelable

/**
 * 查询客户资料
 * @property amount String?金额 [1:一口价、3:暂定价]
 * @property buyuserid String?采购方ID
 * @property buyusername String?采购方名称
 * @property contracctstatus String?合同状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
 * @property contractno String?现货合同编号
 * @property contracttype String?现货合同类型 - 1:采购 -1:销售
 * @property convertfactor String?标仓系数
 * @property deliveryenddate String?交收期(结束)
 * @property deliverygoodscode String?现货品种代码
 * @property deliverygoodsid String?现货品种ID
 * @property deliverygoodsname String?现货品种名称
 * @property deliverystartdate String?交收期(开始)
 * @property enddate String?点价结束日期 [2:点价 3:暂定价]
 * @property enumdicname String?单位名称
 * @property goodscode String?点价合约代码
 * @property goodsid String?点价合约ID - 0:为现货，其它为期货商品合约ID [2:点价 3:暂定价]
 * @property margin String?当前保证金
 * @property price String?价格\暂定价 [1:一口价、3:暂定价]
 * @property pricemove String?升贴水 [2:点价 3:暂定价]
 * @property pricetype String?定价类型 - 1:一口价 2:点价 3:暂定价
 * @property producttype String?产品类型 - 1:标准仓单 2:等标 3:非标
 * @property qty String?数量
 * @property remark String?备注
 * @property selluserid String?销售方ID
 * @property sellusername String?销售方名称
 * @property spotcontractid String?现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
 * @property spotgoodsdesc String?商品型号
 * @property startdate String?点价开始日期 [2:点价 3:暂定价]
 * @property userid String?机构ID
 * @constructor
 */
data class SpotContractData(
    val amount : String?,
    val buyuserid : String?,
    val buyusername : String?,
    val contracctstatus : String?,
    val contractno : String?,
    val contracttype : String?,
    val convertfactor : String?,
    val deliveryenddate : String?,
    val deliverygoodscode : String?,
    val deliverygoodsid : String?,
    val deliverygoodsname : String?,
    val deliverystartdate : String?,
    val enddate : String?,
    val enumdicname : String?,
    val goodscode : String?,
    val goodsid : String?,
    val margin : String?,
    val price : String?,
    val pricemove : String?,
    val pricetype : String?,
    val producttype : String?,
    val qty : String?,
    val remark : String?,
    val selluserid : String?,
    val sellusername : String?,
    val spotcontractid : String?,
    val spotgoodsdesc : String?,
    val startdate : String?,
    val userid : String?
) : Parcelable{
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(amount)
        parcel.writeString(buyuserid)
        parcel.writeString(buyusername)
        parcel.writeString(contracctstatus)
        parcel.writeString(contractno)
        parcel.writeString(contracttype)
        parcel.writeString(convertfactor)
        parcel.writeString(deliveryenddate)
        parcel.writeString(deliverygoodscode)
        parcel.writeString(deliverygoodsid)
        parcel.writeString(deliverygoodsname)
        parcel.writeString(deliverystartdate)
        parcel.writeString(enddate)
        parcel.writeString(enumdicname)
        parcel.writeString(goodscode)
        parcel.writeString(goodsid)
        parcel.writeString(margin)
        parcel.writeString(price)
        parcel.writeString(pricemove)
        parcel.writeString(pricetype)
        parcel.writeString(producttype)
        parcel.writeString(qty)
        parcel.writeString(remark)
        parcel.writeString(selluserid)
        parcel.writeString(sellusername)
        parcel.writeString(spotcontractid)
        parcel.writeString(spotgoodsdesc)
        parcel.writeString(startdate)
        parcel.writeString(userid)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<SpotContractData> {
        override fun createFromParcel(parcel: Parcel): SpotContractData {
            return SpotContractData(parcel)
        }

        override fun newArray(size: Int): Array<SpotContractData?> {
            return arrayOfNulls(size)
        }
    }

}