...
|
...
|
@@ -7,11 +7,16 @@ import com.yohoufo.common.utils.DateUtil; |
|
|
import com.yohoufo.dal.order.BuyerOrderMapper;
|
|
|
import com.yohoufo.dal.order.OrderCouponMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderMapper;
|
|
|
import com.yohoufo.dal.order.model.OrderCoupon;
|
|
|
import com.yohoufo.dal.order.model.SellerOrder;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.order.common.RefundCase;
|
|
|
import com.yohoufo.order.event.BeforeDepotReceiveEvent;
|
|
|
import com.yohoufo.order.event.BeforeSellerDeliverEvent;
|
|
|
import com.yohoufo.order.event.BillLogEvent;
|
|
|
import com.yohoufo.order.model.bo.CouponBo;
|
|
|
import com.yohoufo.order.model.request.PaymentRequest;
|
|
|
import com.yohoufo.order.service.IPaymentService;
|
|
|
import com.yohoufo.order.service.concurrent.ThreadPoolFactory;
|
|
|
import com.yohoufo.order.service.proxy.CouponProxyService;
|
...
|
...
|
@@ -24,6 +29,7 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.concurrent.*;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -52,6 +58,11 @@ public class BuyerOrderCancelService { |
|
|
private IPaymentService paymentService;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderMapper sellerOrderMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private PayRefundService payRefundService;
|
|
|
|
|
|
|
|
|
public void cancel(BeforeSellerDeliverEvent bsdEvent){
|
...
|
...
|
@@ -74,6 +85,18 @@ public class BuyerOrderCancelService { |
|
|
|
|
|
//TODO 整个过程异步去执行(考虑退费依赖订单状态)
|
|
|
//(退费)退保证金给卖家
|
|
|
SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode);
|
|
|
int sellerUid = sellerOrder.getUid();
|
|
|
long sellerOrderCode = sellerOrder.getOrderCode();
|
|
|
BigDecimal earnestMoney = sellerOrder.getEarnestMoney();
|
|
|
PaymentRequest req = PaymentRequest.builder().uid(sellerUid)
|
|
|
.orderCode(sellerOrderCode).refundAmount(earnestMoney.doubleValue())
|
|
|
.build();
|
|
|
BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
|
|
|
.buyerUid(buyerUid).sellerUid(sellerUid).orderCode(sellerOrder.getOrderCode())
|
|
|
.payType(sellerOrder.getPayment()).refundCase(RefundCase.SELLER_EARNEST_MONEY)
|
|
|
.skup(skup);
|
|
|
payRefundService.refund(req, bleb);
|
|
|
|
|
|
//(转账)瓜分指定赔偿款给卖家和平台
|
|
|
//(退费)扣除赔偿款,计算剩余的货款,退给买家
|
...
|
...
|
@@ -103,6 +126,7 @@ public class BuyerOrderCancelService { |
|
|
|
|
|
//TODO 整个过程异步去执行(考虑退费依赖订单状态)
|
|
|
//(退费)退保证金给卖家
|
|
|
|
|
|
//(转账)瓜分指定赔偿款给卖家和平台
|
|
|
//(退费)扣除赔偿款,计算剩余的货款,退给买家
|
|
|
}
|
...
|
...
|
|