Showing
11 changed files
with
92 additions
and
26 deletions
@@ -32,6 +32,8 @@ public interface TopicConstants { | @@ -32,6 +32,8 @@ public interface TopicConstants { | ||
32 | */ | 32 | */ |
33 | String SELLER_ORDER_AUTO_CANCEL_DELIVER = "sellerOrder.autoCancelDeliver"; | 33 | String SELLER_ORDER_AUTO_CANCEL_DELIVER = "sellerOrder.autoCancelDeliver"; |
34 | 34 | ||
35 | + | ||
36 | + String SELLER_ORDER_AUTO_CANCEL_DELIVER_120 = "sellerOrder.autoCancelDeliver_120"; | ||
35 | /** | 37 | /** |
36 | * 付款截止时间前5分钟 | 38 | * 付款截止时间前5分钟 |
37 | */ | 39 | */ |
@@ -39,5 +41,6 @@ public interface TopicConstants { | @@ -39,5 +41,6 @@ public interface TopicConstants { | ||
39 | 41 | ||
40 | 42 | ||
41 | String ORDER_NOT_DELIVER_NOTICE = "order.notDeliver"; | 43 | String ORDER_NOT_DELIVER_NOTICE = "order.notDeliver"; |
44 | + String ORDER_NOT_DELIVER_NOTICE_108 = "order.notDeliver_108"; | ||
42 | 45 | ||
43 | } | 46 | } |
@@ -3,6 +3,7 @@ package com.yohoufo.order.service; | @@ -3,6 +3,7 @@ package com.yohoufo.order.service; | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
5 | import com.yoho.core.common.utils.DateUtil; | 5 | import com.yoho.core.common.utils.DateUtil; |
6 | +import com.yoho.core.config.ConfigReader; | ||
6 | import com.yoho.error.ServiceError; | 7 | import com.yoho.error.ServiceError; |
7 | import com.yoho.error.exception.ServiceException; | 8 | import com.yoho.error.exception.ServiceException; |
8 | import com.yohobuy.ufo.model.order.common.TabType; | 9 | import com.yohobuy.ufo.model.order.common.TabType; |
@@ -28,6 +29,7 @@ import com.yohoufo.order.mq.DelayTime; | @@ -28,6 +29,7 @@ import com.yohoufo.order.mq.DelayTime; | ||
28 | import com.yohoufo.order.service.cache.CacheCleaner; | 29 | import com.yohoufo.order.service.cache.CacheCleaner; |
29 | import com.yohoufo.order.service.cache.CacheKeyBuilder; | 30 | import com.yohoufo.order.service.cache.CacheKeyBuilder; |
30 | import com.yohoufo.order.service.impl.SellerAddressService; | 31 | import com.yohoufo.order.service.impl.SellerAddressService; |
32 | +import com.yohoufo.order.service.proxy.DeliveryMinutesService; | ||
31 | import com.yohoufo.order.service.proxy.InBoxFacade; | 33 | import com.yohoufo.order.service.proxy.InBoxFacade; |
32 | import com.yohoufo.order.service.proxy.OrderStatusFlowService; | 34 | import com.yohoufo.order.service.proxy.OrderStatusFlowService; |
33 | import com.yohoufo.order.utils.BuyerOrderUtils; | 35 | import com.yohoufo.order.utils.BuyerOrderUtils; |
@@ -71,8 +73,8 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | @@ -71,8 +73,8 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | ||
71 | @Autowired | 73 | @Autowired |
72 | private OrderStatusFlowService orderStatusFlowService; | 74 | private OrderStatusFlowService orderStatusFlowService; |
73 | 75 | ||
74 | - @Value("${mq.seller.deliverNotice.third}") | ||
75 | - private int deliverMinutes ; | 76 | + @Autowired |
77 | + private DeliveryMinutesService deliveryMinutesService; | ||
76 | 78 | ||
77 | /** | 79 | /** |
78 | * 更新订单状态 | 80 | * 更新订单状态 |
@@ -119,7 +121,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | @@ -119,7 +121,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { | ||
119 | BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode); | 121 | BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode); |
120 | int skup = buyerOrderGoods.getSkup(); | 122 | int skup = buyerOrderGoods.getSkup(); |
121 | SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); | 123 | SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); |
122 | - int deliveryHours = deliverMinutes/60;//把分钟转小时 | 124 | + int deliveryHours = deliveryMinutesService.getDeliverMinutesThird()/60;//把分钟转小时 |
123 | inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryHours); | 125 | inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryHours); |
124 | 126 | ||
125 | //离发货截止12小时提醒 | 127 | //离发货截止12小时提醒 |
@@ -6,6 +6,7 @@ import com.yohoufo.order.event.DeliverNoticeEvent; | @@ -6,6 +6,7 @@ import com.yohoufo.order.event.DeliverNoticeEvent; | ||
6 | import com.yohoufo.order.mq.DelayTime; | 6 | import com.yohoufo.order.mq.DelayTime; |
7 | import com.yohoufo.order.mq.TopicConstants; | 7 | import com.yohoufo.order.mq.TopicConstants; |
8 | import com.yohoufo.order.mq.producer.TradeMqSender; | 8 | import com.yohoufo.order.mq.producer.TradeMqSender; |
9 | +import com.yohoufo.order.service.proxy.DeliveryMinutesService; | ||
9 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
10 | import org.slf4j.LoggerFactory; | 11 | import org.slf4j.LoggerFactory; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -24,17 +25,20 @@ public class DeliverNoticeAsyncHandler implements IEventHandler<DeliverNoticeEve | @@ -24,17 +25,20 @@ public class DeliverNoticeAsyncHandler implements IEventHandler<DeliverNoticeEve | ||
24 | 25 | ||
25 | //public static final int DELAY_MINUTES_24_HOURS = DelayTime.MINUTES_24_HOURS; | 26 | //public static final int DELAY_MINUTES_24_HOURS = DelayTime.MINUTES_24_HOURS; |
26 | 27 | ||
27 | - @Value("${mq.seller.deliverNotice.second}") | ||
28 | - private int minutes ; | ||
29 | - | ||
30 | @Autowired | 28 | @Autowired |
31 | private TradeMqSender tradeMqSender; | 29 | private TradeMqSender tradeMqSender; |
32 | 30 | ||
31 | + @Autowired | ||
32 | + private DeliveryMinutesService deliveryMinutesService; | ||
33 | + | ||
33 | 34 | ||
34 | @Override | 35 | @Override |
35 | @Subscribe | 36 | @Subscribe |
36 | public void handle(DeliverNoticeEvent event) { | 37 | public void handle(DeliverNoticeEvent event) { |
37 | - logger.info("in DeliverNoticeAsyncHandler handler, msg {},minutes {}", event,minutes); | ||
38 | - tradeMqSender.send(TopicConstants.ORDER_NOT_DELIVER_NOTICE, event, minutes); | 38 | + int minutes = deliveryMinutesService.getDeliverMinutesSecond(); |
39 | + //String topic = TopicConstants.ORDER_NOT_DELIVER_NOTICE; | ||
40 | + String topic = TopicConstants.ORDER_NOT_DELIVER_NOTICE_108; | ||
41 | + logger.info("in DeliverNoticeAsyncHandler handler, topic {},minutes {} ,msg {}",topic, minutes,event); | ||
42 | + tradeMqSender.send(topic, event, minutes); | ||
39 | } | 43 | } |
40 | } | 44 | } |
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.yoho.core.config.ConfigReader; | ||
4 | import com.yohoufo.common.alarm.IEventHandler; | 5 | import com.yohoufo.common.alarm.IEventHandler; |
5 | import com.yohoufo.order.event.SellerCancelDeliverEvent; | 6 | import com.yohoufo.order.event.SellerCancelDeliverEvent; |
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.proxy.DeliveryMinutesService; | ||
9 | import com.yohoufo.order.utils.LoggerUtils; | 11 | import com.yohoufo.order.utils.LoggerUtils; |
10 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
11 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -24,14 +26,17 @@ public class SellerCancelDeliverHandler implements IEventHandler<SellerCancelDel | @@ -24,14 +26,17 @@ public class SellerCancelDeliverHandler implements IEventHandler<SellerCancelDel | ||
24 | @Autowired | 26 | @Autowired |
25 | private TradeMqSender tradeMqSender; | 27 | private TradeMqSender tradeMqSender; |
26 | 28 | ||
27 | - @Value("${mq.seller.deliverNotice.third}") | ||
28 | - private int minutes ; | 29 | + @Autowired |
30 | + private DeliveryMinutesService deliveryMinutesService; | ||
29 | 31 | ||
30 | @Override | 32 | @Override |
31 | @Subscribe | 33 | @Subscribe |
32 | public void handle(SellerCancelDeliverEvent event) { | 34 | public void handle(SellerCancelDeliverEvent event) { |
33 | - logger.info("Subscribe Buyer Confirm delay msg, event {},minutes {}", event,minutes); | 35 | + int minutes = deliveryMinutesService.getDeliverMinutesThird(); |
36 | + //String topic = TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER; | ||
37 | + String topic = TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER_120; | ||
38 | + logger.info("Subscribe Buyer Confirm delay msg,topic {}, delay minutes {} , event {}",topic,minutes, event); | ||
34 | 39 | ||
35 | - tradeMqSender.send(TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER, event, minutes); | 40 | + tradeMqSender.send(topic, event, minutes); |
36 | } | 41 | } |
37 | } | 42 | } |
1 | +package com.yohoufo.order.service.proxy; | ||
2 | + | ||
3 | +import com.yoho.core.config.ConfigReader; | ||
4 | +import org.springframework.beans.factory.annotation.Autowired; | ||
5 | +import org.springframework.stereotype.Component; | ||
6 | + | ||
7 | +/** | ||
8 | + * 动态获取发货时间 | ||
9 | + */ | ||
10 | +@Component | ||
11 | +public class DeliveryMinutesService { | ||
12 | + @Autowired | ||
13 | + private ConfigReader configReader; | ||
14 | + | ||
15 | + public int getDeliverMinutesSecond(){ | ||
16 | + return configReader.getInt("ufo.order.sellerDeliverNoticeSecond",108*60); | ||
17 | + } | ||
18 | + | ||
19 | + public int getDeliverMinutesThird(){ | ||
20 | + return configReader.getInt("ufo.order.sellerDeliverNoticeThird",120*60); | ||
21 | + } | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | +} |
1 | -#UFO鉴定中心默认头像 | 1 | +#UFO��������Ĭ��ͷ�� |
2 | ufo.product.defaultAuthHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height} | 2 | ufo.product.defaultAuthHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height} |
3 | -#UFO用户的默认头像 | 3 | +#UFO�û���Ĭ��ͷ�� |
4 | ufo.product.defaultUserHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height} | 4 | ufo.product.defaultUserHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height} |
5 | 5 | ||
6 | #UFO propaganda video info | 6 | #UFO propaganda video info |
@@ -9,3 +9,9 @@ ufo.order.initVideoPic = http://img11.static.yhbimg.com/goodsimg/2018/12 | @@ -9,3 +9,9 @@ ufo.order.initVideoPic = http://img11.static.yhbimg.com/goodsimg/2018/12 | ||
9 | ufo.order.initVideoDesc = \u5ba3\u4f20\u89c6\u9891 | 9 | ufo.order.initVideoDesc = \u5ba3\u4f20\u89c6\u9891 |
10 | ufo.order.initVideoTime = 1546272000 | 10 | ufo.order.initVideoTime = 1546272000 |
11 | ufo.order.realDesc = \u9274\u5b9a\u7ed3\u679c\uff1a\u771f | 11 | ufo.order.realDesc = \u9274\u5b9a\u7ed3\u679c\uff1a\u771f |
12 | + | ||
13 | + | ||
14 | +#二次发货提醒 108*60 minutes | ||
15 | +ufo.order.sellerDeliverNoticeSecond = 108*60 | ||
16 | +#发货失败提醒 120*60 minutes | ||
17 | +ufo.order.sellerDeliverNoticeThird = 120*60 |
@@ -122,10 +122,6 @@ rabbit_host=192.168.102.45:5672 | @@ -122,10 +122,6 @@ rabbit_host=192.168.102.45:5672 | ||
122 | rabbit_user=yoho | 122 | rabbit_user=yoho |
123 | rabbit_password=yoho | 123 | rabbit_password=yoho |
124 | 124 | ||
125 | -#二次发货提醒 108*60 minutes | ||
126 | -mq.seller.deliverNotice.second=6480 | ||
127 | -#发货失败提醒 120*60 minutes | ||
128 | -mq.seller.deliverNotice.third=7200 | ||
129 | 125 | ||
130 | 126 | ||
131 | yoho.gateway.url=http://api-test3.dev.yohocorp.com | 127 | yoho.gateway.url=http://api-test3.dev.yohocorp.com |
1 | -#UFO鉴定中心默认头像 | 1 | +#UFO��������Ĭ��ͷ�� |
2 | ufo.product.defaultAuthHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height} | 2 | ufo.product.defaultAuthHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height} |
3 | -#UFO用户的默认头像 | 3 | +#UFO�û���Ĭ��ͷ�� |
4 | ufo.product.defaultUserHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height} | 4 | ufo.product.defaultUserHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height} |
5 | 5 | ||
6 | #UFO propaganda video info | 6 | #UFO propaganda video info |
@@ -12,3 +12,8 @@ ufo.order.realDesc = \u9274\u5b9a\u7ed3\u679c\uff1a\u771f | @@ -12,3 +12,8 @@ ufo.order.realDesc = \u9274\u5b9a\u7ed3\u679c\uff1a\u771f | ||
12 | ufo.order.realVideoPic = http://img11.static.yhbimg.com/goodsimg/2019/01/15/17/01e7093ff7effcdf76ed191e68e4a5c4ca.png | 12 | ufo.order.realVideoPic = http://img11.static.yhbimg.com/goodsimg/2019/01/15/17/01e7093ff7effcdf76ed191e68e4a5c4ca.png |
13 | ufo.order.initVideoShow = false | 13 | ufo.order.initVideoShow = false |
14 | ufo.order.appressVideoShow = true | 14 | ufo.order.appressVideoShow = true |
15 | + | ||
16 | +#二次发货提醒 108*60 minutes | ||
17 | +ufo.order.sellerDeliverNoticeSecond = 108*60 | ||
18 | +#发货失败提醒 120*60 minutes | ||
19 | +ufo.order.sellerDeliverNoticeThird = 120*60 |
@@ -38,6 +38,18 @@ consumer: | @@ -38,6 +38,18 @@ consumer: | ||
38 | delay: | 38 | delay: |
39 | interval: 1440 | 39 | interval: 1440 |
40 | 40 | ||
41 | + #春节期间发货时间延长的120小时 | ||
42 | + - class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer | ||
43 | + topic: sellerOrder.autoCancelDeliver_120 | ||
44 | + delay: | ||
45 | + interval: 7200 | ||
46 | + | ||
47 | + #春节期间二次发货提醒时间延长的108小时 | ||
48 | + - class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer | ||
49 | + topic: order.notDeliver_108 | ||
50 | + delay: | ||
51 | + interval: 6480 | ||
52 | + | ||
41 | #更新物流调拨信息 | 53 | #更新物流调拨信息 |
42 | - address: 192.168.102.45:5672 | 54 | - address: 192.168.102.45:5672 |
43 | username: yoho | 55 | username: yoho |
@@ -97,10 +97,6 @@ rabbit_host=${rabbit_ufo} | @@ -97,10 +97,6 @@ rabbit_host=${rabbit_ufo} | ||
97 | rabbit_user=${rabbit_ufo_user} | 97 | rabbit_user=${rabbit_ufo_user} |
98 | rabbit_password=${rabbit_ufo_password} | 98 | rabbit_password=${rabbit_ufo_password} |
99 | 99 | ||
100 | -#二次发货提醒 108*60 minutes | ||
101 | -mq.seller.deliverNotice.second=${mq.seller.deliverNotice.second} | ||
102 | -#发货失败提醒 120*60 minutes | ||
103 | -mq.seller.deliverNotice.third=${mq.seller.deliverNotice.third} | ||
104 | 100 | ||
105 | 101 | ||
106 | yoho.gateway.url=${yoho.gateway.url} | 102 | yoho.gateway.url=${yoho.gateway.url} |
@@ -26,7 +26,7 @@ consumer: | @@ -26,7 +26,7 @@ consumer: | ||
26 | - class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer | 26 | - class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer |
27 | topic: sellerOrder.autoCancelDeliver | 27 | topic: sellerOrder.autoCancelDeliver |
28 | delay: | 28 | delay: |
29 | - interval: ${mq.seller.deliverNotice.third} | 29 | + interval: 2160 |
30 | 30 | ||
31 | #order.notPaidNotice | 31 | #order.notPaidNotice |
32 | - class: com.yohoufo.order.mq.consumer.NotPaidNoticeDelayMsgConsumer | 32 | - class: com.yohoufo.order.mq.consumer.NotPaidNoticeDelayMsgConsumer |
@@ -37,8 +37,19 @@ consumer: | @@ -37,8 +37,19 @@ consumer: | ||
37 | - class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer | 37 | - class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer |
38 | topic: order.notDeliver | 38 | topic: order.notDeliver |
39 | delay: | 39 | delay: |
40 | - interval: ${mq.seller.deliverNotice.second} | 40 | + interval: 1440 |
41 | + | ||
42 | + #春节期间发货时间延长的120小时 | ||
43 | + - class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer | ||
44 | + topic: sellerOrder.autoCancelDeliver_120 | ||
45 | + delay: | ||
46 | + interval: 7200 | ||
41 | 47 | ||
48 | + #春节期间二次发货提醒时间延长的108小时 | ||
49 | + - class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer | ||
50 | + topic: order.notDeliver_108 | ||
51 | + delay: | ||
52 | + interval: 6480 | ||
42 | 53 | ||
43 | - address: ${rabbit_ufo} | 54 | - address: ${rabbit_ufo} |
44 | username: ${rabbit_ufo_user} | 55 | username: ${rabbit_ufo_user} |
-
Please register or login to post a comment