Browse Source

新增商城订单搜索服务的接口

suntg 9 years ago
parent
commit
ddd990a593

+ 61 - 0
search-api/src/main/java/com/uas/search/model/BaseOrder.java

@@ -0,0 +1,61 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 订单主表
+ * 
+ * @author suntg
+ * @since 2016年10月11日上午11:31:38
+ */
+public class BaseOrder implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+
+	private String code;
+
+	private List<BaseOrderDetail> details;
+
+	public BaseOrder() {
+
+	}
+
+	public BaseOrder(Long id) {
+		this.id = id;
+	}
+
+	public BaseOrder(Long id, String code) {
+		this(id);
+		this.code = code;
+	}
+
+	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 List<BaseOrderDetail> getDetails() {
+		return details;
+	}
+
+	public void setDetails(List<BaseOrderDetail> details) {
+		this.details = details;
+	}
+}

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

@@ -0,0 +1,66 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+
+/**
+ * 订单明细
+ * 
+ * @author suntg
+ * @since 2016年10月11日上午11:32:11
+ */
+public class BaseOrderDetail implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+
+	private Short detno;
+
+	private String code;
+
+	public BaseOrderDetail() {
+
+	}
+
+	public BaseOrderDetail(Long id) {
+		this.id = id;
+	}
+
+	public BaseOrderDetail(Long id, Short detno) {
+		this(id);
+		this.detno = detno;
+	}
+
+	public BaseOrderDetail(Long id, Short detno, String code) {
+		this(id, detno);
+		this.code = code;
+	}
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Short getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Short detno) {
+		this.detno = detno;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+}

+ 83 - 0
search-api/src/main/java/com/uas/search/model/SPage.java

@@ -0,0 +1,83 @@
+package com.uas.search.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class SPage<T> implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	private int totalPage;
+
+	private long totalElement;
+
+	private int page;
+
+	private int size;
+
+	private boolean first;
+
+	private boolean last;
+
+	private List<T> content;
+
+	public int getTotalPage() {
+		return totalPage;
+	}
+
+	public void setTotalPage(int totalPage) {
+		this.totalPage = totalPage;
+	}
+
+	public long getTotalElement() {
+		return totalElement;
+	}
+
+	public void setTotalElement(long totalElement) {
+		this.totalElement = totalElement;
+	}
+
+	public int getPage() {
+		return page;
+	}
+
+	public void setPage(int page) {
+		this.page = page;
+	}
+
+	public int getSize() {
+		return size;
+	}
+
+	public void setSize(int size) {
+		this.size = size;
+	}
+
+	public boolean isFirst() {
+		return first;
+	}
+
+	public void setFirst(boolean first) {
+		this.first = first;
+	}
+
+	public boolean isLast() {
+		return last;
+	}
+
+	public void setLast(boolean last) {
+		this.last = last;
+	}
+
+	public List<T> getContent() {
+		return content;
+	}
+
+	public void setContent(List<T> content) {
+		this.content = content;
+	}
+
+}

+ 72 - 0
search-api/src/main/java/com/uas/search/service/OrderSearchService.java

@@ -0,0 +1,72 @@
+package com.uas.search.service;
+
+import com.uas.search.model.BaseOrder;
+import com.uas.search.model.PageParams;
+import com.uas.search.model.SPage;
+
+/**
+ * 商城订单搜索服务
+ * 
+ * @author suntg
+ * @since 2016年10月11日上午11:36:27
+ */
+public interface OrderSearchService {
+
+	/**
+	 * 订单的类型名称
+	 * 
+	 * @author suntg
+	 * @since 2016年10月11日上午11:36:44
+	 */
+	public enum Table_name {
+		/**
+		 * 商城销售订单
+		 */
+		ORDER("order"),
+		/**
+		 * 商城采购订单
+		 */
+		PURCHASE("purchase"),
+		/**
+		 * 商城销售订单的发货单
+		 */
+		ORDER_INVOICE("order_invoice"),
+		/**
+		 * 商城采购订单的发货单
+		 */
+		PURCHASE_INVOICE("purchase_invocie");
+
+		private Table_name(String phrase) {
+			this.phrase = phrase;
+		}
+
+		private String phrase;
+
+		public String value() {
+			return phrase;
+		}
+
+		@Override
+		public String toString() {
+			return phrase;
+		}
+	}
+
+	/**
+	 * 根据订单关键词、订单类型、额外条件搜索订单id信息
+	 * 
+	 * @param keyword
+	 *            模糊搜索关键词,可以是:订单主表单号、订单买方个人姓名、订单买方企业名称、订单买方企业名称、订单明细中的器件型号、
+	 *            器件品牌名称、 器件类目名称
+	 * @param tableName
+	 *            订单类型名称
+	 * @param params
+	 *            额外条件,filter中可以有:买方个人UU号、买方企业UU号、卖方企业UU号、订单日期范围最大值、订单日期最小值
+	 * @return 符合条件的单据。<br>
+	 *         如果关键词命中主表中的信息,结果有主表信息不带从表;<br>
+	 *         如果关键词没命中主表信息,命中了从表的中的信息,结果有主表带被命中的从表信息;<br>
+	 *         如果都没有命中,则不命中。
+	 */
+	public SPage<BaseOrder> getOrderIdsWithDetail(String keyword, Table_name tableName, PageParams params);
+
+}