package cn.muchinfo.rma.global.data

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

/**
 *
 * @property areauserid String? 用户ID
 * @property contracttype String? 计划类型 - 1:采购 -1:销售
 * @property convertfactor String? 标仓系数
 * @property deliverygoodsid String? 现货品种ID
 * @property deliverygoodsname String? 现货品种名称
 * @property hedgeplanid String? 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
 * @property hedgeplanno String? 套保计划编号(名称)
 * @property hedgeplanstatus String? 套保计划状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
 * @property planqty String? 计划数量
 * @property plantime String? 计划时间
 * @property producttype String? 产品类型 - 1:标准仓单 2:等标 3:非标
 * @property remark String? 备注
 * @property spotgoodsdesc String? 商品型号
 * @property wrstandardid String? 现货商品ID
 * @property wrstandardname String 现货商品名称
 * @constructor
 */
data class HedgePlanData(
    val areauserid : String? = "",
    val contracttype : String? = "",
    val convertfactor : String? = "",
    val deliverygoodsid : String? = "",
    val deliverygoodsname : String? = "",
    val hedgeplanid : String? = "",
    val hedgeplanno : String? = "",
    val hedgeplanstatus : String? = "",
    val planqty :String? = "",
    val plantime  : String? = "",
    val producttype : String? = "",
    val remark : String? = "",
    val spotgoodsdesc :String? = "",
    val wrstandardid : String? = "",
    val wrstandardname : String? = "",
    var indexSelect : Int = 0
) : 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.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(areauserid)
        parcel.writeString(contracttype)
        parcel.writeString(convertfactor)
        parcel.writeString(deliverygoodsid)
        parcel.writeString(deliverygoodsname)
        parcel.writeString(hedgeplanid)
        parcel.writeString(hedgeplanno)
        parcel.writeString(hedgeplanstatus)
        parcel.writeString(planqty)
        parcel.writeString(plantime)
        parcel.writeString(producttype)
        parcel.writeString(remark)
        parcel.writeString(spotgoodsdesc)
        parcel.writeString(wrstandardid)
        parcel.writeString(wrstandardname)
        parcel.writeInt(indexSelect)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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

}