Authored by chenchao

overseas order no need auto confirm

... ... @@ -18,4 +18,7 @@ public class BuyerConfirmEvent extends Event{
private int uid;
private long orderCode;
private int orderAttr;
}
... ...
... ... @@ -2,8 +2,6 @@ package com.yohoufo.order.mq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rabbitmq.YhConsumer;
import com.yohoufo.order.event.BuyerConfirmEvent;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.service.transfer.HkAccountSettlement;
import com.yohoufo.order.utils.LoggerUtils;
import org.slf4j.Logger;
... ...
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);
}
... ...
... ... @@ -216,7 +216,8 @@ public class AppraiseService {
expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond());
if (updateBuyerCnt == 1) {
//发货,这个时候产生:买家确认收货的mq
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder()
.uid(buyerUid).orderCode(orderCode).orderAttr(buyerOrder.getAttributes()).build();
EventBusPublisher.publishEvent(buyerConfirmEvent);
executorService.execute(() -> {
... ... @@ -1289,7 +1290,8 @@ public class AppraiseService {
PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus);
try {
//鉴定通过后自动发货,这个时候产生:买家确认收货的mq
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder()
.uid(buyerUid).orderCode(orderCode).orderAttr(buyerOrder.getAttributes()).build();
EventBusPublisher.publishEvent(buyerConfirmEvent);
//更新平台物流状态为已发货
... ...