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

/**
 * 平台里面，供应商发起的发货单（主表角度）<br>
 * （以供应商的视角）
 * 
 * @author suntg
 * 
 */
@Table(name = "sale$send")
@Entity
public class SaleSendAll implements Serializable {

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

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

	/**
	 * 单号
	 */
	@Column(name = "ss_code")
	private String code;

	/**
	 * 发货单 所属企业(卖家)UU
	 */
	@Column(name = "ss_enuu")
	private Long enUU;

	/**
	 * 发货单日期
	 */
	@Column(name = "ss_date")
	private Date date;

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

	/**
	 * 币别
	 */
	@Column(name = "ss_currency")
	private String currency;

	/**
	 * 汇率
	 */
	@Column(name = "ss_rate")
	private Float rate;

	/**
	 * 客户企业UU
	 */
	@Column(name = "ss_custuu")
	private Long custUU;

	/**
	 * 客户联系人UU
	 */
	@Column(name = "ss_custuseruu")
	private Long custUserUU;

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

	/**
	 * 录单人
	 */
	@Column(name = "ss_recorder")
	private String recorder;

	/**
	 * 发货明细
	 */
	@OneToMany(mappedBy = "send", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
	@OrderBy("number")
	private Set<SaleSendItemAll> sendItems;

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

	/**
	 * （对卖家）传输状态
	 */
	@Column(name = "ss_backstatus")
	private Short backStatus;
	
	/**
	 * 收料状态
	 * 0 未收料，1 部分收料，2已收料
	 */
	@Column(name = "ss_verifystatus")
	private Short verifystatus;

	/**
	 * 打印次数
	 */
	@Column(name = "ss_print")
	private Short print;

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

	public Long getEnUU() {
		return enUU;
	}

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

	public String getPayments() {
		return payments;
	}

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

	public String getCurrency() {
		return currency;
	}

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

	public Float getRate() {
		return rate;
	}

	public void setRate(Float rate) {
		this.rate = rate;
	}

	public Long getCustUU() {
		return custUU;
	}

	public void setCustUU(Long custUU) {
		this.custUU = custUU;
	}

	public Long getCustUserUU() {
		return custUserUU;
	}

	public void setCustUserUU(Long custUserUU) {
		this.custUserUU = custUserUU;
	}

	public String getRemark() {
		return remark;
	}

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

	public Set<SaleSendItemAll> getSendItems() {
		return sendItems;
	}

	public void setSendItems(Set<SaleSendItemAll> sendItems) {
		this.sendItems = sendItems;
	}

	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 String getRecorder() {
		return recorder;
	}

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

	public Date getDate() {
		return date;
	}

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

	public Short getVerifystatus() {
		return verifystatus;
	}

	public void setVerifystatus(Short verifystatus) {
		this.verifystatus = verifystatus;
	}

	public Short getPrint() {
		return print;
	}

	public void setPrint(Short print) {
		this.print = print;
	}
}
