1
This commit is contained in:
@@ -115,10 +115,6 @@ 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()
|
||||
@@ -159,11 +155,6 @@ 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)
|
||||
@@ -423,9 +414,6 @@ func (c *OrderManager) SaveOrder(order *model.GoodsOrder, isAdjust bool, db *dao
|
||||
}
|
||||
_, _, err = db.Db.ReadOrCreate(originalOrder, "VendorOrderID", "VendorID")
|
||||
if created {
|
||||
if order.VendorOrderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====err----- %s", utils.Format4Output(order.Skus, false))
|
||||
}
|
||||
if err = dao.CreateMultiEntities(db, order.Skus); err != nil {
|
||||
baseapi.SugarLogger.Warnf("saveOrder orderID:%s, save order_sku failed with error:%v", order.VendorOrderID, err)
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ func (p *PurchaseHandler) AfsOrderDetail2Financial(orderData map[string]interfac
|
||||
VendorOrderID: afsOrder.VendorOrderID,
|
||||
VendorSubOrderID: afsOrder.VendorOrderID2,
|
||||
// ConfirmTime: getTimeFromInterface(xMap["apply_time"]),
|
||||
VendorSkuID: utils.Int2Str(xMap["platform_sku_id"].(int)),
|
||||
VendorSkuID: utils.Int64ToStr(utils.Interface2Int64WithDefault(xMap["platform_sku_id"], 0)),
|
||||
SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(xMap["custom_sku_id"]), 0)),
|
||||
Name: utils.Interface2String(xMap["sku_name"]),
|
||||
UserMoney: utils.MustInterface2Int64(xMap["refund_user_amount"]),
|
||||
|
||||
@@ -171,15 +171,9 @@ func getZengSkus(orderID string, orderMan map[string]interface{}) (skus []*model
|
||||
func (p *PurchaseHandler) partRefund2OrderDetailSkuList(orderID string, orderDetail2 interface{}) []*model.OrderSku {
|
||||
refundDetail := orderDetail2.([]interface{})
|
||||
refundSkuList := refundDetail[len(refundDetail)-1].(map[string]interface{})["sub_reverse_order_list"].([]interface{})
|
||||
if orderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====refundSkuList-----list %s", utils.Format4Output(refundSkuList, false))
|
||||
}
|
||||
skuList := make([]*model.OrderSku, 0, 0)
|
||||
for _, product2 := range refundSkuList {
|
||||
product := product2.(map[string]interface{})
|
||||
if orderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====product-----list %s", utils.Format4Output(product, false))
|
||||
}
|
||||
if product["virtual_type"] == ebaiapi.OrderVirtualType {
|
||||
skuName := product["sku_name"].(string)
|
||||
_, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(skuName)
|
||||
@@ -202,9 +196,6 @@ func (p *PurchaseHandler) partRefund2OrderDetailSkuList(orderID string, orderDet
|
||||
skuList = append(skuList, sku)
|
||||
}
|
||||
}
|
||||
if orderID == "4062150144186637882" {
|
||||
globals.SugarLogger.Debugf("=====order-----list %s", utils.Format4Output(skuList, false))
|
||||
}
|
||||
return skuList
|
||||
}
|
||||
|
||||
@@ -552,16 +543,8 @@ 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-skus---- %s", utils.Format4Output(order.Skus, 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