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.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

/**
 * 代采定单
 * 
 * @author hejq
 * @time 创建时间：2017年3月19日
 */
@Entity
@Table(name = "purc$deputyorders")
public class DeputyOrder implements Serializable {

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

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

	/********************
	 * 基本信息
	 ********************/

	/**
	 * 流水号
	 */
	@Column(name = "deo_code")
	private String code;

	/**
	 * 状态
	 */
	@Column(name = "deo_status")
	private String status;
	
	/**
	 * 状态码
	 */
	@Column(name = "deo_statuscode")
	private Integer statuscode;

	/**
	 * 业务状态
	 */
	@Column(name = "deo_prostatsus")
	private String prostatus;

	/**
	 * 业务状态码
	 */
	@Column(name = "deo_prostatuscode")
	private Integer prostatuscode;

	/**
	 * 录入状态
	 */
	@Column(name = "deo_entrystatus")
	private String entrystatus;

	/**
	 * ERP下载状态
	 */
	@Column(name = "deo_downloadstatus")
	private String downloadstatus;

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

	/**
	 * 主协议签订日期
	 */
	@Column(name = "deo_madealdate")
	private Date madealdate;

	/**
	 * 主协议编号
	 */
	@Column(name = "deo_madealcode")
	private String madealcode;

	/**
	 * 终端供应商名称
	 */
	@Column(name = "deo_tervendor")
	private String tervendor;

	/**
	 * 终端供应商uu
	 */
	@Column(name = "deo_tervenduu")
	private Long tervenduu;

	/**
	 * 供应商联系电话
	 */
	@Column(name = "deo_vendtel")
	private String vendtel;

	/**
	 * 供应商联系人
	 */
	@Column(name = "deo_venduser")
	private String venduser;
	
	/**
	 * 联系人uu
	 */
	@Column(name = "deo_venduseruu")
	private Long venduseruu;


	/**
	 * 发货时间
	 */
	@Column(name = "deo_shipdate")
	private Date shipdate;

	/**
	 * 货物包装
	 */
	@Column(name = "deo_goodspacking")
	private String goodspacking;
	
	/**
	 * 供应商交货方式
	 */
	@Column(name = "deo_deliverymethod")
	private String deliverymethod;

	/**
	 * 我方提货方式
	 */
	@Column(name = "deo_pickupmethod")
	private String pickupmethod;

	/**
	 * 我方提货时间
	 */
	@Column(name = "deo_pickupdate")
	private String pickupdate;

	/**
	 * 录入时间
	 */
	@Column(name = "deo_date")
	private Date date;

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

	/**
	 * 代采企业uu
	 */
	@Column(name = "deo_deputyuu")
	private Long deputyuu;

	/**
	 * 代采企业名称
	 */
	@Column(name = "deo_deputyname")
	private String deputyname;

