package cn.muchinfo.rma.global.data

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

/**
 * 敞口内的现货数量和期货数量的合并实体
 */
data class NumberSpotData(
    //现货部分
    val areauserid : String? = "",//所属机构
    val decreaseqty : String? = "",//现货 减少数量=-(销售已定价数量+采购计划数量) / 期货 减少数量 = (期末卖头寸 - 期初卖头寸)*-1
    val increaseqty : String? = "",//现货 增加数量=销售计划数量+采购已定价数量 / 期货 增加数量 = 期末买头寸 - 期初买头寸
    val oritoalspotqty : String? = "",//昨日数量
    val totalspotqty : String? = "",// 当前数量(现货头寸总量) = (销售计划数量 - 销售已定价数量) - (采购计划数量 - 采购已定价数量)
    val updatetime : String? = "",//更新时间
    val wrstandardcode : String? = "",//现货品种代码
    val wrstandardid : String? = "",//现货商品ID
    val wrstandardname : String? = "",//现货品种
    //期货部分
    val accountid : String? = "",//资金账号[外部母账户]
    val curbuyposition : String? = "",//期末买头寸
    val cursellposition : String? = "",//期末卖头寸
    val curtdbuyposition : String? = "",//期末今日买头寸
    val curtdsellposition : String? = "",//期末今日卖头寸
    val curydbuyposition : String? = "",//期末上日买头寸
    val curydsellposition : String? = "",//期末上日卖头寸
    val fretdbuyposition : String? = "",//冻结今日买头寸
    val fretdsellposition : String? = "",//冻结今日卖头寸
    val freydbuyposition : String? = "",//冻结上日买头寸
    val freydsellposition : String? = "",//冻结上日卖头寸
    val goodscode : String? = "",//商品代码
    val goodsid : String? = "",//商品id
    val goodsname : String? = "",//商品名称
    val hedgeaccountcode : String? = "",//对冲账号
    val hedgegoodsid : String? = "",//对冲合约ID
    val marketid : String? = "",//市场ID
    val relateduserid : String? = "",//关联用户id
    val totalcurqty : String? = "", //期货 当前数量(净头寸) = 期末买头寸 - 期末卖头寸
    val totalydqty : String? = "",//期货 昨日数量(净头寸) = 期初买头寸 - 期初卖头寸
    val tradedate : String? = "",//交易日(yyyyMMdd)
    val ydbuyposition : String? = "",//期初买头寸
    val ydsellposition : 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(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(areauserid)
        parcel.writeString(decreaseqty)
        parcel.writeString(increaseqty)
        parcel.writeString(oritoalspotqty)
        parcel.writeString(totalspotqty)
        parcel.writeString(updatetime)
        parcel.writeString(wrstandardcode)
        parcel.writeString(wrstandardid)
        parcel.writeString(wrstandardname)
        parcel.writeString(accountid)
        parcel.writeString(curbuyposition)
        parcel.writeString(cursellposition)
        parcel.writeString(curtdbuyposition)
        parcel.writeString(curtdsellposition)
        parcel.writeString(curydbuyposition)
        parcel.writeString(curydsellposition)
        parcel.writeString(fretdbuyposition)
        parcel.writeString(fretdsellposition)
        parcel.writeString(freydbuyposition)
        parcel.writeString(freydsellposition)
        parcel.writeString(goodscode)
        parcel.writeString(goodsid)
        parcel.writeString(goodsname)
        parcel.writeString(hedgeaccountcode)
        parcel.writeString(hedgegoodsid)
        parcel.writeString(marketid)
        parcel.writeString(relateduserid)
        parcel.writeString(totalcurqty)
        parcel.writeString(totalydqty)
        parcel.writeString(tradedate)
        parcel.writeString(ydbuyposition)
        parcel.writeString(ydsellposition)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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

}