Authored by qinchao

虚假发货48小时,自动取消

... ... @@ -49,6 +49,9 @@ public class BuyerOrder {
@Getter@Setter
private Integer sellerDeliveryStatus;//卖家的发货物流:1 :已发货且有物流
@Getter@Setter
private Integer sellerDeliveryDeal;//卖家的发货物流,操作员是否已经处理:0:未处理 ,1 :已处理
public Integer getId() {
return id;
}
... ...
... ... @@ -21,10 +21,12 @@
<result column="attributes" jdbcType="INTEGER" property="attributes" />
<result column="platform_delivery_status" jdbcType="INTEGER" property="platformDeliveryStatus" />
<result column="seller_delivery_status" jdbcType="INTEGER" property="sellerDeliveryStatus" />
<result column="seller_delivery_deal" jdbcType="INTEGER" property="sellerDeliveryDeal" />
</resultMap>
<sql id="Base_Column_List">
id, uid, order_code, seller_uid, client_type, payment, payment_type, is_cancel, amount,
ship_fee, status, create_time, update_time, buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status,seller_delivery_status
ship_fee, status, create_time, update_time, buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status,
seller_delivery_status,seller_delivery_deal
</sql>
... ... @@ -139,13 +141,15 @@
client_type, payment, payment_type,
is_cancel, amount, ship_fee,
status, create_time, update_time,
buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status,seller_delivery_status)
buyer_order_status, seller_order_status, channel_no, attributes,platform_delivery_status,
seller_delivery_status,seller_delivery_deal)
values (#{uid,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, #{sellerUid,jdbcType=INTEGER},
#{clientType,jdbcType=INTEGER}, #{payment,jdbcType=INTEGER}, #{paymentType,jdbcType=TINYINT},
#{isCancel,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{shipFee,jdbcType=DECIMAL},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER},
#{buyerOrderStatus,jdbcType=INTEGER}, #{sellerOrderStatus,jdbcType=INTEGER}, #{channelNo,jdbcType=VARCHAR},
#{attributes,jdbcType=INTEGER},#{platformDeliveryStatus,jdbcType=INTEGER},#{sellerDeliveryStatus,jdbcType=INTEGER})
#{attributes,jdbcType=INTEGER},#{platformDeliveryStatus,jdbcType=INTEGER},
#{sellerDeliveryStatus,jdbcType=INTEGER},#{sellerDeliveryDeal,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yohoufo.dal.order.model.BuyerOrder" useGeneratedKeys="true">
insert into buyer_order
... ...
... ... @@ -23,7 +23,7 @@ public interface DelayTime {
int MINI_FAULT_CONFIRM_OUTER_TIME_MINUTE=48*60;
//卖家发货后,系统判定虚假发货的超时时间,96小时
int CANCEL_SHAM_DELIVERY_TIME_MINUTE=96*60;
int CANCEL_SHAM_DELIVERY_TIME_MINUTE=48*60;
int MINUTES_120_HOURS = 120 * 60;
}
... ...
... ... @@ -2,18 +2,24 @@ package com.yohoufo.order.mq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rabbitmq.YhConsumer;
import com.yohobuy.ufo.model.order.common.EnumExpressType;
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohoufo.dal.order.ExpressInfoMapper;
import com.yohoufo.dal.order.model.ExpressInfo;
import com.yohoufo.order.event.BuyerOrderCancelShamDeliveryEvent;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.service.impl.AppraiseService;
import com.yohoufo.order.service.impl.BuyerOrderCancelService;
import com.yohoufo.order.service.proxy.OrderOperateRecordService;
import com.yohoufo.order.utils.LoggerUtils;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 虚假发货取消订单
*/
... ... @@ -23,6 +29,9 @@ public class BuyerOrderCancelShamDeliveryMsgConsumer implements YhConsumer {
final Logger logger = LoggerUtils.getMqConsumerLogger();
@Autowired
private ExpressInfoMapper expressInfoMapper;
@Autowired
private BuyerOrderCancelService buyerOrderCancelService;
@Autowired
... ... @@ -40,6 +49,13 @@ public class BuyerOrderCancelShamDeliveryMsgConsumer implements YhConsumer {
BuyerOrderCancelShamDeliveryEvent event = JSONObject.parseObject(o.toString(), BuyerOrderCancelShamDeliveryEvent.class);
Integer buyerUid = event.getUid();
Long orderCode = event.getOrderCode();
//从物流表查询
List<ExpressInfo> ls = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode, EnumExpressType.EXPRESS_TYPE_1.getCode());
if(CollectionUtils.isNotEmpty(ls)){
logger.info("BuyerOrderCancelShamDeliveryMsgConsumer topic {}, msg {} ,not cancel order because exist express info ", getMessageTopic(), o);
return ;
}
buyerOrderCancelService.cancelForSellerShamSendOut(buyerUid,orderCode, OrderStatus.SELLER_SHAM_SEND_OUT_AUTO);
logger.info("BuyerOrderCancelShamDeliveryMsgConsumer topic {}, msg {} finish", getMessageTopic(), event);
... ...
... ... @@ -26,10 +26,9 @@ public class BuyerOrderCancelShamDeliveryHandler implements IEventHandler<BuyerO
@Override
@Subscribe
public void handle(BuyerOrderCancelShamDeliveryEvent event) {
logger.info("do nothing and return ! Subscribe Buyer Order Cancel ShamDelivery Event delay msg,event {}" ,event);
//int minutes = DelayTime.CANCEL_SHAM_DELIVERY_TIME_MINUTE ;
//logger.info("Subscribe Buyer Order Cancel ShamDelivery Event delay msg, minutes {} ,event {}", minutes ,event);
int minutes = DelayTime.CANCEL_SHAM_DELIVERY_TIME_MINUTE ;
logger.info("Subscribe Buyer Order Cancel ShamDelivery Event delay msg, minutes {} ,event {}", minutes ,event);
//tradeMqSender.send(TopicConstants.BUYER_ORDER_CANCEL_SHAM_DELIVER, event, minutes);
tradeMqSender.send(TopicConstants.BUYER_ORDER_CANCEL_SHAM_DELIVER, event, minutes);
}
}
... ...
... ... @@ -224,6 +224,7 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
buyerOrder.setAttributes(orderBuilder.getAttributes());
buyerOrder.setPlatformDeliveryStatus(0);//平台发货状态给默认值
buyerOrder.setSellerDeliveryStatus(0);
buyerOrder.setSellerDeliveryDeal(0);
buyerOrderMapper.insert(buyerOrder);
}
... ...
... ... @@ -29,10 +29,10 @@ consumer:
delay:
interval: 1440
#- class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer
# topic: buyerOrder.cancelShamDeliver
# delay:
# interval: 5760
- class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer
topic: buyerOrder.cancelShamDeliver
delay:
interval: 2880
- class: com.yohoufo.order.mq.consumer.NotPaidNoticeDelayMsgConsumer
topic: order.notPaidNotice
... ...
... ... @@ -31,10 +31,10 @@ consumer:
delay:
interval: 1440
#- class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer
# topic: buyerOrder.cancelShamDeliver
# delay:
# interval: 5760
- class: com.yohoufo.order.mq.consumer.BuyerOrderCancelShamDeliveryMsgConsumer
topic: buyerOrder.cancelShamDeliver
delay:
interval: 2880
#order.notPaidNotice
- class: com.yohoufo.order.mq.consumer.NotPaidNoticeDelayMsgConsumer
... ...