package cn.muchinfo.rma.global.data

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

/**
 * 现货商品
 * @property areauserid String?所属机构
 * @property createtime String?创建时间
 * @property creatorid String?创建人
 * @property deliverygoodsid String?品种ID
 * @property enumdicname String?单位名称
 * @property minivalue String?最小变动值
 * @property minivaluedp String?最小变动值小数位
 * @property realminivalue String?实际最小变动值
 * @property realminivaluedp String?实际最小变动值小数位
 * @property unitid String?单位ID
 * @property wrstandardcode String?现货商品代码
 * @property wrstandardid String?现货商品ID(SEQ_WRSTANDARD)
 * @property wrstandardname String?现货商品名称
 * @constructor
 */
data class WrStandardData(
    val areauserid : String? = "",
    val createtime : String? = "",
    val creatorid : String? = "",
    val deliverygoodsid : String? = "",
    val enumdicname : String? = "",
    val minivalue : String? = "",
    val minivaluedp : String? = "",
    val realminivalue : String? = "",
    val realminivaluedp : String? = "",
    val unitid : String? = "",
    val wrstandardcode : String? = "",
    val wrstandardid : String? = "",
    val wrstandardname : String? = "",
    val isvalid : String? = "",//是否有效 0-无效(停用) 1-有效(正常)
    val remark : String? = "",
    var indexSelect: Int = 0,
    val updatetime : 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.readInt(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(areauserid)
        parcel.writeString(createtime)
        parcel.writeString(creatorid)
        parcel.writeString(deliverygoodsid)
        parcel.writeString(enumdicname)
        parcel.writeString(minivalue)
        parcel.writeString(minivaluedp)
        parcel.writeString(realminivalue)
        parcel.writeString(realminivaluedp)
        parcel.writeString(unitid)
        parcel.writeString(wrstandardcode)
        parcel.writeString(wrstandardid)
        parcel.writeString(wrstandardname)
        parcel.writeString(isvalid)
        parcel.writeString(remark)
        parcel.writeInt(indexSelect)
        parcel.writeString(updatetime)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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

}