package cn.muchinfo.rma.global.data

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

/**
 * 套保品种
 * @property areauserid String?机构用户ID
 * @property enumdicname String?单位名称
 * @property evaluateratio String?估价系数
 * @property goodsgroupid String?关联期货品种ID
 * @property isvalid String?状态 0-无效(停用) 1-有效(正常)
 * @property middlegoodscode String?套保品种代码
 * @property middlegoodsid String?套保品种ID(SEQ_ERMS_MIDDLEGOODS)
 * @property middlegoodsname String?套保品种名称
 * @property modifytime String?修改时间
 * @property needhedgeratio String?套保比率
 * @property qtydecimalplace String?数量小数位
 * @property relatedgoodsid String?关联交易商品ID
 * @property relatedgoodstype String?关联商品类型 - 1:期货合约 2:现货品种
 * @constructor
 */
data class MiddleGoodsData(
    val areauserid : String? = "",
    val enumdicname : String? = "",
    val evaluateratio : String? = "",
    val goodsgroupid : String? = "",
    val isvalid : String? = "",
    val middlegoodscode : String? = "",
    val middlegoodsid : String? = "",
    val middlegoodsname : String? = "",
    val modifytime : String? = "",
    val needhedgeratio : String? = "",
    val qtydecimalplace : String? = "",
    val relatedgoodsid : String? = "",
    val relatedgoodstype : String? = "",
    var indexSelect: Int = 0,
    var id : String? = ""//用来区分的id
) : 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.readInt(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(areauserid)
        parcel.writeString(enumdicname)
        parcel.writeString(evaluateratio)
        parcel.writeString(goodsgroupid)
        parcel.writeString(isvalid)
        parcel.writeString(middlegoodscode)
        parcel.writeString(middlegoodsid)
        parcel.writeString(middlegoodsname)
        parcel.writeString(modifytime)
        parcel.writeString(needhedgeratio)
        parcel.writeString(qtydecimalplace)
        parcel.writeString(relatedgoodsid)
        parcel.writeString(relatedgoodstype)
        parcel.writeInt(indexSelect)
        parcel.writeString(id)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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


}