1
This commit is contained in:
@@ -115,12 +115,17 @@ func (c *OrderManager) OnOrderAdjust(order *model.GoodsOrder, orderStatus *model
|
||||
order.Status = model.OrderStatusAccepted
|
||||
}
|
||||
isDuplicated, err := addOrderOrWaybillStatus(orderStatus, db)
|
||||
if order.VendorOrderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====isDuplicated----- %s", utils.Format4Output(isDuplicated, false))
|
||||
globals.SugarLogger.Debugf("=====err----- %v", err)
|
||||
}
|
||||
if err == nil && !isDuplicated {
|
||||
err = utils.CallFuncLogError(func() error {
|
||||
_, err = db.Db.Raw("DELETE FROM order_sku WHERE vendor_order_id = ? AND vendor_id = ?", order.VendorOrderID, order.VendorID).Exec()
|
||||
return err
|
||||
}, "OnAdjustOrder delete order, orderID:%s", order.VendorOrderID)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("=====err----- %v", err)
|
||||
return err
|
||||
}
|
||||
adjustCount := int8(0)
|
||||
@@ -129,11 +134,13 @@ func (c *OrderManager) OnOrderAdjust(order *model.GoodsOrder, orderStatus *model
|
||||
VendorID: order.VendorID,
|
||||
}
|
||||
if err = dao.GetEntity(db, previousOrder, model.FieldVendorOrderID, model.FieldVendorID); err != nil && !dao.IsNoRowsError(err) {
|
||||
globals.SugarLogger.Debugf("=====err----- %v", err)
|
||||
return err
|
||||
}
|
||||
if err == nil {
|
||||
adjustCount = previousOrder.AdjustCount
|
||||
if _, err = dao.DeleteEntity(db, previousOrder); err != nil {
|
||||
globals.SugarLogger.Debugf("=====err----- %v", err)
|
||||
return err
|
||||
}
|
||||
order.VendorWaybillID = previousOrder.VendorWaybillID
|
||||
@@ -152,6 +159,11 @@ func (c *OrderManager) OnOrderAdjust(order *model.GoodsOrder, orderStatus *model
|
||||
order.TotalShopMoney = order2.TotalShopMoney
|
||||
}
|
||||
isDuplicated, err = c.SaveOrder(order, true, db)
|
||||
if order.VendorOrderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====isDuplicated222----- %s", utils.Format4Output(isDuplicated, false))
|
||||
globals.SugarLogger.Debugf("=====isDuorderplicated222----- %s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("=====err----- %v", err)
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
dao.Commit(db, txDB)
|
||||
|
||||
@@ -542,8 +542,15 @@ func (c *PurchaseHandler) onOrderMsg(msg *ebaiapi.CallbackMsg) (retVal *ebaiapi.
|
||||
if status.Status == model.OrderStatusAdjust {
|
||||
var order *model.GoodsOrder
|
||||
order, err = c.GetOrder4PartRefund(GetOrderIDFromMsg(msg))
|
||||
if status.RefVendorOrderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====order----- %s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("=====order----- %v", err)
|
||||
}
|
||||
if err == nil {
|
||||
err = partner.CurOrderManager.OnOrderAdjust(order, status)
|
||||
if status.RefVendorOrderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====err----- %v", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 处理饿百降级订单的情况
|
||||
|
||||
Reference in New Issue
Block a user