Authored by qinchao

发货提醒设置为动态设置

... ... @@ -32,6 +32,8 @@ public interface TopicConstants {
*/
String SELLER_ORDER_AUTO_CANCEL_DELIVER = "sellerOrder.autoCancelDeliver";
String SELLER_ORDER_AUTO_CANCEL_DELIVER_120 = "sellerOrder.autoCancelDeliver_120";
/**
* 付款截止时间前5分钟
*/
... ... @@ -39,5 +41,6 @@ public interface TopicConstants {
String ORDER_NOT_DELIVER_NOTICE = "order.notDeliver";
String ORDER_NOT_DELIVER_NOTICE_108 = "order.notDeliver_108";
}
... ...
... ... @@ -3,6 +3,7 @@ package com.yohoufo.order.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.core.config.ConfigReader;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.common.TabType;
... ... @@ -28,6 +29,7 @@ import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.cache.CacheCleaner;
import com.yohoufo.order.service.cache.CacheKeyBuilder;
import com.yohoufo.order.service.impl.SellerAddressService;
import com.yohoufo.order.service.proxy.DeliveryMinutesService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
import com.yohoufo.order.utils.BuyerOrderUtils;
... ... @@ -71,8 +73,8 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
@Autowired
private OrderStatusFlowService orderStatusFlowService;
@Value("${mq.seller.deliverNotice.third}")
private int deliverMinutes ;
@Autowired
private DeliveryMinutesService deliveryMinutesService;
/**
* 更新订单状态
... ... @@ -119,7 +121,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode);
int skup = buyerOrderGoods.getSkup();
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
int deliveryHours = deliverMinutes/60;//把分钟转小时
int deliveryHours = deliveryMinutesService.getDeliverMinutesThird()/60;//把分钟转小时
inBoxFacade.sellerSkupPaidByBuyer(sellerOrderGoods,orderCode,deliveryHours);
//离发货截止12小时提醒
... ...
... ... @@ -6,6 +6,7 @@ import com.yohoufo.order.event.DeliverNoticeEvent;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.mq.producer.TradeMqSender;
import com.yohoufo.order.service.proxy.DeliveryMinutesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -24,17 +25,20 @@ public class DeliverNoticeAsyncHandler implements IEventHandler<DeliverNoticeEve
//public static final int DELAY_MINUTES_24_HOURS = DelayTime.MINUTES_24_HOURS;
@Value("${mq.seller.deliverNotice.second}")
private int minutes ;
@Autowired
private TradeMqSender tradeMqSender;
@Autowired
private DeliveryMinutesService deliveryMinutesService;
@Override
@Subscribe
public void handle(DeliverNoticeEvent event) {
logger.info("in DeliverNoticeAsyncHandler handler, msg {},minutes {}", event,minutes);
tradeMqSender.send(TopicConstants.ORDER_NOT_DELIVER_NOTICE, event, minutes);
int minutes = deliveryMinutesService.getDeliverMinutesSecond();
//String topic = TopicConstants.ORDER_NOT_DELIVER_NOTICE;
String topic = TopicConstants.ORDER_NOT_DELIVER_NOTICE_108;
logger.info("in DeliverNoticeAsyncHandler handler, topic {},minutes {} ,msg {}",topic, minutes,event);
tradeMqSender.send(topic, event, minutes);
}
}
... ...
package com.yohoufo.order.service.handler;
import com.google.common.eventbus.Subscribe;
import com.yoho.core.config.ConfigReader;
import com.yohoufo.common.alarm.IEventHandler;
import com.yohoufo.order.event.SellerCancelDeliverEvent;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.mq.producer.TradeMqSender;
import com.yohoufo.order.service.proxy.DeliveryMinutesService;
import com.yohoufo.order.utils.LoggerUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -24,14 +26,17 @@ public class SellerCancelDeliverHandler implements IEventHandler<SellerCancelDel
@Autowired
private TradeMqSender tradeMqSender;
@Value("${mq.seller.deliverNotice.third}")
private int minutes ;
@Autowired
private DeliveryMinutesService deliveryMinutesService;
@Override
@Subscribe
public void handle(SellerCancelDeliverEvent event) {
logger.info("Subscribe Buyer Confirm delay msg, event {},minutes {}", event,minutes);
int minutes = deliveryMinutesService.getDeliverMinutesThird();
//String topic = TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER;
String topic = TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER_120;
logger.info("Subscribe Buyer Confirm delay msg,topic {}, delay minutes {} , event {}",topic,minutes, event);
tradeMqSender.send(TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER, event, minutes);
tradeMqSender.send(topic, event, minutes);
}
}
... ...
package com.yohoufo.order.service.proxy;
import com.yoho.core.config.ConfigReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 动态获取发货时间
*/
@Component
public class DeliveryMinutesService {
@Autowired
private ConfigReader configReader;
public int getDeliverMinutesSecond(){
return configReader.getInt("ufo.order.sellerDeliverNoticeSecond",108*60);
}
public int getDeliverMinutesThird(){
return configReader.getInt("ufo.order.sellerDeliverNoticeThird",120*60);
}
}
... ...
#UFO鉴定中心默认头像
#UFO��������Ĭ��ͷ��
ufo.product.defaultAuthHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height}
#UFO用户的默认头像
#UFO�û���Ĭ��ͷ��
ufo.product.defaultUserHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}
#UFO propaganda video info
... ... @@ -9,3 +9,9 @@ ufo.order.initVideoPic = http://img11.static.yhbimg.com/goodsimg/2018/12
ufo.order.initVideoDesc = \u5ba3\u4f20\u89c6\u9891
ufo.order.initVideoTime = 1546272000
ufo.order.realDesc = \u9274\u5b9a\u7ed3\u679c\uff1a\u771f
#二次发货提醒 108*60 minutes
ufo.order.sellerDeliverNoticeSecond = 108*60
#发货失败提醒 120*60 minutes
ufo.order.sellerDeliverNoticeThird = 120*60
\ No newline at end of file
... ...
... ... @@ -122,10 +122,6 @@ rabbit_host=192.168.102.45:5672
rabbit_user=yoho
rabbit_password=yoho
#二次发货提醒 108*60 minutes
mq.seller.deliverNotice.second=6480
#发货失败提醒 120*60 minutes
mq.seller.deliverNotice.third=7200
yoho.gateway.url=http://api-test3.dev.yohocorp.com
... ...
#UFO鉴定中心默认头像
#UFO��������Ĭ��ͷ��
ufo.product.defaultAuthHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height}
#UFO用户的默认头像
#UFO�û���Ĭ��ͷ��
ufo.product.defaultUserHeadIcon=http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}
#UFO propaganda video info
... ... @@ -11,4 +11,9 @@ ufo.order.initVideoTime = 1546272000
ufo.order.realDesc = \u9274\u5b9a\u7ed3\u679c\uff1a\u771f
ufo.order.realVideoPic = http://img11.static.yhbimg.com/goodsimg/2019/01/15/17/01e7093ff7effcdf76ed191e68e4a5c4ca.png
ufo.order.initVideoShow = false
ufo.order.appressVideoShow = true
\ No newline at end of file
ufo.order.appressVideoShow = true
#二次发货提醒 108*60 minutes
ufo.order.sellerDeliverNoticeSecond = 108*60
#发货失败提醒 120*60 minutes
ufo.order.sellerDeliverNoticeThird = 120*60
\ No newline at end of file
... ...
... ... @@ -38,6 +38,18 @@ consumer:
delay:
interval: 1440
#春节期间发货时间延长的120小时
- class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer
topic: sellerOrder.autoCancelDeliver_120
delay:
interval: 7200
#春节期间二次发货提醒时间延长的108小时
- class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer
topic: order.notDeliver_108
delay:
interval: 6480
#更新物流调拨信息
- address: 192.168.102.45:5672
username: yoho
... ...
... ... @@ -97,10 +97,6 @@ rabbit_host=${rabbit_ufo}
rabbit_user=${rabbit_ufo_user}
rabbit_password=${rabbit_ufo_password}
#二次发货提醒 108*60 minutes
mq.seller.deliverNotice.second=${mq.seller.deliverNotice.second}
#发货失败提醒 120*60 minutes
mq.seller.deliverNotice.third=${mq.seller.deliverNotice.third}
yoho.gateway.url=${yoho.gateway.url}
... ...
... ... @@ -26,7 +26,7 @@ consumer:
- class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer
topic: sellerOrder.autoCancelDeliver
delay:
interval: ${mq.seller.deliverNotice.third}
interval: 2160
#order.notPaidNotice
- class: com.yohoufo.order.mq.consumer.NotPaidNoticeDelayMsgConsumer
... ... @@ -37,8 +37,19 @@ consumer:
- class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer
topic: order.notDeliver
delay:
interval: ${mq.seller.deliverNotice.second}
interval: 1440
#春节期间发货时间延长的120小时
- class: com.yohoufo.order.mq.consumer.SellerOrderCancelDeliverDelayMsgConsumer
topic: sellerOrder.autoCancelDeliver_120
delay:
interval: 7200
#春节期间二次发货提醒时间延长的108小时
- class: com.yohoufo.order.mq.consumer.NotDeliverNoticeDelayMsgConsumer
topic: order.notDeliver_108
delay:
interval: 6480
- address: ${rabbit_ufo}
username: ${rabbit_ufo_user}
... ...