Authored by LUOXC

去掉修复数据代码

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) {
}
}
}
... ...
... ... @@ -274,35 +274,6 @@ public class BuyerOrderCancelService {
.cancel();
}
/**
* 2020-03-13超时取消BUG修复数据使用
*
* @param uid
* @param orderCode
*/
public void cancelForSellerSendOutTimeoutCompensation(int uid, long orderCode) {
new BuyerOrderCancelHandler(uid, orderCode)
.withBuyerOrderSupplier(buyerOrderMapper, buyerOrderGoodsMapper)
.withSellerOrderSupplier(sellerOrderGoodsMapper, sellerOrderMetaMapper)
// 超时未发货取消 -> 超时未发货取消
.withStateTransition(OrderStatus.SEND_OUT_TIMEOUT, OrderStatus.SEND_OUT_TIMEOUT, null)
// 保证金分账给平台和买家
.withTransferEarnestMoney2Buyer(transferService, SellerWalletDetail.Type.SELLER_OVER_TIME)
// 退买家货款
.withRefundGoodsMoney(payRefundService::refund).refundCase(RefundCase.BUYER_GOODS_MONEY).and()
// 通知卖家商品发货超时
.withNoticeSeller((soa, buyerOrder) -> sellerNoticeFacade.sellerDeliverWithTimes(soa, buyerOrder, OrderConstant.SellerDeliverNotice.TIME_OF_CANCELED, 0, null)).and()
// 通知买家卖家商品发货超时
.withNoticeBuyer(buyerNoticeFacade::noticeBuyerOfSellerSendOutTimeout).and()
// 退优惠券
.withRefundCoupon(BuyerRefundCouponEvent.BizCase.SELLER_DELIVER_TIMEOUT)
.withCacheCleaner(cacheCleaner::delete)
.withFailAlarm(AlarmConfig.DELIVER_TIME_OUT)
.withOrderChangeListenerContainer(orderChangeListenerContainer)
.cancel();
}
public void cancelForSellerShamSendOut(int uid, long orderCode, OrderStatus targetStatus) {
if (serviceOrderProcessor.isGoodsServiceOrder(orderCode)) {
... ...