package cn.muchinfo.rma.global.data

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

/**
 * 实时敞口列表实体
 * @property areaUserID String?
 * @property buyFutureQty String?
 * @property buyPlanQty String?
 * @property buyPricedQty String?
 * @property diffFutuQty String?
 * @property diffSpotQty String?
 * @property enumdicname String?
 * @property middleGoodsCode String?
 * @property middleGoodsHedgeRatio String?
 * @property middleGoodsID String?
 * @property middleGoodsName String?
 * @property needHedgeExposoure String?
 * @property needHedgeRatio String?
 * @property oriBuyFutureQty String?
 * @property oriBuyPlanQty String?
 * @property oriBuyPricedQty String?
 * @property oriSellFutureQty String?
 * @property oriSellPlanQty String?
 * @property oriSellPricedQty String?
 * @property oriTotalFutuQty String?
 * @property oriTotalSpotQty String?
 * @property sellFutureQty String?
 * @property sellPlanQty String?
 * @property sellPricedQty String?
 * @property totalExposure String?
 * @property totalFutureQty String?
 * @property totalHedgeRatio String?
 * @property totalNeedHedgeQty String?
 * @property totalSpotQty String?
 * @constructor
 */
data class RealExposureData(
    val AreaUserID : String? = "",//所属机构
    val BuyFutureQty : String? = "",//买入期货数量
    val BuyPlanQty : String? = "",//采购计划数量
    val BuyPricedQty : String? = "",//采购合同已定价数量
    val DiffFutuQty : String? = "",//今日变动量(期货) = (买入 - 买入期初) - (卖出 - 卖出期初)
    val DiffSpotQty : String? = "",//今日变动量(现货) = 现货数量 - 期初现货数量
    val ENUMDICNAME : String? = "",//单位名称
    val MiddleGoodsCode : String? = "",//套保品种代码
    val MiddleGoodsHedgeRatio : String? = "",//应套保比例
    val MiddleGoodsID : String? = "",//套保品种
    val MiddleGoodsName : String? = "",//套保品种名称
    val NeedHedgeExposoure : String? = "",//应套保敞口
    val NeedHedgeRatio : String? = "",//应套保敞口比例
    val OriBuyFutureQty : String? = "",//期初买入期货数量
    val OriBuyPlanQty : String? = "",//期初采购计划数量
    val OriBuyPricedQty : String? = "",//期初采购合同已定价数量
    val OriSellFutureQty : String? = "",//期初卖出期货数量
    val OriSellPlanQty : String? = "",//期初销售计划数量
    val OriSellPricedQty : String? = "",//期初销售合同已定价数量
    val OriTotalFutuQty : String? = "",//期初期货数量=期初买入期货数量-期初卖出期货数量
    val OriTotalSpotQty : String? = "",//期初现货数量=(期初销售计划数量-期初销售合同已定价数量)-(期初采购计划数量-期初采购合同已定价数量)
    val SellFutureQty : String? = "",//卖出期货数量
    val SellPlanQty : String? = "",//销售计划数量
    val SellPricedQty : String? = "",//销售合同已定价数量
    val TotalExposure : String? = "",//总敞口
    val TotalFutureQty : String? = "",//期货数量
    val TotalHedgeRatio : String? = "",//敞口比例
    val TotalNeedHedgeQty : String? = "",//期货应套保量
    val TotalSpotQty : String? = "",//现货数量
    var rightData : List<String>? = arrayListOf()//组装的右侧数据
) : 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(),
        parcel.createStringArrayList()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(AreaUserID)
        parcel.writeString(BuyFutureQty)
        parcel.writeString(BuyPlanQty)
        parcel.writeString(BuyPricedQty)
        parcel.writeString(DiffFutuQty)
        parcel.writeString(DiffSpotQty)
        parcel.writeString(ENUMDICNAME)
        parcel.writeString(MiddleGoodsCode)
        parcel.writeString(MiddleGoodsHedgeRatio)
        parcel.writeString(MiddleGoodsID)
        parcel.writeString(MiddleGoodsName)
        parcel.writeString(NeedHedgeExposoure)
        parcel.writeString(NeedHedgeRatio)
        parcel.writeString(OriBuyFutureQty)
        parcel.writeString(OriBuyPlanQty)
        parcel.writeString(OriBuyPricedQty)
        parcel.writeString(OriSellFutureQty)
        parcel.writeString(OriSellPlanQty)
        parcel.writeString(OriSellPricedQty)
        parcel.writeString(OriTotalFutuQty)
        parcel.writeString(OriTotalSpotQty)
        parcel.writeString(SellFutureQty)
        parcel.writeString(SellPlanQty)
        parcel.writeString(SellPricedQty)
        parcel.writeString(TotalExposure)
        parcel.writeString(TotalFutureQty)
        parcel.writeString(TotalHedgeRatio)
        parcel.writeString(TotalNeedHedgeQty)
        parcel.writeString(TotalSpotQty)
        parcel.writeStringList(rightData)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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


}