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 productId;

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

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

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

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

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

    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();
        productId = in.readString();
        printCount = in.readInt();
        scanCount = in.readInt();
        createBy = in.readString();
        createTime = in.readString();
        status = in.readInt();
    }

    @Generated(hash = 814397298)
    public VillusBuyEntity(Long id, String buyBatch, String revision, String buyWeight,
            String buyFactory, String buyDate, String personInCharge, String productId,
            int printCount, int scanCount, String createBy, String createTime, int status) {
        this.id = id;
        this.buyBatch = buyBatch;
        this.revision = revision;
        this.buyWeight = buyWeight;
        this.buyFactory = buyFactory;
        this.buyDate = buyDate;
        this.personInCharge = personInCharge;
        this.productId = productId;
        this.printCount = printCount;
        this.scanCount = scanCount;
        this.createBy = createBy;
        this.createTime = createTime;
        this.status = status;
    }

    @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(productId);
        dest.writeInt(printCount);
        dest.writeInt(scanCount);
        dest.writeString(createBy);
        dest.writeString(createTime);
        dest.writeInt(status);
    }

    @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 getProductId() {
        return productId;
    }

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

    public int getPrintCount() {
        return printCount;
    }

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

    public int getScanCount() {
        return scanCount;
    }

    public void setScanCount(int 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;
    }

    @Override
    public String toString() {
        return "VillusBuyEntity{" +
                "id=" + id +
                ", buyBatch='" + buyBatch + '\'' +
                ", revision='" + revision + '\'' +
                ", buyWeight='" + buyWeight + '\'' +
                ", buyFactory='" + buyFactory + '\'' +
                ", buyDate='" + buyDate + '\'' +
                ", personInCharge='" + personInCharge + '\'' +
                ", productId='" + productId + '\'' +
                ", printCount='" + printCount + '\'' +
                ", scanCount='" + scanCount + '\'' +
                ", createBy='" + createBy + '\'' +
                ", createTime='" + createTime + '\'' +
                ", status='" + status + '\'' +
                '}';
    }

}
