Browse Source

去除 model 层类名中的 SimpleInfo

sunyj 8 years ago
parent
commit
42867226ff
28 changed files with 2434 additions and 0 deletions
  1. 24 0
      src/main/java/com/uas/search/dao/BrandDao.java
  2. 18 0
      src/main/java/com/uas/search/dao/ComponentDao.java
  3. 89 0
      src/main/java/com/uas/search/dao/GoodsDao.java
  4. 24 0
      src/main/java/com/uas/search/dao/KindDao.java
  5. 23 0
      src/main/java/com/uas/search/dao/OrderDao.java
  6. 23 0
      src/main/java/com/uas/search/dao/OrderInvoiceDao.java
  7. 23 0
      src/main/java/com/uas/search/dao/PurchaseDao.java
  8. 23 0
      src/main/java/com/uas/search/dao/PurchaseInvoiceDao.java
  9. 18 0
      src/main/java/com/uas/search/dao/StoreDao.java
  10. 20 0
      src/main/java/com/uas/search/dao/TradeGoodsDao.java
  11. 73 0
      src/main/java/com/uas/search/model/BaseOrderDetail.java
  12. 87 0
      src/main/java/com/uas/search/model/Brand.java
  13. 188 0
      src/main/java/com/uas/search/model/Component.java
  14. 58 0
      src/main/java/com/uas/search/model/Enterprise.java
  15. 185 0
      src/main/java/com/uas/search/model/Goods.java
  16. 87 0
      src/main/java/com/uas/search/model/Kind.java
  17. 176 0
      src/main/java/com/uas/search/model/Order.java
  18. 119 0
      src/main/java/com/uas/search/model/OrderDetail.java
  19. 156 0
      src/main/java/com/uas/search/model/OrderInvoice.java
  20. 119 0
      src/main/java/com/uas/search/model/OrderInvoiceDetail.java
  21. 68 0
      src/main/java/com/uas/search/model/Property.java
  22. 120 0
      src/main/java/com/uas/search/model/PropertyValue.java
  23. 138 0
      src/main/java/com/uas/search/model/Purchase.java
  24. 119 0
      src/main/java/com/uas/search/model/PurchaseDetail.java
  25. 140 0
      src/main/java/com/uas/search/model/PurchaseInvoice.java
  26. 119 0
      src/main/java/com/uas/search/model/PurchaseInvoiceDetail.java
  27. 70 0
      src/main/java/com/uas/search/model/Store.java
  28. 127 0
      src/main/java/com/uas/search/model/TradeGoods.java

+ 24 - 0
src/main/java/com/uas/search/dao/BrandDao.java

