|
@@ -28,10 +28,7 @@ import com.yohoufo.dal.order.model.*; |
|
@@ -28,10 +28,7 @@ import com.yohoufo.dal.order.model.*; |
28
|
import com.yohoufo.order.common.ClientType;
|
28
|
import com.yohoufo.order.common.ClientType;
|
29
|
import com.yohoufo.order.common.DelStatus;
|
29
|
import com.yohoufo.order.common.DelStatus;
|
30
|
import com.yohoufo.order.constants.MetaKey;
|
30
|
import com.yohoufo.order.constants.MetaKey;
|
31
|
-import com.yohoufo.order.event.OrderCancelEvent;
|
|
|
32
|
-import com.yohoufo.order.event.PayConfirmEvent;
|
|
|
33
|
-import com.yohoufo.order.event.SellerDepositOrderCancelAsyncEvent;
|
|
|
34
|
-import com.yohoufo.order.event.SellerDepositOrderStatusConsistencyAsyncEvent;
|
31
|
+import com.yohoufo.order.event.*;
|
35
|
import com.yohoufo.order.model.PayQueryBo;
|
32
|
import com.yohoufo.order.model.PayQueryBo;
|
36
|
import com.yohoufo.order.model.dto.PlatformFeeDto;
|
33
|
import com.yohoufo.order.model.dto.PlatformFeeDto;
|
37
|
import com.yohoufo.order.model.dto.SellerDepositOrderContext;
|
34
|
import com.yohoufo.order.model.dto.SellerDepositOrderContext;
|
|
@@ -609,14 +606,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -609,14 +606,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
609
|
}
|
606
|
}
|
610
|
|
607
|
|
611
|
public void processAfterPay(OrderInfo orderInfo){
|
608
|
public void processAfterPay(OrderInfo orderInfo){
|
|
|
609
|
+ Long orderCode = orderInfo.getOrderCode();
|
|
|
610
|
+ Integer uid = orderInfo.getUid();
|
612
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.HAS_PAYED;
|
611
|
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.HAS_PAYED;
|
613
|
inBoxFacade.sellerDepositOrderNotice(orderInfo.getUid(), orderInfo.getOrderCode(), targetOrderStatus);
|
612
|
inBoxFacade.sellerDepositOrderNotice(orderInfo.getUid(), orderInfo.getOrderCode(), targetOrderStatus);
|
614
|
SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(this::handleOrderCancelAsyncEvent);
|
613
|
SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(this::handleOrderCancelAsyncEvent);
|
615
|
- event.setUid(orderInfo.getUid());
|
|
|
616
|
- event.setOrderCode(orderInfo.getOrderCode());
|
614
|
+ event.setUid(uid);
|
|
|
615
|
+ event.setOrderCode(orderCode);
|
617
|
EventBusPublisher.publishEvent(event);
|
616
|
EventBusPublisher.publishEvent(event);
|
618
|
logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
|
617
|
logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
|
619
|
-
|
618
|
+ SellerCancelDeliverEvent cancelDeliverEvent =
|
|
|
619
|
+ SellerCancelDeliverEvent.builder()
|
|
|
620
|
+ .uid(orderInfo.getUid())
|
|
|
621
|
+ .orderCode(orderCode).build();
|
|
|
622
|
+ EventBusPublisher.publishEvent(cancelDeliverEvent);
|
620
|
}
|
623
|
}
|
621
|
|
624
|
|
622
|
|
625
|
|
|
@@ -735,4 +738,53 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
|
@@ -735,4 +738,53 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple |
735
|
asyncEvent.setOrderCode(orderCode);
|
738
|
asyncEvent.setOrderCode(orderCode);
|
736
|
EventBusPublisher.publishEvent(asyncEvent);
|
739
|
EventBusPublisher.publishEvent(asyncEvent);
|
737
|
}
|
740
|
}
|
|
|
741
|
+
|
|
|
742
|
+ /**
|
|
|
743
|
+ * 发货超时取消
|
|
|
744
|
+ * @param orderCode
|
|
|
745
|
+ */
|
|
|
746
|
+ public int cancelForSendOutTimeout(long orderCode){
|
|
|
747
|
+ logger.info("in cancel seller deposit order For Send Out Timeout orderCode {}", orderCode);
|
|
|
748
|
+ ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.isAppraiseOrder(orderCode);
|
|
|
749
|
+
|
|
|
750
|
+ if (!existenceNode.isExisted()){
|
|
|
751
|
+ logger.warn("auto cancel AppraiseOrder not exist, orderCode {}", orderCode);
|
|
|
752
|
+ throw new UfoServiceException(400, "订单已迷路");
|
|
|
753
|
+ }
|
|
|
754
|
+ AppraiseOrder pao = existenceNode.getAppraiseOrder();
|
|
|
755
|
+
|
|
|
756
|
+ OrderAttributes oa = OrderAttributes.getOrderAttributes(pao.getAttributes());
|
|
|
757
|
+ if (!OrderAttributes.DEPOSITE.equals(oa)){
|
|
|
758
|
+ logger.warn("auto cancel AppraiseOrder not deposit Order, orderCode {}", orderCode);
|
|
|
759
|
+ throw new UfoServiceException(400, "订单已迷路");
|
|
|
760
|
+ }
|
|
|
761
|
+ int uid = pao.getUid();
|
|
|
762
|
+ AppraiseOrderStatus appraiseOrderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
|
|
|
763
|
+ int rows = 0;
|
|
|
764
|
+ AppraiseOrderStatus targetOrderStatus = null;
|
|
|
765
|
+ switch (appraiseOrderStatus){
|
|
|
766
|
+ case HAS_PAYED:
|
|
|
767
|
+ targetOrderStatus= AppraiseOrderStatus.SEND_OUT_TIMEOUT;
|
|
|
768
|
+ rows = super.triggerStatusChange(orderCode, targetOrderStatus, appraiseOrderStatus);
|
|
|
769
|
+ if (rows>0){
|
|
|
770
|
+ new GoodsServiceRefundHandler()
|
|
|
771
|
+ .loadLogger(logger)
|
|
|
772
|
+ .loadUser(uid)
|
|
|
773
|
+ .loadActionCase(SellerWalletDetail.Type.SELLER_OVER_TIME)
|
|
|
774
|
+ .loadRefundAction(payRefundService::refund)
|
|
|
775
|
+ .loadOrder(orderCode, orderCode, pao.getPayment(), pao.getAmount())
|
|
|
776
|
+ .refund();
|
|
|
777
|
+ //notice
|
|
|
778
|
+ inBoxFacade.sellerDepositOrderNotice(uid, orderCode, targetOrderStatus);
|
|
|
779
|
+ }
|
|
|
780
|
+
|
|
|
781
|
+
|
|
|
782
|
+ break;
|
|
|
783
|
+ default:
|
|
|
784
|
+ throw new UfoServiceException(400, "订单不支持取消");
|
|
|
785
|
+ }
|
|
|
786
|
+
|
|
|
787
|
+ return rows;
|
|
|
788
|
+
|
|
|
789
|
+ }
|
738
|
} |
790
|
} |