package com.uas.platform.b2b.history.model;

import java.io.Serializable;
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 yingp
 *
 */
@Table(name = "purc$notice$his")
@Entity(name = "PurchaseNoticeHistory")
public class PurchaseNotice implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4637910155625380065L;
	@Id
	@Column(name = "pn_id")
	private Long id;

	/**
	 * 来源系统的送货提醒ID
	 */
	@Column(name = "pn_sourceid")
	private long sourceId;

	/**
	 * 送货提醒单所属企业UU
	 */
	@Column(name = "pn_enuu")
	private Long enUU;

	/**
	 * 卖家企业UU
	 */
	@Column(name = "pn_venduu")
	private Long vendUU;

	/**
	 * 录入日期
	 */
	@Column(name = "pn_date")
	private Date date;

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

	/**
	 * 已发货数
	 */
	@Column(name = "pn_endqty")
	private Double endQty;

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

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

	/**
	 * 处理状态（已回复、未回复），全部发货后改为已回复
	 */
	@Column(name = "pn_status", insertable = false, updatable = false)
	private Short status;

	/**
	 * 客户采购单明细
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pn_pdid", insertable = false, updatable = false, nullable = false)
	private PurchaseOrderItem orderItem;

	@Column(name = "pn_pdid")
	private Long orderItemId;

	/**
	 * （对卖家）传输状态
	 */
	@Column(name = "pn_sendstatus")
	private Short sendStatus;

	/**
	 * 是否已结案
	 */
	@Column(name = "pn_end")
	private Short end;

	/**
	 * 结案状态是否已传输到卖家ERP的情况
	 */
	@Column(name = "pn_endstatus")
	private Short endStatus;

	public Long getId() {
		return id;
	}

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

	public long getSourceId() {
		return sourceId;
	}

	public void setSourceId(long sourceId) {
		this.sourceId = sourceId;
	}

	public Long getEnUU() {
		return enUU;
	}

	public void setEnUU(Long enUU) {
		this.enUU = enUU;
	}

	public Long getVendUU() {
		return vendUU;
	}

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

	public Double getQty() {
		return qty;
	}

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

	public Double getEndQty() {
		return endQty;
	}

	public void setEndQty(Double endQty) {
		this.endQty = endQty;
	}

	public Date getDate() {
		return date;
	}

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

	public Date getDelivery() {
		return delivery;
	}

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

	public String getRemark() {
		return remark;
	}

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

	public PurchaseOrderItem getOrderItem() {
		return orderItem;
	}

	public void setOrderItem(PurchaseOrderItem orderItem) {
		this.orderItem = orderItem;
	}

	public Short getSendStatus() {
		return sendStatus;
	}

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

	public Short getEnd() {
		return end;
	}

	public void setEnd(Short end) {
		this.end = end;
	}

	public Short getEndStatus() {
		return endStatus;
	}

	public void setEndStatus(Short endStatus) {
		this.endStatus = endStatus;
	}

	public Short getStatus() {
		return status;
	}

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

	public Long getOrderItemId() {
		return orderItemId;
	}

	public void setOrderItemId(Long orderItemId) {
		this.orderItemId = orderItemId;
	}

}