	/**
	 * 代采企业
	 */
	@OneToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE })
	@JoinColumn(name = "deo_deputyuu", insertable = false, updatable = false)
	private Enterprise deputyEnterprise;

	/**
	 * ERP对应单据的id
	 */
	@Column(name = "deo_erpid")
	private Long erpid;

	/**
	 * erp保存的时间
	 */
	@Column(name = "deo_erpdate")
	private Date erpdate;

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

	/**
	 * 费率
	 */
	@Column(name = "deo_rate")
	private Double rate;

	/*******************
	 * 下单明细
	 *******************/

	/**
	 * 采购变更单明细
	 */
	@OneToMany(mappedBy = "deputyOrder", cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
	private Set<DeputyOrderItem> deputyOrderItems;

	/********************
	 * 采购订单
	 ********************/

	/**
	 * 订单编号
	 */
	@Column(name = "deo_salecode")
	private String salecode;

	/**
	 * 总金额
	 */
	@Column(name = "deo_totalamount")
	private Double totalamount;

	/**
	 * 订单总金额
	 */
	@Column(name = "deo_orderamount")
	private Double orderamount;

	/**
	 * 我方付款提货时间
	 */
	@Column(name = "deo_paydeldate")
	private Date paydeldate;

	/**
	 * 付款总额
	 */
	@Column(name = "deo_totalpayment")
	private Double totalpayament;
	
	/**
	 * 付款时间
	 */
	@Column(name = "deo_paymentdate")
	private Date paymentdate;
	
	/**
	 * 风险承担方式
	 */
	@Column(name = "deo_riskmethod")
	private String riskmethod;

	/**
	 * 运、税费承担方式
	 */
	@Column(name = "deo_taxpaymentmethod")
	private String taxpaymentmethod;

	/*******************
	 * 付款确认书
	 *******************/

	/**
	 * 终端供应商地址
	 */
	@Column(name = "deo_tervendaddress")
	private String tervendaddress;

	/**
	 * 公司全称
	 */
	@Column(name = "deo_companyname")
	private String companyname;

	/**
	 * 要求付款日期
	 */
	@Column(name = "deo_requirepaydate")
	private Date requirepaydate;

	/**
	 * 实际付款日期
	 */
	@Column(name = "deo_actualpaydate")
	private Date actualpaydate;
	
	/**
	 * 付款金额
	 */
	@Column(name = "deo_usdpayment")
	private Double usdpayment;
	
	/**
	 * 实际付款金额（usd）
	 */
	@Column(name = "deo_actusdpayment")
	private Double actusdpayment;

	/**
	 * 银行名称
	 */
	@Column(name = "deo_bankname")
	private String bankname;

	/**
	 * 银行账户
	 */
	@Column(name = "deo_bankaccount")
	private String bankaccount;

	/**
	 * 银行地址
	 */
	@Column(name = "deo_bankaddress")
	private String bankaddress;

	/**
	 * 银行代码
	 */
	@Column(name = "deo_bankcode")
	private String bankcode;

	/**
	 * 其他资料
	 */
	@Column(name = "deo_otherdata")
	private String otherdata;

	/**
	 * 付款公司
	 */
	@Column(name = "deo_paymentcomenuu")
	private Long paymentcomenuu;

	/**
	 * 付款公司名称
	 */
	@Column(name = "deo_paycomname")
	private String paycomname;

	/**
	 * 付款公司
	 */
	@OneToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE })
	@JoinColumn(name = "deo_paymentcomenuu", insertable = false, updatable = false)
	private Enterprise paymentEnterprise;

	/**
	 * 付款公司地址
	 */
	@Column(name = "deo_paycomaddress")
	private String paycomaddress;

	/*****************
	 * 买卖合同
	 *****************/

	/**
	 * 合同编号
	 */
	@Column(name = "deo_salepocode")
	private String salepocode;

	/**
	 * 我方法定代表人
	 */
	@Column(name = "deo_legalrepresent")
	private String legalrepresent;
	
	/**
	 * 我方联系电话
	 */
	@Column(name = "deo_usertel")
	private String usertel;

	/**
	 * 我方联系地址
	 */
	@Column(name = "deo_enaddress")
	private String enaddress;

	/**
	 * 我方传真
	 */
	@Column(name = "deo_enfax")
	private String enfax;

	/**
	 * 客户名称
	 */
	@Column(name = "deo_customer")
	private String customer;

	/**
	 * 供应商
	 */
	@Column(name = "deo_vendorenuu")
	private Long vendorenuu;

	/**
	 * 供应商
	 */
	@OneToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE })
	@JoinColumn(name = "deo_vendorenuu", insertable = false, updatable = false)
	private Enterprise vendorEnterprise;

	/**
	 * 货款支付方式
	 */
	@Column(name = "deo_paymethod")
	private String paymethod;

	/**
	 * 货款支付时间
	 */
	@Column(name = "deo_paydate")
	private Date paydate;

	/**
	 * 交货时间
	 */
	@Column(name = "deo_deliverydate")
	private Date deliverydate;

	/**
	 * 录入企业uu
	 */
	@Column(name = "deo_enuu")
	private Long enuu;

	/**
	 * 录入人uu
	 */
	@Column(name = "deo_useruu")
	private Long useruu;

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

	/**
	 * ERP审核意见
	 */
	@Column(name = "deo_remark")
	@Length(max = 4000)
	private String remark;

	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 String getStatus() {
		return status;
	}

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

	public Integer getStatuscode() {
		return statuscode;
	}

	public void setStatuscode(Integer statuscode) {
		this.statuscode = statuscode;
	}

	public String getProstatus() {
		return prostatus;
	}

	public void setProstatus(String prostatus) {
		this.prostatus = prostatus;
	}

	public Integer getProstatuscode() {
		return prostatuscode;
	}

	public void setProstatuscode(Integer prostatuscode) {
		this.prostatuscode = prostatuscode;
	}

	public String getEntrystatus() {
		return entrystatus;
	}

	public void setEntrystatus(String entrystatus) {
		this.entrystatus = entrystatus;
	}

	public String getDownloadstatus() {
		return downloadstatus;
	}

	public void setDownloadstatus(String downloadstatus) {
		this.downloadstatus = downloadstatus;
	}

	public Date getEntrydate() {
		return entrydate;
	}

	public void setEntrydate(Date entrydate) {
		this.entrydate = entrydate;
	}

	public Date getMadealdate() {
		return madealdate;
	}

	public void setMadealdate(Date madealdate) {
		this.madealdate = madealdate;
	}

	public String getMadealcode() {
		return madealcode;
	}

	public void setMadealcode(String madealcode) {
		this.madealcode = madealcode;
	}

	public String getTervendor() {
		return tervendor;
	}

	public void setTervendor(String tervendor) {
		this.tervendor = tervendor;
	}

	public Long getTervenduu() {
		return tervenduu;
	}

	public void setTervenduu(Long tervenduu) {
		this.tervenduu = tervenduu;
	}

	public String getVendtel() {
		return vendtel;
	}

	public void setVendtel(String vendtel) {
		this.vendtel = vendtel;
	}

	public String getVenduser() {
		return venduser;
	}

	public void setVenduser(String venduser) {
		this.venduser = venduser;
	}

	public Long getVenduseruu() {
		return venduseruu;
	}

	public void setVenduseruu(Long venduseruu) {
		this.venduseruu = venduseruu;
	}

	public Date getShipdate() {
		return shipdate;
	}

	public void setShipdate(Date shipdate) {
		this.shipdate = shipdate;
	}

	public String getGoodspacking() {
		return goodspacking;
	}

	public void setGoodspacking(String goodspacking) {
		this.goodspacking = goodspacking;
	}

	public String getDeliverymethod() {
		return deliverymethod;
	}

	public void setDeliverymethod(String deliverymethod) {
		this.deliverymethod = deliverymethod;
	}

	public String getPickupmethod() {
		return pickupmethod;
	}

	public void setPickupmethod(String pickupmethod) {
		this.pickupmethod = pickupmethod;
	}

	public String getPickupdate() {
		return pickupdate;
	}

	public void setPickupdate(String pickupdate) {
		this.pickupdate = pickupdate;
	}

	public Date getDate() {
		return date;
	}

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

	public String getPaymentmethod() {
		return paymentmethod;
	}

	public void setPaymentmethod(String paymentmethod) {
		this.paymentmethod = paymentmethod;
	}

	public Long getDeputyuu() {
		return deputyuu;
	}

	public void setDeputyuu(Long deputyuu) {
		this.deputyuu = deputyuu;
	}

	public String getDeputyname() {
		return deputyname;
	}

	public void setDeputyname(String deputyname) {
		this.deputyname = deputyname;
	}

	public Enterprise getDeputyEnterprise() {
		return deputyEnterprise;
	}

	public void setDeputyEnterprise(Enterprise deputyEnterprise) {
		this.deputyEnterprise = deputyEnterprise;
	}

	public Long getErpid() {
		return erpid;
	}

	public void setErpid(Long erpid) {
		this.erpid = erpid;
	}

	public Date getErpdate() {
		return erpdate;
	}

	public void setErpdate(Date erpdate) {
		this.erpdate = erpdate;
	}

	public String getCurrency() {
		return currency;
	}

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

	public Double getRate() {
		return rate;
	}

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

	public Set<DeputyOrderItem> getDeputyOrderItems() {
		return deputyOrderItems;
	}

	public void setDeputyOrderItems(Set<DeputyOrderItem> deputyOrderItems) {
		this.deputyOrderItems = deputyOrderItems;
	}

	public String getSalecode() {
		return salecode;
	}

	public void setSalecode(String salecode) {
		this.salecode = salecode;
	}

	public Double getTotalamount() {
		return totalamount;
	}

	public void setTotalamount(Double totalamount) {
		this.totalamount = totalamount;
	}

	public Double getOrderamount() {
		return orderamount;
	}

	public void setOrderamount(Double orderamount) {
		this.orderamount = orderamount;
	}

	public Date getPaydeldate() {
		return paydeldate;
	}

	public void setPaydeldate(Date paydeldate) {
		this.paydeldate = paydeldate;
	}

	public Double getTotalpayament() {
		return totalpayament;
	}

	public void setTotalpayament(Double totalpayament) {
		this.totalpayament = totalpayament;
	}

	public Date getPaymentdate() {
		return paymentdate;
	}

	public void setPaymentdate(Date paymentdate) {
		this.paymentdate = paymentdate;
	}

	public String getRiskmethod() {
		return riskmethod;
	}

	public void setRiskmethod(String riskmethod) {
		this.riskmethod = riskmethod;
	}

	public String getTaxpaymentmethod() {
		return taxpaymentmethod;
	}

	public void setTaxpaymentmethod(String taxpaymentmethod) {
		this.taxpaymentmethod = taxpaymentmethod;
	}

	public String getTervendaddress() {
		return tervendaddress;
	}

	public void setTervendaddress(String tervendaddress) {
		this.tervendaddress = tervendaddress;
	}

	public String getCompanyname() {
		return companyname;
	}

	public void setCompanyname(String companyname) {
		this.companyname = companyname;
	}

	public Date getRequirepaydate() {
		return requirepaydate;
	}

	public void setRequirepaydate(Date requirepaydate) {
		this.requirepaydate = requirepaydate;
	}

	public Date getActualpaydate() {
		return actualpaydate;
	}

	public void setActualpaydate(Date actualpaydate) {
		this.actualpaydate = actualpaydate;
	}

	public Double getUsdpayment() {
		return usdpayment;
	}

	public void setUsdpayment(Double usdpayment) {
		this.usdpayment = usdpayment;
	}

	public Double getActusdpayment() {
		return actusdpayment;
	}

	public void setActusdpayment(Double actusdpayment) {
		this.actusdpayment = actusdpayment;
	}

	public String getBankname() {
		return bankname;
	}

	public void setBankname(String bankname) {
		this.bankname = bankname;
	}

	public String getBankaccount() {
		return bankaccount;
	}

	public void setBankaccount(String bankaccount) {
		this.bankaccount = bankaccount;
	}

	public String getBankaddress() {
		return bankaddress;
	}

	public void setBankaddress(String bankaddress) {
		this.bankaddress = bankaddress;
	}

	public String getBankcode() {
		return bankcode;
	}

	public void setBankcode(String bankcode) {
		this.bankcode = bankcode;
	}

	public String getOtherdata() {
		return otherdata;
	}

	public void setOtherdata(String otherdata) {
		this.otherdata = otherdata;
	}

	public Long getPaymentcomenuu() {
		return paymentcomenuu;
	}

	public void setPaymentcomenuu(Long paymentcomenuu) {
		this.paymentcomenuu = paymentcomenuu;
	}

	public String getPaycomname() {
		return paycomname;
	}

	public void setPaycomname(String paycomname) {
		this.paycomname = paycomname;
	}

	public Enterprise getPaymentEnterprise() {
		return paymentEnterprise;
	}

	public void setPaymentEnterprise(Enterprise paymentEnterprise) {
		this.paymentEnterprise = paymentEnterprise;
	}

	public String getPaycomaddress() {
		return paycomaddress;
	}

	public void setPaycomaddress(String paycomaddress) {
		this.paycomaddress = paycomaddress;
	}

	public String getSalepocode() {
		return salepocode;
	}

	public void setSalepocode(String salepocode) {
		this.salepocode = salepocode;
	}

	public String getLegalrepresent() {
		return legalrepresent;
	}

	public void setLegalrepresent(String legalrepresent) {
		this.legalrepresent = legalrepresent;
	}

	public String getUsertel() {
		return usertel;
	}

	public void setUsertel(String usertel) {
		this.usertel = usertel;
	}

	public String getEnaddress() {
		return enaddress;
	}

	public void setEnaddress(String enaddress) {
		this.enaddress = enaddress;
	}

	public String getEnfax() {
		return enfax;
	}

	public void setEnfax(String enfax) {
		this.enfax = enfax;
	}

	public String getCustomer() {
		return customer;
	}

	public void setCustomer(String customer) {
		this.customer = customer;
	}

	public Long getVendorenuu() {
		return vendorenuu;
	}

	public void setVendorenuu(Long vendorenuu) {
		this.vendorenuu = vendorenuu;
	}

	public Enterprise getVendorEnterprise() {
		return vendorEnterprise;
	}

	public void setVendorEnterprise(Enterprise vendorEnterprise) {
		this.vendorEnterprise = vendorEnterprise;
	}

	public String getPaymethod() {
		return paymethod;
	}

	public void setPaymethod(String paymethod) {
		this.paymethod = paymethod;
	}

	public Date getPaydate() {
		return paydate;
	}

	public void setPaydate(Date paydate) {
		this.paydate = paydate;
	}

	public Date getDeliverydate() {
		return deliverydate;
	}

	public void setDeliverydate(Date deliverydate) {
		this.deliverydate = deliverydate;
	}

	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 Short getPrint() {
		return print;
	}

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

	public String getRemark() {
		return remark;
	}

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

}
