package com.phlx.wool.entity;


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

import androidx.databinding.BaseObservable;

import com.google.gson.annotations.SerializedName;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * 绒毛收购 对象 zs_villus_buy
 *
 * @author phlx
 * @date 2021-01-14
 */
@Entity
public class VillusBuyEntity extends BaseObservable implements Parcelable {

    /**
     * 主键
     */
    @Id(autoincrement = false)
    private Long id;

    /**
     * 收购批次
     */
    private String buyBatch;

    /**
     * 所属苏木
     */
    private String revision;

    /**
     * 收购重量
     */
    private String buyWeight;

    /**
     * 收购厂家
     */
    private String buyFactory;

    /**
     * 收购日期
     */
    private String buyDate;

    /**
     * 负责人
     */
    private String personInCharge;

    /** 牧户代码 */
    private String pastureUnitId;

    /** 牧户名称 */
    private String pastureUnitName;

    /** 牧户手机号 */
    private String pastureUnitPhone;

    /** 产品追溯唯一标识 */
    private String productId;

    /** 标签被打印的次数 */
    private Integer printCount;

    /** 二维码被扫描的次数 */
    private Integer scanCount;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    private String createTime;

    /**
     * 数据状态 0--上传成功，1----未上传或上传失败
     */
    private int status;

    private Integer testNum;
    private int numTest;

    public VillusBuyEntity() {
    }

    protected VillusBuyEntity(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        buyBatch = in.readString();
        revision = in.readString();
        buyWeight = in.readString();
        buyFactory = in.readString();
        buyDate = in.readString();
        personInCharge = in.readString();
        pastureUnitId = in.readString();
        pastureUnitName = in.readString();
        pastureUnitPhone = in.readString();
        productId = in.readString();
        if (in.readByte() == 0) {
            printCount = null;
        } else {
            printCount = in.readInt();
        }
        if (in.readByte() == 0) {
            scanCount = null;
        } else {
            scanCount = in.readInt();
        }
        createBy = in.readString();
        createTime = in.readString();
        status = in.readInt();
        if (in.readByte() == 0) {
            testNum = null;
        } else {
            testNum = in.readInt();
        }
        numTest = in.readInt();
    }

    @Generated(hash = 2021863346)
    public VillusBuyEntity(Long id, String buyBatch, String revision, String buyWeight,
            String buyFactory, String buyDate, String personInCharge, String pastureUnitId,
            String pastureUnitName, String pastureUnitPhone, String productId,
            Integer printCount, Integer scanCount, String createBy, String createTime,
            int status, Integer testNum, int numTest) {
        this.id = id;
        this.buyBatch = buyBatch;
        this.revision = revision;
        this.buyWeight = buyWeight;
        this.buyFactory = buyFactory;
        this.buyDate = buyDate;
        this.personInCharge = personInCharge;
        this.pastureUnitId = pastureUnitId;
        this.pastureUnitName = pastureUnitName;
        this.pastureUnitPhone = pastureUnitPhone;
        this.productId = productId;
        this.printCount = printCount;
        this.scanCount = scanCount;
        this.createBy = createBy;
        this.createTime = createTime;
        this.status = status;
        this.testNum = testNum;
        this.numTest = numTest;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        dest.writeString(buyBatch);
        dest.writeString(revision);
        dest.writeString(buyWeight);
        dest.writeString(buyFactory);
        dest.writeString(buyDate);
        dest.writeString(personInCharge);
        dest.writeString(pastureUnitId);
        dest.writeString(pastureUnitName);
        dest.writeString(pastureUnitPhone);
        dest.writeString(productId);
        if (printCount == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(printCount);
        }
        if (scanCount == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(scanCount);
        }
        dest.writeString(createBy);
        dest.writeString(createTime);
        dest.writeInt(status);
        if (testNum == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(testNum);
        }
        dest.writeInt(numTest);
    }

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

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

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

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBuyBatch() {
        return buyBatch;
    }

    public void setBuyBatch(String buyBatch) {
        this.buyBatch = buyBatch;
    }

    public String getRevision() {
        return revision;
    }

    public void setRevision(String revision) {
        this.revision = revision;
    }

    public String getBuyWeight() {
        return buyWeight;
    }

    public void setBuyWeight(String buyWeight) {
        this.buyWeight = buyWeight;
    }

    public String getBuyFactory() {
        return buyFactory;
    }

    public void setBuyFactory(String buyFactory) {
        this.buyFactory = buyFactory;
    }

    public String getBuyDate() {
        return buyDate;
    }

    public void setBuyDate(String buyDate) {
        this.buyDate = buyDate;
    }

    public String getPersonInCharge() {
        return personInCharge;
    }

    public void setPersonInCharge(String personInCharge) {
        this.personInCharge = personInCharge;
    }

    public String getPastureUnitId() {
        return pastureUnitId;
    }

    public void setPastureUnitId(String pastureUnitId) {
        this.pastureUnitId = pastureUnitId;
    }

    public String getPastureUnitName() {
        return pastureUnitName;
    }

    public void setPastureUnitName(String pastureUnitName) {
        this.pastureUnitName = pastureUnitName;
    }

    public String getPastureUnitPhone() {
        return pastureUnitPhone;
    }

    public void setPastureUnitPhone(String pastureUnitPhone) {
        this.pastureUnitPhone = pastureUnitPhone;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public Integer getPrintCount() {
        return printCount;
    }

    public void setPrintCount(Integer printCount) {
        this.printCount = printCount;
    }

    public Integer getScanCount() {
        return scanCount;
    }

    public void setScanCount(Integer scanCount) {
        this.scanCount = scanCount;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Integer getTestNum() {
        return testNum;
    }

    public void setTestNum(Integer testNum) {
        this.testNum = testNum;
    }

    public int getNumTest() {
        return numTest;
    }

    public void setNumTest(int numTest) {
        this.numTest = numTest;
    }
}
