Commit d56dd93aad5574049bba6c1aaf01bbf7af1205e5

Authored by weiliwhereareyou@163.com
2 parents a552b937 18ae5fce

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	mobsite-getway-domain/pom.xml
Showing 17 changed files with 699 additions and 823 deletions
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/Order.java
... ... @@ -24,14 +24,6 @@ public class Order implements Serializable {
24 24 * 店铺id
25 25 */
26 26 private Long shopId;
27   - /**
28   - * 商家id
29   - */
30   - private Long sellerId;
31   - /**
32   - * 用户id
33   - */
34   - private Long buyerId;
35 27 /** 配送类型 */
36 28 private Integer deliveryType;
37 29 /** 订单状态 */
... ... @@ -48,8 +40,6 @@ public class Order implements Serializable {
48 40 private String deliveryTime;
49 41 /** 提货时间 */
50 42 private String reservationTime;
51   - /** 买家确认收货时间 */
52   - private String buyerConfirmTime;
53 43 /** 订单提交时间 */
54 44 private String submitTime;
55 45 /** 支付类型 */
... ... @@ -77,22 +67,6 @@ public class Order implements Serializable {
77 67 this.shopId = shopId;
78 68 }
79 69  
80   - public Long getSellerId() {
81   - return sellerId;
82   - }
83   -
84   - public void setSellerId(Long sellerId) {
85   - this.sellerId = sellerId;
86   - }
87   -
88   - public Long getBuyerId() {
89   - return buyerId;
90   - }
91   -
92   - public void setBuyerId(Long buyerId) {
93   - this.buyerId = buyerId;
94   - }
95   -
96 70 public Integer getDeliveryType() {
97 71 return deliveryType;
98 72 }
... ... @@ -149,14 +123,6 @@ public class Order implements Serializable {
149 123 this.reservationTime = reservationTime;
150 124 }
151 125  
152   - public String getBuyerConfirmTime() {
153   - return buyerConfirmTime;
154   - }
155   -
156   - public void setBuyerConfirmTime(String buyerConfirmTime) {
157   - this.buyerConfirmTime = buyerConfirmTime;
158   - }
159   -
160 126 public String getSubmitTime() {
161 127 return submitTime;
162 128 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/PickInfo.java
... ... @@ -4,10 +4,10 @@ import io.swagger.annotations.ApiModelProperty;
4 4  
5 5 import java.io.Serializable;
6 6  
7   -
8 7 /**
9 8 * <B>Description</B> 提货人信息 <br />
10   - * <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 />
11 11 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
12 12 * <B>Company</B> 地利集团
13 13 *
... ... @@ -15,117 +15,109 @@ import java.io.Serializable;
15 15 * @createTime 2014/8/28 10:37
16 16 */
17 17 public class PickInfo implements Serializable {
18   -
19   - private static final long serialVersionUID = 8718494787385584082L;
20   -
21   - /**
22   - * 默认提货人-是
23   - */
24   - public static final int ISDEFAULT_YES = 1;
25   - /**
26   - * 默认提货人-否
27   - */
28   - public static final int ISDEFAULT_NO = 2;
29   -
30   -
31   -
32   - /**
33   - * id
34   - */
35   - @ApiModelProperty(value = "收货人id")
36   - private Long id;
37   - /**
38   - * 用户姓名名字
39   - */
40   - @ApiModelProperty(value = "收货人姓名")
41   - private String name;
42   - /**
43   - * 电话
44   - */
45   - @ApiModelProperty(value = "收货人电话")
46   - private String mobile;
47   -
48   - /**
49   - * 是否为默认提货人
50   - */
51   - @ApiModelProperty(value = "是否为默认提货人:1-是,2-否")
52   - private Integer isDefault;
53   -
54   -
55   - /**
56   - * 城市地址
57   - */
58   - @ApiModelProperty(value = "城市id")
59   - private Integer cityId;
60   - /**
61   - * 城市地址
62   - */
63   - @ApiModelProperty(value = "城市描述")
64   - private String cityAddress;
65   - /**
66   - * 街道地址
67   - */
68   - @ApiModelProperty(value = "街道地址")
69   - private String streetAddress;
70   -
71   -
72   - public Integer getCityId() {
73   - return cityId;
74   - }
75   -
76   - public void setCityId(Integer cityId) {
77   - this.cityId = cityId;
78   - }
79   -
80   - public Long getId() {
81   - return id;
82   - }
83   -
84   - public void setId(Long id) {
85   - this.id = id;
86   - }
87   -
88   - public String getName() {
89   - return name;
90   - }
91   -
92   - public void setName(String name) {
93   - this.name = name;
94   - }
95   -
96   - public String getMobile() {
97   - return mobile;
98   - }
99   -
100   - public void setMobile(String mobile) {
101   - this.mobile = mobile;
102   - }
103   -
104   - public Integer getIsDefault() {
105   - return isDefault;
106   - }
107   -
108   - public void setIsDefault(Integer isDefault) {
109   - this.isDefault = isDefault;
110   - }
111   -
112   -
113   - public String getCityAddress() {
114   - return cityAddress;
115   - }
116   -
117   -
118   - public void setCityAddress(String cityAddress) {
119   - this.cityAddress = cityAddress;
120   - }
121   -
122   -
123   - public String getStreetAddress() {
124   - return streetAddress;
125   - }
126   -
127   -
128   - public void setStreetAddress(String streetAddress) {
129   - this.streetAddress = streetAddress;
130   - }
  18 +
  19 + private static final long serialVersionUID = 8718494787385584082L;
  20 +
  21 + /**
  22 + * 默认提货人-是
  23 + */
  24 + public static final int ISDEFAULT_YES = 1;
  25 + /**
  26 + * 默认提货人-否
  27 + */
  28 + public static final int ISDEFAULT_NO = 2;
  29 +
  30 + /**
  31 + * id
  32 + */
  33 + @ApiModelProperty(value = "收货人id")
  34 + private Long id;
  35 + /**
  36 + * 用户姓名名字
  37 + */
  38 + @ApiModelProperty(value = "收货人姓名")
  39 + private String name;
  40 + /**
  41 + * 电话
  42 + */
  43 + @ApiModelProperty(value = "收货人电话")
  44 + private String mobile;
  45 +
  46 + /**
  47 + * 是否为默认提货人
  48 + */
  49 + @ApiModelProperty(value = "是否为默认提货人:1-是,2-否")
  50 + private Integer isDefault;
  51 +
  52 + /**
  53 + * 城市地址
  54 + */
  55 + @ApiModelProperty(value = "城市id")
  56 + private Long cityId;
  57 + /**
  58 + * 城市地址
  59 + */
  60 + @ApiModelProperty(value = "城市描述")
  61 + private String cityAddress;
  62 + /**
  63 + * 街道地址
  64 + */
  65 + @ApiModelProperty(value = "街道地址")
  66 + private String streetAddress;
  67 +
  68 + public Long getCityId() {
  69 + return cityId;
  70 + }
  71 +
  72 + public void setCityId(Long cityId) {
  73 + this.cityId = cityId;
  74 + }
  75 +
  76 + public Long getId() {
  77 + return id;
  78 + }
  79 +
  80 + public void setId(Long id) {
  81 + this.id = id;
  82 + }
  83 +
  84 + public String getName() {
  85 + return name;
  86 + }
  87 +
  88 + public void setName(String name) {
  89 + this.name = name;
  90 + }
  91 +
  92 + public String getMobile() {
  93 + return mobile;
  94 + }
  95 +
  96 + public void setMobile(String mobile) {
  97 + this.mobile = mobile;
  98 + }
  99 +
  100 + public Integer getIsDefault() {
  101 + return isDefault;
  102 + }
  103 +
  104 + public void setIsDefault(Integer isDefault) {
  105 + this.isDefault = isDefault;
  106 + }
  107 +
  108 + public String getCityAddress() {
  109 + return cityAddress;
  110 + }
  111 +
  112 + public void setCityAddress(String cityAddress) {
  113 + this.cityAddress = cityAddress;
  114 + }
  115 +
  116 + public String getStreetAddress() {
  117 + return streetAddress;
  118 + }
  119 +
  120 + public void setStreetAddress(String streetAddress) {
  121 + this.streetAddress = streetAddress;
  122 + }
131 123 }
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/GetOrderResp.java
... ... @@ -3,22 +3,26 @@ package com.diligrp.mobsite.getway.domain.protocol.order;
3 3 import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
4 4 import com.diligrp.mobsite.getway.domain.protocol.order.model.OrderDetail;
5 5  
6   -
7 6 /**
8 7 * <B>Description</B> 根据id获取订单 <br />
9   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  8 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  9 + * <br />
10 10 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
11 11 * <B>Company</B> 地利集团
  12 + *
12 13 * @createTime 2014年9月1日 下午6:36:42
13 14 * @author zhangshirui
14 15 */
15   -@SuppressWarnings("serial")
16 16 public class GetOrderResp extends BaseResp {
17   -
18   - /**
19   - * 订单详情
20   - */
21   - private OrderDetail order;
  17 +
  18 + /**
  19 + *
  20 + */
  21 + private static final long serialVersionUID = 8320936234572800014L;
  22 + /**
  23 + * 订单详情
  24 + */
  25 + private OrderDetail order;
22 26  
23 27 public OrderDetail getOrder() {
24 28 return order;
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/order/model/OrderDetail.java
... ... @@ -17,6 +17,10 @@ public class OrderDetail extends Order{
17 17  
18 18  
19 19 /**
  20 + *
  21 + */
  22 + private static final long serialVersionUID = -2957039480700213201L;
  23 + /**
20 24 * 提货人信息
21 25 */
22 26 @ApiModelProperty(value = "收货人信息")
... ...
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/saler/order/takeOrderReq.java renamed to mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/protocol/saler/order/TakeOrderReq.java
... ... @@ -3,7 +3,7 @@ package com.diligrp.mobsite.getway.domain.protocol.saler.order;
3 3 import com.diligrp.mobsite.getway.domain.protocol.BaseReq;
4 4 import io.swagger.annotations.ApiModelProperty;
5 5  
6   -public class takeOrderReq extends BaseReq {
  6 +public class TakeOrderReq extends BaseReq {
7 7 /**
8 8 *
9 9 */
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/OrderRPC.java
1 1 package com.diligrp.mobsite.getway.rpc;
2 2  
3   -import java.util.List;
4   -
5 3 import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
6   -import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
  4 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
7 5 import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
8 6 import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
9   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
10   -import com.diligrp.titan.sdk.output.PageOutput;
  7 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
11 8  
12 9 /**
13 10 * <B>Description</B> 订单 <br />
... ... @@ -25,12 +22,11 @@ public interface OrderRPC {
25 22 * 获取订单列表
26 23 *
27 24 * @param input
28   - * @param userId
29 25 * @return
30 26 * @createTime 2014年9月2日 下午2:36:47
31 27 * @author zhangshirui
32 28 */
33   - PageOutput<List<OrderListResponseDto>> getOrders(OrderListRequestDto input, Long userId);
  29 + SearchOrderListResp getOrders(OrderListRequestDto input);
34 30  
35 31 /**
36 32 * 根据id查询订单详情
... ... @@ -41,7 +37,7 @@ public interface OrderRPC {
41 37 * @author zhangshirui
42 38 * @return
43 39 */
44   - GetOrderDetailResp getOrderById(Long orderId, Long userId);
  40 + GetOrderResp getOrderById(Long orderId, Long userId);
45 41  
46 42 /**
47 43 * 取消订单
... ...
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/OrderRPCImpl.java
1 1 package com.diligrp.mobsite.getway.rpc.impl;
2 2  
3   -import java.text.DateFormat;
4   -import java.text.SimpleDateFormat;
5 3 import java.util.ArrayList;
6 4 import java.util.List;
7 5  
8 6 import org.slf4j.Logger;
9 7 import org.slf4j.LoggerFactory;
10 8 import org.springframework.stereotype.Service;
  9 +import org.springframework.util.CollectionUtils;
11 10  
12 11 import com.b2c.orders.domain.client.dto.request.BuyerCancelRequestDto;
13 12 import com.b2c.orders.domain.client.dto.request.BuyerConfirmRequestDto;
... ... @@ -28,13 +27,15 @@ import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
28 27 import com.b2c.orders.domain.client.dto.response.SubmitOrderResponseDto;
29 28 import com.b2c.orders.domain.client.service.OrderService;
30 29 import com.diligrp.mobsite.getway.domain.common.ResultCode;
  30 +import com.diligrp.mobsite.getway.domain.protocol.Order;
31 31 import com.diligrp.mobsite.getway.domain.protocol.OrderItem;
  32 +import com.diligrp.mobsite.getway.domain.protocol.PickInfo;
  33 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
32 34 import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
33 35 import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
34   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
35   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.model.SellerOrder;
  36 +import com.diligrp.mobsite.getway.domain.protocol.order.model.OrderDetail;
  37 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
36 38 import com.diligrp.mobsite.getway.rpc.OrderRPC;
37   -import com.diligrp.titan.sdk.output.PageOutput;
38 39  
39 40 /**
40 41 * <B>Description</B> 订单rpc <br />
... ... @@ -57,8 +58,8 @@ public class OrderRPCImpl implements OrderRPC {
57 58 private OrderService orderService;
58 59  
59 60 @Override
60   - public PageOutput<List<OrderListResponseDto>> getOrders(OrderListRequestDto input, Long userId) {
61   - PageOutput<List<OrderListResponseDto>> output = new PageOutput<>();
  61 + public SearchOrderListResp getOrders(OrderListRequestDto input) {
  62 + SearchOrderListResp output = new SearchOrderListResp();
62 63 ApiPageDataResponse<OrderListResponseDto> response = this.orderService.list(input);
63 64 if (response == null) {
64 65 output.setCode(ResultCode.NETWORK_FAILED);
... ... @@ -66,36 +67,38 @@ public class OrderRPCImpl implements OrderRPC {
66 67 }
67 68 if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
68 69 output.setCode(ResultCode.SUCCESS);
69   - output.setPageSize(response.getPageSize());
70   - output.setPage(response.getCurrentPage());
71   - output.setTotalPage(response.getTotalPage());
72   - output.setResult(response.getMessage());
73   - output.setData(response.getList());
  70 + output.setMaxPageNum(response.getTotalPage());
  71 + if (!CollectionUtils.isEmpty(response.getList())) {
  72 + List<Order> orders = new ArrayList<>(response.getList().size());
  73 + for (OrderListResponseDto dto : response.getList()) {
  74 + Order order = this.convertToOrder(dto);
  75 + orders.add(order);
  76 + }
  77 + output.setOrders(orders);
  78 + }
74 79 } else {
75 80 output.setCode(ResultCode.BUSINESS_FAILED);
76 81 }
  82 + output.setMsg(response.getMessage());
77 83 return output;
78 84 }
79 85  
80 86 @Override
81   - public GetOrderDetailResp getOrderById(Long orderId, Long userId) {
  87 + public GetOrderResp getOrderById(Long orderId, Long userId) {
82 88 OrderDetailRequestDto request = new OrderDetailRequestDto();
83 89 request.setOrderId(orderId);
84 90 ApiDataResponse<OrderDetailResponseDto> response = this.orderService.detail(request);
85   - GetOrderDetailResp resp = new GetOrderDetailResp();
  91 + GetOrderResp resp = new GetOrderResp();
86 92 if (response == null) {
87 93 resp.setCode(ResultCode.NETWORK_FAILED);
88 94 return resp;
89 95 }
90 96 if (response.getCode() == ApiResponse.RESPONSE_CODE_SUCCESS) {
91 97 resp.setCode(ResultCode.SUCCESS);
92   - SellerOrder order = new SellerOrder();
93   - DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
94 98 OrderDetailResponseDto dto = response.getData();
  99 + OrderDetail order = new OrderDetail();
95 100 order.setBuyerMemo(dto.getBuyerMemo());
96   - if (dto.getDeliveryTime() != null) {
97   - order.setDeliveryTime(df.format(dto.getDeliveryTime()));
98   - }
  101 + order.setDeliveryTime(dto.getDeliveryTime());
99 102 order.setDeliveryType(dto.getDeliveryType());
100 103 order.setId(dto.getId());
101 104 order.setOrderStatus(dto.getOrderStatus());
... ... @@ -103,8 +106,16 @@ public class OrderRPCImpl implements OrderRPC {
103 106 order.setPayType(dto.getPayType());
104 107 order.setRealTotalPrice(dto.getRealTotalPrice());
105 108 order.setReservationTime(dto.getReservationTime());
106   - order.setSubmitTime(df.format(dto.getSubmitTime()));
  109 + order.setSubmitTime(dto.getSubmitTime());
107 110 order.setTotalPrice(dto.getTotalPrice());
  111 + PickInfo pickInfo = new PickInfo();
  112 + pickInfo.setCityAddress(dto.getCityName());
  113 + pickInfo.setCityId(dto.getCityId());
  114 + pickInfo.setMobile(dto.getReceiverPhoneNumber());
  115 + pickInfo.setName(dto.getReceiverName());
  116 + pickInfo.setStreetAddress(dto.getDeliveryAddress());
  117 + order.setPickInfo(pickInfo);
  118 + resp.setOrder(order);
108 119 } else {
109 120 resp.setCode(ResultCode.BUSINESS_FAILED);
110 121 }
... ... @@ -265,4 +276,22 @@ public class OrderRPCImpl implements OrderRPC {
265 276 }
266 277 }
267 278  
  279 + private Order convertToOrder(OrderListResponseDto dto) {
  280 + Order order = new Order();
  281 + order.setBuyerMemo(dto.getBuyerMemo());
  282 + order.setDeliveryTime(dto.getDeliveryTime());
  283 + order.setDeliveryType(dto.getDeliveryType());
  284 + order.setId(dto.getId());
  285 + order.setOrderStatus(dto.getOrderStatus());
  286 + order.setPayStatus(dto.getPayStatus());
  287 + order.setPayTime(dto.getPayTime());
  288 + order.setPayType(dto.getPayType());
  289 + order.setRealTotalPrice(dto.getRealTotalPrice());
  290 + order.setReservationTime(dto.getReservationTime());
  291 + order.setShopId(dto.getShopId());
  292 + order.setSubmitTime(dto.getSubmitTime());
  293 + order.setTotalPrice(dto.getTotalPrice());
  294 + return order;
  295 + }
  296 +
268 297 }
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/BuyerOrderService.java deleted 100644 → 0
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   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailReq;
12   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
13   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
14   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
15   -
16   -public interface BuyerOrderService {
17   -
18   - /**
19   - * 提交订单
20   - *
21   - * @param req
22   - * @return
23   - */
24   - SubmitOrderResp submit(SubmitOrderReq req);
25   -
26   - /**
27   - * 支付
28   - *
29   - * @param req
30   - * @return
31   - */
32   - PayOrderResp pay(PayOrderReq req);
33   -
34   - /**
35   - * 确认收货
36   - *
37   - * @param req
38   - * @return
39   - */
40   - BuyerConfirmReceiptResp confirmReceipt(BuyerConfirmReceiptReq req);
41   -
42   - /**
43   - * 取消订单
44   - *
45   - * @param req
46   - * @return
47   - */
48   - BuyerCancelOrderResp cancel(BuyerCancelOrderReq req);
49   -
50   - /**
51   - * 订单列表
52   - *
53   - * @param req
54   - * @return
55   - */
56   - SearchOrderListResp searchOrders(SearchOrderListReq req);
57   -
58   - /**
59   - * 订单详情
60   - *
61   - * @param req
62   - * @return
63   - */
64   - GetOrderDetailResp getOrderById(GetOrderDetailReq req);
65   -
66   -}
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/impl/BuyerOrderServiceImpl.java deleted 100644 → 0
1   -package com.diligrp.mobsite.getway.service.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   -import org.springframework.util.CollectionUtils;
10   -
11   -import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
12   -import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
13   -import com.diligrp.mobsite.getway.domain.common.ResultCode;
14   -import com.diligrp.mobsite.getway.domain.protocol.Order;
15   -import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderReq;
16   -import com.diligrp.mobsite.getway.domain.protocol.order.BuyerCancelOrderResp;
17   -import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptReq;
18   -import com.diligrp.mobsite.getway.domain.protocol.order.BuyerConfirmReceiptResp;
19   -import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderReq;
20   -import com.diligrp.mobsite.getway.domain.protocol.order.PayOrderResp;
21   -import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
22   -import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
23   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailReq;
24   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
25   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
26   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
27   -import com.diligrp.mobsite.getway.rpc.OrderRPC;
28   -import com.diligrp.mobsite.getway.service.buyer.BuyerOrderService;
29   -import com.diligrp.titan.sdk.output.PageOutput;
30   -
31   -@Service
32   -public class BuyerOrderServiceImpl implements BuyerOrderService {
33   -
34   - @Resource
35   - private OrderRPC orderRPC;
36   -
37   - @Override
38   - public SubmitOrderResp submit(SubmitOrderReq req) {
39   - return this.orderRPC.submit(req);
40   - }
41   -
42   - @Override
43   - public PayOrderResp pay(PayOrderReq req) {
44   - PayOrderResp resp = new PayOrderResp();
45   - Integer result = this.orderRPC.pay(req.getOrderId(), req.getShopBuyerId(), req.getPayType());
46   - resp.setCode(result);
47   - return resp;
48   - }
49   -
50   - @Override
51   - public BuyerConfirmReceiptResp confirmReceipt(BuyerConfirmReceiptReq req) {
52   - BuyerConfirmReceiptResp resp = new BuyerConfirmReceiptResp();
53   - Integer result = this.orderRPC.confirmPickUp(req.getOrderId(), req.getBuyerId());
54   - resp.setCode(result);
55   - return resp;
56   - }
57   -
58   - @Override
59   - public BuyerCancelOrderResp cancel(BuyerCancelOrderReq req) {
60   - BuyerCancelOrderResp resp = new BuyerCancelOrderResp();
61   - Integer result = this.orderRPC.cancelOrder(req.getOrderId(), req.getShopBuyerId());
62   - resp.setCode(result);
63   - return resp;
64   - }
65   -
66   - @Override
67   - public SearchOrderListResp searchOrders(SearchOrderListReq req) {
68   - SearchOrderListResp resp = new SearchOrderListResp();
69   - OrderListRequestDto input = new OrderListRequestDto();
70   - input.setOrderStatus(req.getOrderStatus());
71   - input.setPage(req.getPageNum());
72   - input.setQueryString(req.getKeyword());
73   - input.setSellerId(req.getSellerId());
74   - input.setShopBuyerId(req.getShopBuyerId());
75   - PageOutput<List<OrderListResponseDto>> result = this.orderRPC.getOrders(input, req.getUserId());
76   - if (result == null) {
77   - resp.setCode(ResultCode.NETWORK_FAILED);
78   - return resp;
79   - }
80   - if (result.getCode() == ResultCode.SUCCESS) {
81   - if (!CollectionUtils.isEmpty(result.getData())) {
82   - List<Order> orders = new ArrayList<>(result.getData().size());
83   - for (OrderListResponseDto dto : result.getData()) {
84   - Order order = this.convertToOrder(dto);
85   - orders.add(order);
86   - }
87   - resp.setOrders(orders);
88   - }
89   - }
90   - resp.setMaxPageNum(result.getTotalPage());
91   - resp.setMsg(result.getResult());
92   - return resp;
93   - }
94   -
95   - @Override
96   - public GetOrderDetailResp getOrderById(GetOrderDetailReq req) {
97   - return this.orderRPC.getOrderById(req.getOrderId(), req.getUserId());
98   - }
99   -
100   - private Order convertToOrder(OrderListResponseDto dto) {
101   - Order order = new Order();
102   - order.setBuyerConfirmTime(dto.getBuyerConfirmTime());
103   - order.setBuyerId(dto.getBuyerId());
104   - order.setBuyerMemo(dto.getBuyerMemo());
105   - order.setDeliveryTime(dto.getDeliveryTime());
106   - order.setDeliveryType(dto.getDeliveryType());
107   - order.setId(dto.getId());
108   - order.setOrderStatus(dto.getOrderStatus());
109   - order.setPayStatus(dto.getPayStatus());
110   - order.setPayTime(dto.getPayTime());
111   - order.setPayType(dto.getPayType());
112   - order.setRealTotalPrice(dto.getRealTotalPrice());
113   - order.setReservationTime(dto.getReservationTime());
114   - order.setSellerId(dto.getSellerId());
115   - order.setShopId(dto.getShopId());
116   - order.setSubmitTime(dto.getSubmitTime());
117   - order.setTotalPrice(dto.getTotalPrice());
118   - return order;
119   - }
120   -}
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/OrderService.java
1 1 package com.diligrp.mobsite.getway.service.buyer.user;
2 2  
3 3 import com.diligrp.mobsite.getway.domain.protocol.order.*;
  4 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
  5 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
4 6  
5 7  
6 8 /**
... ... @@ -20,7 +22,7 @@ public interface OrderService {
20 22 * @createTime 2014年9月1日 下午6:18:36
21 23 * @author zhangshirui
22 24 */
23   - SearchOrderResp getOrders(SearchOrderReq req);
  25 + SearchOrderListResp getOrders(SearchOrderListReq req);
24 26  
25 27  
26 28 /**
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/buyer/user/impl/OrderServiceImpl.java
1 1 package com.diligrp.mobsite.getway.service.buyer.user.impl;
2 2  
  3 +import javax.annotation.Resource;
3 4  
4   -import com.diligrp.mobsite.getway.domain.protocol.order.*;
5   -import com.diligrp.mobsite.getway.rpc.*;
6   -import com.diligrp.mobsite.getway.service.buyer.user.OrderService;
7   -import com.diligrp.website.util.redis.RedisUtil;
8   -import com.diligrp.website.web.interfaces.WebsiteClient;
9   -import com.yqyw.filter.client.KeyWordsClient;
10 5 import org.apache.log4j.Logger;
11 6 import org.springframework.beans.factory.annotation.Autowired;
12 7 import org.springframework.stereotype.Service;
13 8  
14   -import javax.annotation.Resource;
15   -
  9 +import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
  10 +import com.b2c.orders.enums.UserType;
  11 +import com.diligrp.mobsite.getway.domain.protocol.order.AppraiseGoodsReq;
  12 +import com.diligrp.mobsite.getway.domain.protocol.order.AppraiseGoodsResp;
  13 +import com.diligrp.mobsite.getway.domain.protocol.order.CancelOrderReq;
  14 +import com.diligrp.mobsite.getway.domain.protocol.order.CancelOrderResp;
  15 +import com.diligrp.mobsite.getway.domain.protocol.order.ConfirmPickUpReq;
  16 +import com.diligrp.mobsite.getway.domain.protocol.order.ConfirmPickUpResp;
  17 +import com.diligrp.mobsite.getway.domain.protocol.order.DelOrderReq;
  18 +import com.diligrp.mobsite.getway.domain.protocol.order.DelOrderResp;
  19 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderReq;
  20 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
  21 +import com.diligrp.mobsite.getway.domain.protocol.order.PaymentReq;
  22 +import com.diligrp.mobsite.getway.domain.protocol.order.PaymentResp;
  23 +import com.diligrp.mobsite.getway.domain.protocol.order.SendTradeCodeReq;
  24 +import com.diligrp.mobsite.getway.domain.protocol.order.SendTradeCodeResp;
  25 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  26 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  27 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
  28 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
  29 +import com.diligrp.mobsite.getway.rpc.ConfigRPC;
  30 +import com.diligrp.mobsite.getway.rpc.GoodsRPC;
  31 +import com.diligrp.mobsite.getway.rpc.MarketRPC;
  32 +import com.diligrp.mobsite.getway.rpc.MessageRPC;
  33 +import com.diligrp.mobsite.getway.rpc.OrderRPC;
  34 +import com.diligrp.mobsite.getway.rpc.ShopRPC;
  35 +import com.diligrp.mobsite.getway.rpc.UserRPC;
  36 +import com.diligrp.mobsite.getway.service.buyer.user.OrderService;
  37 +import com.diligrp.website.util.redis.RedisUtil;
  38 +import com.diligrp.website.web.interfaces.WebsiteClient;
  39 +import com.yqyw.filter.client.KeyWordsClient;
16 40  
17 41 /**
18 42 * <B>Description</B> 订单 <br />
19   - * <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 />
20 45 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
21 46 * <B>Company</B> 地利集团
22 47 *
... ... @@ -32,8 +57,8 @@ public class OrderServiceImpl implements OrderService {
32 57 private GoodsRPC goodsRPC;
33 58 @Autowired
34 59 private MessageRPC messageRPC;
35   - //@Resource
36   - //private ServiceRPC serviceRPC;
  60 + // @Resource
  61 + // private ServiceRPC serviceRPC;
37 62 @Resource
38 63 private MarketRPC marketRPC;
39 64 @Resource
... ... @@ -43,8 +68,8 @@ public class OrderServiceImpl implements OrderService {
43 68  
44 69 @Resource
45 70 private ShopRPC shopRPC;
46   -
47   -
  71 + @Resource
  72 + private OrderRPC orderRPC;
48 73  
49 74 @Resource
50 75 private KeyWordsClient keyWordsClient;
... ... @@ -53,42 +78,52 @@ public class OrderServiceImpl implements OrderService {
53 78 private WebsiteClient websiteClient;
54 79  
55 80 /*
56   - * 订单查询类型:简单查询-1
57   - * 订单查询类型:详细查询-2
58   - */
  81 + * 订单查询类型:简单查询-1 订单查询类型:详细查询-2
  82 + */
59 83 public static final int SEARCH_TYPE_SIMPLE = 1;
60 84 public static final int SEARCH_TYPE_DETAIL = 2;
61   - /*成功标志*/
  85 + /* 成功标志 */
62 86 public static final int SUCCESS_FLAG = 1;
63 87  
64 88 private static final int DELAY_PICKUP_DAYS = 3;
65 89  
66 90 private static Logger log = Logger.getLogger(OrderServiceImpl.class);
67 91  
68   -
69 92 @Override
70   - public SearchOrderResp getOrders(SearchOrderReq req) {
71   - return null;
  93 + public SearchOrderListResp getOrders(SearchOrderListReq req) {
  94 + OrderListRequestDto input = new OrderListRequestDto();
  95 + input.setOrderStatus(req.getOrderStatus());
  96 + input.setPage(req.getPageNum());
  97 + input.setQueryString(req.getKeyword());
  98 + input.setShopBuyerId(req.getShopBuyerId());
  99 + input.setUserType(UserType.BUYER.getIndex());
  100 + return this.orderRPC.getOrders(input);
72 101 }
73 102  
74 103 @Override
75 104 public SubmitOrderResp submitOrderNew(SubmitOrderReq req) {
76   - return null;
  105 + return this.orderRPC.submit(req);
77 106 }
78 107  
79 108 @Override
80 109 public CancelOrderResp cancelOrder(CancelOrderReq req) {
81   - return null;
  110 + Integer result = this.orderRPC.cancelOrder(req.getOrderId(), req.getUserId());
  111 + CancelOrderResp resp = new CancelOrderResp();
  112 + resp.setCode(result);
  113 + return resp;
82 114 }
83 115  
84 116 @Override
85 117 public ConfirmPickUpResp confirmPickUp(ConfirmPickUpReq req) {
86   - return null;
  118 + Integer result = this.orderRPC.confirmPickUp(req.getOrderId(), req.getUserId());
  119 + ConfirmPickUpResp resp = new ConfirmPickUpResp();
  120 + resp.setCode(result);
  121 + return resp;
87 122 }
88 123  
89 124 @Override
90 125 public GetOrderResp getOrderById(GetOrderReq req) {
91   - return null;
  126 + return this.orderRPC.getOrderById(req.getOrderId(), req.getUserId());
92 127 }
93 128  
94 129 @Override
... ... @@ -103,12 +138,19 @@ public class OrderServiceImpl implements OrderService {
103 138  
104 139 @Override
105 140 public PaymentResp payment(PaymentReq req) {
106   - return null;
  141 + Integer result = this.orderRPC.pay(req.getOrderId(), req.getUserId(), req.getPayType());
  142 + PaymentResp resp = new PaymentResp();
  143 + resp.setCode(result);
  144 + return resp;
107 145 }
108 146  
109 147 @Override
110 148 public DelOrderResp delOrder(DelOrderReq req) {
111   - return null;
  149 + for (Long id : req.getOrderIds()) {
  150 + this.orderRPC.remove(id, req.getUserId(), UserType.BUYER.getIndex());
  151 + }
  152 + DelOrderResp resp = new DelOrderResp();
  153 + return resp;
112 154 }
113 155  
114 156 }
... ...
mobsite-getway-service/src/main/java/com/diligrp/mobsite/getway/service/seller/SellerOrderService.java
1 1 package com.diligrp.mobsite.getway.service.seller;
2 2  
3 3 import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
  4 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderReq;
  5 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
4 6 import com.diligrp.mobsite.getway.domain.protocol.saler.order.*;
5 7  
6   -
7 8 /**
8 9 * <B>Description</B> 订单 <br />
9   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  10 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  11 + * <br />
10 12 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
11 13 * <B>Company</B> 地利集团
  14 + *
12 15 * @createTime 2014年9月1日 下午5:34:20
13 16 * @author zhangshirui
14 17 */
15 18 public interface SellerOrderService {
16 19  
17   - /**
18   - * 获取订单列表
19   - * @param req
20   - * @return
21   - * @createTime 2014年9月1日 下午6:18:36
22   - * @author weili
23   - */
24   - GetOrderListResp getOrders(GetOrderListReq req) throws Exception;
25   -
26   - /**
27   - * 根据id获取订单
28   - * @param req
29   - * @return
30   - * @createTime 2014年9月1日 下午6:39:42
31   - * @author weili
32   - */
33   - GetOrderDetailResp getOrderById(GetOrderDetailReq req);
34   -
35   -
36   -
37   - /**
38   - * 确认收款
39   - * @param req
40   - * @return
41   - * @createTime 2014年9月1日 下午6:18:29
42   - * @author weili
43   - */
44   - ConfirmReceiptMoneyResp comfirmReceiveMoney(ConfirmReceiptMoneyReq req);
45   -
46   -
47   - /**
48   - * 修改订单信息
49   - * @param req
50   - * @return
51   - * @createTime 2014年9月1日 下午6:18:29
52   - * @author weili
53   - */
54   - BaseResp takeOrder(takeOrderReq req);
  20 + /**
  21 + * 获取订单列表
  22 + *
  23 + * @param req
  24 + * @return
  25 + * @createTime 2014年9月1日 下午6:18:36
  26 + * @author weili
  27 + */
  28 + SearchOrderListResp getOrders(SearchOrderListReq req) throws Exception;
55 29  
  30 + /**
  31 + * 根据id获取订单
  32 + *
  33 + * @param req
  34 + * @return
  35 + * @createTime 2014年9月1日 下午6:39:42
  36 + * @author weili
  37 + */
  38 + GetOrderResp getOrderById(GetOrderReq req);
56 39  
  40 + /**
  41 + * 确认收款
  42 + *
  43 + * @param req
  44 + * @return
  45 + * @createTime 2014年9月1日 下午6:18:29
  46 + * @author weili
  47 + */
  48 + ConfirmReceiptMoneyResp comfirmReceiveMoney(ConfirmReceiptMoneyReq req);
57 49  
  50 + /**
  51 + * 修改订单信息
  52 + *
  53 + * @param req
  54 + * @return
  55 + * @createTime 2014年9月1日 下午6:18:29
  56 + * @author weili
  57 + */
  58 + BaseResp takeOrder(TakeOrderReq req);
58 59  
59   - /**
60   - * 拒绝订单
61   - * @param req
62   - * @return
63   - * @createTime 2014年10月21日 下午4:40:17
64   - * @author weili
65   - */
66   - RefuseQuoteResp refuseOrder(RefuseQuoteReq req);
  60 + /**
  61 + * 拒绝订单
  62 + *
  63 + * @param req
  64 + * @return
  65 + * @createTime 2014年10月21日 下午4:40:17
  66 + * @author weili
  67 + */
  68 + RefuseQuoteResp refuseOrder(RefuseQuoteReq req);
67 69  
68   - SearchOrderListResp searchOrders(SearchOrderListReq req);
69 70 }
... ...
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 java.util.ArrayList;
4   -import java.util.List;
5   -
6 3 import javax.annotation.Resource;
7 4  
8   -import org.springframework.util.CollectionUtils;
9   -
10 5 import com.b2c.orders.domain.client.dto.request.OrderListRequestDto;
11   -import com.b2c.orders.domain.client.dto.response.OrderListResponseDto;
12   -import com.diligrp.mobsite.getway.domain.common.ResultCode;
  6 +import com.b2c.orders.enums.UserType;
13 7 import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
14   -import com.diligrp.mobsite.getway.domain.protocol.Order;
  8 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderReq;
  9 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
15 10 import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyReq;
16 11 import com.diligrp.mobsite.getway.domain.protocol.saler.order.ConfirmReceiptMoneyResp;
17   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailReq;
18   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
19   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListReq;
20   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderListResp;
21 12 import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteReq;
22 13 import com.diligrp.mobsite.getway.domain.protocol.saler.order.RefuseQuoteResp;
23 14 import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
24 15 import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
25   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.takeOrderReq;
  16 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.TakeOrderReq;
26 17 import com.diligrp.mobsite.getway.rpc.OrderRPC;
27 18 import com.diligrp.mobsite.getway.service.seller.SellerOrderService;
28   -import com.diligrp.titan.sdk.output.PageOutput;
29 19  
30 20 /**
31 21 * <B>Description</B> 订单 <br />
... ... @@ -44,58 +34,18 @@ public class SellerOrderServiceImpl implements SellerOrderService {
44 34 private OrderRPC orderRPC;
45 35  
46 36 @Override
47   - public GetOrderListResp getOrders(GetOrderListReq req) throws Exception {
48   - GetOrderListResp resp = new GetOrderListResp();
49   - OrderListRequestDto request = new OrderListRequestDto();
50   - request.setOrderStatus(req.getOrderStatus());
51   - request.setPage(req.getPageNum());
52   - request.setQueryString(req.getQueryString());
53   - request.setSellerId(req.getSellerId());
54   - request.setUserType(req.getUserType());
55   - PageOutput<List<OrderListResponseDto>> result = this.orderRPC.getOrders(request, req.getUserId());
56   - if (result == null) {
57   - resp.setCode(ResultCode.NETWORK_FAILED);
58   - return resp;
59   - }
60   - if (result.getCode() == ResultCode.SUCCESS) {
61   - if (!CollectionUtils.isEmpty(result.getData())) {
62   - List<Order> orderList = new ArrayList<>(result.getData().size());
63   - for (OrderListResponseDto dto : result.getData()) {
64   - Order order = this.convertToOrder(dto);
65   - orderList.add(order);
66   - }
67   - resp.setOrders(orderList);
68   - }
69   - }
70   - resp.setCode(result.getCode());
71   - resp.setMaxPageNum(result.getTotalPage());
72   - resp.setMsg(result.getResult());
73   - return resp;
74   - }
75   -
76   - private Order convertToOrder(OrderListResponseDto dto) {
77   - Order order = new Order();
78   - order.setBuyerConfirmTime(dto.getBuyerConfirmTime());
79   - order.setBuyerId(dto.getBuyerId());
80   - order.setBuyerMemo(dto.getBuyerMemo());
81   - order.setDeliveryTime(dto.getDeliveryTime());
82   - order.setDeliveryType(dto.getDeliveryType());
83   - order.setId(dto.getId());
84   - order.setOrderStatus(dto.getOrderStatus());
85   - order.setPayStatus(dto.getPayStatus());
86   - order.setPayTime(dto.getPayTime());
87   - order.setPayType(dto.getPayType());
88   - order.setRealTotalPrice(dto.getRealTotalPrice());
89   - order.setReservationTime(dto.getReservationTime());
90   - order.setSellerId(dto.getSellerId());
91   - order.setShopId(dto.getShopId());
92   - order.setSubmitTime(dto.getSubmitTime());
93   - order.setTotalPrice(dto.getTotalPrice());
94   - return order;
  37 + public SearchOrderListResp getOrders(SearchOrderListReq req) throws Exception {
  38 + OrderListRequestDto input = new OrderListRequestDto();
  39 + input.setOrderStatus(req.getOrderStatus());
  40 + input.setPage(req.getPageNum());
  41 + input.setQueryString(req.getKeyword());
  42 + input.setSellerId(req.getSellerId());
  43 + input.setUserType(UserType.SELLER.getIndex());
  44 + return this.orderRPC.getOrders(input);
95 45 }
96 46  
97 47 @Override
98   - public GetOrderDetailResp getOrderById(GetOrderDetailReq req) {
  48 + public GetOrderResp getOrderById(GetOrderReq req) {
99 49 return this.orderRPC.getOrderById(req.getOrderId(), req.getUserId());
100 50 }
101 51  
... ... @@ -108,7 +58,7 @@ public class SellerOrderServiceImpl implements SellerOrderService {
108 58 }
109 59  
110 60 @Override
111   - public BaseResp takeOrder(takeOrderReq req) {
  61 + public BaseResp takeOrder(TakeOrderReq req) {
112 62 BaseResp resp = new BaseResp();
113 63 Integer result = this.orderRPC.take(req.getOrderId(), req.getUserId(), req.getPricePrivilege());
114 64 resp.setCode(result);
... ... @@ -123,32 +73,4 @@ public class SellerOrderServiceImpl implements SellerOrderService {
123 73 return resp;
124 74 }
125 75  
126   - @Override
127   - public SearchOrderListResp searchOrders(SearchOrderListReq req) {
128   - SearchOrderListResp resp = new SearchOrderListResp();
129   - OrderListRequestDto input = new OrderListRequestDto();
130   - input.setOrderStatus(req.getOrderStatus());
131   - input.setPage(req.getPageNum());
132   - input.setQueryString(req.getKeyword());
133   - input.setSellerId(req.getSellerId());
134   - input.setShopBuyerId(req.getShopBuyerId());
135   - PageOutput<List<OrderListResponseDto>> result = this.orderRPC.getOrders(input, req.getUserId());
136   - if (result == null) {
137   - resp.setCode(ResultCode.NETWORK_FAILED);
138   - return resp;
139   - }
140   - if (result.getCode() == ResultCode.SUCCESS) {
141   - if (!CollectionUtils.isEmpty(result.getData())) {
142   - List<Order> orders = new ArrayList<>(result.getData().size());
143   - for (OrderListResponseDto dto : result.getData()) {
144   - Order order = this.convertToOrder(dto);
145   - orders.add(order);
146   - }
147   - resp.setOrders(orders);
148   - }
149   - }
150   - resp.setMaxPageNum(result.getTotalPage());
151   - resp.setMsg(result.getResult());
152   - return resp;
153   - }
154 76 }
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/order/BuyerOrderController.java deleted 100644 → 0
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.domain.protocol.saler.order.GetOrderDetailReq;
22   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.GetOrderDetailResp;
23   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
24   -import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
25   -import com.diligrp.mobsite.getway.service.buyer.BuyerOrderService;
26   -import com.diligrp.mobsite.getway.web.api.base.BaseApiController;
27   -
28   -import io.swagger.annotations.Api;
29   -
30   -@RestController
31   -@RequestMapping(value = "/mobsiteApp/buyer/order", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
32   -@Api(value = "/mobsiteApp-order-buyer", description = "订单接口-买家")
33   -public class BuyerOrderController extends BaseApiController {
34   -
35   - private static final Logger log = LoggerFactory.getLogger(BuyerOrderController.class);
36   -
37   - @Resource
38   - private BuyerOrderService buyerOrderService;
39   -
40   - /**
41   - * 提交订单
42   - *
43   - * @param req
44   - */
45   - @RequestMapping(value = "/submit", method = RequestMethod.POST)
46   - public void submit(@RequestBody SubmitOrderReq req) {
47   - try {
48   - SubmitOrderResp resp = buyerOrderService.submit(req);
49   - super.sendSuccessResp(resp);
50   - } catch (Exception e) {
51   - log.error("提交订单失败", e);
52   - super.sendError(e.getMessage());
53   - }
54   - }
55   -
56   - @RequestMapping(value = "/pay", method = RequestMethod.POST)
57   - public void pay(@RequestBody PayOrderReq req) {
58   - try {
59   - PayOrderResp resp = buyerOrderService.pay(req);
60   - super.sendSuccessResp(resp);
61   - } catch (Exception e) {
62   - log.error("提交订单失败", e);
63   - super.sendError(e.getMessage());
64   - }
65   - }
66   -
67   - @RequestMapping(value = "/confirmReceipt")
68   - public void confirmReceipt(@RequestBody BuyerConfirmReceiptReq req) {
69   - try {
70   - BuyerConfirmReceiptResp resp = buyerOrderService.confirmReceipt(req);
71   - super.sendSuccessResp(resp);
72   - } catch (Exception e) {
73   - log.error("提交订单失败", e);
74   - super.sendError(e.getMessage());
75   - }
76   - }
77   -
78   - @RequestMapping(value = "/cancel", method = RequestMethod.POST)
79   - public void cancel(@RequestBody BuyerCancelOrderReq req) {
80   - try {
81   - BuyerCancelOrderResp resp = buyerOrderService.cancel(req);
82   - super.sendSuccessResp(resp);
83   - } catch (Exception e) {
84   - log.error("提交订单失败", e);
85   - super.sendError(e.getMessage());
86   - }
87   - }
88   -
89   - @RequestMapping(value = "/detail", method = RequestMethod.POST)
90   - public void detail(@RequestBody GetOrderDetailReq req) {
91   - try {
92   - GetOrderDetailResp resp = buyerOrderService.getOrderById(req);
93   - super.sendSuccessResp(resp);
94   - } catch (Exception e) {
95   - log.error("提交订单失败", e);
96   - super.sendError(e.getMessage());
97   - }
98   - }
99   -
100   - @RequestMapping(value = "/list", method = RequestMethod.POST)
101   - public void list(@RequestBody SearchOrderListReq req) {
102   - try {
103   - SearchOrderListResp resp = this.buyerOrderService.searchOrders(req);
104   - super.sendSuccessResp(resp);
105   - } catch (Exception e) {
106   - log.error("提交订单失败", e);
107   - super.sendError(e.getMessage());
108   - }
109   - }
110   -}
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/buyer/order/OrderController.java 0 → 100644
  1 +package com.diligrp.mobsite.getway.web.api.buyer.order;
  2 +
  3 +import javax.annotation.Resource;
  4 +import javax.servlet.http.HttpServletRequest;
  5 +
  6 +import org.apache.log4j.Logger;
  7 +import org.springframework.stereotype.Controller;
  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.ResponseBody;
  12 +
  13 +import com.diligrp.mobsite.getway.domain.except.ServiceException;
  14 +import com.diligrp.mobsite.getway.domain.protocol.order.CancelOrderReq;
  15 +import com.diligrp.mobsite.getway.domain.protocol.order.CancelOrderResp;
  16 +import com.diligrp.mobsite.getway.domain.protocol.order.ConfirmPickUpReq;
  17 +import com.diligrp.mobsite.getway.domain.protocol.order.ConfirmPickUpResp;
  18 +import com.diligrp.mobsite.getway.domain.protocol.order.DelOrderReq;
  19 +import com.diligrp.mobsite.getway.domain.protocol.order.DelOrderResp;
  20 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderReq;
  21 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
  22 +import com.diligrp.mobsite.getway.domain.protocol.order.PaymentReq;
  23 +import com.diligrp.mobsite.getway.domain.protocol.order.PaymentResp;
  24 +import com.diligrp.mobsite.getway.domain.protocol.order.SearchOrderReq;
  25 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderReq;
  26 +import com.diligrp.mobsite.getway.domain.protocol.order.SubmitOrderResp;
  27 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListReq;
  28 +import com.diligrp.mobsite.getway.domain.protocol.saler.order.SearchOrderListResp;
  29 +import com.diligrp.mobsite.getway.service.buyer.user.OrderService;
  30 +import com.diligrp.mobsite.getway.web.api.base.BaseApiController;
  31 +import com.diligrp.mobsite.getway.web.utils.BeanValidator;
  32 +
  33 +import io.swagger.annotations.Api;
  34 +import io.swagger.annotations.ApiImplicitParam;
  35 +import io.swagger.annotations.ApiImplicitParams;
  36 +import io.swagger.annotations.ApiOperation;
  37 +
  38 +/**
  39 + * <B>Description</B> 订单操作 <br />
  40 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  41 + * <br />
  42 + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  43 + * <B>Company</B> 地利集团
  44 + *
  45 + * @createTime 2014年9月1日 下午2:30:41
  46 + * @author weili
  47 + */
  48 +@Controller
  49 +@RequestMapping("/mobsiteApp/order/")
  50 +@Api(value = "mobsiteApp-order", description = "订单接口-买家")
  51 +public class OrderController extends BaseApiController {
  52 +
  53 + @Resource
  54 + private OrderService orderService;
  55 +
  56 + private static Logger log = Logger.getLogger(OrderController.class);
  57 +
  58 + /**
  59 + * 获取订单列表
  60 + *
  61 + * 请求协议体:SearchOrderReq 返回协议体:SearchOrderResp
  62 + *
  63 + * @createTime 2014年9月1日 下午5:32:02
  64 + * @author weili
  65 + * @return
  66 + */
  67 + @ApiOperation(value = "获取订单列表", httpMethod = "POST", response = SearchOrderListResp.class)
  68 + @RequestMapping(value = "/getOrders", method = RequestMethod.POST)
  69 + @ApiImplicitParams({ @ApiImplicitParam(paramType = "body", name = "temp", dataType = "SearchOrderReq") })
  70 + @ResponseBody
  71 + public void getOrders(@RequestBody SearchOrderReq temp) {
  72 +
  73 + SearchOrderListReq req = super.getRequest(SearchOrderListReq.class);
  74 + try {
  75 + SearchOrderListResp resp = orderService.getOrders(req);
  76 + super.sendSuccessResp(resp);
  77 + } catch (ServiceException e) {
  78 + log.error("获取订单列表出现业务异常", e);
  79 + super.sendError(e.getCode(), e.getMessage());
  80 + } catch (Exception e) {
  81 + log.error("获取订单列表失败", e);
  82 + super.sendError(e.getMessage());
  83 + }
  84 + }
  85 +
  86 + /**
  87 + * 根据订单id查询订单
  88 + *
  89 + * 请求协议体:GetOrderReq 返回协议体:GetOrderResp
  90 + *
  91 + * @createTime 2014年9月1日 下午6:39:10
  92 + * @author weili
  93 + */
  94 + @ApiOperation(value = "根据订单id查询订单", httpMethod = "POST", response = GetOrderResp.class)
  95 + @RequestMapping(value = "/getOrderById", method = RequestMethod.POST)
  96 + @ResponseBody
  97 + public void getOrderById(@RequestBody GetOrderReq temp) {
  98 +
  99 + GetOrderReq req = super.getRequest(GetOrderReq.class);
  100 + try {
  101 + GetOrderResp resp = orderService.getOrderById(req);
  102 + super.sendSuccessResp(resp);
  103 + } catch (ServiceException e) {
  104 + log.error("获取订单详情出现业务异常", e);
  105 + super.sendError(e.getCode(), e.getMessage());
  106 + } catch (Exception e) {
  107 + log.error("获取订单详情失败", e);
  108 + super.sendError(e.getMessage());
  109 + }
  110 + }
  111 +
  112 + /**
  113 + * 提交订单
  114 + *
  115 + * 请求协议体:SubmitOrderReq 返回协议体:SubmitOrderResp
  116 + *
  117 + * @createTime 2014年9月1日 下午6:05:23
  118 + * @author weili
  119 + */
  120 + @ApiOperation(value = "提交订单", httpMethod = "POST", response = SubmitOrderResp.class)
  121 + @RequestMapping(value = "/submitOrder", method = RequestMethod.POST)
  122 + @ResponseBody
  123 + public void submitOrder(HttpServletRequest request, @RequestBody SubmitOrderReq temp) {
  124 +
  125 + SubmitOrderReq req = super.getRequest(SubmitOrderReq.class);
  126 + try {
  127 + BeanValidator.validator(req);
  128 + SubmitOrderResp resp = orderService.submitOrderNew(req);
  129 + // try {
  130 + // log.info(String.format("提交订单:[ 设备id<%s>用户id<%s>订单id<%s>]"
  131 + // , req.getDeviceId(), req.getUserId(), resp.getOrderInfos().ge
  132 + // getOrderId(), );
  133 + // }catch (Exception e) {
  134 + // log.error("记录下单日志出错!");
  135 + // }
  136 + super.sendSuccessResp(resp);
  137 + } catch (ServiceException e) {
  138 + log.error("提交订单出现业务异常", e);
  139 + super.sendError(e.getCode(), e.getMessage());
  140 + } catch (Exception e) {
  141 + log.error("提交订单失败", e);
  142 + super.sendError(e.getMessage());
  143 + }
  144 + }
  145 +
  146 + /**
  147 + * 付款
  148 + *
  149 + * 请求协议体:paymentreq 返回协议体:PaymentResp
  150 + *
  151 + * @createTime 2014年9月1日 下午6:05:23
  152 + * @author weili
  153 + */
  154 + @ApiOperation(value = "支付", httpMethod = "POST", response = PaymentResp.class)
  155 + @RequestMapping(value = "/payment", method = RequestMethod.POST)
  156 + @ResponseBody
  157 + public void payment(@RequestBody PaymentReq temp) {
  158 + PaymentReq req = super.getRequest(PaymentReq.class);
  159 + try {
  160 + BeanValidator.validator(req);
  161 + PaymentResp resp = orderService.payment(req);
  162 + super.sendSuccessResp(resp);
  163 + } catch (ServiceException e) {
  164 + log.error("录入线下付款信息出现业务异常", e);
  165 + super.sendError(e.getCode(), e.getMessage());
  166 + } catch (Exception e) {
  167 + log.error("录入线下付款信息失败", e);
  168 + super.sendError(e.getMessage());
  169 + }
  170 + }
  171 +
  172 + /**
  173 + * 取消订单
  174 + *
  175 + * 请求协议体:CancelOrderReq 返回协议体:CancelOrderResp
  176 + *
  177 + * @createTime 2014年9月1日 下午6:08:06
  178 + * @author weili
  179 + */
  180 + @ApiOperation(value = "取消订单", httpMethod = "POST", response = CancelOrderResp.class)
  181 + @RequestMapping(value = "/cancelOrder", method = RequestMethod.POST)
  182 + @ResponseBody
  183 + public void cancelOrder(@RequestBody CancelOrderReq temp) {
  184 +
  185 + CancelOrderReq req = super.getRequest(CancelOrderReq.class);
  186 + try {
  187 + CancelOrderResp resp = orderService.cancelOrder(req);
  188 + super.sendSuccessResp(resp);
  189 + } catch (ServiceException e) {
  190 + log.error("取消订单出现业务异常", e);
  191 + super.sendError(e.getCode(), e.getMessage());
  192 + } catch (Exception e) {
  193 + log.error("取消订单失败", e);
  194 + super.sendError(e.getMessage());
  195 + }
  196 + }
  197 +
  198 + /**
  199 + * 取消订单
  200 + *
  201 + * 请求协议体:CancelOrderReq 返回协议体:CancelOrderResp
  202 + *
  203 + * @createTime 2014年9月1日 下午6:08:06
  204 + * @author weili
  205 + */
  206 + @ApiOperation(value = "删除订单", httpMethod = "POST", response = DelOrderResp.class)
  207 + @RequestMapping(value = "/delOrder", method = RequestMethod.POST)
  208 + @ResponseBody
  209 + public void delOrder(@RequestBody DelOrderReq temp) {
  210 +
  211 + DelOrderReq req = super.getRequest(DelOrderReq.class);
  212 + try {
  213 + DelOrderResp resp = orderService.delOrder(req);
  214 + super.sendSuccessResp(resp);
  215 + } catch (ServiceException e) {
  216 + log.error("取消订单出现业务异常", e);
  217 + super.sendError(e.getCode(), e.getMessage());
  218 + } catch (Exception e) {
  219 + log.error("取消订单失败", e);
  220 + super.sendError(e.getMessage());
  221 + }
  222 + }
  223 +
  224 + /**
  225 + * 确认收货
  226 + *
  227 + * 请求协议体:ConfirmPickUpReq 返回协议体:ConfirmPickUpResp
  228 + *
  229 + * @createTime 2014年9月1日 下午6:16:05
  230 + * @author weili
  231 + */
  232 + @ApiOperation(value = "确认收货", httpMethod = "POST", response = ConfirmPickUpResp.class)
  233 + @RequestMapping(value = "/confirmPickUp", method = RequestMethod.POST)
  234 + @ResponseBody
  235 + public void confirmPickUp(@RequestBody ConfirmPickUpReq temp) {
  236 + ConfirmPickUpReq req = super.getRequest(ConfirmPickUpReq.class);
  237 + try {
  238 + ConfirmPickUpResp resp = orderService.confirmPickUp(req);
  239 + super.sendSuccessResp(resp);
  240 + } catch (ServiceException e) {
  241 + log.error("确认收货出现业务异常", e);
  242 + super.sendError(e.getCode(), e.getMessage());
  243 + } catch (Exception e) {
  244 + log.error("确认收货失败", e);
  245 + super.sendError(e.getMessage());
  246 + }
  247 + }
  248 +
  249 +}
... ...
mobsite-getway-web/src/main/java/com/diligrp/mobsite/getway/web/api/seller/order/SellerOrderController.java
... ... @@ -3,6 +3,8 @@ package com.diligrp.mobsite.getway.web.api.seller.order;
3 3 import com.diligrp.mobsite.getway.domain.except.ServiceException;
4 4 import com.diligrp.mobsite.getway.domain.protocol.BaseResp;
5 5 import com.diligrp.mobsite.getway.domain.protocol.order.CancelOrderResp;
  6 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderReq;
  7 +import com.diligrp.mobsite.getway.domain.protocol.order.GetOrderResp;
6 8 import com.diligrp.mobsite.getway.domain.protocol.saler.order.*;
7 9 import com.diligrp.mobsite.getway.service.seller.SellerOrderService;
8 10 import com.diligrp.mobsite.getway.web.api.base.BaseApiController;
... ... @@ -17,12 +19,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
17 19  
18 20 import javax.annotation.Resource;
19 21  
20   -
21 22 /**
22 23 * <B>Description</B> 订单操作 <br />
23   - * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
  24 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  25 + * <br />
24 26 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
25 27 * <B>Company</B> 地利集团
  28 + *
26 29 * @createTime 2014年9月1日 下午2:30:41
27 30 * @author weili
28 31 */
... ... @@ -30,175 +33,137 @@ import javax.annotation.Resource;
30 33 @RequestMapping("/mobsiteApp/seller/order")
31 34 @Api(value = "/mobsiteApp-order-seller", description = "订单接口-卖家")
32 35 public class SellerOrderController extends BaseApiController {
33   - @Resource
34   - private SellerOrderService sellerOrderService;
35   -
36   - private static Logger log = Logger.getLogger(SellerOrderController.class);
37   -
38   - /**
39   - * 获取订单列表
40   - * <p/>
41   - * 请求协议体:GetOrderListReq
42   - * 返回协议体:GetOrderListResp
43   - *
44   - * @return
45   - * @createTime 2017年1月3日 下午5:32:02
46   - * @author weili
47   - */
48   - @ApiOperation(value = "获取订单列表", httpMethod = "POST",response = GetOrderListResp.class)
49   - @RequestMapping(value = "/getOrders",method = RequestMethod.POST)
50   - @ResponseBody
51   - public void getOrders(@RequestBody GetOrderListReq temp) {
52   -
53   - GetOrderListReq req = super.getRequest(GetOrderListReq.class);
54   - try {
55   - GetOrderListResp resp = sellerOrderService.getOrders(req);
56   - super.sendSuccessResp(resp);
57   - } catch (ServiceException e) {
58   - log.error("获取订单列表出现业务异常", e);
59   - super.sendError(e.getCode(), e.getMessage());
60   - } catch (Exception e) {
61   - log.error("获取订单列表失败", e);
62   - super.sendError(e.getMessage());
63   - }
64   - }
65   -
66   - /**
67   - * 根据订单id查询订单
68   - * <p/>
69   - * 请求协议体:GetOrderReq
70   - * 返回协议体:GetOrderResp
71   - *
72   - * @createTime 2014年9月1日 下午6:39:10
73   - * @author weili
74   - */
75   - @ApiOperation(value = "根据订单id查询订单", httpMethod = "POST",response = GetOrderDetailResp.class)
76   - @RequestMapping(value = "/getOrderById",method = RequestMethod.POST)
77   - @ResponseBody
78   - public void getOrderById(@RequestBody GetOrderDetailReq temp) {
79   -
80   - GetOrderDetailReq req = super.getRequest(GetOrderDetailReq.class);
81   - try {
82   - GetOrderDetailResp resp = sellerOrderService.getOrderById(req);
83   - super.sendSuccessResp(resp);
84   - } catch (ServiceException e) {
85   - log.error("获取订单详情出现业务异常", e);
86   - super.sendError(e.getCode(), e.getMessage());
87   - } catch (Exception e) {
88   - log.error("获取订单详情失败", e);
89   - super.sendError(e.getMessage());
90   - }
91   - }
92   -
93   -
94   - /**
95   - * 搜索订单列表
96   - * <p/>
97   - * 请求协议体:GetOrderListReq
98   - * 返回协议体:GetOrderListResp
99   - *
100   - * @return
101   - * @createTime 2017年1月3日 下午5:32:02
102   - * @author weili
103   - */
104   - @ApiOperation(value = "搜索订单列表", httpMethod = "POST",response = SearchOrderListResp.class)
105   - @RequestMapping(value = "/searchOrders",method = RequestMethod.POST)
106   - @ResponseBody
107   - public void searchOrders(@RequestBody SearchOrderListReq temp) {
108   -
109   - SearchOrderListReq req = super.getRequest(SearchOrderListReq.class);
110   - try {
111   - SearchOrderListResp resp = sellerOrderService.searchOrders(req);
112   - super.sendSuccessResp(resp);
113   - } catch (ServiceException e) {
114   - log.error("获取订单列表出现业务异常", e);
115   - super.sendError(e.getCode(), e.getMessage());
116   - } catch (Exception e) {
117   - log.error("获取订单列表失败", e);
118   - super.sendError(e.getMessage());
119   - }
120   - }
121   -
122   - /**
123   - * 确认收款
124   - * <p/>
125   - * 请求协议体:OperateOrderCommonReq
126   - * 返回协议体:OperateOrderCommonResp
127   - *
128   - * @createTime 2014年9月1日 下午6:16:05
129   - * @author weili
130   - */
131   - @ApiOperation(value = "确认收款", httpMethod = "POST",response = ConfirmReceiptMoneyResp.class)
132   - @RequestMapping(value = "/comfirmReceiveMoney",method = RequestMethod.POST)
133   - @ResponseBody
134   - public void comfirmReceiveMoney(@RequestBody ConfirmReceiptMoneyReq temp) {
135   - ConfirmReceiptMoneyReq req = super.getRequest(ConfirmReceiptMoneyReq.class);
136   - try {
137   - ConfirmReceiptMoneyResp resp = sellerOrderService.comfirmReceiveMoney(req);
138   - super.sendSuccessResp(resp);
139   - } catch (ServiceException e) {
140   - log.error("确认收款异常", e);
141   - super.sendError(e.getCode(), e.getMessage());
142   - } catch (Exception e) {
143   - log.error("确认收款失败", e);
144   - super.sendError(e.getMessage());
145   - }
146   - }
147   -
148   -
149   -
150   -
151   - /**
152   - * 接单
153   - * <p/>
154   - * 请求协议体:takeOrderReq
155   - * 返回协议体:OperateOrderCommonResp
156   - *
157   - * @createTime 2014年9月1日 下午6:16:05
158   - * @author weili
159   - */
160   - @ApiOperation(value = "接单", httpMethod = "POST",response = CancelOrderResp.class)
161   - @RequestMapping(value = "/takeOrder",method = RequestMethod.POST)
162   - @ResponseBody
163   - public void takeOrder(@RequestBody takeOrderReq temp) {
164   - takeOrderReq req = super.getRequest(takeOrderReq.class);
165   - try {
166   - BaseResp resp = sellerOrderService.takeOrder(req);
167   - super.sendSuccessResp(resp);
168   - } catch (ServiceException e) {
169   - log.error("接单异常", e);
170   - super.sendError(e.getCode(), e.getMessage());
171   - } catch (Exception e) {
172   - log.error("接单失败", e);
173   - super.sendError(e.getMessage());
174   - }
175   - }
176   -
  36 + @Resource
  37 + private SellerOrderService sellerOrderService;
  38 +
  39 + private static Logger log = Logger.getLogger(SellerOrderController.class);
  40 +
  41 + /**
  42 + * 获取订单列表
  43 + * <p/>
  44 + * 请求协议体:GetOrderListReq 返回协议体:GetOrderListResp
  45 + *
  46 + * @return
  47 + * @createTime 2017年1月3日 下午5:32:02
  48 + * @author weili
  49 + */
  50 + @ApiOperation(value = "获取订单列表", httpMethod = "POST", response = GetOrderListResp.class)
  51 + @RequestMapping(value = "/getOrders", method = RequestMethod.POST)
  52 + @ResponseBody
  53 + public void getOrders(@RequestBody GetOrderListReq temp) {
  54 +
  55 + SearchOrderListReq req = super.getRequest(SearchOrderListReq.class);
  56 + try {
  57 + SearchOrderListResp resp = sellerOrderService.getOrders(req);
  58 + super.sendSuccessResp(resp);
  59 + } catch (ServiceException e) {
  60 + log.error("获取订单列表出现业务异常", e);
  61 + super.sendError(e.getCode(), e.getMessage());
  62 + } catch (Exception e) {
  63 + log.error("获取订单列表失败", e);
  64 + super.sendError(e.getMessage());
  65 + }
  66 + }
  67 +
  68 + /**
  69 + * 根据订单id查询订单
  70 + * <p/>
  71 + * 请求协议体:GetOrderReq 返回协议体:GetOrderResp
  72 + *
  73 + * @createTime 2014年9月1日 下午6:39:10
  74 + * @author weili
  75 + */
  76 + @ApiOperation(value = "根据订单id查询订单", httpMethod = "POST", response = GetOrderDetailResp.class)
  77 + @RequestMapping(value = "/getOrderById", method = RequestMethod.POST)
  78 + @ResponseBody
  79 + public void getOrderById(@RequestBody GetOrderDetailReq temp) {
  80 +
  81 + GetOrderReq req = super.getRequest(GetOrderReq.class);
  82 + try {
  83 + GetOrderResp resp = sellerOrderService.getOrderById(req);
  84 + super.sendSuccessResp(resp);
  85 + } catch (ServiceException e) {
  86 + log.error("获取订单详情出现业务异常", e);
  87 + super.sendError(e.getCode(), e.getMessage());
  88 + } catch (Exception e) {
  89 + log.error("获取订单详情失败", e);
  90 + super.sendError(e.getMessage());
  91 + }
  92 + }
  93 +
  94 + /**
  95 + * 确认收款
  96 + * <p/>
  97 + * 请求协议体:OperateOrderCommonReq 返回协议体:OperateOrderCommonResp
  98 + *
  99 + * @createTime 2014年9月1日 下午6:16:05
  100 + * @author weili
  101 + */
  102 + @ApiOperation(value = "确认收款", httpMethod = "POST", response = ConfirmReceiptMoneyResp.class)
  103 + @RequestMapping(value = "/comfirmReceiveMoney", method = RequestMethod.POST)
  104 + @ResponseBody
  105 + public void comfirmReceiveMoney(@RequestBody ConfirmReceiptMoneyReq temp) {
  106 + ConfirmReceiptMoneyReq req = super.getRequest(ConfirmReceiptMoneyReq.class);
  107 + try {
  108 + ConfirmReceiptMoneyResp resp = sellerOrderService.comfirmReceiveMoney(req);
  109 + super.sendSuccessResp(resp);
  110 + } catch (ServiceException e) {
  111 + log.error("确认收款异常", e);
  112 + super.sendError(e.getCode(), e.getMessage());
  113 + } catch (Exception e) {
  114 + log.error("确认收款失败", e);
  115 + super.sendError(e.getMessage());
  116 + }
  117 + }
  118 +
  119 + /**
  120 + * 接单
  121 + * <p/>
  122 + * 请求协议体:takeOrderReq 返回协议体:OperateOrderCommonResp
  123 + *
  124 + * @createTime 2014年9月1日 下午6:16:05
  125 + * @author weili
  126 + */
  127 + @ApiOperation(value = "接单", httpMethod = "POST", response = CancelOrderResp.class)
  128 + @RequestMapping(value = "/takeOrder", method = RequestMethod.POST)
  129 + @ResponseBody
  130 + public void takeOrder(@RequestBody TakeOrderReq temp) {
  131 + TakeOrderReq req = super.getRequest(TakeOrderReq.class);
  132 + try {
  133 + BaseResp resp = sellerOrderService.takeOrder(req);
  134 + super.sendSuccessResp(resp);
  135 + } catch (ServiceException e) {
  136 + log.error("接单异常", e);
  137 + super.sendError(e.getCode(), e.getMessage());
  138 + } catch (Exception e) {
  139 + log.error("接单失败", e);
  140 + super.sendError(e.getMessage());
  141 + }
  142 + }
  143 +
  144 + /**
  145 + * 拒绝接单
  146 + * <p/>
  147 + * 请求协议体:takeOrderReq 返回协议体:OperateOrderCommonResp
  148 + *
  149 + * @createTime 2014年9月1日 下午6:16:05
  150 + * @author weili
  151 + */
  152 + @ApiOperation(value = "拒绝接单", httpMethod = "POST", response = CancelOrderResp.class)
  153 + @RequestMapping(value = "/refuseOrder", method = RequestMethod.POST)
  154 + @ResponseBody
  155 + public void refuseOrder(@RequestBody RefuseQuoteReq temp) {
  156 + RefuseQuoteReq req = super.getRequest(RefuseQuoteReq.class);
  157 + try {
  158 + RefuseQuoteResp resp = sellerOrderService.refuseOrder(req);
  159 + super.sendSuccessResp(resp);
  160 + } catch (ServiceException e) {
  161 + log.error("接单异常", e);
  162 + super.sendError(e.getCode(), e.getMessage());
  163 + } catch (Exception e) {
  164 + log.error("接单失败", e);
  165 + super.sendError(e.getMessage());
  166 + }
  167 + }
177 168  
178   - /**
179   - * 拒绝接单
180   - * <p/>
181   - * 请求协议体:takeOrderReq
182   - * 返回协议体:OperateOrderCommonResp
183   - *
184   - * @createTime 2014年9月1日 下午6:16:05
185   - * @author weili
186   - */
187   - @ApiOperation(value = "拒绝接单", httpMethod = "POST",response = CancelOrderResp.class)
188   - @RequestMapping(value = "/refuseOrder",method = RequestMethod.POST)
189   - @ResponseBody
190   - public void refuseOrder(@RequestBody RefuseQuoteReq temp) {
191   - RefuseQuoteReq req = super.getRequest(RefuseQuoteReq.class);
192   - try {
193   - RefuseQuoteResp resp = sellerOrderService.refuseOrder(req);
194   - super.sendSuccessResp(resp);
195   - } catch (ServiceException e) {
196   - log.error("接单异常", e);
197   - super.sendError(e.getCode(), e.getMessage());
198   - } catch (Exception e) {
199   - log.error("接单失败", e);
200   - super.sendError(e.getMessage());
201   - }
202   - }
203   -
204 169 }
205 170 \ No newline at end of file
... ...
... ... @@ -366,7 +366,7 @@
366 366 <dependency>
367 367 <groupId>com.b2c.orders</groupId>
368 368 <artifactId>b2c-orders-client</artifactId>
369   - <version>0.0.2-SNAPSHOT</version>
  369 + <version>0.0.3-SNAPSHOT</version>
370 370 </dependency>
371 371  
372 372 <!--商品库sdk-->
... ...