package com.genlot.nativesdk.model;

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

import java.util.ArrayList;

/**
 * @author zhangqiao on 2018-09-13 19:11
 * @email james_geek@qq.com
 */
public class CopyLotteryBean implements Parcelable {
    public String strTicketStationID;//票面投注机号
    public String strIssue;//开奖期号
    public String strGameID;//游戏ID
    public String strTSN;//票流水号
    public String strWagerIssue;//投注期号（多期的时候才会有不同）
    public String strSaleOperatorID;//销售此票的操作员工号
    public String strParValue;//投注金额
    public String strWagerTime;//投注时间，格式为（YYYYMMDDHHMMSS）
    public String strTicketStat;//票状态（0－投注机注销，1－冲正，2－中心注销，3－投注，4－投注机兑奖，5－中心兑奖，6－已弃奖）
    public String strCancelTime;//注销时间
    public String strCancelStationID;//注销此票的投注机号
    public String strBetPerTicket;//注数（指打印的行数）
    public String strMultiIssue;//多期期数
    public String strVIPID;//积分卡号
    public ArrayList<GameCopyInfoBean> gameCopyInfoBeans;

    public CopyLotteryBean(){

    }

    protected CopyLotteryBean(Parcel in) {
        strTicketStationID = in.readString();
        strIssue = in.readString();
        strGameID = in.readString();
        strTSN = in.readString();
        strWagerIssue = in.readString();
        strSaleOperatorID = in.readString();
        strParValue = in.readString();
        strWagerTime = in.readString();
        strTicketStat = in.readString();
        strCancelTime = in.readString();
        strCancelStationID = in.readString();
        strBetPerTicket = in.readString();
        strMultiIssue = in.readString();
        strVIPID = in.readString();
        gameCopyInfoBeans = in.createTypedArrayList(GameCopyInfoBean.CREATOR);
    }

    public static final Creator<CopyLotteryBean> CREATOR = new Creator<CopyLotteryBean>() {
        @Override
        public CopyLotteryBean createFromParcel(Parcel in) {
            return new CopyLotteryBean(in);
        }

        @Override
        public CopyLotteryBean[] newArray(int size) {
            return new CopyLotteryBean[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(strTicketStationID);
        dest.writeString(strIssue);
        dest.writeString(strGameID);
        dest.writeString(strTSN);
        dest.writeString(strWagerIssue);
        dest.writeString(strSaleOperatorID);
        dest.writeString(strParValue);
        dest.writeString(strWagerTime);
        dest.writeString(strTicketStat);
        dest.writeString(strCancelTime);
        dest.writeString(strCancelStationID);
        dest.writeString(strBetPerTicket);
        dest.writeString(strMultiIssue);
        dest.writeString(strVIPID);
        dest.writeTypedList(gameCopyInfoBeans);
    }


    public static class GameCopyInfoBean implements Parcelable {
        public String strBetSN;//注序号
        public String strWagerMode;//投注方式
        public String strPlayType;//游戏玩法
        public String strMultiTimes;//倍数
        public String strBetNumber;//投注号码

        public GameCopyInfoBean(){

        }

        protected GameCopyInfoBean(Parcel in) {
            strBetSN = in.readString();
            strWagerMode = in.readString();
            strPlayType = in.readString();
            strMultiTimes = in.readString();
            strBetNumber = in.readString();
        }

        public static final Creator<GameCopyInfoBean> CREATOR = new Creator<GameCopyInfoBean>() {
            @Override
            public GameCopyInfoBean createFromParcel(Parcel in) {
                return new GameCopyInfoBean(in);
            }

            @Override
            public GameCopyInfoBean[] newArray(int size) {
                return new GameCopyInfoBean[size];
            }
        };

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(strBetSN);
            dest.writeString(strWagerMode);
            dest.writeString(strPlayType);
            dest.writeString(strMultiTimes);
            dest.writeString(strBetNumber);
        }
    }

    @Override
    public String toString() {
        return "CoppyLotteryBean{" +
                "strTicketStationID='" + strTicketStationID + '\'' +
                ", strIssue='" + strIssue + '\'' +
                ", strGameID='" + strGameID + '\'' +
                ", strTSN='" + strTSN + '\'' +
                ", strWagerIssue='" + strWagerIssue + '\'' +
                ", strSaleOperatorID='" + strSaleOperatorID + '\'' +
                ", strParValue='" + strParValue + '\'' +
                ", strWagerTime='" + strWagerTime + '\'' +
                ", strTicketStat='" + strTicketStat + '\'' +
                ", strCancelTime='" + strCancelTime + '\'' +
                ", strCancelStationID='" + strCancelStationID + '\'' +
                ", strBetPerTicket='" + strBetPerTicket + '\'' +
                ", strMultiIssue='" + strMultiIssue + '\'' +
                ", strVIPID='" + strVIPID + '\'' +
                ", gameCopyInfoBeans=" + gameCopyInfoBeans +
                '}';
    }
}
