...
|
...
|
@@ -8,7 +8,6 @@ import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo; |
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.SkupStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.TabType;
|
|
|
import com.yohobuy.ufo.model.order.constants.CustomsClearanceResultType;
|
|
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
|
|
import com.yohobuy.ufo.model.promotion.request.CouponSendMqBean;
|
...
|
...
|
@@ -42,7 +41,6 @@ import com.yohoufo.order.service.proxy.*; |
|
|
import com.yohoufo.order.service.seller.setting.SellerService;
|
|
|
import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import com.yohoufo.order.utils.NamedThreadFactory;
|
|
|
import com.yohoufo.order.utils.OrderAssist;
|
|
|
import com.yohoufo.order.utils.PaymentHelper;
|
|
|
import lombok.Builder;
|
...
|
...
|
@@ -366,23 +364,23 @@ public class BuyerOrderCancelService { |
|
|
}
|
|
|
}
|
|
|
|
|
|
public void buyerCancelRefund(int uid, long orderCode){
|
|
|
public void buyerCancelRefund(int uid, long orderCode) {
|
|
|
OrderStatus targetOrderStatus = OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE;
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
|
|
|
if(targetOrderStatus.getCode() == buyerOrder.getStatus().intValue()){
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid,orderCode);
|
|
|
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, buyerOrderGoods, targetOrderStatus);
|
|
|
TransferCase transferCase = TransferCase.PART_GOODS_MONEY_TO_SELLER;
|
|
|
BuyerCancelAfterProcessTask bcapt = new BuyerCancelAfterProcessTask(buyerOrder, buyerOrderGoods.getSkup(),
|
|
|
bpcr, transferCase,false);
|
|
|
bcapt.targetOrderStatus = targetOrderStatus;
|
|
|
bcapt.setSwdType(SellerWalletDetail.Type.BUYER_CANCEL_DELIVERY);
|
|
|
try {
|
|
|
bcapt.call();
|
|
|
} catch (Exception e) {
|
|
|
throwServiceException("服务异常");
|
|
|
logger.warn("buyerCancelRefund fail uid {}, orderCode {}", uid, orderCode);
|
|
|
}
|
|
|
throwServiceExceptionIf(Objects.isNull(buyerOrder), "订单不存在");
|
|
|
throwServiceExceptionIf(targetOrderStatus.getCode() != buyerOrder.getStatus().intValue(), "订单状态错误");
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode);
|
|
|
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, buyerOrderGoods, targetOrderStatus);
|
|
|
TransferCase transferCase = TransferCase.PART_GOODS_MONEY_TO_SELLER;
|
|
|
BuyerCancelAfterProcessTask bcapt = new BuyerCancelAfterProcessTask(buyerOrder, buyerOrderGoods.getSkup(),
|
|
|
bpcr, transferCase, false);
|
|
|
bcapt.targetOrderStatus = targetOrderStatus;
|
|
|
bcapt.setSwdType(SellerWalletDetail.Type.BUYER_CANCEL_DELIVERY);
|
|
|
try {
|
|
|
bcapt.call();
|
|
|
} catch (Exception e) {
|
|
|
logger.warn("buyerCancelRefund fail uid {}, orderCode {}", uid, orderCode);
|
|
|
throwServiceException("服务异常");
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|