overseas order no need auto confirm
Showing
4 changed files
with
19 additions
and
4 deletions
@@ -2,8 +2,6 @@ package com.yohoufo.order.mq.consumer; | @@ -2,8 +2,6 @@ package com.yohoufo.order.mq.consumer; | ||
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.yoho.core.rabbitmq.YhConsumer; | 4 | import com.yoho.core.rabbitmq.YhConsumer; |
5 | -import com.yohoufo.order.event.BuyerConfirmEvent; | ||
6 | -import com.yohoufo.order.model.request.OrderRequest; | ||
7 | import com.yohoufo.order.service.transfer.HkAccountSettlement; | 5 | import com.yohoufo.order.service.transfer.HkAccountSettlement; |
8 | import com.yohoufo.order.utils.LoggerUtils; | 6 | import com.yohoufo.order.utils.LoggerUtils; |
9 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
1 | package com.yohoufo.order.service.handler; | 1 | package com.yohoufo.order.service.handler; |
2 | 2 | ||
3 | import com.google.common.eventbus.Subscribe; | 3 | import com.google.common.eventbus.Subscribe; |
4 | +import com.yohobuy.ufo.model.order.constants.RegionEnum; | ||
4 | import com.yohoufo.common.alarm.IEventHandler; | 5 | import com.yohoufo.common.alarm.IEventHandler; |
5 | import com.yohoufo.order.event.BuyerConfirmEvent; | 6 | import com.yohoufo.order.event.BuyerConfirmEvent; |
6 | import com.yohoufo.order.mq.DelayTime; | 7 | import com.yohoufo.order.mq.DelayTime; |
7 | import com.yohoufo.order.mq.TopicConstants; | 8 | import com.yohoufo.order.mq.TopicConstants; |
8 | import com.yohoufo.order.mq.producer.TradeMqSender; | 9 | import com.yohoufo.order.mq.producer.TradeMqSender; |
10 | +import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport; | ||
9 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
10 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.stereotype.Component; | 14 | import org.springframework.stereotype.Component; |
13 | 15 | ||
16 | +import java.util.Objects; | ||
17 | + | ||
14 | /** | 18 | /** |
15 | * Created by chenchao on 2018/9/30. | 19 | * Created by chenchao on 2018/9/30. |
16 | */ | 20 | */ |
@@ -27,6 +31,14 @@ public class BuyerConfirmHandler implements IEventHandler<BuyerConfirmEvent> { | @@ -27,6 +31,14 @@ public class BuyerConfirmHandler implements IEventHandler<BuyerConfirmEvent> { | ||
27 | @Subscribe | 31 | @Subscribe |
28 | public void handle(BuyerConfirmEvent event) { | 32 | public void handle(BuyerConfirmEvent event) { |
29 | logger.info("Subscribe Buyer Confirm delay msg, event {}", event); | 33 | logger.info("Subscribe Buyer Confirm delay msg, event {}", event); |
34 | + Integer orderAttr = event.getOrderAttr(); | ||
35 | + if (Objects.nonNull(orderAttr)){ | ||
36 | + SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(orderAttr); | ||
37 | + if (codeNode.getRegion() == RegionEnum.HONGKONG.getCode()){ | ||
38 | + logger.info("in BuyerConfirmHandler no need sent delay message, {}", event); | ||
39 | + return; | ||
40 | + } | ||
41 | + } | ||
30 | 42 | ||
31 | tradeMqSender.send(TopicConstants.BUYER_ORDER_AUTO_CONFIRM, event, DELAY_MINUTES_7_DAYS); | 43 | tradeMqSender.send(TopicConstants.BUYER_ORDER_AUTO_CONFIRM, event, DELAY_MINUTES_7_DAYS); |
32 | } | 44 | } |
@@ -216,7 +216,8 @@ public class AppraiseService { | @@ -216,7 +216,8 @@ public class AppraiseService { | ||
216 | expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond()); | 216 | expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond()); |
217 | if (updateBuyerCnt == 1) { | 217 | if (updateBuyerCnt == 1) { |
218 | //发货,这个时候产生:买家确认收货的mq | 218 | //发货,这个时候产生:买家确认收货的mq |
219 | - BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build(); | 219 | + BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder() |
220 | + .uid(buyerUid).orderCode(orderCode).orderAttr(buyerOrder.getAttributes()).build(); | ||
220 | EventBusPublisher.publishEvent(buyerConfirmEvent); | 221 | EventBusPublisher.publishEvent(buyerConfirmEvent); |
221 | 222 | ||
222 | executorService.execute(() -> { | 223 | executorService.execute(() -> { |
@@ -1289,7 +1290,8 @@ public class AppraiseService { | @@ -1289,7 +1290,8 @@ public class AppraiseService { | ||
1289 | PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus); | 1290 | PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus); |
1290 | try { | 1291 | try { |
1291 | //鉴定通过后自动发货,这个时候产生:买家确认收货的mq | 1292 | //鉴定通过后自动发货,这个时候产生:买家确认收货的mq |
1292 | - BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build(); | 1293 | + BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder() |
1294 | + .uid(buyerUid).orderCode(orderCode).orderAttr(buyerOrder.getAttributes()).build(); | ||
1293 | EventBusPublisher.publishEvent(buyerConfirmEvent); | 1295 | EventBusPublisher.publishEvent(buyerConfirmEvent); |
1294 | 1296 | ||
1295 | //更新平台物流状态为已发货 | 1297 | //更新平台物流状态为已发货 |
-
Please register or login to post a comment