package com.uas.platform.b2b.model;

import java.io.Serializable;
import java.sql.Date;
import java.util.List;

//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.OneToMany;
//import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Table(name = "purc$orders")
@Entity
public class PurchaseOrder implements Serializable {

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

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "purc$orders_gen")
	@SequenceGenerator(name = "purc$orders_gen", sequenceName = "purc$orders_seq", allocationSize = 1)
	@Column(name = "pu_id")
	private Long id;

	/**
	 * 采购单所属企业UU
	 */
	@Column(name = "pu_enuu")
	private Long enUU;

	/**
	 * 采购单所属采购员UU
	 */
	@Column(name = "pu_useruu")
	private Long userUU;

	/**
	 * 采购单号
	 */
	@Column(name = "pu_code")
	private String code;

	/**
	 * 采购类型
	 */
	@Column(name = "pu_type")
	private String type;

	/**
	 * 单据归属日期
	 */
	@Column(name = "pu_date")
	private Date date;

	/**
	 * 录单人员UU
	 */
	@Column(name = "pu_recorderuu")
	private Long recorderUU;

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

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

	/**
	 * 收货地址
	 */
	@Column(name = "pu_shipaddress")
	private String shipAddress;

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

	/**
	 * 付款币种
	 */
	@Column(name = "pu_currency")
	private String currency;

	/**
	 * 付款方式
	 */
	@Column(name = "pu_payments")
	private String payments;

	/**
	 * 采购单状态
	 */
	@Column(name = "pu_status")
	private String status;

	/**
	 * 采购单明细
	 */
//	@OneToMany(cascade = CascadeType.ALL, mappedBy = "order", fetch=FetchType.EAGER)
//	@OrderBy("pd_number")
	@Transient
	private List<PurchaseOrderItem> orderItems;

	public Long getId() {
		return id;
	}

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

	public Long getEnUU() {
		return enUU;
	}

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

	public Long getUserUU() {
		return userUU;
	}

	public void setUserUU(Long userUU) {
		this.userUU = userUU;
	}

	public String getCode() {
		return code;
	}

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

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getDate() {
		return date;
	}

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

	public Long getRecorderUU() {
		return recorderUU;
	}

	public void setRecorderUU(Long recorderUU) {
		this.recorderUU = recorderUU;
	}

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

	public String getShipAddress() {
		return shipAddress;
	}

	public void setShipAddress(String shipAddress) {
		this.shipAddress = shipAddress;
	}

	public String getRemark() {
		return remark;
	}

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

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public String getPayments() {
		return payments;
	}

	public void setPayments(String payments) {
		this.payments = payments;
	}

	public String getStatus() {
		return status;
	}

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

	public List<PurchaseOrderItem> getOrderItems() {
		return orderItems;
	}

	public void setOrderItems(List<PurchaseOrderItem> orderItems) {
		this.orderItems = orderItems;
	}
}
