Authored by chenchao

fix old data without sellerordergoods

@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject; @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
4 import com.yoho.core.rabbitmq.YhConsumer; 4 import com.yoho.core.rabbitmq.YhConsumer;
5 import com.yohobuy.ufo.model.order.common.OrderStatus; 5 import com.yohobuy.ufo.model.order.common.OrderStatus;
6 import com.yohoufo.dal.order.BuyerOrderMapper; 6 import com.yohoufo.dal.order.BuyerOrderMapper;
  7 +import com.yohoufo.dal.order.SellerOrderGoodsMapper;
7 import com.yohoufo.dal.order.model.BuyerOrder; 8 import com.yohoufo.dal.order.model.BuyerOrder;
  9 +import com.yohoufo.dal.order.model.SellerOrderGoods;
8 import com.yohoufo.order.event.DeliverNoticeEvent; 10 import com.yohoufo.order.event.DeliverNoticeEvent;
9 import com.yohoufo.order.mq.TopicConstants; 11 import com.yohoufo.order.mq.TopicConstants;
10 import com.yohoufo.order.service.proxy.InBoxFacade; 12 import com.yohoufo.order.service.proxy.InBoxFacade;
@@ -30,6 +32,9 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer { @@ -30,6 +32,9 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
30 @Autowired 32 @Autowired
31 private BuyerOrderMapper buyerOrderMapper; 33 private BuyerOrderMapper buyerOrderMapper;
32 34
  35 + @Autowired
  36 + private SellerOrderGoodsMapper sellerOrderGoodsMapper;
  37 +
33 38
34 @Override 39 @Override
35 public void handleMessage(Object o) throws Exception { 40 public void handleMessage(Object o) throws Exception {
@@ -47,6 +52,15 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer { @@ -47,6 +52,15 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
47 } 52 }
48 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, buyerUid); 53 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, buyerUid);
49 if(OrderStatus.HAS_PAYED.getCode() == buyerOrder.getStatus().intValue()){ 54 if(OrderStatus.HAS_PAYED.getCode() == buyerOrder.getStatus().intValue()){
  55 + SellerOrderGoods sog = msg.getSellerOrderGoods();
  56 + if (sog == null){
  57 + sog = sellerOrderGoodsMapper.selectByPrimaryKey(msg.getSkup());
  58 + }
  59 + if (sog == null){
  60 + sog = new SellerOrderGoods();
  61 + sog.setUid(msg.getSellerUid());
  62 + sog.setProductName(msg.getPrdName());
  63 + }
50 LOGGER.info("ready notice sellerDeliverNotice, msg {}", msg); 64 LOGGER.info("ready notice sellerDeliverNotice, msg {}", msg);
51 inBoxFacade.sellerDeliverNotice(msg.getSellerOrderGoods(),orderCode, 2); 65 inBoxFacade.sellerDeliverNotice(msg.getSellerOrderGoods(),orderCode, 2);
52 } 66 }
@@ -7,7 +7,9 @@ import com.yohoufo.common.alarm.EventBusPublisher; @@ -7,7 +7,9 @@ import com.yohoufo.common.alarm.EventBusPublisher;
7 import com.yohoufo.common.alarm.SmsAlarmEvent; 7 import com.yohoufo.common.alarm.SmsAlarmEvent;
8 import com.yohoufo.common.utils.DateUtil; 8 import com.yohoufo.common.utils.DateUtil;
9 import com.yohoufo.dal.order.BuyerOrderMapper; 9 import com.yohoufo.dal.order.BuyerOrderMapper;
  10 +import com.yohoufo.dal.order.SellerOrderGoodsMapper;
10 import com.yohoufo.dal.order.model.BuyerOrder; 11 import com.yohoufo.dal.order.model.BuyerOrder;
  12 +import com.yohoufo.dal.order.model.SellerOrderGoods;
11 import com.yohoufo.dal.order.model.SellerWalletDetail; 13 import com.yohoufo.dal.order.model.SellerWalletDetail;
12 import com.yohoufo.order.common.BillTradeStatus; 14 import com.yohoufo.order.common.BillTradeStatus;
13 import com.yohoufo.order.common.RefundCase; 15 import com.yohoufo.order.common.RefundCase;
@@ -49,6 +51,9 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer { @@ -49,6 +51,9 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
49 @Autowired 51 @Autowired
50 private PayRefundService payRefundService; 52 private PayRefundService payRefundService;
51 53
  54 + @Autowired
  55 + private SellerOrderGoodsMapper sellerOrderGoodsMapper;
  56 +
52 public String getMessageTopic() { 57 public String getMessageTopic() {
53 return TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER; 58 return TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER;
54 } 59 }
@@ -91,6 +96,11 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer { @@ -91,6 +96,11 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
91 try{ 96 try{
92 payRefundService.refund(req, bleb); 97 payRefundService.refund(req, bleb);
93 // 98 //
  99 + SellerOrderGoods sog = event.getSellerOrderGoods();
  100 + if (sog == null){
  101 + sog = sellerOrderGoodsMapper.selectByPrimaryKey(event.getSkup());
  102 + }
  103 +
94 inBoxFacade.sellerDeliverNotice(event.getSellerOrderGoods(), orderCode,3); 104 inBoxFacade.sellerDeliverNotice(event.getSellerOrderGoods(), orderCode,3);
95 }catch (Exception ex){ 105 }catch (Exception ex){
96 logger.warn("in topic {} , refund fail,req {}", getMessageTopic(), req, ex); 106 logger.warn("in topic {} , refund fail,req {}", getMessageTopic(), req, ex);