Commit 76ab596c7c596adc3a32540db9d2ddd4b3b912b4

Authored by Jiang
1 parent 9db91378

完成订单买家端和卖家端接口

Showing 28 changed files with 1027 additions and 914 deletions
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/Order.java
1 1 package com.diligrp.mobsite.getway.domain.protocol;
2 2  
3   -import io.swagger.annotations.ApiModelProperty;
4   -
5 3 import java.io.Serializable;
6   -import java.util.List;
  4 +import java.util.Date;
  5 +
  6 +import com.b2c.orders.enums.DeliveryType;
  7 +import com.b2c.orders.enums.OrderStatus;
  8 +import com.b2c.orders.enums.PayStatus;
  9 +import com.b2c.orders.enums.PayType;
  10 +import com.fasterxml.jackson.annotation.JsonFormat;
7 11  
8 12 /**
9 13 * <B>Description</B> 订单 <br />
10   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  14 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  15 + * <br />
11 16 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
12 17 * <B>Company</B> 地利集团
13 18 *
14 19 * @createTime 2014年9月1日 下午3:17:28
15 20 * @author zhangshirui
16 21 */
17   -public class Order implements Serializable{
18   -
19   - /**
20   - * 是否已评论,1是,0否
21   - */
22   - public static final int IS_COMMENTED_YES = 1;
23   - /**
24   - * 否:0
25   - */
26   - public static final int IS_COMMENTED_NO = 0;
27   -
  22 +public class Order implements Serializable {
28 23  
29 24 /**
30   - * id,订单编号
  25 + *
31 26 */
32   - @ApiModelProperty(value = "订单id")
33   - private Long orderId;
  27 + private static final long serialVersionUID = 552215083930422779L;
34 28  
  29 + private Long id;
35 30 /**
36   - * 订单状态:(10待接单,15已接单待付款,20待自提,25待送货,30接单已过期,35支付超时,40已拒绝,45已取消,50已完成)
  31 + * 店铺id
37 32 */
38   - @ApiModelProperty(value = "订单状态:(10待接单,15已接单待付款,20待自提,25待送货,30接单已过期,35支付超时,40已拒绝,45已取消,50已完成) ")
39   - private Integer orderState;
40   -
  33 + private Long shopId;
41 34 /**
42   - * 订单状态名称
  35 + * 商家id
43 36 */
44   - @ApiModelProperty(value = "订单状态名称")
45   - private String stateName;
46   -
  37 + private Long sellerId;
47 38 /**
48   - * 支付方式
  39 + * 用户id
49 40 */
50   - @ApiModelProperty(value = "支付方式:10-在线支付,20-线下支付")
51   - private Integer payType;
52   - /**
53   - * 总金额
54   - */
55   - @ApiModelProperty(value = "商品总金额")
56   - private Long totalAmount;
  41 + private Long buyerId;
  42 + /** 配送类型 */
  43 + private Integer deliveryType;
  44 + /** 订单状态 */
  45 + private Integer orderStatus;
  46 + /** 支付状态 */
  47 + private Integer payStatus;
  48 + /** 买家备注说明 */
  49 + private String buyerMemo;
  50 + /** 支付时间 */
  51 + private String payTime;
57 52 /**
58   - * 应付金额
  53 + * 送货时间
59 54 */
60   - @ApiModelProperty(value = "实际支付金额")
61   - private Long realPayAmount;
62   - /**
63   - * 优惠金额
64   - */
65   - @ApiModelProperty(value = "优惠金额")
66   - private Long discountAmount;
67   - /**
68   - * 邮费
69   - */
70   - @ApiModelProperty(value = "运费")
71   - private Long postage;
72   -
73   - /**
74   - * 订单提交日期
75   - */
76   - @ApiModelProperty(value = "订单提交时间")
  55 + private String deliveryTime;
  56 + /** 提货时间 */
  57 + private String reservationTime;
  58 + /** 买家确认收货时间 */
  59 + private String buyerConfirmTime;
  60 + /** 订单提交时间 */
77 61 private String submitTime;
78   -
79   -
80   - @ApiModelProperty(value = "送达时间")
81   - private String arriveTime;
82   -
83   - /**
84   - * 订单详情页最上面
85   - */
86   - @ApiModelProperty(value = "订单详情状态描述")
87   - private String orderDesc;
88   - /**
89   - * 是否评论
90   - */
91   - @ApiModelProperty(value = "是否评论")
92   - private Integer isCommented;
93   -
94   -
95   - /**
96   - * 卖家姓名
97   - */
98   - @ApiModelProperty(value = "卖家姓名")
99   - private String sellerName;
100   - /**
101   - * 卖家电话
102   - */
103   - @ApiModelProperty(value = "卖家电话")
104   - private String sellerMobile;
105   -
106   - /**
107   - * 店铺名称
108   - */
109   - @ApiModelProperty(value = "店铺名")
110   - private String shopName;
111   -
112   - /**
113   - * 订单商品列表
114   - */
115   - @ApiModelProperty(value = "商品列表")
116   - private List<OrderProduct> orderProducts;
117   - /**
118   - * 提货留言
119   - */
120   - @ApiModelProperty(value = "提货备注留言")
121   - private String pickUserMsg;
122   -
123   - /**
124   - * 提货时间
125   - *
126   - */
127   - @ApiModelProperty(value = "提货时间")
128   - private String pickDate;
129   -
130   - /**
131   - * 提货地点
132   - */
133   - @ApiModelProperty(value = "提货地点")
134   - private String pickAddress;
135   -
136   -
137   - /**
138   - * 提货方式名称
139   - */
140   - @ApiModelProperty(value = "配送方式")
141   - private String deliveryName;
142   -
143   -
144   -
  62 + /** 支付类型 */
  63 + private Integer payType;
  64 + /** 总金额 */
  65 + private Long totalPrice;
145 66 /**
146   - * 店铺地址
  67 + * 接单后修改的价格
147 68 */
148   - @ApiModelProperty(value = "店铺地址")
149   - private String shopAddr;
150   -
151   -
152   - public Long getOrderId() {
153   - return orderId;
154   - }
155   -
156   - public void setOrderId(Long orderId) {
157   - this.orderId = orderId;
158   - }
159   -
160   - public Integer getOrderState() {
161   - return orderState;
162   - }
163   -
164   - public void setOrderState(Integer orderState) {
165   - this.orderState = orderState;
166   - }
167   -
168   - public String getStateName() {
169   - return stateName;
170   - }
171   -
172   - public void setStateName(String stateName) {
173   - this.stateName = stateName;
174   - }
175   -
176   - public Integer getPayType() {
177   - return payType;
178   - }
179   -
180   - public void setPayType(Integer payType) {
181   - this.payType = payType;
182   - }
  69 + private Long realTotalPrice;
183 70  
184   - public Long getTotalAmount() {
185   - return totalAmount;
  71 + public Long getId() {
  72 + return id;
186 73 }
187 74  
188   - public void setTotalAmount(Long totalAmount) {
189   - this.totalAmount = totalAmount;
  75 + public void setId(Long id) {
  76 + this.id = id;
190 77 }
191 78  
192   - public Long getRealPayAmount() {
193   - return realPayAmount;
  79 + public Long getShopId() {
  80 + return shopId;
194 81 }
195 82  
196   - public void setRealPayAmount(Long realPayAmount) {
197   - this.realPayAmount = realPayAmount;
  83 + public void setShopId(Long shopId) {
  84 + this.shopId = shopId;
198 85 }
199 86  
200   - public Long getDiscountAmount() {
201   - return discountAmount;
  87 + public Long getSellerId() {
  88 + return sellerId;
202 89 }
203 90  
204   - public void setDiscountAmount(Long discountAmount) {
205   - this.discountAmount = discountAmount;
  91 + public void setSellerId(Long sellerId) {
  92 + this.sellerId = sellerId;
206 93 }
207 94  
208   - public Long getPostage() {
209   - return postage;
  95 + public Long getBuyerId() {
  96 + return buyerId;
210 97 }
211 98  
212   - public void setPostage(Long postage) {
213   - this.postage = postage;
  99 + public void setBuyerId(Long buyerId) {
  100 + this.buyerId = buyerId;
214 101 }
215 102  
216   - public String getSubmitTime() {
217   - return submitTime;
218   - }
219   -
220   - public void setSubmitTime(String submitTime) {
221   - this.submitTime = submitTime;
  103 + public Integer getDeliveryType() {
  104 + return deliveryType;
222 105 }
223 106  
224   - public String getArriveTime() {
225   - return arriveTime;
  107 + public void setDeliveryType(Integer deliveryType) {
  108 + this.deliveryType = deliveryType;
226 109 }
227 110  
228   - public void setArriveTime(String arriveTime) {
229   - this.arriveTime = arriveTime;
  111 + public Integer getOrderStatus() {
  112 + return orderStatus;
230 113 }
231 114  
232   - public String getOrderDesc() {
233   - return orderDesc;
  115 + public void setOrderStatus(Integer orderStatus) {
  116 + this.orderStatus = orderStatus;
234 117 }
235 118  
236   - public void setOrderDesc(String orderDesc) {
237   - this.orderDesc = orderDesc;
  119 + public Integer getPayStatus() {
  120 + return payStatus;
238 121 }
239 122  
240   - public Integer getIsCommented() {
241   - return isCommented;
  123 + public void setPayStatus(Integer payStatus) {
  124 + this.payStatus = payStatus;
242 125 }
243 126  
244   - public void setIsCommented(Integer isCommented) {
245   - this.isCommented = isCommented;
  127 + public String getBuyerMemo() {
  128 + return buyerMemo;
246 129 }
247 130  
248   - public String getSellerName() {
249   - return sellerName;
  131 + public void setBuyerMemo(String buyerMemo) {
  132 + this.buyerMemo = buyerMemo;
250 133 }
251 134  
252   - public void setSellerName(String sellerName) {
253   - this.sellerName = sellerName;
  135 + public String getPayTime() {
  136 + return payTime;
254 137 }
255 138  
256   - public String getSellerMobile() {
257   - return sellerMobile;
  139 + public void setPayTime(String payTime) {
  140 + this.payTime = payTime;
258 141 }
259 142  
260   - public void setSellerMobile(String sellerMobile) {
261   - this.sellerMobile = sellerMobile;
  143 + public String getDeliveryTime() {
  144 + return deliveryTime;
262 145 }
263 146  
264   - public String getShopName() {
265   - return shopName;
  147 + public void setDeliveryTime(String deliveryTime) {
  148 + this.deliveryTime = deliveryTime;
266 149 }
267 150  
268   - public void setShopName(String shopName) {
269   - this.shopName = shopName;
  151 + public String getReservationTime() {
  152 + return reservationTime;
270 153 }
271 154  
272   - public List<OrderProduct> getOrderProducts() {
273   - return orderProducts;
  155 + public void setReservationTime(String reservationTime) {
  156 + this.reservationTime = reservationTime;
274 157 }
275 158  
276   - public void setOrderProducts(List<OrderProduct> orderProducts) {
277   - this.orderProducts = orderProducts;
  159 + public String getBuyerConfirmTime() {
  160 + return buyerConfirmTime;
278 161 }
279 162  
280   - public String getPickUserMsg() {
281   - return pickUserMsg;
  163 + public void setBuyerConfirmTime(String buyerConfirmTime) {
  164 + this.buyerConfirmTime = buyerConfirmTime;
282 165 }
283 166  
284   - public void setPickUserMsg(String pickUserMsg) {
285   - this.pickUserMsg = pickUserMsg;
  167 + public String getSubmitTime() {
  168 + return submitTime;
286 169 }
287 170  
288   -
289   -
290   - public String getPickDate() {
291   - return pickDate;
  171 + public void setSubmitTime(String submitTime) {
  172 + this.submitTime = submitTime;
292 173 }
293 174  
294   - public void setPickDate(String pickDate) {
295   - this.pickDate = pickDate;
  175 + public Integer getPayType() {
  176 + return payType;
296 177 }
297 178  
298   - public String getPickAddress() {
299   - return pickAddress;
  179 + public void setPayType(Integer payType) {
  180 + this.payType = payType;
300 181 }
301 182  
302   - public void setPickAddress(String pickAddress) {
303   - this.pickAddress = pickAddress;
  183 + public Long getTotalPrice() {
  184 + return totalPrice;
304 185 }
305 186  
306   - public String getDeliveryName() {
307   - return deliveryName;
  187 + public void setTotalPrice(Long totalPrice) {
  188 + this.totalPrice = totalPrice;
308 189 }
309 190  
310   - public void setDeliveryName(String deliveryName) {
311   - this.deliveryName = deliveryName;
  191 + public Long getRealTotalPrice() {
  192 + return realTotalPrice;
312 193 }
313 194  
314   - public String getShopAddr() {
315   - return shopAddr;
  195 + public void setRealTotalPrice(Long realTotalPrice) {
  196 + this.realTotalPrice = realTotalPrice;
316 197 }
317 198  
318   - public void setShopAddr(String shopAddr) {
319   - this.shopAddr = shopAddr;
320   - }
321 199 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/OrderItem.java
1 1 package com.diligrp.mobsite.getway.domain.protocol;
2 2  
  3 +import javax.validation.constraints.NotNull;
3 4  
4   -import io.swagger.annotations.ApiModelProperty;
  5 +import io.swagger.annotations.ApiParam;
5 6  
6 7 /**
7 8 * <B>Description</B> 订单具体项<br />
8   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  9 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  10 + * <br />
9 11 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
10 12 * <B>Company</B> 地利集团
  13 + *
11 14 * @createTime 2014年9月19日 上午11:55:57
12   - * @author zhangshirui
  15 + * @author Chris
13 16 */
14 17 public class OrderItem {
15   -
16   - ///**
17   - // * 进货单id
18   - // */
19   - //@ApiModelProperty(value = "购物车id")
20   - //private Long cartId;
21   - /**
22   - * 购买数量
23   - */
24   - @ApiModelProperty(value = "购买数量",required = true)
25   - private Integer amount;
26   - /**
27   - * 价格-单位:分
28   - */
29   - @ApiModelProperty(value = "价格-单位:分",required = true)
30   - private Long price;
31 18  
32   - /**
33   - * 商品sku
34   - */
35   - @ApiModelProperty(value = "sku",required = true)
36   - private String sku;
  19 + @ApiParam("sku编号")
  20 + @NotNull(message = "sku编号不能为空")
  21 + private String sku;
  22 + @ApiParam("购买数量")
  23 + @NotNull(message = "购买数量不能为空")
  24 + private Integer amount;
37 25  
38   - /**
39   - * 商品id
40   - * */
41   - @ApiModelProperty(value = "商品id",required = true)
42   - private Long productId;
  26 + public String getSku() {
  27 + return sku;
  28 + }
43 29  
  30 + public void setSku(String sku) {
  31 + this.sku = sku;
  32 + }
44 33  
45   - public Integer getAmount() {
46   - return amount;
47   - }
  34 + public Integer getAmount() {
  35 + return amount;
  36 + }
48 37  
49   - public void setAmount(Integer amount) {
50   - this.amount = amount;
51   - }
52   -
53   - public Long getProductId() {
54   - return productId;
55   - }
56   -
57   - public void setProductId(Long productId) {
58   - this.productId = productId;
59   - }
60   -
61   - public String getSku() {
62   - return sku;
63   - }
64   -
65   - public void setSku(String sku) {
66   - this.sku = sku;
67   - }
68   -
69   - public Long getPrice() {
70   - return price;
71   - }
72   -
73   - public void setPrice(Long price) {
74   - this.price = price;
75   - }
  38 + public void setAmount(Integer amount) {
  39 + this.amount = amount;
  40 + }
76 41 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/BuyerCancelOrderReq.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.order;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +public class BuyerCancelOrderReq extends BaseReq {
  8 +
  9 + /**
  10 + *
  11 + */
  12 + private static final long serialVersionUID = -1108479005816375698L;
  13 +
  14 + @ApiModelProperty("订单id")
  15 + private Long orderId;
  16 + @ApiModelProperty("买家id")
  17 + private Long shopBuyerId;
  18 +
  19 + public Long getOrderId() {
  20 + return orderId;
  21 + }
  22 +
  23 + public void setOrderId(Long orderId) {
  24 + this.orderId = orderId;
  25 + }
  26 +
  27 + public Long getShopBuyerId() {
  28 + return shopBuyerId;
  29 + }
  30 +
  31 + public void setShopBuyerId(Long shopBuyerId) {
  32 + this.shopBuyerId = shopBuyerId;
  33 + }
  34 +
  35 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/BuyerCancelOrderResp.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.order;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  4 +
  5 +public class BuyerCancelOrderResp extends BaseResp {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = -3717184844982266363L;
  11 +
  12 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/BuyerConfirmReceiptReq.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.order;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +public class BuyerConfirmReceiptReq extends BaseReq {
  8 +
  9 + /**
  10 + *
  11 + */
  12 + private static final long serialVersionUID = -7578114562110271763L;
  13 +
  14 + @ApiModelProperty("订单id")
  15 + private Long orderId;
  16 + @ApiModelProperty("买家id")
  17 + private Long buyerId;
  18 +
  19 + public Long getOrderId() {
  20 + return orderId;
  21 + }
  22 +
  23 + public void setOrderId(Long orderId) {
  24 + this.orderId = orderId;
  25 + }
  26 +
  27 + public Long getBuyerId() {
  28 + return buyerId;
  29 + }
  30 +
  31 + public void setBuyerId(Long buyerId) {
  32 + this.buyerId = buyerId;
  33 + }
  34 +
  35 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/BuyerConfirmReceiptResp.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.order;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  4 +
  5 +public class BuyerConfirmReceiptResp extends BaseResp {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 2818352073956139966L;
  11 +
  12 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/PayOrderReq.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.order;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
  4 +
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +public class PayOrderReq extends BaseReq {
  8 +
  9 + /**
  10 + *
  11 + */
  12 + private static final long serialVersionUID = 4349767161975527606L;
  13 +
  14 + @ApiModelProperty("订单id")
  15 + private Long orderId;
  16 + @ApiModelProperty("支付类型,10线上支付,20线下支付")
  17 + private Integer payType;
  18 +
  19 + public Long getOrderId() {
  20 + return orderId;
  21 + }
  22 +
  23 + public void setOrderId(Long orderId) {
  24 + this.orderId = orderId;
  25 + }
  26 +
  27 + public Integer getPayType() {
  28 + return payType;
  29 + }
  30 +
  31 + public void setPayType(Integer payType) {
  32 + this.payType = payType;
  33 + }
  34 +
  35 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/PayOrderResp.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.domain.protocol.order;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  4 +
  5 +public class PayOrderResp extends BaseResp {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 1075044637572228252L;
  11 +
  12 +}
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/SubmitOrderReq.java
1 1 package com.diligrp.mobsite.getway.domain.protocol.order;
2 2  
  3 +import java.util.List;
  4 +
3 5 import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
4   -import com.diligrp.mobsite.getway.domain.protocol.ConsigneeInfo;
5   -import com.diligrp.mobsite.getway.domain.protocol.order.model.OrderShopInfo;
6   -import io.swagger.annotations.ApiModelProperty;
  6 +import com.diligrp.mobsite.getway.domain.protocol.OrderItem;
7 7  
8   -import javax.validation.Valid;
9   -import javax.validation.constraints.NotNull;
10   -import java.util.List;
  8 +import io.swagger.annotations.ApiModelProperty;
11 9  
12 10 /**
13 11 * <B>Description</B> 提交订单请求 <br />
14   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  12 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  13 + * <br />
15 14 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
16 15 * <B>Company</B> 地利集团
  16 + *
17 17 * @createTime 2014年9月1日 下午5:47:53
18 18 * @author zhangshirui
19 19 */
20   -@SuppressWarnings("serial")
21 20 public class SubmitOrderReq extends BaseReq {
22   -
23   - /**
24   - * 提货人信息
25   - */
26   - @Valid @NotNull(message = "联系人不能为空")
27   - @ApiModelProperty(value = "收货人信息",required = true)
28   - private ConsigneeInfo consigneeInfo;
29   -
30 21  
31 22 /**
32   - * 支付方式:10线上付款,20线下付款
33   - */
34   - @NotNull(message = "支付方式不能为空")
35   - @ApiModelProperty(value = "支付方式:10线上付款,20线下付款",required = true)
36   - private Integer payType;
37   - /**
38   - * 送货方式:10:自提,20:送货上门
39   - */
40   - @NotNull(message = "送货方式不能为空")
41   - @ApiModelProperty(value = "送货方式:10自提、20送货上门",required = true)
42   - private Integer deliveryType;
43   -
44   - @ApiModelProperty(value = "送达时间" )
45   - private String arriveTime;
46   -
47   - @ApiModelProperty(value = "提货时间" )
48   - private String reservationTime;
49   -
50   - @ApiModelProperty(value = "市场id" )
51   - private Long marketId;
52   -
53   - /**
54   - * 买家留言
55   - */
56   - @ApiModelProperty(value = "买家留言")
57   - private String remark;
58   -
59   - /**
60   - * 邮费
61   - */
62   - @ApiModelProperty(value = "邮费")
63   - private Long postage = 0L;
64   -
65   - /**
66   - * 店铺商品信息
67   - */
68   - @Valid @NotNull(message = "商品不能为空")
69   - @ApiModelProperty(value = "商品列表")
70   - private List<OrderShopInfo> orderShopInfos;
71   -
72   -
73   - public ConsigneeInfo getConsigneeInfo() {
74   - return consigneeInfo;
75   - }
76   -
77   - public void setConsigneeInfo(ConsigneeInfo consigneeInfo) {
78   - this.consigneeInfo = consigneeInfo;
79   - }
80   -
81   - public Integer getPayType() {
82   - return payType;
83   - }
84   -
85   - public void setPayType(Integer payType) {
86   - this.payType = payType;
87   - }
88   -
89   - public Integer getDeliveryType() {
90   - return deliveryType;
91   - }
92   -
93   - public void setDeliveryType(Integer deliveryType) {
94   - this.deliveryType = deliveryType;
95   - }
96   -
97   - public String getArriveTime() {
98   - return arriveTime;
99   - }
100   -
101   - public void setArriveTime(String arriveTime) {
102   - this.arriveTime = arriveTime;
103   - }
104   -
105   - public String getReservationTime() {
106   - return reservationTime;
107   - }
108   -
109   - public void setReservationTime(String reservationTime) {
110   - this.reservationTime = reservationTime;
111   - }
112   -
113   - public Long getMarketId() {
114   - return marketId;
115   - }
116   -
117   - public void setMarketId(Long marketId) {
118   - this.marketId = marketId;
119   - }
120   -
121   - public String getRemark() {
122   - return remark;
123   - }
124   -
125   - public void setRemark(String remark) {
126   - this.remark = remark;
127   - }
128   -
129   - public Long getPostage() {
130   - return postage;
131   - }
132   -
133   - public void setPostage(Long postage) {
134   - this.postage = postage;
135   - }
136   -
137   - public List<OrderShopInfo> getOrderShopInfos() {
138   - return orderShopInfos;
139   - }
140   -
141   - public void setOrderShopInfos(List<OrderShopInfo> orderShopInfos) {
142   - this.orderShopInfos = orderShopInfos;
143   - }
  23 + *
  24 + */
  25 + private static final long serialVersionUID = 7543262727665130065L;
  26 +
  27 + @ApiModelProperty(value = "买家绑定店铺的id")
  28 + private Long shopBuyerId;
  29 + @ApiModelProperty(value = "市场id", required = true)
  30 + private Long marketId;
  31 + @ApiModelProperty(value = "配送类型", required = true)
  32 + private Integer deliveryType;
  33 + @ApiModelProperty(value = "买家备注说明", required = true)
  34 + private String buyerMemo;
  35 + @ApiModelProperty(value = "送货时间")
  36 + private String deliveryTime;
  37 + @ApiModelProperty("收货人姓名")
  38 + private String receiverName;
  39 + @ApiModelProperty("送货地址")
  40 + private String deliveryAddress;
  41 + @ApiModelProperty("收货人电话")
  42 + private String receiverPhoneNumber;
  43 + @ApiModelProperty(value = "提货时间")
  44 + private String reservationTime;
  45 + @ApiModelProperty(value = "订单项", required = true)
  46 + private List<OrderItem> orderItems;
  47 +
  48 + public Long getShopBuyerId() {
  49 + return shopBuyerId;
  50 + }
  51 +
  52 + public void setShopBuyerId(Long shopBuyerId) {
  53 + this.shopBuyerId = shopBuyerId;
  54 + }
  55 +
  56 + public Long getMarketId() {
  57 + return marketId;
  58 + }
  59 +
  60 + public void setMarketId(Long marketId) {
  61 + this.marketId = marketId;
  62 + }
  63 +
  64 + public Integer getDeliveryType() {
  65 + return deliveryType;
  66 + }
  67 +
  68 + public void setDeliveryType(Integer deliveryType) {
  69 + this.deliveryType = deliveryType;
  70 + }
  71 +
  72 + public String getBuyerMemo() {
  73 + return buyerMemo;
  74 + }
  75 +
  76 + public void setBuyerMemo(String buyerMemo) {
  77 + this.buyerMemo = buyerMemo;
  78 + }
  79 +
  80 + public String getDeliveryTime() {
  81 + return deliveryTime;
  82 + }
  83 +
  84 + public void setDeliveryTime(String deliveryTime) {
  85 + this.deliveryTime = deliveryTime;
  86 + }
  87 +
  88 + public String getReceiverName() {
  89 + return receiverName;
  90 + }
  91 +
  92 + public void setReceiverName(String receiverName) {
  93 + this.receiverName = receiverName;
  94 + }
  95 +
  96 + public String getDeliveryAddress() {
  97 + return deliveryAddress;
  98 + }
  99 +
  100 + public void setDeliveryAddress(String deliveryAddress) {
  101 + this.deliveryAddress = deliveryAddress;
  102 + }
  103 +
  104 + public String getReceiverPhoneNumber() {
  105 + return receiverPhoneNumber;
  106 + }
  107 +
  108 + public void setReceiverPhoneNumber(String receiverPhoneNumber) {
  109 + this.receiverPhoneNumber = receiverPhoneNumber;
  110 + }
  111 +
  112 + public String getReservationTime() {
  113 + return reservationTime;
  114 + }
  115 +
  116 + public void setReservationTime(String reservationTime) {
  117 + this.reservationTime = reservationTime;
  118 + }
  119 +
  120 + public List<OrderItem> getOrderItems() {
  121 + return orderItems;
  122 + }
  123 +
  124 + public void setOrderItems(List<OrderItem> orderItems) {
  125 + this.orderItems = orderItems;
  126 + }
144 127 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/SubmitOrderResp.java
... ... @@ -6,70 +6,31 @@ import io.swagger.annotations.ApiModelProperty;
6 6  
7 7 import java.util.List;
8 8  
9   -
10 9 /**
11 10 * <B>Description</B> 提交订单响应 <br />
12   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  11 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  12 + * <br />
13 13 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
14 14 * <B>Company</B> 地利集团
  15 + *
15 16 * @createTime 2014年9月1日 下午5:48:14
16 17 * @author zhangshirui
17 18 */
18   -@SuppressWarnings("serial")
19 19 public class SubmitOrderResp extends BaseResp {
20   -
21   - /**
22   - * 订单号
23   - */
24   - @ApiModelProperty(value = "订单信息")
25   - private List<OrderSumInfo> orderInfos;
26   -
27   - /**
28   - * 提交成功描述
29   - */
30   - @ApiModelProperty(value = "提交结果描述")
31   - private String description;
32   - /**
33   - * 总金额
34   - */
35   - @ApiModelProperty(value = "总金额")
36   - private Long totalPrice;
37   -
38   -
39   -
40   -
41   -
42   - public List<OrderSumInfo> getOrderInfos() {
43   - return orderInfos;
44   - }
45   -
46   -
47   - public void setOrderInfos(List<OrderSumInfo> orderInfos) {
48   - this.orderInfos = orderInfos;
49   - }
50   -
51   -
52   - public String getDescription() {
53   - return description;
54   - }
55   -
56   -
57   - public void setDescription(String description) {
58   - this.description = description;
59   - }
60   -
61   -
62   -
63   - public Long getTotalPrice() {
64   - return totalPrice;
65   - }
66   -
67 20  
68   -
69   - public void setTotalPrice(Long totalPrice) {
70   - this.totalPrice = totalPrice;
71   - }
  21 + /**
  22 + *
  23 + */
  24 + private static final long serialVersionUID = 7702524427180927511L;
  25 +
  26 + private Long orderId;
72 27  
  28 + public Long getOrderId() {
  29 + return orderId;
  30 + }
73 31  
  32 + public void setOrderId(Long orderId) {
  33 + this.orderId = orderId;
  34 + }
74 35  
75 36 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/saler/order/SearchOrderListReq.java
... ... @@ -5,19 +5,18 @@ import io.swagger.annotations.ApiModelProperty;
5 5  
6 6 public class SearchOrderListReq extends BaseListReq {
7 7  
8   -
9 8 /**
10 9 * 订单状态
11 10 */
12 11 @ApiModelProperty(value = "搜索关键字:订单号等 ")
13   - private Integer keyword;
14   -
  12 + private String keyword;
15 13  
16   - public Integer getKeyword() {
  14 + public String getKeyword() {
17 15 return keyword;
18 16 }
19 17  
20   - public void setKeyword(Integer keyword) {
  18 + public void setKeyword(String keyword) {
21 19 this.keyword = keyword;
22 20 }
  21 +
23 22 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/saler/order/model/SellerOrder.java
1 1 package com.diligrp.mobsite.getway.domain.protocol.saler.order.model;
2 2  
3   -import com.diligrp.mobsite.getway.domain.protocol.ConsigneeInfo;
4 3 import com.diligrp.mobsite.getway.domain.protocol.Order;
5   -import io.swagger.annotations.ApiModelProperty;
6 4  
7 5 /**
8 6 * Created by david on 2015/4/16.
9 7 */
10 8 public class SellerOrder extends Order {
11 9  
  10 + /**
  11 + *
  12 + */
  13 + private static final long serialVersionUID = 4271243184715004188L;
12 14  
13 15 /**
14   - * 提货人信息
  16 + * 收货人姓名
15 17 */
16   - @ApiModelProperty(value = "收货人信息")
17   - private ConsigneeInfo consigneeInfo;
  18 + private String receiverName;
  19 + /**
  20 + * 收货人电话
  21 + */
  22 + private String receiverPhoneNumber;
18 23  
19   - public ConsigneeInfo getConsigneeInfo() {
20   - return consigneeInfo;
  24 + public String getReceiverName() {
  25 + return receiverName;
21 26 }
22 27  
23   - public void setConsigneeInfo(ConsigneeInfo consigneeInfo) {
24   - this.consigneeInfo = consigneeInfo;
  28 + public void setReceiverName(String receiverName) {
  29 + this.receiverName = receiverName;
25 30 }
  31 +
  32 + public String getReceiverPhoneNumber() {
  33 + return receiverPhoneNumber;
  34 + }
  35 +
  36 + public void setReceiverPhoneNumber(String receiverPhoneNumber) {
  37 + this.receiverPhoneNumber = receiverPhoneNumber;
  38 + }
  39 +
26 40 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/saler/order/takeOrderReq.java
... ... @@ -4,7 +4,12 @@ import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
4 4 import io.swagger.annotations.ApiModelProperty;
5 5  
6 6 public class takeOrderReq extends BaseReq {
7   - /***
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 3768912856291424399L;
  11 +
  12 + /***
8 13 * 订单id
9 14 * */
10 15 @ApiModelProperty(value = "订单id",required = true)
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/buyer/BuyerOrderRPCService.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.rpc.buyer;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderReq;
  4 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderResp;
  5 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptReq;
  6 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptResp;
  7 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderReq;
  8 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderResp;
  9 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  10 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  11 +
  12 +public interface BuyerOrderRPCService {
  13 +
  14 + SubmitOrderResp submit(SubmitOrderReq req);
  15 +
  16 + PayOrderResp pay(PayOrderReq req);
  17 +
  18 + BuyerConfirmReceiptResp confirmReceipt(BuyerConfirmReceiptReq req);
  19 +
  20 + BuyerCancelOrderResp cancel(BuyerCancelOrderReq req);
  21 +
  22 +}
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/buyer/OrderRPC.java deleted 100644 → 0
1   -package com.diligrp.mobsite.getway.rpc.buyer;
2   -
3   -import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
4   -import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
5   -import com.diligrp.mobsite.getway.domain.protocol.ProductAppraise;
6   -import com.diligrp.titan.sdk.output.PageOutput;
7   -
8   -import java.util.List;
9   -
10   -
11   -/**
12   - * <B>Description</B> 订单 <br />
13   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
14   - * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
15   - * <B>Company</B> 地利集团
16   - * @createTime 2014年9月1日 下午6:30:54
17   - * @author zhangshirui
18   - */
19   -public interface OrderRPC {
20   -
21   - /**
22   - * 获取订单列表
23   - * @param input
24   - * @param userId
25   - * @return
26   - * @createTime 2014年9月2日 下午2:36:47
27   - * @author zhangshirui
28   - */
29   - PageOutput<List<OrderListResponseDto>> getOrders(OrderListRequestDto input, Long userId);
30   -
31   - /**
32   - * 根据id查询订单详情
33   - * @param orderId
34   - * @param userId
35   - * @createTime 2014年9月3日 上午11:08:03
36   - * @author zhangshirui
37   - * @return
38   - */
39   - OrderListResponseDto getOrderById(Long orderId, Long userId);
40   -
41   - /**
42   - * 取消订单
43   - * @param orderId
44   - * @param reason
45   - * @param userId
46   - * @return
47   - * @createTime 2014年9月3日 上午11:27:08
48   - * @author zhangshirui
49   - */
50   - Integer cancelOrder(Long orderId, String reason, Long userId);
51   -
52   -
53   - /**
54   - * 确认提货
55   - * @param orderId
56   - * @param userId
57   - * @return
58   - * @createTime 2014年9月3日 下午4:46:26
59   - * @author zhangshirui
60   - */
61   - Integer confirmPickUp(Long orderId, String paytoken, Long userId);
62   -
63   -
64   -
65   -
66   - /**
67   - * 发布商品评价
68   - * @param productAppraises
69   - * @param userId
70   - */
71   - void addComment(List<ProductAppraise> productAppraises, Long orderId, Long userId);
72   -
73   -
74   -
75   -
76   -}
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/buyer/impl/BuyerOrderRPCServiceBean.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.rpc.buyer.impl;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +import javax.annotation.Resource;
  7 +
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import com.b2c.orders.domain.client.dto.request.BuyerCancelRequestDto;
  11 +import com.b2c.orders.domain.client.dto.request.BuyerConfirmRequestDto;
  12 +import com.b2c.orders.domain.client.dto.request.OrderItemDto;
  13 +import com.b2c.orders.domain.client.dto.request.PayOrderRequestDto;
  14 +import com.b2c.orders.domain.client.dto.request.SubmitOrderRequestDto;
  15 +import com.b2c.orders.domain.client.dto.response.ApiDataResponse;
  16 +import com.b2c.orders.domain.client.dto.response.ApiResponse;
  17 +import com.b2c.orders.domain.client.dto.response.SubmitOrderResponseDto;
  18 +import com.b2c.orders.domain.client.service.OrderService;
  19 +import com.diligrp.mobsite.getway.domain.common.ResultCode;
  20 +import com.diligrp.mobsite.getway.domain.protocol.OrderItem;
  21 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderReq;
  22 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderResp;
  23 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptReq;
  24 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptResp;
  25 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderReq;
  26 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderResp;
  27 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  28 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  29 +import com.diligrp.mobsite.getway.rpc.buyer.BuyerOrderRPCService;
  30 +
  31 +@Service
  32 +public class BuyerOrderRPCServiceBean implements BuyerOrderRPCService {
  33 +
  34 + @Resource
  35 + private OrderService orderService;
  36 +
  37 + @Override
  38 + public SubmitOrderResp submit(SubmitOrderReq req) {
  39 + SubmitOrderResp resp = new SubmitOrderResp();
  40 + SubmitOrderRequestDto request = new SubmitOrderRequestDto();
  41 + request.setBuyerMemo(req.getBuyerMemo());
  42 + request.setDeliveryAddress(req.getDeliveryAddress());
  43 + request.setDeliveryTime(req.getDeliveryTime());
  44 + request.setDeliveryType(req.getDeliveryType());
  45 + request.setMarketId(req.getMarketId());
  46 + List<OrderItemDto> orderItems = new ArrayList<>(req.getOrderItems().size());
  47 + for (OrderItem item : req.getOrderItems()) {
  48 + OrderItemDto dto = new OrderItemDto();
  49 + dto.setAmount(item.getAmount());
  50 + dto.setSku(item.getSku());
  51 + orderItems.add(dto);
  52 + }
  53 + request.setOrderItems(orderItems);
  54 + request.setReceiverName(req.getReceiverName());
  55 + request.setReceiverPhoneNumber(req.getReceiverPhoneNumber());
  56 + request.setReservationTime(req.getReservationTime());
  57 + request.setShopBuyerId(req.getShopBuyerId());
  58 + ApiDataResponse<SubmitOrderResponseDto> response = this.orderService.submit(request);
  59 + if (response == null) {
  60 + resp.setCode(ResultCode.NETWORK_FAILED);
  61 + return resp;
  62 + }
  63 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  64 + resp.setCode(ResultCode.SUCCESS);
  65 + SubmitOrderResponseDto data = response.getData();
  66 + resp.setOrderId(data.getOrderId());
  67 + } else {
  68 + resp.setCode(ResultCode.BUSINESS_FAILED);
  69 + }
  70 + resp.setMsg(response.getMessage());
  71 + return resp;
  72 + }
  73 +
  74 + @Override
  75 + public PayOrderResp pay(PayOrderReq req) {
  76 + PayOrderResp resp = new PayOrderResp();
  77 + PayOrderRequestDto request = new PayOrderRequestDto();
  78 + request.setOrderId(req.getOrderId());
  79 + request.setPayType(req.getPayType());
  80 + ApiResponse response = this.orderService.pay(request);
  81 + if (response == null) {
  82 + resp.setCode(ResultCode.NETWORK_FAILED);
  83 + return resp;
  84 + }
  85 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  86 + resp.setCode(ResultCode.SUCCESS);
  87 + } else {
  88 + resp.setCode(ResultCode.BUSINESS_FAILED);
  89 + }
  90 + resp.setMsg(response.getMessage());
  91 + return resp;
  92 + }
  93 +
  94 + @Override
  95 + public BuyerConfirmReceiptResp confirmReceipt(BuyerConfirmReceiptReq req) {
  96 + BuyerConfirmReceiptResp resp = new BuyerConfirmReceiptResp();
  97 + BuyerConfirmRequestDto request = new BuyerConfirmRequestDto();
  98 + request.setOrderId(req.getOrderId());
  99 + ApiResponse response = this.orderService.buyerConfirm(request);
  100 + if (response == null) {
  101 + resp.setCode(ResultCode.NETWORK_FAILED);
  102 + return resp;
  103 + }
  104 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  105 + resp.setCode(ResultCode.SUCCESS);
  106 + } else {
  107 + resp.setCode(ResultCode.BUSINESS_FAILED);
  108 + }
  109 + resp.setMsg(response.getMessage());
  110 + return resp;
  111 + }
  112 +
  113 + @Override
  114 + public BuyerCancelOrderResp cancel(BuyerCancelOrderReq req) {
  115 + BuyerCancelOrderResp resp = new BuyerCancelOrderResp();
  116 + BuyerCancelRequestDto request = new BuyerCancelRequestDto();
  117 + request.setOrderId(req.getOrderId());
  118 + request.setShopBuyerId(req.getShopBuyerId());
  119 + ApiResponse response = this.orderService.cancel(request);
  120 + if (response == null) {
  121 + resp.setCode(ResultCode.NETWORK_FAILED);
  122 + return resp;
  123 + }
  124 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  125 + resp.setCode(ResultCode.SUCCESS);
  126 + } else {
  127 + resp.setCode(ResultCode.BUSINESS_FAILED);
  128 + }
  129 + resp.setMsg(response.getMessage());
  130 + return resp;
  131 + }
  132 +
  133 +}
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/buyer/impl/OrderRPCImpl.java deleted 100644 → 0
1   -package com.diligrp.mobsite.getway.rpc.buyer.impl;
2   -
3   -import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
4   -import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
5   -import com.diligrp.mobsite.getway.domain.protocol.ProductAppraise;
6   -import com.diligrp.mobsite.getway.rpc.buyer.OrderRPC;
7   -import com.diligrp.titan.sdk.output.PageOutput;
8   -import org.slf4j.Logger;
9   -import org.slf4j.LoggerFactory;
10   -import org.springframework.stereotype.Service;
11   -
12   -import java.util.List;
13   -
14   -
15   -/**
16   - * <B>Description</B> 订单rpc <br />
17   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
18   - * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
19   - * <B>Company</B> 地利集团
20   - *
21   - * @author zhangshirui
22   - * @createTime 2014年9月1日 下午6:31:13
23   - */
24   -@Service("orderRPC")
25   -public class OrderRPCImpl implements OrderRPC {
26   -
27   - public static final long ORDER_USER_TYPE_BUYER = 10L;
28   - public static final long ORDER_USER_TYPE_SELLER = 20L;
29   -
30   - private static final Logger logger = LoggerFactory.getLogger(OrderRPCImpl.class);
31   -
32   -
33   - @Override
34   - public PageOutput<List<OrderListResponseDto>> getOrders(OrderListRequestDto input, Long userId) {
35   - return null;
36   - }
37   -
38   - @Override
39   - public OrderListResponseDto getOrderById(Long orderId, Long userId) {
40   - return null;
41   - }
42   -
43   - @Override
44   - public Integer cancelOrder(Long orderId, String reason, Long userId) {
45   - return null;
46   - }
47   -
48   - @Override
49   - public Integer confirmPickUp(Long orderId, String paytoken, Long userId) {
50   - return null;
51   - }
52   -
53   - @Override
54   - public void addComment(List<ProductAppraise> productAppraises, Long orderId, Long userId) {
55   -
56   - }
57   -}
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/seller/SellerOrderRPC.java
1 1 package com.diligrp.mobsite.getway.rpc.seller;
2 2  
  3 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  4 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyReq;
  5 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyResp;
  6 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailReq;
  7 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
  8 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListReq;
  9 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListResp;
  10 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteReq;
  11 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteResp;
  12 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
  13 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
  14 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.takeOrderReq;
  15 +
3 16 /**
4 17 * <B>Description</B> 订单 <br />
5   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  18 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  19 + * <br />
6 20 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
7 21 * <B>Company</B> 地利集团
  22 + *
8 23 * @createTime 2014年9月1日 下午6:30:54
9 24 * @author duanyugen
10 25 */
11 26 public interface SellerOrderRPC {
12 27  
13   - }
  28 + GetOrderListResp getOrders(GetOrderListReq req);
  29 +
  30 + GetOrderDetailResp getOrderById(GetOrderDetailReq req);
  31 +
  32 + SearchOrderListResp searchOrders(SearchOrderListReq req);
  33 +
  34 + ConfirmReceiptMoneyResp comfirmReceiveMoney(ConfirmReceiptMoneyReq req);
  35 +
  36 + BaseResp takeOrder(takeOrderReq req);
  37 +
  38 + RefuseQuoteResp refuseOrder(RefuseQuoteReq req);
  39 +
  40 +}
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/seller/impl/SellerOrderRPCImpl.java
1 1 package com.diligrp.mobsite.getway.rpc.seller.impl;
2 2  
3   -import com.diligrp.mobsite.getway.rpc.seller.SellerOrderRPC;
  3 +import java.text.DateFormat;
  4 +import java.text.SimpleDateFormat;
  5 +import java.util.ArrayList;
  6 +import java.util.List;
  7 +
  8 +import javax.annotation.Resource;
  9 +
4 10 import org.springframework.stereotype.Service;
  11 +import org.springframework.util.CollectionUtils;
5 12  
  13 +import com.b2c.orders.domain.client.dto.request.OrderDetailRequestDto;
  14 +import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
  15 +import com.b2c.orders.domain.client.dto.request.SellerConfirmRequestDto;
  16 +import com.b2c.orders.domain.client.dto.request.SellerRefuseRequestDto;
  17 +import com.b2c.orders.domain.client.dto.request.TakeOrderRequestDto;
  18 +import com.b2c.orders.domain.client.dto.response.ApiDataResponse;
  19 +import com.b2c.orders.domain.client.dto.response.ApiPageDataResponse;
  20 +import com.b2c.orders.domain.client.dto.response.ApiResponse;
  21 +import com.b2c.orders.domain.client.dto.response.OrderDetailResponseDto;
  22 +import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
  23 +import com.b2c.orders.domain.client.service.OrderService;
  24 +import com.diligrp.mobsite.getway.domain.common.ResultCode;
  25 +import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  26 +import com.diligrp.mobsite.getway.domain.protocol.Order;
  27 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyReq;
  28 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyResp;
  29 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailReq;
  30 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
  31 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListReq;
  32 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListResp;
  33 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteReq;
  34 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteResp;
  35 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
  36 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
  37 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.takeOrderReq;
  38 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.model.SellerOrder;
  39 +import com.diligrp.mobsite.getway.rpc.seller.SellerOrderRPC;
6 40  
7 41 /**
8 42 * <B>Description</B> 订单rpc <br />
9   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  43 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  44 + * <br />
10 45 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
11 46 * <B>Company</B> 地利集团
12 47 *
... ... @@ -15,6 +50,174 @@ import org.springframework.stereotype.Service;
15 50 */
16 51 @Service("sellerOrderRPC")
17 52 public class SellerOrderRPCImpl implements SellerOrderRPC {
18   -
  53 +
  54 + @Resource
  55 + private OrderService orderService;
  56 +
  57 + @Override
  58 + public GetOrderListResp getOrders(GetOrderListReq req) {
  59 + OrderListRequestDto request = new OrderListRequestDto();
  60 + ApiPageDataResponse<OrderListResponseDto> response = this.orderService.list(request);
  61 + GetOrderListResp resp = new GetOrderListResp();
  62 + if (response == null) {
  63 + resp.setCode(ResultCode.NETWORK_FAILED);
  64 + return resp;
  65 + }
  66 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  67 + resp.setCode(ResultCode.SUCCESS);
  68 + resp.setMaxPageNum(response.getTotalPage());
  69 + if (!CollectionUtils.isEmpty(response.getList())) {
  70 + List<Order> orders = new ArrayList<>(response.getList().size());
  71 + for (OrderListResponseDto dto : response.getList()) {
  72 + orders.add(this.convertToOrder(dto));
  73 + }
  74 + resp.setOrders(orders);
  75 + }
  76 + } else {
  77 + resp.setCode(ResultCode.BUSINESS_FAILED);
  78 + }
  79 + resp.setMsg(response.getMessage());
  80 + return resp;
  81 + }
  82 +
  83 + private Order convertToOrder(OrderListResponseDto dto) {
  84 + Order order = new Order();
  85 + order.setBuyerConfirmTime(dto.getBuyerConfirmTime());
  86 + order.setBuyerId(dto.getBuyerId());
  87 + order.setBuyerMemo(dto.getBuyerMemo());
  88 + order.setDeliveryTime(dto.getDeliveryTime());
  89 + order.setDeliveryType(dto.getDeliveryType());
  90 + order.setId(dto.getId());
  91 + order.setOrderStatus(dto.getOrderStatus());
  92 + order.setPayStatus(dto.getPayStatus());
  93 + order.setPayTime(dto.getPayTime());
  94 + order.setPayType(dto.getPayType());
  95 + order.setRealTotalPrice(dto.getRealTotalPrice());
  96 + order.setReservationTime(dto.getReservationTime());
  97 + order.setSellerId(dto.getSellerId());
  98 + order.setShopId(dto.getShopId());
  99 + order.setSubmitTime(dto.getSubmitTime());
  100 + order.setTotalPrice(dto.getTotalPrice());
  101 + return order;
  102 + }
  103 +
  104 + @Override
  105 + public GetOrderDetailResp getOrderById(GetOrderDetailReq req) {
  106 + OrderDetailRequestDto request = new OrderDetailRequestDto();
  107 + request.setOrderId(req.getOrderId());
  108 + ApiDataResponse<OrderDetailResponseDto> response = this.orderService.detail(request);
  109 + GetOrderDetailResp resp = new GetOrderDetailResp();
  110 + if (response == null) {
  111 + resp.setCode(ResultCode.NETWORK_FAILED);
  112 + return resp;
  113 + }
  114 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  115 + resp.setCode(ResultCode.SUCCESS);
  116 + SellerOrder order = new SellerOrder();
  117 + DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  118 + OrderDetailResponseDto dto = response.getData();
  119 + order.setBuyerMemo(dto.getBuyerMemo());
  120 + if (dto.getDeliveryTime() != null) {
  121 + order.setDeliveryTime(df.format(dto.getDeliveryTime()));
  122 + }
  123 + order.setDeliveryType(dto.getDeliveryType());
  124 + order.setId(dto.getId());
  125 + order.setOrderStatus(dto.getOrderStatus());
  126 + order.setPayStatus(dto.getPayStatus());
  127 + order.setPayType(dto.getPayType());
  128 + order.setRealTotalPrice(dto.getRealTotalPrice());
  129 + order.setReservationTime(dto.getReservationTime());
  130 + order.setSubmitTime(df.format(dto.getSubmitTime()));
  131 + order.setTotalPrice(dto.getTotalPrice());
  132 + } else {
  133 + resp.setCode(ResultCode.BUSINESS_FAILED);
  134 + }
  135 + resp.setMsg(response.getMessage());
  136 + return resp;
  137 + }
  138 +
  139 + @Override
  140 + public SearchOrderListResp searchOrders(SearchOrderListReq req) {
  141 + SearchOrderListResp resp = new SearchOrderListResp();
  142 + OrderListRequestDto request = new OrderListRequestDto();
  143 + request.setPage(req.getPageNum());
  144 + request.setSellerId(req.getUserId());
  145 + ApiPageDataResponse<OrderListResponseDto> response = this.orderService.list(request);
  146 + if (response == null) {
  147 + resp.setCode(ResultCode.NETWORK_FAILED);
  148 + return resp;
  149 + }
  150 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  151 + resp.setCode(ResultCode.SUCCESS);
  152 + resp.setMaxPageNum(response.getTotalPage());
  153 + if (!CollectionUtils.isEmpty(response.getList())) {
  154 + List<Order> orders = new ArrayList<>(response.getList().size());
  155 + for (OrderListResponseDto dto : response.getList()) {
  156 + orders.add(this.convertToOrder(dto));
  157 + }
  158 + resp.setOrders(orders);
  159 + }
  160 + } else {
  161 + resp.setCode(ResultCode.BUSINESS_FAILED);
  162 + }
  163 + resp.setMsg(response.getMessage());
  164 + return resp;
  165 + }
  166 +
  167 + @Override
  168 + public ConfirmReceiptMoneyResp comfirmReceiveMoney(ConfirmReceiptMoneyReq req) {
  169 + ConfirmReceiptMoneyResp resp = new ConfirmReceiptMoneyResp();
  170 + SellerConfirmRequestDto request = new SellerConfirmRequestDto();
  171 + request.setOrderId(req.getOrderId());
  172 + request.setSellerId(req.getUserId());
  173 + ApiResponse response = this.orderService.sellerConfirm(request);
  174 + if (response == null) {
  175 + resp.setCode(ResultCode.NETWORK_FAILED);
  176 + return resp;
  177 + }
  178 + if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  179 + resp.setCode(ResultCode.SUCCESS);
  180 + } else {
  181 + resp.setCode(ResultCode.BUSINESS_FAILED);
  182 + }
  183 + resp.setMsg(response.getMessage());
  184 + resp.setResp(response.getCode());
  185 + return resp;
  186 + }
  187 +
  188 + @Override
  189 + public BaseResp takeOrder(takeOrderReq req) {
  190 + BaseResp resp = new BaseResp();
  191 + TakeOrderRequestDto request = new TakeOrderRequestDto();
  192 + request.setOrderId(req.getOrderId());
  193 + request.setSellerId(req.getUserId());
  194 + request.setTotalPrice(req.getPricePrivilege());
  195 + ApiResponse response = this.orderService.take(request);
  196 + if (response != null && response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  197 + resp.setCode(ResultCode.SUCCESS);
  198 + } else {
  199 + resp.setCode(ResultCode.BUSINESS_FAILED);
  200 + }
  201 + resp.setMsg(response.getMessage());
  202 + return resp;
  203 + }
  204 +
  205 + @Override
  206 + public RefuseQuoteResp refuseOrder(RefuseQuoteReq req) {
  207 + RefuseQuoteResp resp = new RefuseQuoteResp();
  208 + SellerRefuseRequestDto request = new SellerRefuseRequestDto();
  209 + request.setOrderId(req.getOrderId());
  210 + request.setRefuseReason(req.getRefuseReason());
  211 + request.setSellerId(req.getUserId());
  212 + ApiResponse response = this.orderService.refuse(request);
  213 + if (response != null && response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
  214 + resp.setCode(ResultCode.SUCCESS);
  215 + resp.setResp(response.getCode());
  216 + } else {
  217 + resp.setCode(ResultCode.BUSINESS_FAILED);
  218 + }
  219 + resp.setMsg(response.getMessage());
  220 + return resp;
  221 + }
19 222  
20 223 }
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/BuyerOrderService.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.service.buyer;
  2 +
  3 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderReq;
  4 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderResp;
  5 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptReq;
  6 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptResp;
  7 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderReq;
  8 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderResp;
  9 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  10 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  11 +
  12 +public interface BuyerOrderService {
  13 +
  14 + SubmitOrderResp submit(SubmitOrderReq req);
  15 +
  16 + PayOrderResp pay(PayOrderReq req);
  17 +
  18 + BuyerConfirmReceiptResp confirmReceipt(BuyerConfirmReceiptReq req);
  19 +
  20 + BuyerCancelOrderResp cancel(BuyerCancelOrderReq req);
  21 +
  22 +}
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/impl/BuyerOrderServiceBean.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.service.buyer.impl;
  2 +
  3 +import javax.annotation.Resource;
  4 +
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderReq;
  8 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderResp;
  9 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptReq;
  10 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptResp;
  11 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderReq;
  12 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderResp;
  13 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  14 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  15 +import com.diligrp.mobsite.getway.rpc.buyer.BuyerOrderRPCService;
  16 +import com.diligrp.mobsite.getway.service.buyer.BuyerOrderService;
  17 +
  18 +@Service
  19 +public class BuyerOrderServiceBean implements BuyerOrderService {
  20 +
  21 + @Resource
  22 + private BuyerOrderRPCService buyerOrderService;
  23 +
  24 + @Override
  25 + public SubmitOrderResp submit(SubmitOrderReq req) {
  26 + return this.buyerOrderService.submit(req);
  27 + }
  28 +
  29 + @Override
  30 + public PayOrderResp pay(PayOrderReq req) {
  31 + return this.buyerOrderService.pay(req);
  32 + }
  33 +
  34 + @Override
  35 + public BuyerConfirmReceiptResp confirmReceipt(BuyerConfirmReceiptReq req) {
  36 + return this.buyerOrderService.confirmReceipt(req);
  37 + }
  38 +
  39 + @Override
  40 + public BuyerCancelOrderResp cancel(BuyerCancelOrderReq req) {
  41 + return this.buyerOrderService.cancel(req);
  42 + }
  43 +
  44 +}
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/impl/OrderServiceImpl.java
... ... @@ -28,8 +28,6 @@ import javax.annotation.Resource;
28 28 public class OrderServiceImpl implements OrderService {
29 29  
30 30 @Resource
31   - private OrderRPC orderRPC;
32   - @Resource
33 31 private UserRPC userRPC;
34 32 @Resource
35 33 private GoodsRPC goodsRPC;
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/impl/SellerOrderServiceImpl.java
1 1 package com.diligrp.mobsite.getway.service.seller.impl;
2 2  
  3 +import javax.annotation.Resource;
  4 +
3 5 import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
4   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.*;
  6 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyReq;
  7 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyResp;
  8 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailReq;
  9 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
  10 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListReq;
  11 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListResp;
  12 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteReq;
  13 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteResp;
  14 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
  15 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
  16 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.takeOrderReq;
  17 +import com.diligrp.mobsite.getway.rpc.seller.SellerOrderRPC;
5 18 import com.diligrp.mobsite.getway.service.seller.SellerOrderService;
6 19  
7   -
8 20 /**
9 21 * <B>Description</B> 订单 <br />
10   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  22 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  23 + * <br />
11 24 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
12 25 * <B>Company</B> 地利集团
13 26 *
... ... @@ -17,34 +30,36 @@ import com.diligrp.mobsite.getway.service.seller.SellerOrderService;
17 30 @org.springframework.stereotype.Service("sellerOrderService")
18 31 public class SellerOrderServiceImpl implements SellerOrderService {
19 32  
  33 + @Resource
  34 + private SellerOrderRPC sellerOrderRPCService;
20 35  
21   - @Override
22   - public GetOrderListResp getOrders(GetOrderListReq req) throws Exception {
23   - return null;
24   - }
  36 + @Override
  37 + public GetOrderListResp getOrders(GetOrderListReq req) throws Exception {
  38 + return this.sellerOrderRPCService.getOrders(req);
  39 + }
25 40  
26   - @Override
27   - public GetOrderDetailResp getOrderById(GetOrderDetailReq req) {
28   - return null;
29   - }
  41 + @Override
  42 + public GetOrderDetailResp getOrderById(GetOrderDetailReq req) {
  43 + return this.sellerOrderRPCService.getOrderById(req);
  44 + }
30 45  
31   - @Override
32   - public ConfirmReceiptMoneyResp comfirmReceiveMoney(ConfirmReceiptMoneyReq req) {
33   - return null;
34   - }
  46 + @Override
  47 + public ConfirmReceiptMoneyResp comfirmReceiveMoney(ConfirmReceiptMoneyReq req) {
  48 + return this.sellerOrderRPCService.comfirmReceiveMoney(req);
  49 + }
35 50  
36   - @Override
37   - public BaseResp takeOrder(takeOrderReq req) {
38   - return null;
39   - }
  51 + @Override
  52 + public BaseResp takeOrder(takeOrderReq req) {
  53 + return this.sellerOrderRPCService.takeOrder(req);
  54 + }
40 55  
41   - @Override
42   - public RefuseQuoteResp refuseOrder(RefuseQuoteReq req) {
43   - return null;
44   - }
  56 + @Override
  57 + public RefuseQuoteResp refuseOrder(RefuseQuoteReq req) {
  58 + return this.sellerOrderRPCService.refuseOrder(req);
  59 + }
45 60  
46   - @Override
47   - public SearchOrderListResp searchOrders(SearchOrderListReq req) {
48   - return null;
49   - }
  61 + @Override
  62 + public SearchOrderListResp searchOrders(SearchOrderListReq req) {
  63 + return this.sellerOrderRPCService.searchOrders(req);
  64 + }
50 65 }
... ...
mobsite-getway-web/pom.xml
... ... @@ -646,7 +646,7 @@
646 646 <dependency>
647 647 <groupId>com.diligrp</groupId>
648 648 <artifactId>passport-client</artifactId>
649   - <version>0.0.3</version>
  649 + <version>0.0.9-SNAPSHOT</version>
650 650 </dependency>
651 651  
652 652 <!-- 权限拦截器 -->
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/base/BaseApiController.java
1 1 package com.diligrp.mobsite.getway.web.api.base;
2 2  
  3 +import java.io.BufferedReader;
  4 +import java.io.IOException;
  5 +import java.io.InputStreamReader;
  6 +
  7 +import javax.servlet.http.HttpServletRequest;
  8 +
  9 +import org.apache.commons.codec.binary.Base64;
  10 +import org.nutz.json.Json;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Value;
  14 +
3 15 import com.alibaba.fastjson.JSON;
4 16 import com.alibaba.fastjson.serializer.SerializerFeature;
5   -import com.dili.dataStored.sdk.common.DataStoredService;
6 17 import com.diligrp.mobsite.getway.domain.common.Constant;
7 18 import com.diligrp.mobsite.getway.domain.common.ResultCode;
8 19 import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
9 20 import com.diligrp.mobsite.getway.web.utils.DESUtil;
10 21 import com.diligrp.mobsite.getway.web.utils.WebContent;
11 22 import com.diligrp.website.util.security.Validator;
12   -import org.apache.commons.codec.binary.Base64;
13   -import org.nutz.json.Json;
14   -import org.slf4j.Logger;
15   -import org.slf4j.LoggerFactory;
16   -import org.springframework.beans.factory.annotation.Value;
17   -
18   -import javax.annotation.Resource;
19   -import javax.servlet.http.HttpServletRequest;
20   -import java.io.BufferedReader;
21   -import java.io.IOException;
22   -import java.io.InputStreamReader;
23 23  
24 24 /**
25 25 * <B>Description</B> 网关controller <br />
... ... @@ -41,9 +41,6 @@ public abstract class BaseApiController {
41 41 @Value("${getway.log.isPrintParam}")
42 42 private boolean isPrintParam;
43 43  
44   - @Resource
45   - private DataStoredService dataStoredService;
46   -
47 44 protected void sendError(int code, String message) {
48 45 try {
49 46 BaseResp resp = new BaseResp();
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/order/BuyerOrderController.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.web.api.buyer.order;
  2 +
  3 +import javax.annotation.Resource;
  4 +
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.http.MediaType;
  8 +import org.springframework.web.bind.annotation.RequestBody;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderReq;
  14 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderResp;
  15 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptReq;
  16 +import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptResp;
  17 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderReq;
  18 +import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderResp;
  19 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  20 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  21 +import com.diligrp.mobsite.getway.service.buyer.BuyerOrderService;
  22 +import com.diligrp.mobsite.getway.web.api.base.BaseApiController;
  23 +
  24 +import io.swagger.annotations.Api;
  25 +
  26 +@RestController
  27 +@RequestMapping(value = "/mobsiteApp/buyer/order", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  28 +@Api(value = "/mobsiteApp-order-buyer", description = "订单接口-买家")
  29 +public class BuyerOrderController extends BaseApiController {
  30 +
  31 + private static final Logger log = LoggerFactory.getLogger(BuyerOrderController.class);
  32 +
  33 + @Resource
  34 + private BuyerOrderService buyerOrderService;
  35 +
  36 + /**
  37 + * 提交订单
  38 + *
  39 + * @param req
  40 + */
  41 + @RequestMapping(value = "/submit", method = RequestMethod.POST)
  42 + public void submit(@RequestBody SubmitOrderReq req) {
  43 + try {
  44 + SubmitOrderResp resp = buyerOrderService.submit(req);
  45 + super.sendSuccessResp(resp);
  46 + } catch (Exception e) {
  47 + log.error("提交订单失败", e);
  48 + super.sendError(e.getMessage());
  49 + }
  50 + }
  51 +
  52 + @RequestMapping(value = "/pay", method = RequestMethod.POST)
  53 + public void pay(@RequestBody PayOrderReq req) {
  54 + try {
  55 + PayOrderResp resp = buyerOrderService.pay(req);
  56 + super.sendSuccessResp(resp);
  57 + } catch (Exception e) {
  58 + log.error("提交订单失败", e);
  59 + super.sendError(e.getMessage());
  60 + }
  61 + }
  62 +
  63 + @RequestMapping(value = "/confirmReceipt")
  64 + public void confirmReceipt(@RequestBody BuyerConfirmReceiptReq req) {
  65 + try {
  66 + BuyerConfirmReceiptResp resp = buyerOrderService.confirmReceipt(req);
  67 + super.sendSuccessResp(resp);
  68 + } catch (Exception e) {
  69 + log.error("提交订单失败", e);
  70 + super.sendError(e.getMessage());
  71 + }
  72 + }
  73 +
  74 + @RequestMapping(value = "/cancel", method = RequestMethod.POST)
  75 + public void cancel(@RequestBody BuyerCancelOrderReq req) {
  76 + try {
  77 + BuyerCancelOrderResp resp = buyerOrderService.cancel(req);
  78 + super.sendSuccessResp(resp);
  79 + } catch (Exception e) {
  80 + log.error("提交订单失败", e);
  81 + super.sendError(e.getMessage());
  82 + }
  83 + }
  84 +}
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/user/OrderController.java deleted 100644 → 0
1   -package com.diligrp.mobsite.getway.web.api.buyer.user;
2   -
3   -import com.diligrp.mobsite.getway.domain.except.ServiceException;
4   -import com.diligrp.mobsite.getway.domain.protocol.order.*;
5   -import com.diligrp.mobsite.getway.service.buyer.user.OrderService;
6   -import com.diligrp.mobsite.getway.web.api.base.BaseApiController;
7   -import com.diligrp.mobsite.getway.web.utils.BeanValidator;
8   -import io.swagger.annotations.Api;
9   -import io.swagger.annotations.ApiImplicitParam;
10   -import io.swagger.annotations.ApiImplicitParams;
11   -import io.swagger.annotations.ApiOperation;
12   -import org.apache.log4j.Logger;
13   -import org.springframework.stereotype.Controller;
14   -import org.springframework.web.bind.annotation.*;
15   -
16   -import javax.annotation.Resource;
17   -import javax.servlet.http.HttpServletRequest;
18   -
19   -
20   -/**
21   - * <B>Description</B> 订单操作 <br />
22   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
23   - * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
24   - * <B>Company</B> 地利集团
25   - * @createTime 2014年9月1日 下午2:30:41
26   - * @author weili
27   - */
28   -@Controller
29   -@RequestMapping("/mobsiteApp/order/")
30   -@Api(value = "mobsiteApp-order", description = "订单接口-买家")
31   -public class OrderController extends BaseApiController {
32   -
33   - @Resource
34   - private OrderService orderService;
35   -
36   - private static Logger log = Logger.getLogger(OrderController.class);
37   -
38   - /**
39   - * 获取订单列表
40   - *
41   - * 请求协议体:SearchOrderReq
42   - * 返回协议体:SearchOrderResp
43   - *
44   - * @createTime 2014年9月1日 下午5:32:02
45   - * @author weili
46   - * @return
47   - */
48   - @ApiOperation(value = "获取订单列表", httpMethod = "POST",response = SearchOrderResp.class)
49   - @RequestMapping(value = "/getOrders",method = RequestMethod.POST)
50   - @ApiImplicitParams({
51   - @ApiImplicitParam(paramType = "body",name = "temp",dataType = "SearchOrderReq")
52   - })
53   - @ResponseBody
54   - public void getOrders(@RequestBody SearchOrderReq temp){
55   -
56   - SearchOrderReq req = super.getRequest(SearchOrderReq.class);
57   - try {
58   - SearchOrderResp resp = orderService.getOrders(req);
59   - super.sendSuccessResp(resp);
60   - }catch (ServiceException e) {
61   - log.error("获取订单列表出现业务异常", e);
62   - super.sendError(e.getCode(), e.getMessage());
63   - }catch (Exception e) {
64   - log.error("获取订单列表失败", e);
65   - super.sendError(e.getMessage());
66   - }
67   - }
68   -
69   - /**
70   - * 根据订单id查询订单
71   - *
72   - * 请求协议体:GetOrderReq
73   - * 返回协议体:GetOrderResp
74   - *
75   - * @createTime 2014年9月1日 下午6:39:10
76   - * @author weili
77   - */
78   - @ApiOperation(value = "根据订单id查询订单", httpMethod = "POST",response = GetOrderResp.class)
79   - @RequestMapping(value = "/getOrderById",method = RequestMethod.POST)
80   - @ResponseBody
81   - public void getOrderById(@RequestBody GetOrderReq temp){
82   -
83   - GetOrderReq req = super.getRequest(GetOrderReq.class);
84   - try {
85   - GetOrderResp resp = orderService.getOrderById(req);
86   - super.sendSuccessResp(resp);
87   - }catch (ServiceException e) {
88   - log.error("获取订单详情出现业务异常", e);
89   - super.sendError(e.getCode(), e.getMessage());
90   - } catch (Exception e) {
91   - log.error("获取订单详情失败", e);
92   - super.sendError(e.getMessage());
93   - }
94   - }
95   -
96   -
97   - /**
98   - * 提交订单
99   - *
100   - * 请求协议体:SubmitOrderReq
101   - * 返回协议体:SubmitOrderResp
102   - *
103   - * @createTime 2014年9月1日 下午6:05:23
104   - * @author weili
105   - */
106   - @ApiOperation(value = "提交订单", httpMethod = "POST",response = SubmitOrderResp.class)
107   - @RequestMapping(value = "/submitOrder",method = RequestMethod.POST)
108   - @ResponseBody
109   - public void submitOrder(HttpServletRequest request,@RequestBody SubmitOrderReq temp){
110   -
111   - SubmitOrderReq req = super.getRequest(SubmitOrderReq.class);
112   - try {
113   - BeanValidator.validator(req);
114   - SubmitOrderResp resp = orderService.submitOrderNew(req);
115   - //try {
116   - // log.info(String.format("提交订单:[ 设备id<%s>用户id<%s>订单id<%s>]"
117   - // , req.getDeviceId(), req.getUserId(), resp.getOrderInfos().ge getOrderId(), );
118   - //}catch (Exception e) {
119   - // log.error("记录下单日志出错!");
120   - //}
121   - super.sendSuccessResp(resp);
122   - } catch (ServiceException e) {
123   - log.error("提交订单出现业务异常", e);
124   - super.sendError(e.getCode(), e.getMessage());
125   - } catch (Exception e) {
126   - log.error("提交订单失败", e);
127   - super.sendError(e.getMessage());
128   - }
129   - }
130   -
131   - /**
132   - * 付款
133   - *
134   - * 请求协议体:paymentreq
135   - * 返回协议体:PaymentResp
136   - *
137   - * @createTime 2014年9月1日 下午6:05:23
138   - * @author weili
139   - */
140   - @ApiOperation(value = "支付", httpMethod = "POST",response = PaymentResp.class)
141   - @RequestMapping(value = "/payment",method = RequestMethod.POST)
142   - @ResponseBody
143   - public void payment(@RequestBody PaymentReq temp){
144   - PaymentReq req = super.getRequest(PaymentReq.class);
145   - try {
146   - BeanValidator.validator(req);
147   - PaymentResp resp = orderService.payment(req);
148   - super.sendSuccessResp(resp);
149   - } catch (ServiceException e) {
150   - log.error("录入线下付款信息出现业务异常", e);
151   - super.sendError(e.getCode(), e.getMessage());
152   - } catch (Exception e) {
153   - log.error("录入线下付款信息失败", e);
154   - super.sendError(e.getMessage());
155   - }
156   - }
157   -
158   -
159   -
160   -
161   - /**
162   - * 取消订单
163   - *
164   - * 请求协议体:CancelOrderReq
165   - * 返回协议体:CancelOrderResp
166   - *
167   - * @createTime 2014年9月1日 下午6:08:06
168   - * @author weili
169   - */
170   - @ApiOperation(value = "取消订单", httpMethod = "POST",response = CancelOrderResp.class)
171   - @RequestMapping(value = "/cancelOrder",method = RequestMethod.POST)
172   - @ResponseBody
173   - public void cancelOrder(@RequestBody CancelOrderReq temp){
174   -
175   - CancelOrderReq req = super.getRequest(CancelOrderReq.class);
176   - try {
177   - CancelOrderResp resp = orderService.cancelOrder(req);
178   - super.sendSuccessResp(resp);
179   - } catch (ServiceException e) {
180   - log.error("取消订单出现业务异常", e);
181   - super.sendError(e.getCode(), e.getMessage());
182   - } catch (Exception e) {
183   - log.error("取消订单失败", e);
184   - super.sendError(e.getMessage());
185   - }
186   - }
187   -
188   - /**
189   - * 取消订单
190   - *
191   - * 请求协议体:CancelOrderReq
192   - * 返回协议体:CancelOrderResp
193   - *
194   - * @createTime 2014年9月1日 下午6:08:06
195   - * @author weili
196   - */
197   - @ApiOperation(value = "删除订单", httpMethod = "POST",response = DelOrderResp.class)
198   - @RequestMapping(value = "/delOrder",method = RequestMethod.POST)
199   - @ResponseBody
200   - public void delOrder(@RequestBody DelOrderReq temp){
201   -
202   - DelOrderReq req = super.getRequest(DelOrderReq.class);
203   - try {
204   - DelOrderResp resp = orderService.delOrder(req);
205   - super.sendSuccessResp(resp);
206   - } catch (ServiceException e) {
207   - log.error("取消订单出现业务异常", e);
208   - super.sendError(e.getCode(), e.getMessage());
209   - } catch (Exception e) {
210   - log.error("取消订单失败", e);
211   - super.sendError(e.getMessage());
212   - }
213   - }
214   -
215   -
216   - /**
217   - * 确认收货
218   - *
219   - * 请求协议体:ConfirmPickUpReq
220   - * 返回协议体:ConfirmPickUpResp
221   - *
222   - * @createTime 2014年9月1日 下午6:16:05
223   - * @author weili
224   - */
225   - @ApiOperation(value = "确认收货", httpMethod = "POST",response = ConfirmPickUpResp.class)
226   - @RequestMapping(value = "/confirmPickUp",method = RequestMethod.POST)
227   - @ResponseBody
228   - public void confirmPickUp(@RequestBody ConfirmPickUpReq temp){
229   - ConfirmPickUpReq req = super.getRequest(ConfirmPickUpReq.class);
230   - try {
231   - ConfirmPickUpResp resp = orderService.confirmPickUp(req);
232   - super.sendSuccessResp(resp);
233   - } catch (ServiceException e) {
234   - log.error("确认收货出现业务异常", e);
235   - super.sendError(e.getCode(), e.getMessage());
236   - } catch (Exception e) {
237   - log.error("确认收货失败", e);
238   - super.sendError(e.getMessage());
239   - }
240   - }
241   -
242   -
243   -
244   -
245   -}
... ... @@ -244,11 +244,11 @@
244 244  
245 245  
246 246  
247   - <dependency>
  247 + <!-- <dependency>
248 248 <groupId>com.diligrp.dataStored</groupId>
249 249 <artifactId>dataStored-sdk</artifactId>
250 250 <version>0.0.1-SNAPSHOT</version>
251   - </dependency>
  251 + </dependency> -->
252 252  
253 253 <!--<dependency>-->
254 254 <!--<groupId>com.diligrp</groupId>-->
... ...