Authored by qinchao

瑕疵确认改48

... ... @@ -11,6 +11,8 @@ public interface OrderOverTimeMapper {
int insertShamSendTime(OrderOverTime record);
int insertMiniFaultConfirmTime(OrderOverTime record);
List<OrderOverTime> selectByOrderCodes(@Param(value = "orderCodeList") List<Long> orderCodeList);
OrderOverTime selectByOrderCode(@Param(value = "orderCode")Long orderCode);
... ...
... ... @@ -13,6 +13,8 @@ public class OrderOverTime {
private Integer shamSendTime;
private Integer miniFaultConfirmMinutes;
public OrderOverTime() {
}
... ... @@ -27,6 +29,14 @@ public class OrderOverTime {
this.orderCode = orderCode;
}
public Integer getMiniFaultConfirmMinutes() {
return miniFaultConfirmMinutes;
}
public void setMiniFaultConfirmMinutes(Integer miniFaultConfirmMinutes) {
this.miniFaultConfirmMinutes = miniFaultConfirmMinutes;
}
public Integer getDeliveryMinutes() {
return deliveryMinutes;
}
... ...
... ... @@ -7,6 +7,7 @@
<result column="delivery_time" property="deliveryTime" jdbcType="INTEGER" />
<result column="delivery_minutes" property="deliveryMinutes" jdbcType="INTEGER" />
<result column="sham_send_time" property="shamSendTime" jdbcType="INTEGER" />
<result column="mini_fault_confirm_minutes" property="miniFaultConfirmMinutes" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, delivery_time, delivery_minutes, sham_send_time
... ... @@ -21,6 +22,11 @@
values (#{orderCode,jdbcType=BIGINT}, #{shamSendTime,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE sham_send_time = #{shamSendTime,jdbcType=INTEGER}
</insert>
<insert id="insertMiniFaultConfirmTime" parameterType="com.yohoufo.dal.order.model.OrderOverTime" >
insert into order_over_time (order_code, mini_fault_confirm_minutes)
values (#{orderCode,jdbcType=BIGINT}, #{miniFaultConfirmMinutes,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE mini_fault_confirm_minutes = #{miniFaultConfirmMinutes,jdbcType=INTEGER}
</insert>
<select id="selectByOrderCodes" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
... ...
... ... @@ -19,7 +19,8 @@ public interface DelayTime {
int SELLER_ORDER_WAITING_PAY = 15;
//瑕疵等待用户确认的超时时间,24小时
int MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE=24*60;
//修改为48小时 2019-03-01 craig.qin
int MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE=48*60;
//卖家发货后,系统判定虚假发货的超时时间,96小时
int CANCEL_SHAM_DELIVERY_TIME_MINUTE=96*60;
... ...
... ... @@ -2,10 +2,12 @@ package com.yohoufo.order.service.handler;
import com.google.common.eventbus.Subscribe;
import com.yohoufo.common.alarm.IEventHandler;
import com.yohoufo.dal.order.model.OrderOverTime;
import com.yohoufo.order.event.BuyerMiniFaultOuterTimeEvent;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.mq.producer.TradeMqSender;
import com.yohoufo.order.service.impl.OrderOverTimeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -22,11 +24,21 @@ public class BuyerMiniFaultOuterTimeHandler implements IEventHandler<BuyerMiniFa
@Autowired
private TradeMqSender tradeMqSender;
@Autowired
private OrderOverTimeService orderOverTimeService;
@Override
@Subscribe
public void handle(BuyerMiniFaultOuterTimeEvent event) {
logger.info("Subscribe Buyer mini fault delay msg, event {}", event);
int minutes = DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE;
logger.info("Subscribe Buyer mini fault delay msg, event {},minutes {}", event,minutes);
tradeMqSender.send(TopicConstants.BUYER_ORDER_MINI_FAULT_AUTO_REJECT, event,minutes );
tradeMqSender.send(TopicConstants.BUYER_ORDER_MINI_FAULT_AUTO_REJECT, event, DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE);
//更新订单的瑕疵确认时间
OrderOverTime orderOverTime=new OrderOverTime();
orderOverTime.setOrderCode(event.getOrderCode());
orderOverTime.setMiniFaultConfirmMinutes(minutes);
orderOverTimeService.insertMiniFaultConfirmTime(orderOverTime);
}
}
... ...
... ... @@ -42,6 +42,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
... ... @@ -96,6 +97,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
@Autowired
private QualityCheckMapper qualityCheckMapper;
@Autowired
private OrderOverTimeService orderOverTimeService;
private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data";
//物流文案设置
... ... @@ -743,7 +747,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
boolean showBtn=false;
int leftTime = 0;
//倒计时
int mini_fault_mark_outer_time_second= DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE * 60;
OrderOverTime orderOverTime = Optional.ofNullable(qualityCheck.getOrderCode()).map(orderOverTimeService::selectByOrderCode).orElse(null);
// 对于老订单来说,超时表记录无数据,则默认24小时 ,即1440分钟
Integer miniFaultConfirmMinutes = Optional.ofNullable(orderOverTime).map(OrderOverTime::getMiniFaultConfirmMinutes).orElse(1440);
int mini_fault_mark_outer_time_second= miniFaultConfirmMinutes * 60;
//int mini_fault_mark_outer_time_second= DelayTime.MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE * 60;
int expireTime = qualityCheck.getCreateTime() + mini_fault_mark_outer_time_second;
int nowTs = DateUtil.getCurrentTimeSecond();
if(expireTime> nowTs){
... ...
... ... @@ -19,6 +19,10 @@ public class OrderOverTimeService {
return orderOverTimeMapper.insertDeliveryTime(record);
}
public int insertMiniFaultConfirmTime(OrderOverTime record) {
return orderOverTimeMapper.insertMiniFaultConfirmTime(record);
}
public int insertShamSendTime(OrderOverTime record) {
return orderOverTimeMapper.insertShamSendTime(record);
}
... ...
... ... @@ -18,11 +18,19 @@ consumer:
delay:
interval: 10080
#瑕疵确认时间为24小时,
#新版本使用后面的48小时的mq , 6.8.7以后的版本可以去掉这个24小时的
- class: com.yohoufo.order.mq.consumer.BuyerOrderMiniFaultOuterTimeDelayMsgConsumer
topic: buyerOrder.miniFaultAutoReject
delay:
interval: 1440
#瑕疵确认时间为48小时
- class: com.yohoufo.order.mq.consumer.BuyerOrderMiniFaultOuterTimeDelayMsgConsumer
topic: buyerOrder.miniFaultAutoReject
delay:
interval: 2880
- class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer
topic: buyerOrder.cancelShamDeliver
delay:
... ...