Merge branch 'test6.8.6' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.6
Showing
8 changed files
with
89 additions
and
152 deletions
@@ -6,15 +6,12 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo; | @@ -6,15 +6,12 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo; | ||
6 | import com.yohobuy.ufo.model.order.common.OrderListType; | 6 | import com.yohobuy.ufo.model.order.common.OrderListType; |
7 | import com.yohobuy.ufo.model.order.common.SellerOrderListType; | 7 | import com.yohobuy.ufo.model.order.common.SellerOrderListType; |
8 | import com.yohobuy.ufo.model.order.common.TabType; | 8 | import com.yohobuy.ufo.model.order.common.TabType; |
9 | -import com.yohobuy.ufo.model.order.req.BuyerOrderCancelReq; | ||
10 | import com.yohobuy.ufo.model.order.resp.BuyerOrderNums; | 9 | import com.yohobuy.ufo.model.order.resp.BuyerOrderNums; |
11 | import com.yohobuy.ufo.model.order.resp.OrderCntResp; | 10 | import com.yohobuy.ufo.model.order.resp.OrderCntResp; |
12 | import com.yohobuy.ufo.model.order.resp.OrderListInfo; | 11 | import com.yohobuy.ufo.model.order.resp.OrderListInfo; |
13 | import com.yohobuy.ufo.model.order.resp.PageResp; | 12 | import com.yohobuy.ufo.model.order.resp.PageResp; |
14 | import com.yohobuy.ufo.model.order.vo.AddressInfo; | 13 | import com.yohobuy.ufo.model.order.vo.AddressInfo; |
15 | import com.yohoufo.common.ApiResponse; | 14 | import com.yohoufo.common.ApiResponse; |
16 | -import com.yohoufo.common.annotation.IgnoreSession; | ||
17 | -import com.yohoufo.common.annotation.IgnoreSignature; | ||
18 | import com.yohoufo.order.model.request.OrderListRequest; | 15 | import com.yohoufo.order.model.request.OrderListRequest; |
19 | import com.yohoufo.order.model.request.OrderRequest; | 16 | import com.yohoufo.order.model.request.OrderRequest; |
20 | import com.yohoufo.order.model.response.OrderDetailInfo; | 17 | import com.yohoufo.order.model.response.OrderDetailInfo; |
@@ -25,7 +22,9 @@ import com.yohoufo.order.utils.LoggerUtils; | @@ -25,7 +22,9 @@ import com.yohoufo.order.utils.LoggerUtils; | ||
25 | import org.apache.commons.lang3.StringUtils; | 22 | import org.apache.commons.lang3.StringUtils; |
26 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
27 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
28 | -import org.springframework.web.bind.annotation.*; | 25 | +import org.springframework.web.bind.annotation.RequestMapping; |
26 | +import org.springframework.web.bind.annotation.RequestParam; | ||
27 | +import org.springframework.web.bind.annotation.RestController; | ||
29 | 28 | ||
30 | import java.util.HashMap; | 29 | import java.util.HashMap; |
31 | import java.util.List; | 30 | import java.util.List; |
@@ -45,9 +44,6 @@ public class BuyerOrderController { | @@ -45,9 +44,6 @@ public class BuyerOrderController { | ||
45 | @Autowired | 44 | @Autowired |
46 | private SellerFeeService sellerFeeService; | 45 | private SellerFeeService sellerFeeService; |
47 | 46 | ||
48 | - | ||
49 | - | ||
50 | - | ||
51 | /** | 47 | /** |
52 | * [购买]订单列表 | 48 | * [购买]订单列表 |
53 | * 1: 全部 | 49 | * 1: 全部 |
@@ -58,16 +54,12 @@ public class BuyerOrderController { | @@ -58,16 +54,12 @@ public class BuyerOrderController { | ||
58 | * 7:交易失败 | 54 | * 7:交易失败 |
59 | */ | 55 | */ |
60 | @RequestMapping(params = "method=ufo.order.list") | 56 | @RequestMapping(params = "method=ufo.order.list") |
61 | - @ResponseBody | ||
62 | public ApiResponse getOrderList(@RequestParam("type") int type, | 57 | public ApiResponse getOrderList(@RequestParam("type") int type, |
63 | @RequestParam("uid") int uid, | 58 | @RequestParam("uid") int uid, |
64 | @RequestParam("tabType") String tabType, | 59 | @RequestParam("tabType") String tabType, |
65 | @RequestParam(value = "page", required = false, defaultValue = "1") int page, | 60 | @RequestParam(value = "page", required = false, defaultValue = "1") int page, |
66 | @RequestParam(value = "limit", required = false, defaultValue = "10") int limit) { | 61 | @RequestParam(value = "limit", required = false, defaultValue = "10") int limit) { |
67 | - | ||
68 | - | ||
69 | TabType actor = TabType.getTabType(tabType); | 62 | TabType actor = TabType.getTabType(tabType); |
70 | - | ||
71 | if (Objects.isNull(actor)){ | 63 | if (Objects.isNull(actor)){ |
72 | return new ApiResponse.ApiResponseBuilder().code(400).message("非法的tab").build(); | 64 | return new ApiResponse.ApiResponseBuilder().code(400).message("非法的tab").build(); |
73 | } | 65 | } |
@@ -79,9 +71,7 @@ public class BuyerOrderController { | @@ -79,9 +71,7 @@ public class BuyerOrderController { | ||
79 | .tabType(tabType) | 71 | .tabType(tabType) |
80 | .actor(actor) | 72 | .actor(actor) |
81 | .build(); | 73 | .build(); |
82 | - | ||
83 | LOG.info("in ufo.order.list, req {}", orderListRequest); | 74 | LOG.info("in ufo.order.list, req {}", orderListRequest); |
84 | - | ||
85 | PageResp<OrderListInfo> orderListInfoRsp; | 75 | PageResp<OrderListInfo> orderListInfoRsp; |
86 | switch (actor){ | 76 | switch (actor){ |
87 | case BUY: | 77 | case BUY: |
@@ -93,7 +83,6 @@ public class BuyerOrderController { | @@ -93,7 +83,6 @@ public class BuyerOrderController { | ||
93 | default: | 83 | default: |
94 | orderListInfoRsp = null; | 84 | orderListInfoRsp = null; |
95 | } | 85 | } |
96 | - | ||
97 | return new ApiResponse.ApiResponseBuilder().code(200).data(orderListInfoRsp).message("订单列表").build(); | 86 | return new ApiResponse.ApiResponseBuilder().code(200).data(orderListInfoRsp).message("订单列表").build(); |
98 | } | 87 | } |
99 | 88 | ||
@@ -105,7 +94,6 @@ public class BuyerOrderController { | @@ -105,7 +94,6 @@ public class BuyerOrderController { | ||
105 | * @return | 94 | * @return |
106 | */ | 95 | */ |
107 | @RequestMapping(params = "method=ufo.order.detail") | 96 | @RequestMapping(params = "method=ufo.order.detail") |
108 | - @ResponseBody | ||
109 | public ApiResponse getOrderDetail(@RequestParam("orderCode") long orderCode, | 97 | public ApiResponse getOrderDetail(@RequestParam("orderCode") long orderCode, |
110 | @RequestParam("uid") int uid, | 98 | @RequestParam("uid") int uid, |
111 | @RequestParam("tabType") String tabType) { | 99 | @RequestParam("tabType") String tabType) { |
@@ -137,8 +125,6 @@ public class BuyerOrderController { | @@ -137,8 +125,6 @@ public class BuyerOrderController { | ||
137 | return new ApiResponse.ApiResponseBuilder().code(200).data(orderDetailInfo).message("订单详情").build(); | 125 | return new ApiResponse.ApiResponseBuilder().code(200).data(orderDetailInfo).message("订单详情").build(); |
138 | } | 126 | } |
139 | 127 | ||
140 | - | ||
141 | - | ||
142 | /** | 128 | /** |
143 | * 买家修改收货地址 | 129 | * 买家修改收货地址 |
144 | * 最新逻辑:手机号码、详细地址和收货人如果存在*号,先判断是不是跟原来的一样,如果不一样, | 130 | * 最新逻辑:手机号码、详细地址和收货人如果存在*号,先判断是不是跟原来的一样,如果不一样, |
@@ -184,28 +170,6 @@ public class BuyerOrderController { | @@ -184,28 +170,6 @@ public class BuyerOrderController { | ||
184 | return new ApiResponse.ApiResponseBuilder().code(200).message("接受瑕疵").build(); | 170 | return new ApiResponse.ApiResponseBuilder().code(200).message("接受瑕疵").build(); |
185 | } | 171 | } |
186 | 172 | ||
187 | - @IgnoreSession | ||
188 | - @IgnoreSignature | ||
189 | - @RequestMapping(value = "/erp/qualityCheckPass") | ||
190 | - @ResponseBody | ||
191 | - public ApiResponse qualityCheckPass(@RequestBody OrderRequest request) { | ||
192 | - LOG.info("method ufo.depot.qualityCheckPass in, req is {}", request); | ||
193 | - buyerOrderService.qualityCheckPass(request.getOrderCode()); | ||
194 | - LOG.info("method ufo.depot.qualityCheckPass out, req is {}", request); | ||
195 | - return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定中心质检通过成功").build(); | ||
196 | - } | ||
197 | - | ||
198 | - @IgnoreSession | ||
199 | - @IgnoreSignature | ||
200 | - @RequestMapping(value = "/erp/miniFaultCreate") | ||
201 | - @ResponseBody | ||
202 | - public ApiResponse miniFaultCreate(@RequestBody OrderRequest request) { | ||
203 | - LOG.info("method ufo.depot.miniFaultCreate in, req is {}", request); | ||
204 | - buyerOrderService.miniFaultCreate(request.getOrderCode()); | ||
205 | - LOG.info("method ufo.depot.miniFaultCreate out, req is {}", request); | ||
206 | - return new ApiResponse.ApiResponseBuilder().code(200).message("瑕疵创建成功").build(); | ||
207 | - } | ||
208 | - | ||
209 | /** | 173 | /** |
210 | * 用户不接受瑕疵 | 174 | * 用户不接受瑕疵 |
211 | */ | 175 | */ |
@@ -229,29 +193,22 @@ public class BuyerOrderController { | @@ -229,29 +193,22 @@ public class BuyerOrderController { | ||
229 | */ | 193 | */ |
230 | 194 | ||
231 | @RequestMapping(params = "method=ufo.buyer.cancel") | 195 | @RequestMapping(params = "method=ufo.buyer.cancel") |
232 | - @ResponseBody | ||
233 | public ApiResponse cancel(@RequestParam("orderCode") long orderCode, | 196 | public ApiResponse cancel(@RequestParam("orderCode") long orderCode, |
234 | @RequestParam("uid") int uid) { | 197 | @RequestParam("uid") int uid) { |
235 | LOG.info("method ufo.buyer.cancel in, orderCode is {}, uid is {}", orderCode, uid); | 198 | LOG.info("method ufo.buyer.cancel in, orderCode is {}, uid is {}", orderCode, uid); |
236 | - | ||
237 | - | ||
238 | OrderRequest orderRequest = OrderRequest.builder() | 199 | OrderRequest orderRequest = OrderRequest.builder() |
239 | .uid(uid) | 200 | .uid(uid) |
240 | .orderCode(orderCode) | 201 | .orderCode(orderCode) |
241 | .build(); | 202 | .build(); |
242 | buyerOrderService.cancel(orderRequest); | 203 | buyerOrderService.cancel(orderRequest); |
243 | - | ||
244 | LOG.info("method ufo.buyer.cancel out, orderCode is {}, uid is {}", orderCode, uid); | 204 | LOG.info("method ufo.buyer.cancel out, orderCode is {}, uid is {}", orderCode, uid); |
245 | - | ||
246 | return new ApiResponse.ApiResponseBuilder().code(200).message("取消成功").build(); | 205 | return new ApiResponse.ApiResponseBuilder().code(200).message("取消成功").build(); |
247 | } | 206 | } |
248 | 207 | ||
249 | /** | 208 | /** |
250 | * 取消订单 | 209 | * 取消订单 |
251 | */ | 210 | */ |
252 | - | ||
253 | @RequestMapping(params = "method=ufo.buyer.delete") | 211 | @RequestMapping(params = "method=ufo.buyer.delete") |
254 | - @ResponseBody | ||
255 | public ApiResponse delete(@RequestParam("orderCode") long orderCode, | 212 | public ApiResponse delete(@RequestParam("orderCode") long orderCode, |
256 | @RequestParam("uid") int uid) { | 213 | @RequestParam("uid") int uid) { |
257 | LOG.info("method ufo.buyer.delete in, orderCode is {}, uid is {}", orderCode, uid); | 214 | LOG.info("method ufo.buyer.delete in, orderCode is {}, uid is {}", orderCode, uid); |
@@ -260,7 +217,6 @@ public class BuyerOrderController { | @@ -260,7 +217,6 @@ public class BuyerOrderController { | ||
260 | return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("取消成功").build(); | 217 | return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("取消成功").build(); |
261 | } | 218 | } |
262 | 219 | ||
263 | - | ||
264 | /** | 220 | /** |
265 | * 确认收货 | 221 | * 确认收货 |
266 | * @param orderCode | 222 | * @param orderCode |
@@ -268,7 +224,6 @@ public class BuyerOrderController { | @@ -268,7 +224,6 @@ public class BuyerOrderController { | ||
268 | * @return | 224 | * @return |
269 | */ | 225 | */ |
270 | @RequestMapping(params = "method=ufo.buyer.confirm") | 226 | @RequestMapping(params = "method=ufo.buyer.confirm") |
271 | - @ResponseBody | ||
272 | public ApiResponse confirm(@RequestParam("orderCode") long orderCode, | 227 | public ApiResponse confirm(@RequestParam("orderCode") long orderCode, |
273 | @RequestParam("uid") int uid) { | 228 | @RequestParam("uid") int uid) { |
274 | LOG.info("method ufo.buyer.confirm in, orderCode is {}, uid is {}", orderCode, uid); | 229 | LOG.info("method ufo.buyer.confirm in, orderCode is {}, uid is {}", orderCode, uid); |
@@ -285,42 +240,7 @@ public class BuyerOrderController { | @@ -285,42 +240,7 @@ public class BuyerOrderController { | ||
285 | } | 240 | } |
286 | 241 | ||
287 | 242 | ||
288 | - /** | ||
289 | - * 平台确认收货 | ||
290 | - */ | ||
291 | - @IgnoreSession | ||
292 | - @IgnoreSignature | ||
293 | - @RequestMapping(value = "/erp/confirmReceive") | ||
294 | - @ResponseBody | ||
295 | - public ApiResponse confirmReceive(@RequestBody OrderRequest request) { | ||
296 | - LOG.info("method ufo.depot.confirmReceive in, req is {}", request); | ||
297 | - buyerOrderService.confirmReceive(request.getOrderCode()); | ||
298 | - LOG.info("method ufo.depot.confirmReceive out, req is {}", request); | ||
299 | - return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定中心确认收货成功").build(); | ||
300 | - } | ||
301 | - | ||
302 | - /** | ||
303 | - * 客服取消买家订单 | ||
304 | - * 提供给运营平台使用 | ||
305 | - * | ||
306 | - * @return | ||
307 | - */ | ||
308 | - @RequestMapping(value = "/erp/cancelBuyerOrderByCS") | ||
309 | - @IgnoreSession | ||
310 | - @IgnoreSignature | ||
311 | - public ApiResponse cancelBuyerOrderByCS(@RequestBody BuyerOrderCancelReq request) { | ||
312 | - LOG.info("method cs cancel buyer order in, req is {}", request); | ||
313 | - // 检查 | ||
314 | - if (request.getUid() <= 0 || request.getOrderCode() <= 0) { | ||
315 | - return new ApiResponse.ApiResponseBuilder().code(400).message("参数校验不通过").build(); | ||
316 | - } | ||
317 | - buyerOrderService.cancelByCS(request.getUid(), request.getOrderCode()); | ||
318 | - return new ApiResponse.ApiResponseBuilder().code(200).build(); | ||
319 | - } | ||
320 | - | ||
321 | - | ||
322 | @RequestMapping(params = "method=ufo.buyer.computeCompensate") | 243 | @RequestMapping(params = "method=ufo.buyer.computeCompensate") |
323 | - @ResponseBody | ||
324 | public ApiResponse computeCompensate(@RequestParam("orderCode") long orderCode, | 244 | public ApiResponse computeCompensate(@RequestParam("orderCode") long orderCode, |
325 | @RequestParam("uid") int uid) { | 245 | @RequestParam("uid") int uid) { |
326 | LOG.info("method ufo.buyer.computeCompensate in, orderCode is {}, uid is {}", orderCode, uid); | 246 | LOG.info("method ufo.buyer.computeCompensate in, orderCode is {}, uid is {}", orderCode, uid); |
@@ -366,7 +286,6 @@ public class BuyerOrderController { | @@ -366,7 +286,6 @@ public class BuyerOrderController { | ||
366 | } | 286 | } |
367 | 287 | ||
368 | @RequestMapping(params = "method=ufo.buyer.orderListNums") | 288 | @RequestMapping(params = "method=ufo.buyer.orderListNums") |
369 | - @ResponseBody | ||
370 | public ApiResponse getBuyerOrderNums(@RequestParam("uid") int uid){ | 289 | public ApiResponse getBuyerOrderNums(@RequestParam("uid") int uid){ |
371 | LOG.info("in ufo.buyer.orderListNums uid {}", uid); | 290 | LOG.info("in ufo.buyer.orderListNums uid {}", uid); |
372 | BuyerOrderNums buyerOrderNums = buyerOrderService.getBuyerOrderNums(uid); | 291 | BuyerOrderNums buyerOrderNums = buyerOrderService.getBuyerOrderNums(uid); |
@@ -377,27 +296,21 @@ public class BuyerOrderController { | @@ -377,27 +296,21 @@ public class BuyerOrderController { | ||
377 | * [购买] 已购买的商品列表 | 296 | * [购买] 已购买的商品列表 |
378 | */ | 297 | */ |
379 | @RequestMapping(params = "method=ufo.buyedGoods.list") | 298 | @RequestMapping(params = "method=ufo.buyedGoods.list") |
380 | - @ResponseBody | ||
381 | public ApiResponse getMyBuyedGoods( | 299 | public ApiResponse getMyBuyedGoods( |
382 | @RequestParam("uid") int uid, | 300 | @RequestParam("uid") int uid, |
383 | @RequestParam(value = "page", required = false, defaultValue = "1") int page, | 301 | @RequestParam(value = "page", required = false, defaultValue = "1") int page, |
384 | @RequestParam(value = "limit", required = false, defaultValue = "10") int limit) { | 302 | @RequestParam(value = "limit", required = false, defaultValue = "10") int limit) { |
385 | - | ||
386 | - | ||
387 | TabType actor = TabType.BUY; | 303 | TabType actor = TabType.BUY; |
388 | - | ||
389 | - | ||
390 | OrderListRequest orderListRequest = OrderListRequest.builder() | 304 | OrderListRequest orderListRequest = OrderListRequest.builder() |
391 | .uid(uid) | 305 | .uid(uid) |
392 | - .type(5) | 306 | + .type(OrderListType.ORDER_SUCCESS.getType()) |
393 | .page(page) | 307 | .page(page) |
394 | .limit(limit) | 308 | .limit(limit) |
395 | .tabType(actor.getValue()) | 309 | .tabType(actor.getValue()) |
396 | .actor(actor) | 310 | .actor(actor) |
397 | .build(); | 311 | .build(); |
398 | - | ||
399 | LOG.info("in ufo.getMyBuyedGoods.list, req {}", orderListRequest); | 312 | LOG.info("in ufo.getMyBuyedGoods.list, req {}", orderListRequest); |
400 | - | 313 | + //TODO remove below codes 2 service level |
401 | PageResp<OrderListInfo> orderListInfoRsp = buyerOrderService.getOrderList(orderListRequest); | 314 | PageResp<OrderListInfo> orderListInfoRsp = buyerOrderService.getOrderList(orderListRequest); |
402 | List<JSONObject> goods = Lists.newArrayList(); | 315 | List<JSONObject> goods = Lists.newArrayList(); |
403 | List<Integer> goodsId = Lists.newArrayList(); | 316 | List<Integer> goodsId = Lists.newArrayList(); |
1 | package com.yohoufo.order.controller; | 1 | package com.yohoufo.order.controller; |
2 | 2 | ||
3 | import com.yoho.error.exception.ServiceException; | 3 | import com.yoho.error.exception.ServiceException; |
4 | +import com.yohobuy.ufo.model.order.req.BuyerOrderCancelReq; | ||
4 | import com.yohobuy.ufo.model.order.req.ManualDealRequest; | 5 | import com.yohobuy.ufo.model.order.req.ManualDealRequest; |
5 | import com.yohobuy.ufo.model.order.resp.BuyerOrderNums; | 6 | import com.yohobuy.ufo.model.order.resp.BuyerOrderNums; |
6 | import com.yohoufo.common.ApiResponse; | 7 | import com.yohoufo.common.ApiResponse; |
7 | import com.yohoufo.common.annotation.IgnoreSession; | 8 | import com.yohoufo.common.annotation.IgnoreSession; |
8 | import com.yohoufo.common.annotation.IgnoreSignature; | 9 | import com.yohoufo.common.annotation.IgnoreSignature; |
10 | +import com.yohoufo.order.model.request.OrderRequest; | ||
9 | import com.yohoufo.order.service.IBuyerOrderService; | 11 | import com.yohoufo.order.service.IBuyerOrderService; |
10 | import com.yohoufo.order.service.IPaymentService; | 12 | import com.yohoufo.order.service.IPaymentService; |
13 | +import com.yohoufo.order.utils.LoggerUtils; | ||
14 | +import org.slf4j.Logger; | ||
11 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.web.bind.annotation.*; | 16 | import org.springframework.web.bind.annotation.*; |
13 | 17 | ||
14 | @RestController | 18 | @RestController |
15 | @RequestMapping("/erp") | 19 | @RequestMapping("/erp") |
16 | public class ErpGWOrderController { | 20 | public class ErpGWOrderController { |
17 | - | 21 | + private final Logger LOG = LoggerUtils.getBuyerOrderLogger(); |
18 | 22 | ||
19 | @Autowired | 23 | @Autowired |
20 | IBuyerOrderService buyerOrderService; | 24 | IBuyerOrderService buyerOrderService; |
@@ -23,7 +27,6 @@ public class ErpGWOrderController { | @@ -23,7 +27,6 @@ public class ErpGWOrderController { | ||
23 | IPaymentService paymentService; | 27 | IPaymentService paymentService; |
24 | 28 | ||
25 | @RequestMapping(params = "method=ufo.buyer.orderNums") | 29 | @RequestMapping(params = "method=ufo.buyer.orderNums") |
26 | - @ResponseBody | ||
27 | @IgnoreSession | 30 | @IgnoreSession |
28 | public BuyerOrderNums getBuyerOrderNums(@RequestParam("uid") int uid){ | 31 | public BuyerOrderNums getBuyerOrderNums(@RequestParam("uid") int uid){ |
29 | 32 | ||
@@ -33,7 +36,6 @@ public class ErpGWOrderController { | @@ -33,7 +36,6 @@ public class ErpGWOrderController { | ||
33 | 36 | ||
34 | @IgnoreSignature | 37 | @IgnoreSignature |
35 | @IgnoreSession | 38 | @IgnoreSession |
36 | - //@RequestMapping(params = "method=ufo.order.manualDealMon") | ||
37 | @RequestMapping(value="/manualDealMon") | 39 | @RequestMapping(value="/manualDealMon") |
38 | public ApiResponse manualDealMon(@RequestBody ManualDealRequest req) { | 40 | public ApiResponse manualDealMon(@RequestBody ManualDealRequest req) { |
39 | try { | 41 | try { |
@@ -43,4 +45,56 @@ public class ErpGWOrderController { | @@ -43,4 +45,56 @@ public class ErpGWOrderController { | ||
43 | } | 45 | } |
44 | return new ApiResponse.ApiResponseBuilder().code(200).data("").message("处理成功").build(); | 46 | return new ApiResponse.ApiResponseBuilder().code(200).data("").message("处理成功").build(); |
45 | } | 47 | } |
48 | + | ||
49 | + /** | ||
50 | + * 客服取消买家订单 | ||
51 | + * 提供给运营平台使用 | ||
52 | + * | ||
53 | + * @return | ||
54 | + */ | ||
55 | + @RequestMapping(value = "/cancelBuyerOrderByCS") | ||
56 | + @IgnoreSession | ||
57 | + @IgnoreSignature | ||
58 | + public ApiResponse cancelBuyerOrderByCS(@RequestBody BuyerOrderCancelReq request) { | ||
59 | + LOG.info("method cs cancel buyer order in, req is {}", request); | ||
60 | + // 检查 | ||
61 | + if (request.getUid() <= 0 || request.getOrderCode() <= 0) { | ||
62 | + return new ApiResponse.ApiResponseBuilder().code(400).message("参数校验不通过").build(); | ||
63 | + } | ||
64 | + buyerOrderService.cancelByCS(request.getUid(), request.getOrderCode()); | ||
65 | + return new ApiResponse.ApiResponseBuilder().code(200).build(); | ||
66 | + } | ||
67 | + | ||
68 | + @IgnoreSession | ||
69 | + @IgnoreSignature | ||
70 | + @RequestMapping(value = "/qualityCheckPass") | ||
71 | + public ApiResponse qualityCheckPass(@RequestBody OrderRequest request) { | ||
72 | + LOG.info("method ufo.depot.qualityCheckPass in, req is {}", request); | ||
73 | + buyerOrderService.qualityCheckPass(request.getOrderCode()); | ||
74 | + LOG.info("method ufo.depot.qualityCheckPass out, req is {}", request); | ||
75 | + return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定中心质检通过成功").build(); | ||
76 | + } | ||
77 | + | ||
78 | + @IgnoreSession | ||
79 | + @IgnoreSignature | ||
80 | + @RequestMapping(value = "/miniFaultCreate") | ||
81 | + public ApiResponse miniFaultCreate(@RequestBody OrderRequest request) { | ||
82 | + LOG.info("method ufo.depot.miniFaultCreate in, req is {}", request); | ||
83 | + buyerOrderService.miniFaultCreate(request.getOrderCode()); | ||
84 | + LOG.info("method ufo.depot.miniFaultCreate out, req is {}", request); | ||
85 | + return new ApiResponse.ApiResponseBuilder().code(200).message("瑕疵创建成功").build(); | ||
86 | + } | ||
87 | + | ||
88 | + /** | ||
89 | + * 平台确认收货 | ||
90 | + */ | ||
91 | + @IgnoreSession | ||
92 | + @IgnoreSignature | ||
93 | + @RequestMapping(value = "/confirmReceive") | ||
94 | + public ApiResponse confirmReceive(@RequestBody OrderRequest request) { | ||
95 | + LOG.info("method ufo.depot.confirmReceive in, req is {}", request); | ||
96 | + buyerOrderService.confirmReceive(request.getOrderCode()); | ||
97 | + LOG.info("method ufo.depot.confirmReceive out, req is {}", request); | ||
98 | + return new ApiResponse.ApiResponseBuilder().code(200).message("鉴定中心确认收货成功").build(); | ||
99 | + } | ||
46 | } | 100 | } |
@@ -37,8 +37,11 @@ public class ExpressInfoController { | @@ -37,8 +37,11 @@ public class ExpressInfoController { | ||
37 | * @return | 37 | * @return |
38 | */ | 38 | */ |
39 | @RequestMapping(params = "method=ufo.order.deliverToDepot") | 39 | @RequestMapping(params = "method=ufo.order.deliverToDepot") |
40 | - public ApiResponse deliverToDepot(@RequestParam("uid") Integer uid,@RequestParam("expressCompanyId") Integer expressCompanyId, | ||
41 | - @RequestParam("orderCode") Long orderCode, @RequestParam("wayBillCode") String wayBillCode, @RequestParam("depotNum") Integer depotNum) { | 40 | + public ApiResponse deliverToDepot(@RequestParam("uid") Integer uid, |
41 | + @RequestParam("expressCompanyId") Integer expressCompanyId, | ||
42 | + @RequestParam("orderCode") Long orderCode, | ||
43 | + @RequestParam("wayBillCode") String wayBillCode, | ||
44 | + @RequestParam("depotNum") Integer depotNum) { | ||
42 | expressInfoService.deliverToDepot(uid,expressCompanyId, orderCode, wayBillCode,depotNum); | 45 | expressInfoService.deliverToDepot(uid,expressCompanyId, orderCode, wayBillCode,depotNum); |
43 | return new ApiResponse(); | 46 | return new ApiResponse(); |
44 | } | 47 | } |
@@ -52,7 +55,9 @@ public class ExpressInfoController { | @@ -52,7 +55,9 @@ public class ExpressInfoController { | ||
52 | * @return | 55 | * @return |
53 | */ | 56 | */ |
54 | @RequestMapping(params = "method=ufo.order.expressDetailInfo") | 57 | @RequestMapping(params = "method=ufo.order.expressDetailInfo") |
55 | - public ApiResponse queryExpressDetailInfo(@RequestParam("uid") Integer uid, @RequestParam("orderCode") Long orderCode,@RequestParam(value = "tabType",required = false) String tabType) { | 58 | + public ApiResponse queryExpressDetailInfo(@RequestParam("uid") Integer uid, |
59 | + @RequestParam("orderCode") Long orderCode, | ||
60 | + @RequestParam(value = "tabType",required = false) String tabType) { | ||
56 | TabType actor = null; | 61 | TabType actor = null; |
57 | if(StringUtils.isNotBlank(tabType)){ | 62 | if(StringUtils.isNotBlank(tabType)){ |
58 | actor = TabType.getTabType(tabType); | 63 | actor = TabType.getTabType(tabType); |
@@ -195,9 +195,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -195,9 +195,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
195 | EventBusPublisher.publishEvent(event); | 195 | EventBusPublisher.publishEvent(event); |
196 | } | 196 | } |
197 | LOGGER.info("deliverToDepot update buyer order status result {} ",updateBuyerCnt); | 197 | LOGGER.info("deliverToDepot update buyer order status result {} ",updateBuyerCnt); |
198 | - | ||
199 | - | ||
200 | - | ||
201 | } | 198 | } |
202 | 199 | ||
203 | @Override | 200 | @Override |
@@ -157,20 +157,18 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | @@ -157,20 +157,18 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi | ||
157 | log.info("in computePublishPrd, req {}", req); | 157 | log.info("in computePublishPrd, req {}", req); |
158 | PriceComputePrepareProcessor.PriceComputeNode pcn = priceComputePrepareProcessor.checkBasePrice(req); | 158 | PriceComputePrepareProcessor.PriceComputeNode pcn = priceComputePrepareProcessor.checkBasePrice(req); |
159 | int uid = pcn.getUid(); | 159 | int uid = pcn.getUid(); |
160 | - | ||
161 | - | ||
162 | Integer storageId = pcn.getStorageId(); | 160 | Integer storageId = pcn.getStorageId(); |
163 | int num = pcn.getNum(); | 161 | int num = pcn.getNum(); |
164 | BigDecimal salePrice = pcn.getPrdPrice(); | 162 | BigDecimal salePrice = pcn.getPrdPrice(); |
165 | String tips = null; | 163 | String tips = null; |
166 | ProductProxyService.PrdPrice prdPrice = sellerOrderPrepareProcessor.checkPrice(storageId, salePrice, true); | 164 | ProductProxyService.PrdPrice prdPrice = sellerOrderPrepareProcessor.checkPrice(storageId, salePrice, true); |
165 | + SkupType skupType = SkupType.getSkupType(req.getSkupType()); | ||
167 | try { | 166 | try { |
168 | - sellerOrderPrepareProcessor.checkSuggestPrice(prdPrice, salePrice); | 167 | + sellerOrderPrepareProcessor.checkSuggestPrice(prdPrice, salePrice, skupType); |
169 | }catch (UfoServiceException ex){ | 168 | }catch (UfoServiceException ex){ |
170 | tips = ex.getErrorMessage(); | 169 | tips = ex.getErrorMessage(); |
171 | } | 170 | } |
172 | boolean isSuper = sellerService.isSuperEntrySeller(uid); | 171 | boolean isSuper = sellerService.isSuperEntrySeller(uid); |
173 | - SkupType skupType = SkupType.getSkupType(req.getSkupType()); | ||
174 | SoldPrdComputeBo spc = buildSoldPrdComputeBo(uid, num, salePrice, isSuper, skupType); | 172 | SoldPrdComputeBo spc = buildSoldPrdComputeBo(uid, num, salePrice, isSuper, skupType); |
175 | spc.setTips(tips); | 173 | spc.setTips(tips); |
176 | return spc; | 174 | return spc; |
@@ -89,13 +89,13 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | @@ -89,13 +89,13 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | ||
89 | String tips = null; | 89 | String tips = null; |
90 | ProductProxyService.PrdPrice prdPrice; | 90 | ProductProxyService.PrdPrice prdPrice; |
91 | prdPrice = sellerOrderPrepareProcessor.checkPrice(storageId, salePrice, req.isShowPriceError()); | 91 | prdPrice = sellerOrderPrepareProcessor.checkPrice(storageId, salePrice, req.isShowPriceError()); |
92 | + SkupType skupType = SkupType.getSkupType(req.getSkupType()); | ||
92 | try { | 93 | try { |
93 | - sellerOrderPrepareProcessor.checkSuggestPrice(prdPrice, salePrice); | 94 | + sellerOrderPrepareProcessor.checkSuggestPrice(prdPrice, salePrice, skupType); |
94 | }catch (UfoServiceException ex){ | 95 | }catch (UfoServiceException ex){ |
95 | tips = ex.getErrorMessage(); | 96 | tips = ex.getErrorMessage(); |
96 | } | 97 | } |
97 | // compute every fee from price | 98 | // compute every fee from price |
98 | - SkupType skupType = SkupType.getSkupType(req.getSkupType()); | ||
99 | OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); | 99 | OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType); |
100 | SellerOrderComputeResult computeResult = computeHandler.compute(salePrice); | 100 | SellerOrderComputeResult computeResult = computeHandler.compute(salePrice); |
101 | int num = skupMap.size(); | 101 | int num = skupMap.size(); |
@@ -134,43 +134,10 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | @@ -134,43 +134,10 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | ||
134 | BigDecimal newPrice, | 134 | BigDecimal newPrice, |
135 | Map<Integer, SkupDto> skupOfSalingMap); | 135 | Map<Integer, SkupDto> skupOfSalingMap); |
136 | 136 | ||
137 | -// Map<Integer, SkupDto> checkNeedProcessSkups(List<Integer> needChangePriceSkupList, Map<Integer, SkupDto> skupOfSalingMap){ | ||
138 | -// Map<Integer, SkupDto> map = new HashMap<>(needChangePriceSkupList.size()); | ||
139 | -// | ||
140 | -// for(Integer skup: needChangePriceSkupList) { | ||
141 | -// | ||
142 | -// if (!skupOfSalingMap.containsKey(skup)) { | ||
143 | -// logger.warn("ChangePrice checkNeedProcessSkups skup is in other status , skup {}", skup); | ||
144 | -// throw new UfoServiceException(501, "部分商品不可调价"); | ||
145 | -// } | ||
146 | -// map.put(skup, skupOfSalingMap.get(skup)); | ||
147 | -// } | ||
148 | -// | ||
149 | -// return map; | ||
150 | -// } | ||
151 | 137 | ||
152 | private BigDecimal calDiffOfEM(BigDecimal sourceEM, BigDecimal targetEM){ | 138 | private BigDecimal calDiffOfEM(BigDecimal sourceEM, BigDecimal targetEM){ |
153 | return targetEM.subtract(sourceEM); | 139 | return targetEM.subtract(sourceEM); |
154 | } | 140 | } |
155 | - | ||
156 | -// private Long checkNAcquireBatchNo(String batchNoStr, BatchChangePriceReq req){ | ||
157 | -// Long batchNo = null; | ||
158 | -// boolean isIllegalBatchNo; | ||
159 | -// try { | ||
160 | -// isIllegalBatchNo = (StringUtils.isBlank(batchNoStr) || (batchNo = Long.valueOf(batchNoStr)) <= 0L); | ||
161 | -// | ||
162 | -// }catch (Exception ex){ | ||
163 | -// isIllegalBatchNo = true; | ||
164 | -// logger.warn("ChangePrice checkAndAcquire batchNoStr illegal , req {}", req, ex); | ||
165 | -// } | ||
166 | -// | ||
167 | -// if (isIllegalBatchNo){ | ||
168 | -// throw new UfoServiceException(400, "参数[batchNoStr]非法"); | ||
169 | -// } | ||
170 | -// return batchNo; | ||
171 | -// } | ||
172 | - | ||
173 | - | ||
174 | /** | 141 | /** |
175 | * 获取期望变价的skup | 142 | * 获取期望变价的skup |
176 | * @param req | 143 | * @param req |
@@ -186,9 +153,6 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | @@ -186,9 +153,6 @@ public abstract class AbstractChangePricePrepareProcessor<T extends SellerBaseCh | ||
186 | protected abstract List<SellerOrderGoods> getRealSkupOrderGoodsList(T req); | 153 | protected abstract List<SellerOrderGoods> getRealSkupOrderGoodsList(T req); |
187 | 154 | ||
188 | private Map<Integer, SkupDto> checkExistWaitingBuyerPay(T req){ | 155 | private Map<Integer, SkupDto> checkExistWaitingBuyerPay(T req){ |
189 | -// SellerOrderGoods condition = new SellerOrderGoods(); | ||
190 | -// condition.setBatchNo(batchNo); | ||
191 | -// List<SellerOrderGoods> sellerOrderGoodList = sellerOrderGoodsMapper.selectByBatchNo(condition, Arrays.asList(SkupStatus.CAN_SELL.getCode(), SkupStatus.SELL_OUT.getCode())); | ||
192 | List<SellerOrderGoods> sellerOrderGoodList = getRealSkupOrderGoodsList(req); | 156 | List<SellerOrderGoods> sellerOrderGoodList = getRealSkupOrderGoodsList(req); |
193 | if (CollectionUtils.isEmpty(sellerOrderGoodList)){ | 157 | if (CollectionUtils.isEmpty(sellerOrderGoodList)){ |
194 | logger.warn("ChangePrice checkAndAcquire not find skups by req {}", req); | 158 | logger.warn("ChangePrice checkAndAcquire not find skups by req {}", req); |
@@ -137,7 +137,7 @@ public class SellerOrderPrepareProcessor { | @@ -137,7 +137,7 @@ public class SellerOrderPrepareProcessor { | ||
137 | ProductProxyService.PrdPrice prdPrice = checkPrice(storageId, salePrice, true); | 137 | ProductProxyService.PrdPrice prdPrice = checkPrice(storageId, salePrice, true); |
138 | 138 | ||
139 | try { | 139 | try { |
140 | - checkSuggestPrice(prdPrice, salePrice); | 140 | + checkSuggestPrice(prdPrice, salePrice, skupType); |
141 | }catch (UfoServiceException ex){ | 141 | }catch (UfoServiceException ex){ |
142 | context.setPriceOverFlowTips( ex.getErrorMessage()); | 142 | context.setPriceOverFlowTips( ex.getErrorMessage()); |
143 | } | 143 | } |
@@ -210,7 +210,10 @@ public class SellerOrderPrepareProcessor { | @@ -210,7 +210,10 @@ public class SellerOrderPrepareProcessor { | ||
210 | return prdPriceRange; | 210 | return prdPriceRange; |
211 | } | 211 | } |
212 | 212 | ||
213 | - public void checkSuggestPrice(ProductProxyService.PrdPrice prdPrice, BigDecimal salePrice){ | 213 | + public void checkSuggestPrice(ProductProxyService.PrdPrice prdPrice, BigDecimal salePrice, SkupType skupType){ |
214 | + if (Objects.nonNull(skupType) && SkupType.ADVANCE.equals(skupType)){ | ||
215 | + return; | ||
216 | + } | ||
214 | BigDecimal suggestMaxPrice = prdPrice.getSuggestMaxPrice(); | 217 | BigDecimal suggestMaxPrice = prdPrice.getSuggestMaxPrice(); |
215 | if (isOverSuggestMaxPrice(suggestMaxPrice, salePrice)){ | 218 | if (isOverSuggestMaxPrice(suggestMaxPrice, salePrice)){ |
216 | log.warn("in computePublishPrd,prdPrice {}, prdPriceRange {}", salePrice, prdPrice); | 219 | log.warn("in computePublishPrd,prdPrice {}, prdPriceRange {}", salePrice, prdPrice); |
@@ -590,8 +590,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | @@ -590,8 +590,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | ||
590 | IdentifyTrackResp track = new IdentifyTrackResp(); | 590 | IdentifyTrackResp track = new IdentifyTrackResp(); |
591 | track.setUid(uid); | 591 | track.setUid(uid); |
592 | track.setType(MESSAGE_TYPE_APPLICANT); | 592 | track.setType(MESSAGE_TYPE_APPLICANT); |
593 | - String mobileMask = MobileHelper.coverMobile2(profileInfo.getMobile());//隐位的手机号码--隐藏中间6位 | ||
594 | - track.setContent(StringUtils.isEmpty(profileInfo.getNickname()) ? mobileMask : profileInfo.getNickname()); | 593 | + track.setContent(getContent(profileInfo)); |
595 | String headIcon = profileInfo.getHead_ico(); | 594 | String headIcon = profileInfo.getHead_ico(); |
596 | if(DEFAULT_HEAD_IMG.equals(headIcon) || StringUtils.isBlank(headIcon)){//有货的默认头像 | 595 | if(DEFAULT_HEAD_IMG.equals(headIcon) || StringUtils.isBlank(headIcon)){//有货的默认头像 |
597 | //ufo 用户的默认头像 | 596 | //ufo 用户的默认头像 |
@@ -611,6 +610,14 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | @@ -611,6 +610,14 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | ||
611 | result.getTrackList().add(track); | 610 | result.getTrackList().add(track); |
612 | } | 611 | } |
613 | 612 | ||
613 | + private String getContent(ProfileInfoRsp profileInfo) { | ||
614 | + String content = profileInfo.getNickname(); | ||
615 | + if(StringUtils.isEmpty(content)|| content.startsWith("YOHO-")) { | ||
616 | + content = MobileHelper.coverMobile2(profileInfo.getMobile());//隐位的手机号码--隐藏中间6位 | ||
617 | + } | ||
618 | + return content; | ||
619 | + } | ||
620 | + | ||
614 | //交易轨迹 | 621 | //交易轨迹 |
615 | private List<IdentifyTrackResp> getTrackList(IdentifyRecord identifyRecord, String authGroup) { | 622 | private List<IdentifyTrackResp> getTrackList(IdentifyRecord identifyRecord, String authGroup) { |
616 | List<IdentifyTrackResp> trackRespList = new ArrayList<>(); | 623 | List<IdentifyTrackResp> trackRespList = new ArrayList<>(); |
@@ -644,11 +651,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | @@ -644,11 +651,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ | ||
644 | IdentifyTrackResp item = new IdentifyTrackResp(); | 651 | IdentifyTrackResp item = new IdentifyTrackResp(); |
645 | Integer toUid = Integer.parseInt(record.getToUid()); | 652 | Integer toUid = Integer.parseInt(record.getToUid()); |
646 | item.setUid(toUid); | 653 | item.setUid(toUid); |
647 | - String content = profileMap.get(toUid).getNickname(); | ||
648 | - if(StringUtils.isEmpty(content) || content.startsWith("YOHO-")) { | ||
649 | - content = MobileHelper.coverMobile2(profileMap.get(toUid).getMobile());//隐位的手机号码--隐藏中间6位 | ||
650 | - } | ||
651 | - item.setContent(content); | 654 | + item.setContent(getContent(profileMap.get(toUid))); |
652 | String headIcon = profileMap.get(toUid).getHead_ico(); | 655 | String headIcon = profileMap.get(toUid).getHead_ico(); |
653 | if(DEFAULT_HEAD_IMG.equals(headIcon) || StringUtils.isBlank(headIcon)){//有货的默认头像 | 656 | if(DEFAULT_HEAD_IMG.equals(headIcon) || StringUtils.isBlank(headIcon)){//有货的默认头像 |
654 | //ufo 用户的默认头像 | 657 | //ufo 用户的默认头像 |
-
Please register or login to post a comment