@@ -0,0 +1,24 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.Brand;
+
+/**
+ * @author sunyj
+ * @since 2016年7月7日 下午5:52:52
+ */
+@Repository
+public interface BrandDao
+		extends JpaSpecificationExecutor<Brand>, JpaRepository<Brand, Long> {
+
+	/**
+	 * 根据id获取品牌
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public Brand findById(Long id);
+}

+ 18 - 0
src/main/java/com/uas/search/dao/ComponentDao.java

@@ -0,0 +1,18 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.Component;
+
+/**
+ * @author sunyj
+ * @since 2016年7月7日 下午5:59:24
+ */
+@Repository
+public interface ComponentDao
+		extends JpaSpecificationExecutor<Component>, JpaRepository<Component, Long> {
+
+	public Component findByUuid(String uuid);
+}

+ 89 - 0
src/main/java/com/uas/search/dao/GoodsDao.java

@@ -0,0 +1,89 @@
+package com.uas.search.dao;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+import org.springframework.util.CollectionUtils;
+
+import com.uas.search.model.Component;
+import com.uas.search.model.Goods;
+import com.uas.search.model.Store;
+import com.uas.search.model.TradeGoods;
+
+/**
+ * @author sunyj
+ * @since 2017年7月8日 下午7:45:01
+ */
+@Repository
+public class GoodsDao {
+
+	@Autowired
+	private TradeGoodsDao tradeGoodsDao;
+
+	@Autowired
+	private ComponentDao componentDao;
+
+	@Autowired
+	private StoreDao storeDao;
+
+	/**
+	 * 根据批次id或者器件id获取批次
+	 * 
+	 * @param goods
+	 * @return
+	 */
+	public List<Goods> find(Goods goods) {
+		if (goods == null) {
+			return null;
+		}
+		List<Goods> goodsesList = new ArrayList<>();
+		if (goods.getGoId() != null) {
+			goodsesList.add(findByGoId(goods.getGoId()));
+		} else if (goods.getCmpId() != null) {
+			goodsesList.addAll(findByCmpId(goods.getCmpId()));
+		}
+		return goodsesList;
+	}
+
+	/**
+	 * 根据批次id获取批次信息
+	 * 
+	 * @param goId
+	 * @return
+	 */
+	private Goods findByGoId(Long goId) {
+		TradeGoods tradeGoods = tradeGoodsDao.findOne(goId);
+		Component component = componentDao.findByUuid(tradeGoods.getCmpUuid());
+		Store store = null;
+		if (tradeGoods.getStoreId() != null) {
+			store = storeDao.findByUuid(tradeGoods.getStoreId());
+		}
+		return new Goods(tradeGoods, store, component);
+	}
+
+	/**
+	 * 根据器件id获取批次信息
+	 * 
+	 * @param cmpId
+	 * @return
+	 */
+	private List<Goods> findByCmpId(Long cmpId) {
+		Component component = componentDao.findOne(cmpId);
+		List<TradeGoods> tradeGoodsesList = tradeGoodsDao.findByCmpUuid(component.getUuid());
+		List<Goods> goodsesList = new ArrayList<>();
+		if (!CollectionUtils.isEmpty(tradeGoodsesList)) {
+			for (TradeGoods tradeGoods : tradeGoodsesList) {
+				Store store = null;
+				if (tradeGoods.getStoreId() != null) {
+					store = storeDao.findByUuid(tradeGoods.getStoreId());
+				}
+				goodsesList.add(new Goods(tradeGoods, store, component));
+			}
+		} else {
+			goodsesList.add(new Goods(null, null, component));
+		}
+		return goodsesList;
+	}
+}

+ 24 - 0
src/main/java/com/uas/search/dao/KindDao.java

@@ -0,0 +1,24 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.Kind;
+
+/**
+ * @author sunyj
+ * @since 2016年7月7日 下午5:46:35
+ */
+@Repository
+public interface KindDao
+		extends JpaSpecificationExecutor<Kind>, JpaRepository<Kind, Long> {
+
+	/**
+	 * 根据id获取类目
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public Kind findById(Long id);
+}

+ 23 - 0
src/main/java/com/uas/search/dao/OrderDao.java

@@ -0,0 +1,23 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.Order;
+
+/**
+ * @author sunyj
+ * @since 2016年10月14日 上午11:58:50
+ */
+@Repository
+public interface OrderDao
+		extends JpaSpecificationExecutor<Order>, JpaRepository<Order, Long> {
+	/**
+	 * 根据id获取销售单
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public Order findById(Long id);
+}

+ 23 - 0
src/main/java/com/uas/search/dao/OrderInvoiceDao.java

@@ -0,0 +1,23 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.OrderInvoice;
+
+/**
+ * @author sunyj
+ * @since 2016年10月14日 上午11:58:50
+ */
+@Repository
+public interface OrderInvoiceDao
+		extends JpaSpecificationExecutor<OrderInvoice>, JpaRepository<OrderInvoice, Long> {
+	/**
+	 * 根据id获取销售发货单
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public OrderInvoice findById(Long id);
+}

+ 23 - 0
src/main/java/com/uas/search/dao/PurchaseDao.java

@@ -0,0 +1,23 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.Purchase;
+
+/**
+ * @author sunyj
+ * @since 2016年10月14日 上午11:58:50
+ */
+@Repository
+public interface PurchaseDao
+		extends JpaSpecificationExecutor<Purchase>, JpaRepository<Purchase, Long> {
+	/**
+	 * 根据id获取销售单
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public Purchase findById(Long id);
+}

+ 23 - 0
src/main/java/com/uas/search/dao/PurchaseInvoiceDao.java

@@ -0,0 +1,23 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.PurchaseInvoice;
+
+/**
+ * @author sunyj
+ * @since 2016年10月14日 上午11:58:50
+ */
+@Repository
+public interface PurchaseInvoiceDao
+		extends JpaSpecificationExecutor<PurchaseInvoice>, JpaRepository<PurchaseInvoice, Long> {
+	/**
+	 * 根据id获取销售发货单
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public PurchaseInvoice findById(Long id);
+}

+ 18 - 0
src/main/java/com/uas/search/dao/StoreDao.java

@@ -0,0 +1,18 @@
+package com.uas.search.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.Store;
+
+/**
+ * @author sunyj
+ * @since 2017年7月22日 下午8:16:07
+ */
+@Repository
+public interface StoreDao
+		extends JpaSpecificationExecutor<Store>, JpaRepository<Store, Long> {
+
+	public Store findByUuid(String uuid);
+}

+ 20 - 0
src/main/java/com/uas/search/dao/TradeGoodsDao.java

@@ -0,0 +1,20 @@
+package com.uas.search.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.search.model.TradeGoods;
+
+/**
+ * @author sunyj
+ * @since 2017年7月22日 下午8:16:07
+ */
+@Repository
+public interface TradeGoodsDao
+		extends JpaSpecificationExecutor<TradeGoods>, JpaRepository<TradeGoods, Long> {
+
+	public List<TradeGoods> findByCmpUuid(String cmpUuid);
+}

+ 73 - 0
src/main/java/com/uas/search/model/BaseOrderDetail.java

@@ -0,0 +1,73 @@
+package com.uas.search.model;
+
+/**
+ * 单据明细基类
+ * 
+ * @author sunyj
+ * @since 2016年10月31日 上午11:30:35
+ */
+public class BaseOrderDetail {
+	private Long id;
+	private String code;
+	private Short detno;
+	private String cmpCode;
+	private String kiName;
+	private String brName;
+	private Integer status;
+
+	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 Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getCmpCode() {
+		return cmpCode;
+	}
+
+	public void setCmpCode(String cmpCode) {
+		this.cmpCode = cmpCode;
+	}
+
+	public String getKiName() {
+		return kiName;
+	}
+
+	public void setKiName(String kiName) {
+		this.kiName = kiName;
+	}
+
+	public String getBrName() {
+		return brName;
+	}
+
+	public void setBrName(String brName) {
+		this.brName = brName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+}

+ 87 - 0
src/main/java/com/uas/search/model/Brand.java

@@ -0,0 +1,87 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 品牌简要信息,只用于索引的创建与查询
+ * 
+ * @author sunyj
+ * @since 2016年7月7日 下午5:48:32
+ */
+@Entity
+@Table(name = "product$brand")
+public class Brand implements Serializable {
+
+	/**
+	 * 序列号
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "br_id")
+	private Long id;
+
+	/**
+	 * uuid
+	 */
+	@Column(name = "br_uuid", unique = true)
+	private String uuid;
+
+	/**
+	 * 品牌中文名称
+	 */
+	@Column(name = "br_name_cn")
+	private String nameCn;
+
+	/**
+	 * 品牌英文名称
+	 */
+	@Column(name = "br_name_en")
+	private String nameEn;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getUuid() {
+		return uuid;
+	}
+
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	public String getNameCn() {
+		return nameCn;
+	}
+
+	public void setNameCn(String nameCn) {
+		this.nameCn = nameCn;
+	}
+
+	public String getNameEn() {
+		return nameEn;
+	}
+
+	public void setNameEn(String nameEn) {
+		this.nameEn = nameEn;
+	}
+
+	@Override
+	public String toString() {
+		return "Brand [id=" + id + ", uuid=" + uuid + ", nameCn=" + nameCn + ", nameEn=" + nameEn + "]";
+	}
+
+}

+ 188 - 0
src/main/java/com/uas/search/model/Component.java

@@ -0,0 +1,188 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ * 器件简要信息,只用于索引的创建与查询
+ * 
+ * @author sunyj
+ * @since 2016年7月7日 下午5:55:26
+ */
+@Entity
+@Table(name = "product$component")
+public class Component implements Serializable {
+
+	/**
+	 * 序列号
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "cmp_id")
+	private Long id;
+
+	/**
+	 * 器件的uuid
+	 */
+	@Column(name = "cmp_uuid", unique = true)
+	private String uuid;
+
+	/**
+	 * 原厂型号
+	 */
+	@Column(name = "cmp_code")
+	private String code;
+
+	/**
+	 * 类目
+	 */
+	@ManyToOne
+	@JoinColumn(name = "cmp_kiid")
+	private Kind kind;
+
+	/**
+	 * 品牌
+	 */
+	@ManyToOne
+	@JoinColumn(name = "cmp_brid")
+	private Brand brand;
+
+	/**
+	 * 以下为器件的库存交易属性,由器件对应的上架商品发生变化时,更新反应到器件
+	 */
+
+	/**
+	 * 器件的库存
+	 */
+	@Column(name = "cmp_reserve")
+	private Double reserve;
+
+	/**
+	 * 样品数量汇总
+	 */
+	@Column(name = "cmp_sampleqty")
+	private Double sampleQty;
+
+	/**
+	 * 现货数量
+	 */
+	@Column(name = "cmp_originalqty")
+	private Double originalQty;
+
+	/**
+	 * 呆滞库存数量
+	 */
+	@Column(name = "cmp_inastockqty")
+	private Double inactionStockQty;
+
+	/**
+	 * 带的属性及属性的值
+	 */
+	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "pv_componentid", updatable = false, insertable = false)
+	@OrderBy("detno")
+	private Set<PropertyValue> properties;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getUuid() {
+		return uuid;
+	}
+
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Kind getKind() {
+		return kind;
+	}
+
+	public void setKind(Kind kind) {
+		this.kind = kind;
+	}
+
+	public Brand getBrand() {
+		return brand;
+	}
+
+	public void setBrand(Brand brand) {
+		this.brand = brand;
+	}
+
+	public Double getReserve() {
+		return reserve;
+	}
+
+	public void setReserve(Double reserve) {
+		this.reserve = reserve;
+	}
+
+	public Double getSampleQty() {
+		return sampleQty;
+	}
+
+	public void setSampleQty(Double sampleQty) {
+		this.sampleQty = sampleQty;
+	}
+
+	public Double getOriginalQty() {
+		return originalQty;
+	}
+
+	public void setOriginalQty(Double originalQty) {
+		this.originalQty = originalQty;
+	}
+
+	public Double getInactionStockQty() {
+		return inactionStockQty;
+	}
+
+	public void setInactionStockQty(Double inactionStockQty) {
+		this.inactionStockQty = inactionStockQty;
+	}
+
+	public Set<PropertyValue> getProperties() {
+		return properties;
+	}
+
+	public void setProperties(Set<PropertyValue> properties) {
+		this.properties = properties;
+	}
+
+	@Override
+	public String toString() {
+		return "Component [id=" + id + ", uuid=" + uuid + ", code=" + code + ", kind=" + kind + ", brand="
+				+ brand + ", reserve=" + reserve + ", sampleQty=" + sampleQty + ", originalQty=" + originalQty
+				+ ", inactionStockQty=" + inactionStockQty + ", properties=" + properties + "]";
+	}
+
+}

+ 58 - 0
src/main/java/com/uas/search/model/Enterprise.java

@@ -0,0 +1,58 @@
+/*CopyRright (c)2014: <www.usoftchina.com>
+ */
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 企业信息
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:55:23
+ */
+@Entity
+@Table(name = "sec$enterprises")
+public class Enterprise implements Serializable {
+
+	/**
+	 * 序列号
+	 */
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@Column(name = "en_uu")
+	private Long uu;
+
+	/**
+	 * 公司名称
+	 */
+	@Column(name = "en_name")
+	private String enName;
+
+	public Long getUu() {
+		return uu;
+	}
+
+	public void setUu(Long uu) {
+		this.uu = uu;
+	}
+
+	public String getEnName() {
+		return enName;
+	}
+
+	public void setEnName(String enName) {
+		this.enName = enName;
+	}
+
+	@Override
+	public String toString() {
+		return "Enterprise [uu=" + uu + ", enName=" + enName + "]";
+	}
+
+}

+ 185 - 0
src/main/java/com/uas/search/model/Goods.java

@@ -0,0 +1,185 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+/**
+ * 器件批次
+ * 
+ * @author sunyj
+ * @since 2017年7月8日 下午5:14:08
+ */
+public class Goods implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	private String id;
+
+	/**
+	 * 批次id
+	 */
+	private Long goId;
+
+	/**
+	 * 批次的库存
+	 */
+	private Double goReserve;
+
+	/**
+	 * 批次的人民币价格
+	 */
+	private Double goMinPriceRMB;
+
+	/**
+	 * 批次的美元价格
+	 */
+	private Double goMinPriceUSD;
+
+	/**
+	 * 货币
+	 */
+	private String crName;
+
+	/**
+	 * 货源
+	 */
+	private Store store;
+
+	/**
+	 * 器件的id
+	 */
+	private Long cmpId;
+
+	/**
+	 * 原厂型号
+	 */
+	private String cmpCode;
+
+	/**
+	 * 类目
+	 */
+	private Kind kind;
+
+	/**
+	 * 品牌
+	 */
+	private Brand brand;
+
+	public Goods() {
+	}
+
+	public Goods(TradeGoods tradeGoods, Store store, Component component) {
+		if (tradeGoods != null) {
+			this.goId = tradeGoods.getId();
+			this.goReserve = tradeGoods.getReserve();
+			this.goMinPriceRMB = tradeGoods.getMinPriceRMB();
+			this.goMinPriceUSD = tradeGoods.getMinPriceUSD();
+			this.crName = tradeGoods.getCrName();
+		}
+		this.store = store;
+		if (component != null) {
+			this.cmpId = component.getId();
+			this.cmpCode = component.getCode();
+			this.kind = component.getKind();
+			this.brand = component.getBrand();
+		}
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Long getGoId() {
+		return goId;
+	}
+
+	public void setGoId(Long goId) {
+		this.goId = goId;
+	}
+
+	public Double getGoReserve() {
+		return goReserve;
+	}
+
+	public void setGoReserve(Double goReserve) {
+		this.goReserve = goReserve;
+	}
+
+	public Double getGoMinPriceRMB() {
+		return goMinPriceRMB;
+	}
+
+	public void setGoMinPriceRMB(Double goMinPriceRMB) {
+		this.goMinPriceRMB = goMinPriceRMB;
+	}
+
+	public Double getGoMinPriceUSD() {
+		return goMinPriceUSD;
+	}
+
+	public void setGoMinPriceUSD(Double goMinPriceUSD) {
+		this.goMinPriceUSD = goMinPriceUSD;
+	}
+
+	public String getCrName() {
+		return crName;
+	}
+
+	public void setCrName(String crName) {
+		this.crName = crName;
+	}
+
+	public Store getStore() {
+		return store;
+	}
+
+	public void setStore(Store store) {
+		this.store = store;
+	}
+
+	public Long getCmpId() {
+		return cmpId;
+	}
+
+	public void setCmpId(Long cmpId) {
+		this.cmpId = cmpId;
+	}
+
+	public String getCmpCode() {
+		return cmpCode;
+	}
+
+	public void setCmpCode(String cmpCode) {
+		this.cmpCode = cmpCode;
+	}
+
+	public Kind getKind() {
+		return kind;
+	}
+
+	public void setKind(Kind kind) {
+		this.kind = kind;
+	}
+
+	public Brand getBrand() {
+		return brand;
+	}
+
+	public void setBrand(Brand brand) {
+		this.brand = brand;
+	}
+
+	@Override
+	public String toString() {
+		return "Goods [id=" + id + ", goId=" + goId + ", goReserve=" + goReserve + ", goMinPriceRMB="
+				+ goMinPriceRMB + ", goMinPriceUSD=" + goMinPriceUSD + ", crName=" + crName + ", store=" + store
+				+ ", cmpId=" + cmpId + ", cmpCode=" + cmpCode + ", kind=" + kind + ", brand=" + brand + "]";
+	}
+
+}

+ 87 - 0
src/main/java/com/uas/search/model/Kind.java

@@ -0,0 +1,87 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 类目简要信息,只用于索引的创建与查询
+ * 
+ * @author sunyj
+ * @since 2016年7月7日 下午5:38:44
+ */
+@Entity
+@Table(name = "product$kind")
+public class Kind implements Serializable {
+
+	/**
+	 * 序列号
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "ki_id")
+	private Long id;
+
+	/**
+	 * 类目名称
+	 */
+	@Column(name = "ki_name")
+	private String nameCn;
+
+	/**
+	 * 类目的层级,从1开始,1、2、3
+	 */
+	@Column(name = "ki_level")
+	private Short level;
+
+	/**
+	 * 是否为叶子类目 1是 0否
+	 */
+	@Column(name = "ki_isleaf")
+	private Short isLeaf;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getNameCn() {
+		return nameCn;
+	}
+
+	public void setNameCn(String nameCn) {
+		this.nameCn = nameCn;
+	}
+
+	public Short getLevel() {
+		return level;
+	}
+
+	public void setLevel(Short level) {
+		this.level = level;
+	}
+
+	public Short getIsLeaf() {
+		return isLeaf;
+	}
+
+	public void setIsLeaf(Short isLeaf) {
+		this.isLeaf = isLeaf;
+	}
+
+	@Override
+	public String toString() {
+		return "Kind [id=" + id + ", nameCn=" + nameCn + ", level=" + level + ", isLeaf=" + isLeaf + "]";
+	}
+
+}

+ 176 - 0
src/main/java/com/uas/search/model/Order.java

@@ -0,0 +1,176 @@
+package com.uas.search.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.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ * 商城销售订单
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:09:53
+ */
+@Entity(name = "trade.Order")
+@Table(name = "trade$order")
+public class Order implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 订单号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "or_id", unique = true)
+	private String code;
+
+	/**
+	 * 买方uu
+	 * 
+	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
+	 */
+	@Column(name = "or_buyeruu")
+	private Long buyeruu;
+
+	/**
+	 * 买方姓名
+	 */
+	@Column(name = "or_buyername")
+	private String buyername;
+
+	/**
+	 * 买方企业
+	 * 
+	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
+	 */
+	@OneToOne
+	@JoinColumn(name = "or_buyerenuu", updatable = false, insertable = false)
+	private Enterprise buyerEnterprise;
+
+	/**
+	 * 卖方企业
+	 * 
+	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
+	 */
+	@OneToOne
+	@JoinColumn(name = "or_sellerenuu", updatable = false, insertable = false)
+	private Enterprise sellerEnterprise;
+
+	/**
+	 * 订单生成时间
+	 */
+	@Column(name = "or_creattime")
+	private Date createtime;
+
+	/**
+	 * 订单状态(1->2->3->4->5->6->7->8->9)
+	 * 
+	 * @Tip 必须严格按照顺序流转 1、TOBECONFIRMED(501, "待确认"), 2、TOBEPAID(503, "待付款"),
+	 *      3、PAID(505, "已付款"), 4、TOBESHIPPED(406, "待出货"), 5、SHIPPINGIN(403,
+	 *      "出货中"), 6、SHIPPED(407, "已出货"), 7、SENDING(408, "发货中"), 8、INBOUND(404,
+	 *      "待收货") 9、RECEIVED(405, "已收货"), 10、UNAVAILABLE(602, "无效的");
+	 */
+	@Column(name = "or_status")
+	private Integer status;
+
+	/**
+	 * 订单明细
+	 */
+	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "order_id", updatable = false, insertable = false)
+	@OrderBy("detno")
+	private Set<OrderDetail> details;
+
+	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 Long getBuyeruu() {
+		return buyeruu;
+	}
+
+	public void setBuyeruu(Long buyeruu) {
+		this.buyeruu = buyeruu;
+	}
+
+	public String getBuyername() {
+		return buyername;
+	}
+
+	public void setBuyername(String buyername) {
+		this.buyername = buyername;
+	}
+
+	public Enterprise getBuyerEnterprise() {
+		return buyerEnterprise;
+	}
+
+	public void setBuyerEnterprise(Enterprise buyerEnterprise) {
+		this.buyerEnterprise = buyerEnterprise;
+	}
+
+	public Enterprise getSellerEnterprise() {
+		return sellerEnterprise;
+	}
+
+	public void setSellerEnterprise(Enterprise sellerEnterprise) {
+		this.sellerEnterprise = sellerEnterprise;
+	}
+
+	public Date getCreatetime() {
+		return createtime;
+	}
+
+	public void setCreatetime(Date createtime) {
+		this.createtime = createtime;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Set<OrderDetail> getDetails() {
+		return details;
+	}
+
+	public void setDetails(Set<OrderDetail> details) {
+		this.details = details;
+	}
+
+	@Override
+	public String toString() {
+		return "Order [id=" + id + ", code=" + code + ", buyeruu=" + buyeruu + ", buyername=" + buyername
+				+ ", buyerEnterprise=" + buyerEnterprise + ", sellerEnterprise=" + sellerEnterprise + ", createtime="
+				+ createtime + ", status=" + status + ", details=" + details + "]";
+	}
+
+}

+ 119 - 0
src/main/java/com/uas/search/model/OrderDetail.java

@@ -0,0 +1,119 @@
+package com.uas.search.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 商城销售订单明细
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:19:23
+ */
+@Entity
+@Table(name = "trade$order_detail")
+public class OrderDetail {
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 明细序号
+	 */
+	@Column(name = "detno")
+	private Short detno;
+
+	/**
+	 * 订单明细编号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "detail_id", unique = true)
+	private String code;
+
+	/**
+	 * 原厂型号
+	 */
+	@Column(name = "cmp_code")
+	private String cmpCode;
+
+	/**
+	 * 器件所属类目
+	 */
+	@Column(name = "ki_name")
+	private String kiName;
+
+	/**
+	 * 器件所属品牌
+	 */
+	@Column(name = "br_name")
+	private String brName;
+
+	/**
+	 * 订单明细状态
+	 */
+	@Column(name = "detail_status")
+	private Integer status;
+
+	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 Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getCmpCode() {
+		return cmpCode;
+	}
+
+	public void setCmpCode(String cmpCode) {
+		this.cmpCode = cmpCode;
+	}
+
+	public String getKiName() {
+		return kiName;
+	}
+
+	public void setKiName(String kiName) {
+		this.kiName = kiName;
+	}
+
+	public String getBrName() {
+		return brName;
+	}
+
+	public void setBrName(String brName) {
+		this.brName = brName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@Override
+	public String toString() {
+		return "OrderDetail [id=" + id + ", detno=" + detno + ", code=" + code + ", cmpCode=" + cmpCode
+				+ ", kiName=" + kiName + ", brName=" + brName + ", status=" + status + "]";
+	}
+}

+ 156 - 0
src/main/java/com/uas/search/model/OrderInvoice.java

@@ -0,0 +1,156 @@
+package com.uas.search.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.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ * 商城销售订单的发货单
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:05:02
+ */
+@Entity
+@Table(name = "trade$invoice_fmor")
+public class OrderInvoice implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 发货单号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "in_id", unique = true)
+	private String code;
+
+	/**
+	 * 买方uu
+	 * 
+	 * @Tip 这里因为平台作为中间商,所以发货单都由平台下达
+	 */
+	@Column(name = "in_buyeruu")
+	private Long buyeruu;
+
+	/**
+	 * 买方姓名
+	 */
+	@Column(name = "in_buyername")
+	private String buyername;
+
+	/**
+	 * 买方企业
+	 * 
+	 * @Tip 这里因为平台作为中间商,下达订单都看做给平台下达订单
+	 */
+	@OneToOne
+	@JoinColumn(name = "in_buyerenuu", updatable = false, insertable = false)
+	private Enterprise buyerEnterprise;
+
+	/**
+	 * 单生成时间
+	 */
+	@Column(name = "in_creattime")
+	private Date createtime;
+
+	/**
+	 * 订单状态(1->2)
+	 * 
+	 * @Tip 必须严格按照顺序流转 1、INBOUND(404, "待收货") 2、RECEIVED(405, "已收货"),
+	 */
+	@Column(name = "in_status")
+	private Integer status;
+
+	/**
+	 * 发货单明细
+	 */
+	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "invoice_id", updatable = false, insertable = false)
+	@OrderBy("detno")
+	private Set<OrderInvoiceDetail> details;
+
+	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 Long getBuyeruu() {
+		return buyeruu;
+	}
+
+	public void setBuyeruu(Long buyeruu) {
+		this.buyeruu = buyeruu;
+	}
+
+	public String getBuyername() {
+		return buyername;
+	}
+
+	public void setBuyername(String buyername) {
+		this.buyername = buyername;
+	}
+
+	public Date getCreatetime() {
+		return createtime;
+	}
+
+	public void setCreatetime(Date createtime) {
+		this.createtime = createtime;
+	}
+
+	public Enterprise getBuyerEnterprise() {
+		return buyerEnterprise;
+	}
+
+	public void setBuyerEnterprise(Enterprise buyerEnterprise) {
+		this.buyerEnterprise = buyerEnterprise;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Set<OrderInvoiceDetail> getDetails() {
+		return details;
+	}
+
+	public void setDetails(Set<OrderInvoiceDetail> details) {
+		this.details = details;
+	}
+
+	@Override
+	public String toString() {
+		return "OrderInvoice [id=" + id + ", code=" + code + ", buyeruu=" + buyeruu + ", buyername="
+				+ buyername + ", buyerEnterprise=" + buyerEnterprise + ", createtime=" + createtime + ", status="
+				+ status + ", details=" + details + "]";
+	}
+
+}

+ 119 - 0
src/main/java/com/uas/search/model/OrderInvoiceDetail.java

@@ -0,0 +1,119 @@
+package com.uas.search.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 商城销售订单的发货单明细
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:29:22
+ */
+@Entity
+@Table(name = "trade$invoice_fmor_dt")
+public class OrderInvoiceDetail {
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 明细序号 detail NO.
+	 */
+	@Column(name = "detno")
+	private Short detno;
+
+	/**
+	 * 发货单明细编号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "detail_id", unique = true)
+	private String code;
+
+	/**
+	 * 原厂型号
+	 */
+	@Column(name = "cmp_code")
+	private String cmpCode;
+
+	/**
+	 * 器件所属类目
+	 */
+	@Column(name = "ki_name")
+	private String kiName;
+
+	/**
+	 * 器件所属品牌
+	 */
+	@Column(name = "br_name")
+	private String brName;
+
+	/**
+	 * 发货单明细状态
+	 */
+	@Column(name = "detail_status")
+	private Integer status;
+
+	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 Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getCmpCode() {
+		return cmpCode;
+	}
+
+	public void setCmpCode(String cmpCode) {
+		this.cmpCode = cmpCode;
+	}
+
+	public String getKiName() {
+		return kiName;
+	}
+
+	public void setKiName(String kiName) {
+		this.kiName = kiName;
+	}
+
+	public String getBrName() {
+		return brName;
+	}
+
+	public void setBrName(String brName) {
+		this.brName = brName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@Override
+	public String toString() {
+		return "OrderInvoiceDetail [id=" + id + ", detno=" + detno + ", code=" + code + ", cmpCode=" + cmpCode
+				+ ", kiName=" + kiName + ", brName=" + brName + ", status=" + status + "]";
+	}
+}

+ 68 - 0
src/main/java/com/uas/search/model/Property.java

@@ -0,0 +1,68 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 标准属性
+ * 
+ * @author suntg
+ * @since 2016年3月11日下午5:02:18
+ */
+@Entity
+@Table(name = "product$property")
+public class Property implements Serializable {
+
+	/**
+	 * 序列号
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "pt_id")
+	private Long id;
+
+	/**
+	 * 属性中文名
+	 */
+	@Column(name = "pt_label")
+	private String labelCn;
+
+	/**
+	 * 属性名 英文
+	 */
+	@Column(name = "pt_label_en")
+	private String labelEn;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getLabelCn() {
+		return labelCn;
+	}
+
+	public void setLabelCn(String labelCn) {
+		this.labelCn = labelCn;
+	}
+
+	public String getLabelEn() {
+		return labelEn;
+	}
+
+	public void setLabelEn(String labelEn) {
+		this.labelEn = labelEn;
+	}
+
+}

+ 120 - 0
src/main/java/com/uas/search/model/PropertyValue.java

@@ -0,0 +1,120 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+
+/**
+ * 器件对应的属性的值
+ * 
+ * @author suntg
+ * @since 2016年3月11日下午2:24:29
+ */
+@Entity
+@Table(name = "product$propertyvalue")
+public class PropertyValue implements Serializable {
+
+	/**
+	 * 序列号
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "pv_id")
+	private Long id;
+
+	/**
+	 * 器件Id TODO 仅用于合并导出的器件和属性数据,jpa中不需要,后期可能会删除
+	 */
+	@Column(name = "pv_componentid")
+	private Long componentid;
+
+	/**
+	 * 属性Id
+	 */
+	@Column(name = "pv_propertyid")
+	private Long propertyid;
+
+	/**
+	 * 属性
+	 */
+	// TODO 索引未用到,确认无用后删除
+	@OneToOne(cascade = { CascadeType.REFRESH })
+	@JoinColumn(name = "pv_propertyid", insertable = false, updatable = false)
+	private Property property;
+
+	/**
+	 * 排序 TODO jpa使用,之后换为jdbc后,需要删除
+	 */
+	@Column(name = "pv_detno")
+	private Short detno;
+
+	/**
+	 * 属性的值
+	 */
+	@Column(name = "pv_value")
+	private String value;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getComponentid() {
+		return componentid;
+	}
+
+	public void setComponentid(Long componentid) {
+		this.componentid = componentid;
+	}
+
+	public Property getProperty() {
+		return property;
+	}
+
+	public void setProperty(Property property) {
+		this.property = property;
+	}
+
+	public Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	public Long getPropertyid() {
+		return propertyid;
+	}
+
+	public void setPropertyid(Long propertyid) {
+		this.propertyid = propertyid;
+	}
+
+	@Override
+	public String toString() {
+		return "PropertyValue [propertyid=" + propertyid + ", value=" + value + "]";
+	}
+
+}

+ 138 - 0
src/main/java/com/uas/search/model/Purchase.java

@@ -0,0 +1,138 @@
+package com.uas.search.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.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ * 商城采购订单
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:24:00
+ */
+@Entity(name = "trade.Purchase")
+@Table(name = "trade$purchase")
+public class Purchase implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 采购单号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "pu_id", unique = true)
+	private String code;
+
+	/**
+	 * 企业卖方uu
+	 * 
+	 * @Tip 这里因为平台作为中间商,所以采购单都由平台下达
+	 */
+	@Column(name = "pu_sellerenuu")
+	private Long sellerenuu;
+
+	/**
+	 * 卖方企业名称
+	 */
+	@Column(name = "pu_sellername")
+	private String sellerenname;
+
+	/**
+	 * 单生成时间
+	 */
+	@Column(name = "pu_createtime")
+	private Date createtime;
+
+	/**
+	 * 订单状态(1->2->3)
+	 * 
+	 * @Tip 必须严格按照顺序流转 1、TOBESHIPPED(406, "待出货"), 2、INBOUND(404, "待收货"),
+	 *      3、RECEIVED(405, "已收货"), 4、TOBEPAID(503, "待付款"), 5、PAID(504, "已付款"),
+	 */
+	@Column(name = "pu_status")
+	private Integer status;
+
+	/**
+	 * 采购单明细
+	 */
+	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "purchase_id", updatable = false, insertable = false)
+	@OrderBy("detno")
+	private Set<PurchaseDetail> details;
+
+	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 Long getSellerenuu() {
+		return sellerenuu;
+	}
+
+	public void setSellerenuu(Long sellerenuu) {
+		this.sellerenuu = sellerenuu;
+	}
+
+	public String getSellerenname() {
+		return sellerenname;
+	}
+
+	public void setSellerenname(String sellerenname) {
+		this.sellerenname = sellerenname;
+	}
+
+	public Date getCreatetime() {
+		return createtime;
+	}
+
+	public void setCreatetime(Date createtime) {
+		this.createtime = createtime;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Set<PurchaseDetail> getDetails() {
+		return details;
+	}
+
+	public void setDetails(Set<PurchaseDetail> details) {
+		this.details = details;
+	}
+
+	@Override
+	public String toString() {
+		return "Purchase [id=" + id + ", code=" + code + ", sellerenuu=" + sellerenuu + ", sellerenname="
+				+ sellerenname + ", createtime=" + createtime + ", status=" + status + ", details=" + details + "]";
+	}
+
+}

+ 119 - 0
src/main/java/com/uas/search/model/PurchaseDetail.java

@@ -0,0 +1,119 @@
+package com.uas.search.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 商城采购订单明细
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:27:53
+ */
+@Entity
+@Table(name = "trade$purchase_detail")
+public class PurchaseDetail {
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 明细序号 detailNO
+	 */
+	@Column(name = "detno")
+	private Short detno;
+
+	/**
+	 * 采购单明细编号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "detail_id", unique = true)
+	private String code;
+
+	/**
+	 * 原厂型号
+	 */
+	@Column(name = "cmp_code")
+	private String cmpCode;
+
+	/**
+	 * 器件所属类目
+	 */
+	@Column(name = "ki_name")
+	private String kiName;
+
+	/**
+	 * 器件所属品牌
+	 */
+	@Column(name = "br_name")
+	private String brName;
+
+	/**
+	 * 采购单明细状态
+	 */
+	@Column(name = "detail_status")
+	private Integer status;
+
+	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 Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getCmpCode() {
+		return cmpCode;
+	}
+
+	public void setCmpCode(String cmpCode) {
+		this.cmpCode = cmpCode;
+	}
+
+	public String getKiName() {
+		return kiName;
+	}
+
+	public void setKiName(String kiName) {
+		this.kiName = kiName;
+	}
+
+	public String getBrName() {
+		return brName;
+	}
+
+	public void setBrName(String brName) {
+		this.brName = brName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@Override
+	public String toString() {
+		return "PurchaseDetail [id=" + id + ", detno=" + detno + ", code=" + code + ", cmpCode=" + cmpCode
+				+ ", kiName=" + kiName + ", brName=" + brName + ", status=" + status + "]";
+	}
+}

+ 140 - 0
src/main/java/com/uas/search/model/PurchaseInvoice.java

@@ -0,0 +1,140 @@
+package com.uas.search.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.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ * 商城采购订单的发货单
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:32:37
+ */
+@Entity
+@Table(name = "trade$invoice_fmpu")
+public class PurchaseInvoice implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 发货单号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "in_id", unique = true)
+	private String code;
+
+	/**
+	 * 卖方企业uu
+	 * 
+	 * @Tip 这里因为平台作为中间商,所以发货单都由平台下达
+	 */
+	@Column(name = "in_sellerenuu")
+	private Long sellerenuu;
+
+	/**
+	 * 卖方企业名称
+	 */
+	@Column(name = "in_sellername")
+	private String sellerenname;
+
+	/**
+	 * 单生成时间
+	 */
+	@Column(name = "in_creattime")
+	private Date createtime;
+
+	/**
+	 * 单据状态(1->2->3)
+	 * 
+	 * @Tip 必须严格按照顺序流转 1、TOBESHIPPED(406, "待出货"), 2、INBOUND(404, "待收货")
+	 *      3、RECEIVED(405, "已收货"), 4、TORECEIVEMONEY(506, "待收款"),
+	 *      5、MONEYRECEIVED(505, "已收款"),
+	 */
+	@Column(name = "in_status")
+	private Integer status;
+
+	/**
+	 * 发货单明细
+	 */
+	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "invoice_id", updatable = false, insertable = false)
+	@OrderBy("detno")
+	private Set<PurchaseInvoiceDetail> details;
+
+	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 Long getSellerenuu() {
+		return sellerenuu;
+	}
+
+	public void setSellerenuu(Long sellerenuu) {
+		this.sellerenuu = sellerenuu;
+	}
+
+	public String getSellerenname() {
+		return sellerenname;
+	}
+
+	public void setSellerenname(String sellerenname) {
+		this.sellerenname = sellerenname;
+	}
+
+	public Date getCreatetime() {
+		return createtime;
+	}
+
+	public void setCreatetime(Date createtime) {
+		this.createtime = createtime;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Set<PurchaseInvoiceDetail> getDetails() {
+		return details;
+	}
+
+	public void setDetails(Set<PurchaseInvoiceDetail> details) {
+		this.details = details;
+	}
+
+	@Override
+	public String toString() {
+		return "PurchaseInvoice [id=" + id + ", code=" + code + ", sellerenuu=" + sellerenuu
+				+ ", sellerenname=" + sellerenname + ", createtime=" + createtime + ", status=" + status + ", details="
+				+ details + "]";
+	}
+
+}

+ 119 - 0
src/main/java/com/uas/search/model/PurchaseInvoiceDetail.java

@@ -0,0 +1,119 @@
+package com.uas.search.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 商城采购订单的发货单明细
+ * 
+ * @author sunyj
+ * @since 2016年10月14日 上午10:31:06
+ */
+@Entity
+@Table(name = "trade$invoice_fmpu_dt")
+public class PurchaseInvoiceDetail {
+
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * 明细序号 detail NO.(保存ERP的序号)
+	 */
+	@Column(name = "detno")
+	private Short detno;
+
+	/**
+	 * 发货单明细编号,因易与id命名混淆,其他类、lucenne建索引时该字段难以区分,特以此命名
+	 */
+	@Column(name = "detail_id", unique = true)
+	private String code;
+
+	/**
+	 * 原厂型号
+	 */
+	@Column(name = "cmp_code")
+	private String cmpCode;
+
+	/**
+	 * 器件所属类目
+	 */
+	@Column(name = "ki_name")
+	private String kiName;
+
+	/**
+	 * 器件所属品牌
+	 */
+	@Column(name = "br_name")
+	private String brName;
+
+	/**
+	 * 发货单明细状态
+	 */
+	@Column(name = "detail_status")
+	private Integer status;
+
+	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 Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getCmpCode() {
+		return cmpCode;
+	}
+
+	public void setCmpCode(String cmpCode) {
+		this.cmpCode = cmpCode;
+	}
+
+	public String getKiName() {
+		return kiName;
+	}
+
+	public void setKiName(String kiName) {
+		this.kiName = kiName;
+	}
+
+	public String getBrName() {
+		return brName;
+	}
+
+	public void setBrName(String brName) {
+		this.brName = brName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	@Override
+	public String toString() {
+		return "PurchaseInvoiceDetail [id=" + id + ", detno=" + detno + ", code=" + code + ", cmpCode="
+				+ cmpCode + ", kiName=" + kiName + ", brName=" + brName + ", status=" + status + "]";
+	}
+}

+ 70 - 0
src/main/java/com/uas/search/model/Store.java

@@ -0,0 +1,70 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 店铺
+ * 
+ * @author sunyj
+ * @since 2017年7月8日 下午6:14:26
+ */
+@Entity
+@Table(name = "store$info")
+public class Store implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "id")
+	private Long id;
+
+	/**
+	 * uuid
+	 */
+	@Column(name = "ST_UUID")
+	private String uuid;
+
+	/**
+	 * 类型
+	 */
+	@Column(name = "ST_TYPE")
+	private String type;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getUuid() {
+		return uuid;
+	}
+
+	public void setUuid(String uuid) {
+		this.uuid = uuid;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	@Override
+	public String toString() {
+		return "Store [id=" + id + ", uuid=" + uuid + ", type=" + type + "]";
+	}
+
+}

+ 127 - 0
src/main/java/com/uas/search/model/TradeGoods.java

@@ -0,0 +1,127 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 批次简要信息,只用于索引的创建与查询
+ * 
+ * @author sunyj
+ * @since 2017年7月22日 下午8:06:10
+ */
+@Entity
+@Table(name = "trade$goods")
+public class TradeGoods implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@Id
+	@Column(name = "go_id")
+	private Long id;
+
+	/**
+	 * 批次的库存
+	 */
+	@Column(name = "go_reserve")
+	private Double reserve;
+
+	/**
+	 * 批次的人民币价格
+	 */
+	@Column(name = "go_minpricermb")
+	private Double minPriceRMB;
+
+	/**
+	 * 批次的美元价格
+	 */
+	@Column(name = "go_minpriceusd")
+	private Double minPriceUSD;
+
+	/**
+	 * 货币
+	 */
+	@Column(name = "cr_name")
+	private String crName;
+
+	/**
+	 * 货源uuid
+	 */
+	@Column(name = "go_storeid")
+	private String storeId;
+
+	/**
+	 * 器件的uuid
+	 */
+	@Column(name = "cmp_uuid")
+	private String cmpUuid;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Double getReserve() {
+		return reserve;
+	}
+
+	public void setReserve(Double reserve) {
+		this.reserve = reserve;
+	}
+
+	public Double getMinPriceRMB() {
+		return minPriceRMB;
+	}
+
+	public void setMinPriceRMB(Double minPriceRMB) {
+		this.minPriceRMB = minPriceRMB;
+	}
+
+	public Double getMinPriceUSD() {
+		return minPriceUSD;
+	}
+
+	public void setMinPriceUSD(Double minPriceUSD) {
+		this.minPriceUSD = minPriceUSD;
+	}
+
+	public String getCrName() {
+		return crName;
+	}
+
+	public void setCrName(String crName) {
+		this.crName = crName;
+	}
+
+	public String getStoreId() {
+		return storeId;
+	}
+
+	public void setStoreId(String storeId) {
+		this.storeId = storeId;
+	}
+
+	public String getCmpUuid() {
+		return cmpUuid;
+	}
+
+	public void setCmpUuid(String cmpUuid) {
+		this.cmpUuid = cmpUuid;
+	}
+
+	@Override
+	public String toString() {
+		return "TradeGoods [id=" + id + ", reserve=" + reserve + ", minPriceRMB=" + minPriceRMB + ", minPriceUSD="
+				+ minPriceUSD + ", crName=" + crName + ", storeId=" + storeId + ", cmpUuid=" + cmpUuid + "]";
+	}
+
+}