|
|
package com.yohoufo.order.service.handler;
|
|
|
|
|
|
import com.google.common.eventbus.Subscribe;
|
|
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
|
|
import com.yohoufo.common.alarm.IEventHandler;
|
|
|
import com.yohoufo.order.event.BuyerConfirmEvent;
|
|
|
import com.yohoufo.order.mq.DelayTime;
|
|
|
import com.yohoufo.order.mq.TopicConstants;
|
|
|
import com.yohoufo.order.mq.producer.TradeMqSender;
|
|
|
import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* Created by chenchao on 2018/9/30.
|
|
|
*/
|
...
|
...
|
@@ -27,6 +31,14 @@ public class BuyerConfirmHandler implements IEventHandler<BuyerConfirmEvent> { |
|
|
@Subscribe
|
|
|
public void handle(BuyerConfirmEvent event) {
|
|
|
logger.info("Subscribe Buyer Confirm delay msg, event {}", event);
|
|
|
Integer orderAttr = event.getOrderAttr();
|
|
|
if (Objects.nonNull(orderAttr)){
|
|
|
SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(orderAttr);
|
|
|
if (codeNode.getRegion() == RegionEnum.HONGKONG.getCode()){
|
|
|
logger.info("in BuyerConfirmHandler no need sent delay message, {}", event);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
tradeMqSender.send(TopicConstants.BUYER_ORDER_AUTO_CONFIRM, event, DELAY_MINUTES_7_DAYS);
|
|
|
}
|
...
|
...
|
|