Browse Source

订单功能

浅川 8 years ago
parent
commit
34a68b8b77

+ 108 - 0
src/main/java/com/goafanti/order/bo/OrderDetailBo.java

@@ -0,0 +1,108 @@
+package com.goafanti.order.bo;
+
+public class OrderDetailBo {
+	/** 订单编号 **/
+	private String orderNo;
+	/** 商品id **/
+	private String commodityId;
+	/** 商品名称 **/
+	private String commodityName;
+	/** 商品单价 **/
+	private String commodityPrice;
+	/** 商品数量 **/
+	private Integer commodityQuantity; 
+	/** 商品型号 **/
+	private String commodityMode;
+	/** 首付金 **/
+	private String firstPayment;
+	/** 订单类型 **/
+	private Integer orderType;
+	/** 订单创建时间 **/
+	private String createTime;
+	/** 订单金额 **/
+	private String orderAmount;
+	/** 订单留言 **/
+	private String orderRemarks;
+	/** 技术类型 **/
+	private Integer technologyType;
+	/** 交意方式 **/
+	private Integer transferMode;
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public String getCommodityId() {
+		return commodityId;
+	}
+	public void setCommodityId(String commodityId) {
+		this.commodityId = commodityId;
+	}
+	public String getCommodityName() {
+		return commodityName;
+	}
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+	public String getCommodityPrice() {
+		return commodityPrice;
+	}
+	public void setCommodityPrice(String commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+	public Integer getCommodityQuantity() {
+		return commodityQuantity;
+	}
+	public void setCommodityQuantity(Integer commodityQuantity) {
+		this.commodityQuantity = commodityQuantity;
+	}
+	public String getCommodityMode() {
+		return commodityMode;
+	}
+	public void setCommodityMode(String commodityMode) {
+		this.commodityMode = commodityMode;
+	}
+	public String getFirstPayment() {
+		return firstPayment;
+	}
+	public void setFirstPayment(String firstPayment) {
+		this.firstPayment = firstPayment;
+	}
+	public Integer getOrderType() {
+		return orderType;
+	}
+	public void setOrderType(Integer orderType) {
+		this.orderType = orderType;
+	}
+	public String getCreateTime() {
+		return createTime;
+	}
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+	public String getOrderAmount() {
+		return orderAmount;
+	}
+	public void setOrderAmount(String orderAmount) {
+		this.orderAmount = orderAmount;
+	}
+	public String getOrderRemarks() {
+		return orderRemarks;
+	}
+	public void setOrderRemarks(String orderRemarks) {
+		this.orderRemarks = orderRemarks;
+	}
+	public Integer getTechnologyType() {
+		return technologyType;
+	}
+	public void setTechnologyType(Integer technologyType) {
+		this.technologyType = technologyType;
+	}
+	public Integer getTransferMode() {
+		return transferMode;
+	}
+	public void setTransferMode(Integer transferMode) {
+		this.transferMode = transferMode;
+	}
+}

+ 5 - 0
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -0,0 +1,5 @@
+package com.goafanti.order.bo;
+
+public class OrderListBo {
+
+}

+ 65 - 0
src/main/java/com/goafanti/order/controller/OrderController.java

@@ -1,12 +1,77 @@
 package com.goafanti.order.controller;
 
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.order.bo.OrderDetailBo;
+
 
 @RestController
 @RequestMapping(value = "/api/user/order")
 public class OrderController extends CertifyApiController{
+	/**
+	 * 进入添加意向订单
+	 * @param commodityId 商品编号
+	 * @param orderType 订单类型
+	 * @return
+	 */
+	@RequestMapping(value = "/toAddIntention" , method = RequestMethod.GET)
+	public Result toAddIntention(String commodityId,Integer orderType){
+		Result res = new Result();
+		return res;
+	}
+	
+	/**
+	 * 添加意向订单
+	 * @param bo
+	 * @param orderChannel
+	 * @return
+	 */
+	@RequestMapping(value = "/addIntention" , method = RequestMethod.POST)
+	public Result addIntention(OrderDetailBo bo,Integer orderChannel) {
+		Result res = new Result();
+		return res;
+	}
+	
+	/**
+	 * 查看订单列表
+	 * @param confirm  我的意向-false 我的订单 - true
+	 * @return
+	 */
+	public Result orderList(boolean confirm) {
+		Result res = new Result();
+		return res;
+	}
+	
+	/**
+	 * 查看订单详情
+	 * @return
+	 */
+	public Result orderDetails(String orderNo) {
+		Result res = new Result();
+		return res;
+	}
+	
+	/**
+	 * 订单支付(首付 or 尾款)
+	 * @param orderId 
+	 * @return
+	 */
+	public Result orderPay(String orderNo,Integer Channel) {
+		Result res = new Result();
+		return res;
+	}
 	
+	/**
+	 * 查询支付流水
+	 * @param orderId
+	 * @return
+	 */
+	public Result payHistory(String orderNo) {
+		Result res = new Result();
+		return res;
+	}
 }

+ 1 - 1
src/main/java/com/goafanti/order/enums/LiquidationSate.java

@@ -17,7 +17,7 @@ public enum LiquidationSate {
 	/** 等待退款 **/
 	WAIT_FOR_REFUND(5,"WAIT_FOR_REFUND"),
 	/** 退款结清 **/
-	REFUND_SETTLE(6,"WAIT_FOR_REFUND"),
+	REFUND_SETTLE(6,"REFUND_SETTLE"),
 	/** 无效 **/
 	INVALID(10, "INVALID");
 	

+ 2 - 2
src/main/java/com/goafanti/order/enums/OrderState.java

@@ -11,9 +11,9 @@ public enum OrderState {
 	/** 等待支付 **/
 	WAIT_FOR_PAY(2,"WAIT_FOR_PAY"),
 	/** 已完成 **/
-	COMPLETED(3,"WAIT_FOR_PAY"),
+	COMPLETED(3,"COMPLETED"),
 	/** 已取消 **/
-	CANCELLED(4,"WAIT_FOR_PAY"),
+	CANCELLED(4,"CANCELLED"),
 	/** 无效 **/
 	INVALID(10, "INVALID");
 	

+ 57 - 0
src/main/java/com/goafanti/order/enums/OrderType.java

@@ -0,0 +1,57 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum OrderType {
+	/** 科技服务 **/
+	TECH_SERVICE(0,"TECH_SERVICE"),
+	/** 科技成果购买 **/
+	ACHIEVEMENT_PURCHASE(1,"ACHIEVEMENT_PURCHASE"),
+	/** 科技需求接单 **/
+	DEMAND_PROVIDE(2,"DEMAND_PROVIDE"),
+	/** 专家邀约  **/
+	EXPERT_INVITATION(3,"EXPERT_INVITATION"),
+	/** 活动报名 **/
+	ACTIVITY_APPLY(4,"ACTIVITY_APPLY"),
+	/** 会员升级 **/
+	MEMBER_UPGRADE(5,"MEMBER_UPGRADE"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	private OrderType(Integer typeCode, String typeName) {
+		this.typeCode = typeCode;
+		this.typeName = typeName;
+	}
+
+	private static Map<Integer, OrderType> types = new HashMap<Integer, OrderType>();
+
+	static {
+		for (OrderType value : OrderType.values()) {
+			types.put(value.getTypeCode(), value);
+		}
+	}
+	public static OrderType getStatus(Integer typeCode) {
+		if (containsType(typeCode)) {
+			return types.get(typeCode);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer typeCode) {
+		return types.containsKey(typeCode);
+	}
+	private Integer	typeCode;
+	private String	typeName;
+	
+	public Integer getTypeCode() {
+		return typeCode;
+	}
+	public void setTypeCode(Integer typeCode) {
+		this.typeCode = typeCode;
+	}
+	public String getTypeName() {
+		return typeName;
+	}
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+}

+ 1 - 1
src/main/java/com/goafanti/order/enums/PaymentState.java

@@ -13,7 +13,7 @@ public enum PaymentState {
 	/** 待退款 **/
 	WAIT_REFUND(3,"WAIT_REFUND"),
 	/** 已退款 **/
-	ALREADY_REFUND(4,"WAIT_REFUND"),
+	ALREADY_REFUND(4,"ALREADY_REFUND"),
 	/** 无效 **/
 	INVALID(10, "INVALID");