Authored by chenchao

fix old data without sellerordergoods

... ... @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rabbitmq.YhConsumer;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.event.DeliverNoticeEvent;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.service.proxy.InBoxFacade;
... ... @@ -30,6 +32,9 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
@Autowired
private BuyerOrderMapper buyerOrderMapper;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Override
public void handleMessage(Object o) throws Exception {
... ... @@ -47,6 +52,15 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
}
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, buyerUid);
if(OrderStatus.HAS_PAYED.getCode() == buyerOrder.getStatus().intValue()){
SellerOrderGoods sog = msg.getSellerOrderGoods();
if (sog == null){
sog = sellerOrderGoodsMapper.selectByPrimaryKey(msg.getSkup());
}
if (sog == null){
sog = new SellerOrderGoods();
sog.setUid(msg.getSellerUid());
sog.setProductName(msg.getPrdName());
}
LOGGER.info("ready notice sellerDeliverNotice, msg {}", msg);
inBoxFacade.sellerDeliverNotice(msg.getSellerOrderGoods(),orderCode, 2);
}
... ...
... ... @@ -7,7 +7,9 @@ import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.alarm.SmsAlarmEvent;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.SellerWalletDetail;
import com.yohoufo.order.common.BillTradeStatus;
import com.yohoufo.order.common.RefundCase;
... ... @@ -49,6 +51,9 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
@Autowired
private PayRefundService payRefundService;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
public String getMessageTopic() {
return TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER;
}
... ... @@ -91,6 +96,11 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
try{
payRefundService.refund(req, bleb);
//
SellerOrderGoods sog = event.getSellerOrderGoods();
if (sog == null){
sog = sellerOrderGoodsMapper.selectByPrimaryKey(event.getSkup());
}
inBoxFacade.sellerDeliverNotice(event.getSellerOrderGoods(), orderCode,3);
}catch (Exception ex){
logger.warn("in topic {} , refund fail,req {}", getMessageTopic(), req, ex);
... ...