|
|
package com.yohoufo.order.controller;
|
|
|
|
|
|
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.annotation.IgnoreSession;
|
|
|
import com.yohoufo.common.annotation.IgnoreSignature;
|
|
|
import com.yohoufo.common.annotation.InnerApi;
|
|
|
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderMapper;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrder;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrderGoods;
|
|
|
import com.yohoufo.dal.order.model.SellerOrder;
|
|
|
import com.yohoufo.dal.order.model.SellerWalletDetail;
|
|
|
import com.yohoufo.order.common.RefundCase;
|
|
|
import com.yohoufo.order.constants.AlarmConfig;
|
|
|
import com.yohoufo.order.event.BillLogEvent;
|
|
|
import com.yohoufo.order.event.BuyerRefundCouponEvent;
|
|
|
import com.yohoufo.order.model.request.OrderRequest;
|
|
|
import com.yohoufo.order.model.request.PaymentRequest;
|
|
|
import com.yohoufo.order.model.request.TransferMoneyRequest;
|
|
|
import com.yohoufo.order.service.IBuyerOrderService;
|
|
|
import com.yohoufo.order.service.impl.*;
|
|
|
import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
...
|
...
|
@@ -43,29 +20,7 @@ import java.util.stream.Collectors; |
|
|
public class OrderHelpController {
|
|
|
|
|
|
@Autowired
|
|
|
private TransferService transferService;
|
|
|
|
|
|
@Autowired
|
|
|
private PaymentServiceImpl paymentService;
|
|
|
|
|
|
@Autowired
|
|
|
AlipayOuyinService alipayService;
|
|
|
|
|
|
@Autowired
|
|
|
IBuyerOrderService buyerOrderService;
|
|
|
|
|
|
@Autowired
|
|
|
BuyerOrderCancelService buyerOrderCancelService;
|
|
|
|
|
|
@Autowired
|
|
|
PayRefundService payRefundService;
|
|
|
@Autowired
|
|
|
private SellerOrderMapper sellerOrderMapper;
|
|
|
@Autowired
|
|
|
private BuyerOrderMapper buyerOrderMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
|
|
|
private AlipayOuyinService alipayService;
|
|
|
|
|
|
@Data
|
|
|
public static class RefundEarnestMoneyRequest {
|
...
|
...
|
@@ -74,18 +29,6 @@ public class OrderHelpController { |
|
|
private BigDecimal refundAmount;
|
|
|
}
|
|
|
|
|
|
@IgnoreSession
|
|
|
@IgnoreSignature
|
|
|
@InnerApi
|
|
|
@RequestMapping(value = "/cancelForSellerSendOutTimeoutCompensation")
|
|
|
public ApiResponse refundEarnestMoney(@RequestBody OrderRequest request) {
|
|
|
buyerOrderCancelService.cancelForSellerSendOutTimeoutCompensation(request.getUid(), request.getOrderCode());
|
|
|
return new ApiResponse.ApiResponseBuilder()
|
|
|
.code(200)
|
|
|
.message("ok")
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/transferQueryAsOriginalResult")
|
|
|
public ApiResponse transferQuery(@RequestBody List<String> orderCodes) {
|
|
|
val result = orderCodes.stream().map(alipayService::transferQueryAsOriginalResult).collect(Collectors.toList());
|
...
|
...
|
@@ -106,28 +49,4 @@ public class OrderHelpController { |
|
|
.build();
|
|
|
}
|
|
|
|
|
|
@IgnoreSession
|
|
|
@IgnoreSignature
|
|
|
@InnerApi
|
|
|
@RequestMapping(value = "/buyerCancel")
|
|
|
public ApiResponse buyerCancel(@RequestBody List<OrderRequest> orders) {
|
|
|
orders.stream().forEach(order -> {
|
|
|
try {
|
|
|
buyerOrderService.cancel(order);
|
|
|
} catch (Exception e) {
|
|
|
log.info("buyer Cancel fail {}", order, e);
|
|
|
}
|
|
|
sleep(200);
|
|
|
});
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("处理成功").build();
|
|
|
}
|
|
|
|
|
|
private void sleep(long millis) {
|
|
|
try {
|
|
|
Thread.sleep(millis);
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|