package com.uas.platform.b2b.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;

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.ManyToOne;
import javax.persistence.Table;
import java.io.Serializable;

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

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

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

	/**
	 * 产品名称
	 */
	@Column(name = "dei_prodname")
	private String prodname;

	/**
	 * 品牌
	 */
	@Column(name = "dei_prodbrand")
	private String prodbrand;

	/**
	 * 产品型号
	 */
	@Column(name = "dei_prodcode")
	private String prodcode;

	/**
	 * 产品规格
	 */
	@Column(name = "dei_prodspec")
	private String prodspec;

	/**
	 * 数量
	 */
	@Column(name = "dei_amount")
	private Double amount;
	
	/**
	 * 单价
	 */
	@Column(name = "dei_unitprice")
	private Double unitprice;
	
	/**
	 * 采购单价
	 */
	@Column(name = "dei_purcprice")
	private Double purcprice;

	/**
	 * 总金额
	 */
	@Column(name = "dei_totalprice")
	private Double totalprice;
	
	/**
	 * 备注
	 */
	@Column(name = "dei_remark")
	private String remark;

	/**
	 * 代采主记录id
	 */
	@Column(name = "dei_deoid")
	private Long deoid;

	/**
	 * 代采单主记录
	 */
	@ManyToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "dei_deoid", insertable = false, updatable = false)
	private DeputyOrder deputyOrder;

	/**
	 * 序号
	 */
	@Column(name = "dei_detno")
	private Integer detno;

	public Long getId() {
		return id;
	}

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

	public String getProdname() {
		return prodname;
	}

	public void setProdname(String prodname) {
		this.prodname = prodname;
	}

	public String getProdcode() {
		return prodcode;
	}

	public void setProdcode(String prodcode) {
		this.prodcode = prodcode;
	}

	public String getProdspec() {
		return prodspec;
	}

	public void setProdspec(String prodspec) {
		this.prodspec = prodspec;
	}

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Double getUnitprice() {
		return unitprice;
	}

	public void setUnitprice(Double unitprice) {
		this.unitprice = unitprice;
	}

	public Double getPurcprice() {
		return purcprice;
	}

	public void setPurcprice(Double purcprice) {
		this.purcprice = purcprice;
	}

	public Double getTotalprice() {
		return totalprice;
	}

	public void setTotalprice(Double totalprice) {
		this.totalprice = totalprice;
	}

	public String getRemark() {
		return remark;
	}

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

	@JsonIgnore
	@JSONField(serialize = false)
	public DeputyOrder getDeputyOrder() {
		return deputyOrder;
	}

	public void setDeputyOrder(DeputyOrder deputyOrder) {
		this.deputyOrder = deputyOrder;
	}

	public Integer getDetno() {
		return detno;
	}

	public void setDetno(Integer detno) {
		this.detno = detno;
	}

	public String getProdbrand() {
		return prodbrand;
	}

	public void setProdbrand(String prodbrand) {
		this.prodbrand = prodbrand;
	}

	public Long getDeoid() {
		return deoid;
	}

	public void setDeoid(Long deoid) {
		this.deoid = deoid;
	}

}
