package com.uas.platform.b2b.model;

import java.sql.Clob;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.uas.platform.core.persistence.EnterpriseUU;
import com.uas.platform.core.persistence.Logger;
import com.uas.platform.core.persistence.StatusColumn;
import com.uas.platform.core.persistence.UserUU;

/**
 * 商品信息
 * @author yingp
 *
 */
@Entity
@Table(name = "products")
@Logger
public class Product {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "products_gen")
	@SequenceGenerator(name = "products_gen", sequenceName = "products_seq", allocationSize = 1)
	@Column(name = "pr_id")
	private Long id;

	/**
	 * 商品信息标题
	 */
	@Column(name = "pr_title")
	private String title;

	/**
	 * 产品编号
	 */
	@Column(name = "pr_code")
	private String code;

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

	/**
	 * 单位
	 */
	@Column(name = "pr_unit")
	private String unit;

	/**
	 * 所属企业UU
	 */
	@Column(name = "pr_enuu")
	@EnterpriseUU
	private Long enUU;

	/**
	 * 个人UU
	 */
	@Column(name = "pr_useruu")
	@UserUU
	private Long userUU;

	/**
	 * 最小包装量
	 */
	@Column(name = "pr_minpack")
	private Float minPack;

	/**
	 * 最小采购量
	 */
	@Column(name = "pr_minorder")
	private Float minOrder;

	/**
	 * 采购提前期
	 */
	@Column(name = "pr_leadtime")
	private Float leadtime;

	/**
	 * 状态
	 */
	@Column(name = "pr_status")
	@StatusColumn
	private Integer status;

	/**
	 * 库存数
	 */
	@Column(name = "pr_stock")
	private Double stock;

	/**
	 * 附件ID串(逗号间隔)
	 */
	@Column(name = "pr_attach")
	private String attach;

	/**
	 * 详细描述
	 */
	@Column(name = "pr_description")
	private Clob description;

	/**
	 * 图片path
	 */
	@Column(name = "pr_img1")
	private String img1;

	/**
	 * 图片path
	 */
	@Column(name = "pr_img2")
	private String img2;

	/**
	 * 图片path
	 */
	@Column(name = "pr_img3")
	private String img3;

	/**
	 * 图片path
	 */
	@Column(name = "pr_img4")
	private String img4;

	/**
	 * 图片path
	 */
	@Column(name = "pr_img5")
	private String img5;

	/**
	 * 价格
	 */
	@Column(name = "pr_price")
	private Double price;

	/**
	 * 价格区间
	 */
	@Column(name = "pr_pricerange")
	private String priceRange;

	/**
	 * 品牌
	 */
	@Column(name = "pr_brand")
	private String brand;

	/**
	 * 支持网上交易
	 */
	@Column(name = "pr_onlineorder")
	private Short onlineOrder;

	/**
	 * 信息有效截止期
	 */
	@Column(name = "pr_validity")
	private Date validity;

	/**
	 * 发货地址
	 */
	@Column(name = "pr_shipaddr")
	private String shipAddr;

	/**
	 * 图片私密
	 */
	@Column(name = "pr_privateimg")
	private Short privateImg;

	/**
	 * 价格私密
	 */
	@Column(name = "pr_privateprice")
	private Short privatePrice;

	/**
	 * 会员特供
	 */
	@Column(name = "pr_formember")
	private Short forMember;

	/**
	 * 商品属性
	 */
	@Column(name = "pr_properties")
	private String properties;

	public Long getId() {
		return id;
	}

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

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getSpec() {
		return spec;
	}

	public void setSpec(String spec) {
		this.spec = spec;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	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 Float getMinPack() {
		return minPack;
	}

	public void setMinPack(Float minPack) {
		this.minPack = minPack;
	}

	public Float getMinOrder() {
		return minOrder;
	}

	public void setMinOrder(Float minOrder) {
		this.minOrder = minOrder;
	}

	public Float getLeadtime() {
		return leadtime;
	}

	public void setLeadtime(Float leadtime) {
		this.leadtime = leadtime;
	}

	public Integer getStatus() {
		return status;
	}

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

	public Double getStock() {
		return stock;
	}

	public void setStock(Double stock) {
		this.stock = stock;
	}

	public String getAttach() {
		return attach;
	}

	public void setAttach(String attach) {
		this.attach = attach;
	}

	public Clob getDescription() {
		return description;
	}

	public void setDescription(Clob description) {
		this.description = description;
	}

	public String getImg1() {
		return img1;
	}

	public void setImg1(String img1) {
		this.img1 = img1;
	}

	public String getImg2() {
		return img2;
	}

	public void setImg2(String img2) {
		this.img2 = img2;
	}

	public String getImg3() {
		return img3;
	}

	public void setImg3(String img3) {
		this.img3 = img3;
	}

	public String getImg4() {
		return img4;
	}

	public void setImg4(String img4) {
		this.img4 = img4;
	}

	public String getImg5() {
		return img5;
	}

	public void setImg5(String img5) {
		this.img5 = img5;
	}

	public Double getPrice() {
		return price;
	}

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

	public String getPriceRange() {
		return priceRange;
	}

	public void setPriceRange(String priceRange) {
		this.priceRange = priceRange;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public Short getOnlineOrder() {
		return onlineOrder;
	}

	public void setOnlineOrder(Short onlineOrder) {
		this.onlineOrder = onlineOrder;
	}

	public Date getValidity() {
		return validity;
	}

	public void setValidity(Date validity) {
		this.validity = validity;
	}

	public String getShipAddr() {
		return shipAddr;
	}

	public void setShipAddr(String shipAddr) {
		this.shipAddr = shipAddr;
	}

	public Short getPrivateImg() {
		return privateImg;
	}

	public void setPrivateImg(Short privateImg) {
		this.privateImg = privateImg;
	}

	public Short getPrivatePrice() {
		return privatePrice;
	}

	public void setPrivatePrice(Short privatePrice) {
		this.privatePrice = privatePrice;
	}

	public Short getForMember() {
		return forMember;
	}

	public void setForMember(Short forMember) {
		this.forMember = forMember;
	}

	public String getProperties() {
		return properties;
	}

	public void setProperties(String properties) {
		this.properties = properties;
	}

	@Override
	public String toString() {
		return "编号：" + getCode() + "，标题：" + getTitle() + "，规格型号：" + getSpec();
	}

}