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 middleGoodsCode String?套保品种代码
 * @property middleGoodsHedgeRatio String?应套保比例
 * @property middleGoodsID String?套保品种
 * @property middleGoodsName String?************以下需计算或非redis数据************
 * @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 RealtimeExposureData(
    val areaUserID : String?,
    val buyFutureQty : String?,
    val buyPlanQty : String?,
    val buyPricedQty : 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?
) :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()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(areaUserID)
        parcel.writeString(buyFutureQty)
        parcel.writeString(buyPlanQty)
        parcel.writeString(buyPricedQty)
        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)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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

}