package com.uas.platform.b2b.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 平台里面，供应商针对客户打样申请的送样单
 * 
 * @author suntg
 *
 */
@Table(name = "purc$proofingsend")
@Entity
public class PurchaseProofingSend implements Serializable {

	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "pps_id")
	private Long id;

	/**
	 * 送样单号
	 */
	@Column(name = "pps_code")
	private String code;

	/**
	 * 客户打样申请
	 */
	@OneToOne(cascade = { CascadeType.MERGE }, fetch = FetchType.EAGER)
	@JoinColumn(name = "pps_itemid", insertable = false, updatable = false)
	private PurchaseProofingItem proofingItem;

	/**
	 * 客户打样申请id
	 */
	@Column(name = "pps_itemid")
	private Long itemId;

	/**
	 * 送样数量
	 */
	@Column(name = "pps_sendqty")
	private Double sendQty;

	/**
	 * 口水料比例
	 */
	@Column(name = "pps_ratio")
	private Double ratio;

	/**
	 * 单重(g)
	 */
	@Column(name = "pps_weight")
	private Double weight;

	/**
	 * 材料
	 */
	@Column(name = "pps_material")
	private String material;

	/**
	 * 材质
	 */
	@Column(name = "pps_materialquality")
	private String materialQuality;

	/**
	 * 主要产地
	 */
	@Column(name = "pps_adress")
	private String adress;

	/**
	 * 产地标示
	 */
	@Column(name = "pps_addressmark")
	private String addressMark;

	/**
	 * 送样日期
	 */
	@Column(name = "pps_date")
	private Date date;

	/**
	 * 采购单价
	 */
	@Column(name = "pps_puprice")
	private Double puprice;

	/**
	 * 备品率(%)
	 */
	@Column(name = "pps_spare")
	private Double spare;

	/**
	 * 最小包装量
	 */
	@Column(name = "pps_minqty")
	private Double minQty;

	/**
	 * 最小订购量
	 */
	@Column(name = "pps_minbuyqty")
	private Double minBuyQty;

	/**
	 * 品牌
	 */
	@Column(name = "pps_brand")
	private String brand;
	
	/**
	 * 生产厂型号(供应商物料规格)
	 */
	@Column(name = "pps_vendspec")
	private String vendSpec;

	/**
	 * 交货周期
	 */
	@Column(name = "pps_delivery")
	private Double delivery;

	/**
	 * 录入人（送样人）
	 */
	@Column(name = "pps_recorder")
	private String recorder;

	/**
	 * 附件
	 */
	@OneToMany(cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
	@JoinTable(name="purc$proofingsendattach", joinColumns = @JoinColumn(name = "pps_id", referencedColumnName = "pps_id"), inverseJoinColumns = @JoinColumn(name="at_id", referencedColumnName = "at_id"))
	private Set<Attach> attachs;

	/**
	 * 传输到买方ERP的状态
	 */
	@Column(name = "pps_sendstatus")
	private Short sendStatus;

	/**
	 * 传输到卖方ERP的状态
	 */
	@Column(name = "pps_backstatus")
	private Short backStatus;

	public Short getSendStatus() {
		return sendStatus;
	}

	public void setSendStatus(Short sendStatus) {
		this.sendStatus = sendStatus;
	}

	public Short getBackStatus() {
		return backStatus;
	}

	public void setBackStatus(Short backStatus) {
		this.backStatus = backStatus;
	}

	public Long getId() {
		return id;
	}

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

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@JsonIgnore
	@JSONField(serialize = false)
	public PurchaseProofingItem getProofingItem() {
		return proofingItem;
	}

	public void setProofingItem(PurchaseProofingItem proofingItem) {
		this.proofingItem = proofingItem;
	}

	public Long getItemId() {
		return itemId;
	}

	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}

	public Double getSendQty() {
		return sendQty;
	}

	public void setSendQty(Double sendQty) {
		this.sendQty = sendQty;
	}

	public Double getRatio() {
		return ratio;
	}

	public void setRatio(Double ratio) {
		this.ratio = ratio;
	}

	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	public String getMaterial() {
		return material;
	}

	public void setMaterial(String material) {
		this.material = material;
	}

	public String getMaterialQuality() {
		return materialQuality;
	}

	public void setMaterialQuality(String materialQuality) {
		this.materialQuality = materialQuality;
	}

	public String getAdress() {
		return adress;
	}

	public void setAdress(String adress) {
		this.adress = adress;
	}

	public String getAddressMark() {
		return addressMark;
	}

	public void setAddressMark(String addressMark) {
		this.addressMark = addressMark;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Double getPuprice() {
		return puprice;
	}

	public void setPuprice(Double puprice) {
		this.puprice = puprice;
	}

	public Double getSpare() {
		return spare;
	}

	public void setSpare(Double spare) {
		this.spare = spare;
	}

	public Double getMinQty() {
		return minQty;
	}

	public void setMinQty(Double minQty) {
		this.minQty = minQty;
	}

	public Double getMinBuyQty() {
		return minBuyQty;
	}

	public void setMinBuyQty(Double minBuyQty) {
		this.minBuyQty = minBuyQty;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public Double getDelivery() {
		return delivery;
	}

	public void setDelivery(Double delivery) {
		this.delivery = delivery;
	}

	public String getRecorder() {
		return recorder;
	}

	public void setRecorder(String recorder) {
		this.recorder = recorder;
	}

	public Set<Attach> getAttachs() {
		return attachs;
	}

	public void setAttachs(Set<Attach> attachs) {
		this.attachs = attachs;
	}

	public String getVendSpec() {
		return vendSpec;
	}

	public void setVendSpec(String vendSpec) {
		this.vendSpec = vendSpec;
	}

}