package com.uas.search.console.b2b.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 平台里面，以供应商的角度来查看客户打样申请
 * 
 * @author suntg
 *
 */
@Table(name = "purc$proofing")
@Entity
public class PurchaseProofingSimpleInfo {

	@Id
	@Column(name = "pp_id")
	private Long id;

	/**
	 * 流水号
	 */
	@Column(name = "pp_code")
	private String code;

	/**
	 * 日期
	 */
	@Column(name = "pp_indate")
	private Date date;

	/**
	 * 供应商
	 */
	@OneToOne
	@JoinColumn(name = "pp_enuu", insertable = false, updatable = false)
	private EnterpriseSimpleInfo vend;

	/**
	 * 物料(买方物料)
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pp_prid", insertable = false, updatable = false)
	private ProductSimpleInfo product;

	public Long getId() {
		return id;
	}

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

	public EnterpriseSimpleInfo getVend() {
		return vend;
	}

	public void setVend(EnterpriseSimpleInfo vend) {
		this.vend = vend;
	}

	public String getCode() {
		return code;
	}

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

	public Date getDate() {
		return date;
	}

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

	public ProductSimpleInfo getProduct() {
		return product;
	}

	public void setProduct(ProductSimpleInfo product) {
		this.product = product;
	}

	@Override
	public String toString() {
		return "PurchaseProofingSimpleInfo [id=" + id + ", code=" + code + ", date=" + date + ", vend=" + vend
				+ ", product=" + product + "]";
	}
}
