1
|
package com.yohoufo.order.controller;
|
1
|
package com.yohoufo.order.controller;
|
2
|
|
2
|
|
3
|
-import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
|
|
|
4
|
-import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
5
|
-import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
6
|
-import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
|
|
7
|
import com.yohoufo.common.ApiResponse;
|
3
|
import com.yohoufo.common.ApiResponse;
|
8
|
-import com.yohoufo.common.annotation.IgnoreSession;
|
|
|
9
|
-import com.yohoufo.common.annotation.IgnoreSignature;
|
|
|
10
|
-import com.yohoufo.common.annotation.InnerApi;
|
|
|
11
|
-import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
|
|
12
|
-import com.yohoufo.dal.order.BuyerOrderMapper;
|
|
|
13
|
-import com.yohoufo.dal.order.SellerOrderMapper;
|
|
|
14
|
-import com.yohoufo.dal.order.model.BuyerOrder;
|
|
|
15
|
-import com.yohoufo.dal.order.model.BuyerOrderGoods;
|
|
|
16
|
-import com.yohoufo.dal.order.model.SellerOrder;
|
|
|
17
|
-import com.yohoufo.dal.order.model.SellerWalletDetail;
|
|
|
18
|
-import com.yohoufo.order.common.RefundCase;
|
|
|
19
|
-import com.yohoufo.order.constants.AlarmConfig;
|
|
|
20
|
-import com.yohoufo.order.event.BillLogEvent;
|
|
|
21
|
-import com.yohoufo.order.event.BuyerRefundCouponEvent;
|
|
|
22
|
-import com.yohoufo.order.model.request.OrderRequest;
|
|
|
23
|
-import com.yohoufo.order.model.request.PaymentRequest;
|
|
|
24
|
-import com.yohoufo.order.model.request.TransferMoneyRequest;
|
|
|
25
|
-import com.yohoufo.order.service.IBuyerOrderService;
|
|
|
26
|
-import com.yohoufo.order.service.impl.*;
|
|
|
27
|
import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
|
4
|
import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
|
28
|
import lombok.Data;
|
5
|
import lombok.Data;
|
29
|
import lombok.extern.slf4j.Slf4j;
|
6
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -43,29 +20,7 @@ import java.util.stream.Collectors; |
|
@@ -43,29 +20,7 @@ import java.util.stream.Collectors; |
43
|
public class OrderHelpController {
|
20
|
public class OrderHelpController {
|
44
|
|
21
|
|
45
|
@Autowired
|
22
|
@Autowired
|
46
|
- private TransferService transferService;
|
|
|
47
|
-
|
|
|
48
|
- @Autowired
|
|
|
49
|
- private PaymentServiceImpl paymentService;
|
|
|
50
|
-
|
|
|
51
|
- @Autowired
|
|
|
52
|
- AlipayOuyinService alipayService;
|
|
|
53
|
-
|
|
|
54
|
- @Autowired
|
|
|
55
|
- IBuyerOrderService buyerOrderService;
|
|
|
56
|
-
|
|
|
57
|
- @Autowired
|
|
|
58
|
- BuyerOrderCancelService buyerOrderCancelService;
|
|
|
59
|
-
|
|
|
60
|
- @Autowired
|
|
|
61
|
- PayRefundService payRefundService;
|
|
|
62
|
- @Autowired
|
|
|
63
|
- private SellerOrderMapper sellerOrderMapper;
|
|
|
64
|
- @Autowired
|
|
|
65
|
- private BuyerOrderMapper buyerOrderMapper;
|
|
|
66
|
-
|
|
|
67
|
- @Autowired
|
|
|
68
|
- private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
|
23
|
+ private AlipayOuyinService alipayService;
|
69
|
|
24
|
|
70
|
@Data
|
25
|
@Data
|
71
|
public static class RefundEarnestMoneyRequest {
|
26
|
public static class RefundEarnestMoneyRequest {
|
|
@@ -74,18 +29,6 @@ public class OrderHelpController { |
|
@@ -74,18 +29,6 @@ public class OrderHelpController { |
74
|
private BigDecimal refundAmount;
|
29
|
private BigDecimal refundAmount;
|
75
|
}
|
30
|
}
|
76
|
|
31
|
|
77
|
- @IgnoreSession
|
|
|
78
|
- @IgnoreSignature
|
|
|
79
|
- @InnerApi
|
|
|
80
|
- @RequestMapping(value = "/cancelForSellerSendOutTimeoutCompensation")
|
|
|
81
|
- public ApiResponse refundEarnestMoney(@RequestBody OrderRequest request) {
|
|
|
82
|
- buyerOrderCancelService.cancelForSellerSendOutTimeoutCompensation(request.getUid(), request.getOrderCode());
|
|
|
83
|
- return new ApiResponse.ApiResponseBuilder()
|
|
|
84
|
- .code(200)
|
|
|
85
|
- .message("ok")
|
|
|
86
|
- .build();
|
|
|
87
|
- }
|
|
|
88
|
-
|
|
|
89
|
@RequestMapping(value = "/transferQueryAsOriginalResult")
|
32
|
@RequestMapping(value = "/transferQueryAsOriginalResult")
|
90
|
public ApiResponse transferQuery(@RequestBody List<String> orderCodes) {
|
33
|
public ApiResponse transferQuery(@RequestBody List<String> orderCodes) {
|
91
|
val result = orderCodes.stream().map(alipayService::transferQueryAsOriginalResult).collect(Collectors.toList());
|
34
|
val result = orderCodes.stream().map(alipayService::transferQueryAsOriginalResult).collect(Collectors.toList());
|
|
@@ -106,28 +49,4 @@ public class OrderHelpController { |
|
@@ -106,28 +49,4 @@ public class OrderHelpController { |
106
|
.build();
|
49
|
.build();
|
107
|
}
|
50
|
}
|
108
|
|
51
|
|
109
|
- @IgnoreSession
|
|
|
110
|
- @IgnoreSignature
|
|
|
111
|
- @InnerApi
|
|
|
112
|
- @RequestMapping(value = "/buyerCancel")
|
|
|
113
|
- public ApiResponse buyerCancel(@RequestBody List<OrderRequest> orders) {
|
|
|
114
|
- orders.stream().forEach(order -> {
|
|
|
115
|
- try {
|
|
|
116
|
- buyerOrderService.cancel(order);
|
|
|
117
|
- } catch (Exception e) {
|
|
|
118
|
- log.info("buyer Cancel fail {}", order, e);
|
|
|
119
|
- }
|
|
|
120
|
- sleep(200);
|
|
|
121
|
- });
|
|
|
122
|
- return new ApiResponse.ApiResponseBuilder().code(200).message("处理成功").build();
|
|
|
123
|
- }
|
|
|
124
|
-
|
|
|
125
|
- private void sleep(long millis) {
|
|
|
126
|
- try {
|
|
|
127
|
- Thread.sleep(millis);
|
|
|
128
|
- } catch (InterruptedException e) {
|
|
|
129
|
-
|
|
|
130
|
- }
|
|
|
131
|
- }
|
|
|
132
|
-
|
|
|
133
|
} |
52
|
} |