- fixed bug wrong use orderid ref in loadSavedOrderFromMap.

This commit is contained in:
gazebo
2018-07-22 23:26:45 +08:00
parent ae214d38b9
commit 818856a5ed

View File

@@ -258,7 +258,8 @@ func (s *DefScheduler) swtich2SelfDeliverWithRetry(order *model.GoodsOrder, bill
// 这个函数这样写的原因是适应一些消息错序
func (s *DefScheduler) loadSavedOrderFromMap(status *model.OrderStatus) *WatchOrderInfo {
universalOrderID := jxutils.ComposeUniversalOrderID(status.VendorOrderID, status.VendorID)
globals.SugarLogger.Debugf("loadSavedOrderFromMap status:%v", status)
universalOrderID := jxutils.ComposeUniversalOrderID(status.RefVendorOrderID, status.RefVendorID)
var realSavedInfo *WatchOrderInfo
if savedInfo, ok := s.orderMap.Load(universalOrderID); ok {
realSavedInfo = savedInfo.(*WatchOrderInfo)
@@ -269,21 +270,21 @@ func (s *DefScheduler) loadSavedOrderFromMap(status *model.OrderStatus) *WatchOr
s.orderMap.Store(universalOrderID, realSavedInfo)
} else {
realSavedInfo.dirty = 0
globals.SugarLogger.Infof("order is dirty, orderID:%s, load it", status.VendorOrderID)
globals.SugarLogger.Infof("loadSavedOrderFromMap order is dirty, orderID:%s, load it", status.RefVendorOrderID)
}
if order, err := s.CurOrderManager.LoadOrder(status.VendorOrderID, status.VendorID); err == nil {
if order, err := s.CurOrderManager.LoadOrder(status.RefVendorOrderID, status.RefVendorID); err == nil {
realSavedInfo.order = order
} else {
realSavedInfo.order = &model.GoodsOrder{
VendorOrderID: status.VendorOrderID,
VendorID: status.VendorID,
VendorOrderID: status.RefVendorOrderID,
VendorID: status.RefVendorID,
Status: status.Status,
StatusTime: status.StatusTime,
OrderCreatedAt: status.StatusTime,
WaybillVendorID: model.VendorIDUnknown,
}
realSavedInfo.dirty = 1
globals.SugarLogger.Infof("can not load order orderID:%s", status.VendorOrderID)
globals.SugarLogger.Infof("loadSavedOrderFromMap can not load order orderID:%s", status.VendorOrderID)
}
}
return realSavedInfo