package com.uas.platform.b2b.model;

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

/**
 * 买家的委外验收单
 * 
 * @author aof
 * @date 2015年8月18日
 */
@Table(name = "make$accept", indexes = {
		@Index(name = "make_accept_enduu_index", columnList = "ma_enuu")
})
@Entity
public class MakeAccept implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ma_id")
	private Long id;

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

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

	/**
	 * 验收单 所属企业(买家)UU
	 */
	@Column(name = "ma_enuu")
	private Long enUU;

	/**
	 * 验收单 所属企业(买家)
	 */
	@OneToOne
	@JoinColumn(name = "ma_enuu", insertable = false, updatable = false)
	private EnterpriseInfo enterprise;

	/**
	 * 送货单号
	 */
	@Column(name = "ma_sendcode")
	private String sendCode;

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

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

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

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

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

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

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

	/**
	 * 应付供应商编号
	 */
	@Column(name = "ma_receivecode")
	private String receiveCode;

	/**
	 * 应付供应商名称
	 */
	@Column(name = "ma_receivename")
	private String receiveName;

	/**
	 * 验收明细
	 */
	@OneToMany(mappedBy = "accept", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
			CascadeType.MERGE }, fetch = FetchType.EAGER)
	@OrderBy("number")
	private Set<MakeAcceptItem> acceptItems;

	/**
	 * 已反过账(1 已反过账, 0|空 未反过账(默认未空))
	 */
	@Column(name = "ma_nonposting")
	private Short nonPosting;

	/**
	 * 对应erpid
	 * 
	 * @return
	 */
	@Column(name = "ma_erpid")
	private Long erpId;

	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 Date getDate() {
		return date;
	}

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

	public Long getEnUU() {
		return enUU;
	}

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

	public String getSendCode() {
		return sendCode;
	}

	public void setSendCode(String sendCode) {
		this.sendCode = sendCode;
	}

	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 getVendUU() {
		return vendUU;
	}

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

	public String getRemark() {
		return remark;
	}

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

	public String getRecorder() {
		return recorder;
	}

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

	public Short getSendStatus() {
		return sendStatus;
	}

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

	public Set<MakeAcceptItem> getAcceptItems() {
		return acceptItems;
	}

	public void setAcceptItems(Set<MakeAcceptItem> acceptItems) {
		this.acceptItems = acceptItems;
	}

	public Short getNonPosting() {
		return nonPosting;
	}

	public void setNonPosting(Short nonPosting) {
		this.nonPosting = nonPosting;
	}

	public String getReceiveCode() {
		return receiveCode;
	}

	public void setReceiveCode(String receiveCode) {
		this.receiveCode = receiveCode;
	}

	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}

	public Long getErpId() {
		return erpId;
	}

	public void setErpId(Long erpId) {
		this.erpId = erpId;
	}

	public EnterpriseInfo getEnterprise() {
		return enterprise;
	}

	public void setEnterprise(EnterpriseInfo enterprise) {
		this.enterprise = enterprise;
	}
}
