1
This commit is contained in:
@@ -115,12 +115,18 @@ func (c *OrderManager) OnOrderAdjust(order *model.GoodsOrder, orderStatus *model
|
||||
order.Status = model.OrderStatusAccepted
|
||||
}
|
||||
isDuplicated, err := addOrderOrWaybillStatus(orderStatus, db)
|
||||
if order.VendorOrderID == "4075590068743535177" {
|
||||
globals.SugarLogger.Debugf("============isDuplicated : %s", utils.Format4Output(isDuplicated, false))
|
||||
globals.SugarLogger.Debugf("============err : %v", err)
|
||||
globals.SugarLogger.Debugf("============order : %s", utils.Format4Output(order, false))
|
||||
}
|
||||
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("============err1 : %v", err)
|
||||
return err
|
||||
}
|
||||
adjustCount := int8(0)
|
||||
@@ -129,6 +135,7 @@ 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("============err2 : %v", err)
|
||||
return err
|
||||
}
|
||||
if err == nil {
|
||||
@@ -152,6 +159,8 @@ func (c *OrderManager) OnOrderAdjust(order *model.GoodsOrder, orderStatus *model
|
||||
order.TotalShopMoney = order2.TotalShopMoney
|
||||
}
|
||||
isDuplicated, err = c.SaveOrder(order, true, db)
|
||||
globals.SugarLogger.Debugf("============err3 : %v", err)
|
||||
globals.SugarLogger.Debugf("============isDuplicated : %v", utils.Format4Output(isDuplicated, false))
|
||||
}
|
||||
if err == nil {
|
||||
dao.Commit(db, txDB)
|
||||
|
||||
@@ -127,13 +127,8 @@ func (p *PurchaseHandler) GetOrder4PartRefund(vendorOrderID string) (order *mode
|
||||
}, taskIDs)
|
||||
task.Run()
|
||||
task.GetResult(0)
|
||||
globals.SugarLogger.Debugf("=======result1 : %s", utils.Format4Output(result1, false))
|
||||
globals.SugarLogger.Debugf("=======err1 : %v", err1)
|
||||
globals.SugarLogger.Debugf("=======result1 : %s", utils.Format4Output(result1, false))
|
||||
globals.SugarLogger.Debugf("=======err2 : %v", err2)
|
||||
if err1 == nil {
|
||||
order = p.Map2Order(result1)
|
||||
globals.SugarLogger.Debugf("=======order : %s", utils.Format4Output(order, false))
|
||||
if err2 == nil {
|
||||
order.Skus = p.partRefund2OrderDetailSkuList(utils.Interface2String(result2["order_id"]), result2["reverse_order_list"])
|
||||
giftSkus, discountMoney := getZengSkus(vendorOrderID, result1)
|
||||
|
||||
Reference in New Issue
Block a user