...
|
...
|
@@ -28,10 +28,7 @@ import com.yohoufo.dal.order.model.*; |
|
|
import com.yohoufo.order.common.ClientType;
|
|
|
import com.yohoufo.order.common.DelStatus;
|
|
|
import com.yohoufo.order.constants.MetaKey;
|
|
|
import com.yohoufo.order.event.OrderCancelEvent;
|
|
|
import com.yohoufo.order.event.PayConfirmEvent;
|
|
|
import com.yohoufo.order.event.SellerDepositOrderCancelAsyncEvent;
|
|
|
import com.yohoufo.order.event.SellerDepositOrderStatusConsistencyAsyncEvent;
|
|
|
import com.yohoufo.order.event.*;
|
|
|
import com.yohoufo.order.model.PayQueryBo;
|
|
|
import com.yohoufo.order.model.dto.PlatformFeeDto;
|
|
|
import com.yohoufo.order.model.dto.SellerDepositOrderContext;
|
...
|
...
|
@@ -609,14 +606,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
|
}
|
|
|
|
|
|
public void processAfterPay(OrderInfo orderInfo){
|
|
|
Long orderCode = orderInfo.getOrderCode();
|
|
|
Integer uid = orderInfo.getUid();
|
|
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.HAS_PAYED;
|
|
|
inBoxFacade.sellerDepositOrderNotice(orderInfo.getUid(), orderInfo.getOrderCode(), targetOrderStatus);
|
|
|
SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(this::handleOrderCancelAsyncEvent);
|
|
|
event.setUid(orderInfo.getUid());
|
|
|
event.setOrderCode(orderInfo.getOrderCode());
|
|
|
event.setUid(uid);
|
|
|
event.setOrderCode(orderCode);
|
|
|
EventBusPublisher.publishEvent(event);
|
|
|
logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
|
|
|
|
|
|
SellerCancelDeliverEvent cancelDeliverEvent =
|
|
|
SellerCancelDeliverEvent.builder()
|
|
|
.uid(orderInfo.getUid())
|
|
|
.orderCode(orderCode).build();
|
|
|
EventBusPublisher.publishEvent(cancelDeliverEvent);
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -735,4 +738,53 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
|
asyncEvent.setOrderCode(orderCode);
|
|
|
EventBusPublisher.publishEvent(asyncEvent);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发货超时取消
|
|
|
* @param orderCode
|
|
|
*/
|
|
|
public int cancelForSendOutTimeout(long orderCode){
|
|
|
logger.info("in cancel seller deposit order For Send Out Timeout orderCode {}", orderCode);
|
|
|
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.isAppraiseOrder(orderCode);
|
|
|
|
|
|
if (!existenceNode.isExisted()){
|
|
|
logger.warn("auto cancel AppraiseOrder not exist, orderCode {}", orderCode);
|
|
|
throw new UfoServiceException(400, "订单已迷路");
|
|
|
}
|
|
|
AppraiseOrder pao = existenceNode.getAppraiseOrder();
|
|
|
|
|
|
OrderAttributes oa = OrderAttributes.getOrderAttributes(pao.getAttributes());
|
|
|
if (!OrderAttributes.DEPOSITE.equals(oa)){
|
|
|
logger.warn("auto cancel AppraiseOrder not deposit Order, orderCode {}", orderCode);
|
|
|
throw new UfoServiceException(400, "订单已迷路");
|
|
|
}
|
|
|
int uid = pao.getUid();
|
|
|
AppraiseOrderStatus appraiseOrderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
|
|
|
int rows = 0;
|
|
|
AppraiseOrderStatus targetOrderStatus = null;
|
|
|
switch (appraiseOrderStatus){
|
|
|
case HAS_PAYED:
|
|
|
targetOrderStatus= AppraiseOrderStatus.SEND_OUT_TIMEOUT;
|
|
|
rows = super.triggerStatusChange(orderCode, targetOrderStatus, appraiseOrderStatus);
|
|
|
if (rows>0){
|
|
|
new GoodsServiceRefundHandler()
|
|
|
.loadLogger(logger)
|
|
|
.loadUser(uid)
|
|
|
.loadActionCase(SellerWalletDetail.Type.SELLER_OVER_TIME)
|
|
|
.loadRefundAction(payRefundService::refund)
|
|
|
.loadOrder(orderCode, orderCode, pao.getPayment(), pao.getAmount())
|
|
|
.refund();
|
|
|
//notice
|
|
|
inBoxFacade.sellerDepositOrderNotice(uid, orderCode, targetOrderStatus);
|
|
|
}
|
|
|
|
|
|
|
|
|
break;
|
|
|
default:
|
|
|
throw new UfoServiceException(400, "订单不支持取消");
|
|
|
}
|
|
|
|
|
|
return rows;
|
|
|
|
|
|
}
|
|
|
} |
...
|
...
|
|