package com.uas.platform.b2b.model;

import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Where;

/**
 * 平台里面，以供应商的角度来查看委外加工单 <br>
 * 已回复委外加工单
 * 
 * @author aof
 * 
 */
@Table(name = "make$orders")
@Where(clause = "ma_status=201")
@Entity
public class MakeOrderDone {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ma_id")
	private Long id;

	/**
	 * 委外加工单所属（买方）企业UU
	 */
	@Column(name = "ma_enuu")
	private Long enUU;

	/**
	 * 委外加工单所属（买方）企业
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "ma_enuu", insertable = false, updatable = false)
	private EnterpriseInfo enterprise;

	/**
	 * 委外加工单所属（买方）采购员
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "ma_useruu", insertable = false, updatable = false)
	private UserBaseInfo user;

	/**
	 * 委外加工单所属（买方）采购员UU
	 */
	@Column(name = "ma_useruu")
	private Long userUU;

	/**
	 * 委外加工单号
	 */
	@Column(name = "ma_code")
	private String code;

	/**
	 * 单据类型
	 */
	@Column(name = "ma_type")
	private String type;

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

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

	/**
	 * 审核人
	 */
	@Column(name = "ma_auditor")
	private String auditor;

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

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

	/**
	 * 产品ID
	 */
	@Column(name = "ma_prid")
	private Long productId;

	/**
	 * 产品
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "ma_prid", insertable = false, updatable = false)
	private Product product;
	
	/**
	 * 需求日期
	 */
	@Column(name = "ma_delivery")
	private Date delivery;
	
	/**
	 * 加工数量
	 */
	@Column(name = "ma_qty")
	private Double qty;
	
	/**
	 * 已加工数
	 */
	@Column(name = "ma_makeqty")
	private Double makeQty;
	
	/**
	 * 已验收数量
	 */
	@Column(name = "ma_acceptqty")
	private  Double acceptQty;
	
	/**
	 * 已验退数量 
	 */
	@Column(name = "ma_returnsqty")
	private Double returnsqty;
	
	/**
	 * 工单类型
	 */
	@Column(name = "ma_kind")
	private String kind;

	/**
	 * 加工单价
	 */
	@Column(name = "ma_price")
	private Double price;

	/**
	 * 加工金额
	 */
	@Column(name = "ma_total")
	private Double total;
	
	/**
	 * 计划开工日期
	 */
	@Column(name = "ma_commence")
	private Date commence;
	
	/**
	 * 计划完工日期
	 */
	@Column(name = "ma_complete")
	private Date complete;

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

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

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

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

	/**
	 * 税率
	 */
	@Column(name = "ma_taxrate")
	private Float taxrate;

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

	/**
	 * 处理状态（已回复、未回复），全部回复后改为已回复
	 */
	@Column(name = "ma_status")
	private Short status;

	/**
	 * 从平台传到供应商ERP的状态
	 */
	@Column(name = "ma_sendstatus")
	private Short sendStatus;
	
	/**
	 * 1表示该采购单的明细至少有一条结案的情况
	 */
	@Column(name = "ma_end")
	private Short end;

	/**
	 * 回复数量
	 */
	@Column(name = "ma_replyqty")
	private Double replyQty;

	/**
	 * (最近一次)回复的交期
	 */
	@Column(name = "ma_replydelivery")
	private Date replyDelivery;

	/**
	 * (最近一次)回复的备注
	 */
	@Column(name = "ma_replyremark")
	private String replyRemark;
	
	/**
	 * 送货工厂
	 */
	@Column(name = "ma_factory")
	private String factory;
	
	public String getFactory() {
		return factory;
	}

	public void setFactory(String factory) {
		this.factory = factory;
	}
	
	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 EnterpriseInfo getEnterprise() {
		return enterprise;
	}

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

	public UserBaseInfo getUser() {
		return user;
	}

	public void setUser(UserBaseInfo user) {
		this.user = user;
	}

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

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

	public String getAuditor() {
		return auditor;
	}

	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}

	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 Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Date getDelivery() {
		return delivery;
	}

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

	public Double getQty() {
		return qty;
	}

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

	public Double getMakeQty() {
		return makeQty;
	}

	public void setMakeQty(Double makeQty) {
		this.makeQty = makeQty;
	}

	public String getKind() {
		return kind;
	}

	public void setKind(String kind) {
		this.kind = kind;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}

	public Date getCommence() {
		return commence;
	}

	public void setCommence(Date commence) {
		this.commence = commence;
	}

	public Date getComplete() {
		return complete;
	}

	public void setComplete(Date complete) {
		this.complete = complete;
	}

	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 Float getRate() {
		return rate;
	}

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

	public String getPayments() {
		return payments;
	}

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

	public Short getStatus() {
		return status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}
	
	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 Float getTaxrate() {
		return taxrate;
	}

	public void setTaxrate(Float taxrate) {
		this.taxrate = taxrate;
	}

	public Double getReplyQty() {
		return replyQty;
	}

	public void setReplyQty(Double replyQty) {
		this.replyQty = replyQty;
	}

	public Date getReplyDelivery() {
		return replyDelivery;
	}

	public void setReplyDelivery(Date replyDelivery) {
		this.replyDelivery = replyDelivery;
	}

	public String getReplyRemark() {
		return replyRemark;
	}

	public void setReplyRemark(String replyRemark) {
		this.replyRemark = replyRemark;
	}

	public Double getAcceptQty() {
		return acceptQty;
	}

	public void setAcceptQty(Double acceptQty) {
		this.acceptQty = acceptQty;
	}

	public Double getReturnsqty() {
		return returnsqty;
	}

	public void setReturnsqty(Double returnsqty) {
		this.returnsqty = returnsqty;
	}
	
}
