Showing
8 changed files
with
55 additions
and
4 deletions
@@ -11,6 +11,8 @@ public interface OrderOverTimeMapper { | @@ -11,6 +11,8 @@ public interface OrderOverTimeMapper { | ||
11 | 11 | ||
12 | int insertShamSendTime(OrderOverTime record); | 12 | int insertShamSendTime(OrderOverTime record); |
13 | 13 | ||
14 | + int insertMiniFaultConfirmTime(OrderOverTime record); | ||
15 | + | ||
14 | List<OrderOverTime> selectByOrderCodes(@Param(value = "orderCodeList") List<Long> orderCodeList); | 16 | List<OrderOverTime> selectByOrderCodes(@Param(value = "orderCodeList") List<Long> orderCodeList); |
15 | 17 | ||
16 | OrderOverTime selectByOrderCode(@Param(value = "orderCode")Long orderCode); | 18 | OrderOverTime selectByOrderCode(@Param(value = "orderCode")Long orderCode); |
@@ -13,6 +13,8 @@ public class OrderOverTime { | @@ -13,6 +13,8 @@ public class OrderOverTime { | ||
13 | 13 | ||
14 | private Integer shamSendTime; | 14 | private Integer shamSendTime; |
15 | 15 | ||
16 | + private Integer miniFaultConfirmMinutes; | ||
17 | + | ||
16 | public OrderOverTime() { | 18 | public OrderOverTime() { |
17 | } | 19 | } |
18 | 20 | ||
@@ -27,6 +29,14 @@ public class OrderOverTime { | @@ -27,6 +29,14 @@ public class OrderOverTime { | ||
27 | this.orderCode = orderCode; | 29 | this.orderCode = orderCode; |
28 | } | 30 | } |
29 | 31 | ||
32 | + public Integer getMiniFaultConfirmMinutes() { | ||
33 | + return miniFaultConfirmMinutes; | ||
34 | + } | ||
35 | + | ||
36 | + public void setMiniFaultConfirmMinutes(Integer miniFaultConfirmMinutes) { | ||
37 | + this.miniFaultConfirmMinutes = miniFaultConfirmMinutes; | ||
38 | + } | ||
39 | + | ||
30 | public Integer getDeliveryMinutes() { | 40 | public Integer getDeliveryMinutes() { |
31 | return deliveryMinutes; | 41 | return deliveryMinutes; |
32 | } | 42 | } |
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | <result column="delivery_time" property="deliveryTime" jdbcType="INTEGER" /> | 7 | <result column="delivery_time" property="deliveryTime" jdbcType="INTEGER" /> |
8 | <result column="delivery_minutes" property="deliveryMinutes" jdbcType="INTEGER" /> | 8 | <result column="delivery_minutes" property="deliveryMinutes" jdbcType="INTEGER" /> |
9 | <result column="sham_send_time" property="shamSendTime" jdbcType="INTEGER" /> | 9 | <result column="sham_send_time" property="shamSendTime" jdbcType="INTEGER" /> |
10 | + <result column="mini_fault_confirm_minutes" property="miniFaultConfirmMinutes" jdbcType="INTEGER" /> | ||
10 | </resultMap> | 11 | </resultMap> |
11 | <sql id="Base_Column_List" > | 12 | <sql id="Base_Column_List" > |
12 | id, order_code, delivery_time, delivery_minutes, sham_send_time | 13 | id, order_code, delivery_time, delivery_minutes, sham_send_time |
@@ -21,6 +22,11 @@ | @@ -21,6 +22,11 @@ | ||
21 | values (#{orderCode,jdbcType=BIGINT}, #{shamSendTime,jdbcType=INTEGER}) | 22 | values (#{orderCode,jdbcType=BIGINT}, #{shamSendTime,jdbcType=INTEGER}) |
22 | ON DUPLICATE KEY UPDATE sham_send_time = #{shamSendTime,jdbcType=INTEGER} | 23 | ON DUPLICATE KEY UPDATE sham_send_time = #{shamSendTime,jdbcType=INTEGER} |
23 | </insert> | 24 | </insert> |
25 | + <insert id="insertMiniFaultConfirmTime" parameterType="com.yohoufo.dal.order.model.OrderOverTime" > | ||
26 | + insert into order_over_time (order_code, mini_fault_confirm_minutes) | ||
27 | + values (#{orderCode,jdbcType=BIGINT}, #{miniFaultConfirmMinutes,jdbcType=INTEGER}) | ||
28 | + ON DUPLICATE KEY UPDATE mini_fault_confirm_minutes = #{miniFaultConfirmMinutes,jdbcType=INTEGER} | ||
29 | + </insert> | ||
24 | <select id="selectByOrderCodes" resultMap="BaseResultMap"> | 30 | <select id="selectByOrderCodes" resultMap="BaseResultMap"> |
25 | select | 31 | select |
26 | <include refid="Base_Column_List" /> | 32 | <include refid="Base_Column_List" /> |
@@ -19,7 +19,8 @@ public interface DelayTime { | @@ -19,7 +19,8 @@ public interface DelayTime { | ||
19 | int SELLER_ORDER_WAITING_PAY = 15; | 19 | int SELLER_ORDER_WAITING_PAY = 15; |
20 | 20 | ||
21 | //瑕疵等待用户确认的超时时间,24小时 | 21 | //瑕疵等待用户确认的超时时间,24小时 |
22 | - int MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE=24*60; | 22 | + //修改为48小时 2019-03-01 craig.qin |
23 | + int MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE=48*60; | ||
23 | 24 | ||
24 | //卖家发货后,系统判定虚假发货的超时时间,96小时 | 25 | //卖家发货后,系统判定虚假发货的超时时间,96小时 |
25 | int CANCEL_SHAM_DELIVERY_TIME_MINUTE=96*60; | 26 | int CANCEL_SHAM_DELIVERY_TIME_MINUTE=96*60; |
@@ -2,10 +2,12 @@ package com.yohoufo.order.service.handler; | @@ -2,10 +2,12 @@ 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.yohoufo.common.alarm.IEventHandler; | 4 | import com.yohoufo.common.alarm.IEventHandler; |
5 | +import com.yohoufo.dal.order.model.OrderOverTime; | ||
5 | import com.yohoufo.order.event.BuyerMiniFaultOuterTimeEvent; | 6 | import com.yohoufo.order.event.BuyerMiniFaultOuterTimeEvent; |
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.impl.OrderOverTimeService; | ||
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; |
@@ -22,11 +24,21 @@ public class BuyerMiniFaultOuterTimeHandler implements IEventHandler<BuyerMiniFa | @@ -22,11 +24,21 @@ public class BuyerMiniFaultOuterTimeHandler implements IEventHandler<BuyerMiniFa | ||
22 | @Autowired | 24 | @Autowired |
23 | private TradeMqSender tradeMqSender; | 25 | private TradeMqSender tradeMqSender; |
24 | 26 | ||
27 | + @Autowired | ||
28 | + private OrderOverTimeService orderOverTimeService; | ||
29 | + | ||
25 | @Override | 30 | @Override |
26 | @Subscribe | 31 | @Subscribe |
27 | public void handle(BuyerMiniFaultOuterTimeEvent event) { | 32 | public void handle(BuyerMiniFaultOuterTimeEvent event) { |
28 | - logger.info("Subscribe Buyer mini fault delay msg, event {}", event); | 33 | + int minutes = DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE; |
34 | + logger.info("Subscribe Buyer mini fault delay msg, event {},minutes {}", event,minutes); | ||
35 | + | ||
36 | + tradeMqSender.send(TopicConstants.BUYER_ORDER_MINI_FAULT_AUTO_REJECT, event,minutes ); | ||
29 | 37 | ||
30 | - tradeMqSender.send(TopicConstants.BUYER_ORDER_MINI_FAULT_AUTO_REJECT, event, DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE); | 38 | + //更新订单的瑕疵确认时间 |
39 | + OrderOverTime orderOverTime=new OrderOverTime(); | ||
40 | + orderOverTime.setOrderCode(event.getOrderCode()); | ||
41 | + orderOverTime.setMiniFaultConfirmMinutes(minutes); | ||
42 | + orderOverTimeService.insertMiniFaultConfirmTime(orderOverTime); | ||
31 | } | 43 | } |
32 | } | 44 | } |
@@ -42,6 +42,7 @@ import javax.annotation.Resource; | @@ -42,6 +42,7 @@ import javax.annotation.Resource; | ||
42 | import java.util.ArrayList; | 42 | import java.util.ArrayList; |
43 | import java.util.Arrays; | 43 | import java.util.Arrays; |
44 | import java.util.List; | 44 | import java.util.List; |
45 | +import java.util.Optional; | ||
45 | import java.util.stream.Collectors; | 46 | import java.util.stream.Collectors; |
46 | 47 | ||
47 | /** | 48 | /** |
@@ -96,6 +97,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -96,6 +97,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
96 | @Autowired | 97 | @Autowired |
97 | private QualityCheckMapper qualityCheckMapper; | 98 | private QualityCheckMapper qualityCheckMapper; |
98 | 99 | ||
100 | + @Autowired | ||
101 | + private OrderOverTimeService orderOverTimeService; | ||
102 | + | ||
99 | private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data"; | 103 | private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data"; |
100 | 104 | ||
101 | //物流文案设置 | 105 | //物流文案设置 |
@@ -743,7 +747,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | @@ -743,7 +747,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { | ||
743 | boolean showBtn=false; | 747 | boolean showBtn=false; |
744 | int leftTime = 0; | 748 | int leftTime = 0; |
745 | //倒计时 | 749 | //倒计时 |
746 | - int mini_fault_mark_outer_time_second= DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE * 60; | 750 | + OrderOverTime orderOverTime = Optional.ofNullable(qualityCheck.getOrderCode()).map(orderOverTimeService::selectByOrderCode).orElse(null); |
751 | + // 对于老订单来说,超时表记录无数据,则默认24小时 ,即1440分钟 | ||
752 | + Integer miniFaultConfirmMinutes = Optional.ofNullable(orderOverTime).map(OrderOverTime::getMiniFaultConfirmMinutes).orElse(1440); | ||
753 | + int mini_fault_mark_outer_time_second= miniFaultConfirmMinutes * 60; | ||
754 | + //int mini_fault_mark_outer_time_second= DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE * 60; | ||
747 | int expireTime = qualityCheck.getCreateTime() + mini_fault_mark_outer_time_second; | 755 | int expireTime = qualityCheck.getCreateTime() + mini_fault_mark_outer_time_second; |
748 | int nowTs = DateUtil.getCurrentTimeSecond(); | 756 | int nowTs = DateUtil.getCurrentTimeSecond(); |
749 | if(expireTime> nowTs){ | 757 | if(expireTime> nowTs){ |
@@ -19,6 +19,10 @@ public class OrderOverTimeService { | @@ -19,6 +19,10 @@ public class OrderOverTimeService { | ||
19 | return orderOverTimeMapper.insertDeliveryTime(record); | 19 | return orderOverTimeMapper.insertDeliveryTime(record); |
20 | } | 20 | } |
21 | 21 | ||
22 | + public int insertMiniFaultConfirmTime(OrderOverTime record) { | ||
23 | + return orderOverTimeMapper.insertMiniFaultConfirmTime(record); | ||
24 | + } | ||
25 | + | ||
22 | public int insertShamSendTime(OrderOverTime record) { | 26 | public int insertShamSendTime(OrderOverTime record) { |
23 | return orderOverTimeMapper.insertShamSendTime(record); | 27 | return orderOverTimeMapper.insertShamSendTime(record); |
24 | } | 28 | } |
@@ -18,11 +18,19 @@ consumer: | @@ -18,11 +18,19 @@ consumer: | ||
18 | delay: | 18 | delay: |
19 | interval: 10080 | 19 | interval: 10080 |
20 | 20 | ||
21 | + #瑕疵确认时间为24小时, | ||
22 | + #新版本使用后面的48小时的mq , 6.8.7以后的版本可以去掉这个24小时的 | ||
21 | - class: com.yohoufo.order.mq.consumer.BuyerOrderMiniFaultOuterTimeDelayMsgConsumer | 23 | - class: com.yohoufo.order.mq.consumer.BuyerOrderMiniFaultOuterTimeDelayMsgConsumer |
22 | topic: buyerOrder.miniFaultAutoReject | 24 | topic: buyerOrder.miniFaultAutoReject |
23 | delay: | 25 | delay: |
24 | interval: 1440 | 26 | interval: 1440 |
25 | 27 | ||
28 | + #瑕疵确认时间为48小时 | ||
29 | + - class: com.yohoufo.order.mq.consumer.BuyerOrderMiniFaultOuterTimeDelayMsgConsumer | ||
30 | + topic: buyerOrder.miniFaultAutoReject | ||
31 | + delay: | ||
32 | + interval: 2880 | ||
33 | + | ||
26 | - class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer | 34 | - class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer |
27 | topic: buyerOrder.cancelShamDeliver | 35 | topic: buyerOrder.cancelShamDeliver |
28 | delay: | 36 | delay: |
-
Please register or login to post a comment