package com.uas.platform.b2b.model;

import com.alibaba.fastjson.annotation.JSONField;
import org.codehaus.jackson.annotate.JsonIgnore;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 采购预测单明细
 */
@Table(name = "purc$forecastitems")
@Entity
public class PurchaseForecastAllItem implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

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

	/**
	 * 序号
	 */
	@Column(name = "pfd_number")
	private Short number;

	/**
	 * 采购预测单
	 */
	@ManyToOne(cascade = CascadeType.ALL, optional = true)
	@JoinColumn(name = "pfd_pfid", nullable = false)
	private PurchaseForecastAll order;

	/**
	 * 产品ID
	 */
	@Column(name = "pfd_prid")
	private Long productId;

	/**
	 * 产品
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pfd_prid", insertable = false, updatable = false)
	private Product product;

	/**
	 * 数量
	 */
	@Column(name = "pfd_qty")
	private Double qty;

	/**
	 * 备注
	 */
	@Column(name = "pfd_remark")
	private String remark;

	/**
	 * 供应商UU
	 */
	@Column(name = "pfd_venduu")
	private Long vendUU;

	/**
	 * 供应商联系人UU
	 */
	@Column(name = "pfd_venduseruu")
	private Long vendUserUU;

	/**
	 * 交货日期
	 */
	@Column(name = "pfd_delivery")
	private Date delivery;

	/**
	 * 采购预测下载(到卖方ERP)状态
	 */
	@Column(name = "pfd_sendstatus")
	private Short sendStatus;

	@Column(name = "pfd_erpdate")
	private Date erpDate;

	public Long getId() {
		return id;
	}

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

	public Short getNumber() {
		return number;
	}

	public void setNumber(Short number) {
		this.number = number;
	}

	public Long getVendUU() {
		return vendUU;
	}

	public void setVendUU(Long vendUU) {
		this.vendUU = vendUU;
	}

	public Long getVendUserUU() {
		return vendUserUU;
	}

	public void setVendUserUU(Long vendUserUU) {
		this.vendUserUU = vendUserUU;
	}

	@JsonIgnore
	@JSONField(serialize = false)
	public PurchaseForecastAll getOrder() {
		return order;
	}

	public void setOrder(PurchaseForecastAll order) {
		this.order = order;
	}

	public Long getProductId() {
		return productId;
	}

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

	public Product getProduct() {
		return product;
	}

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

	public Double getQty() {
		return qty;
	}

	public void setQty(Double qty) {
		this.qty = qty;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getDelivery() {
		return delivery;
	}

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

	public Short getSendStatus() {
		return sendStatus;
	}

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

	public Date getErpDate() {
		return erpDate;
	}

	public void setErpDate(Date erpDate) {
		this.erpDate = erpDate;
	}

}
