银豹创建商品失败,尝试把删除的恢复
This commit is contained in:
@@ -38,15 +38,17 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
result, err = api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
||||
}
|
||||
if err != nil {
|
||||
// if strings.Contains(err.Error(), addErr1) {
|
||||
// queryProductByBarcodeResult, err := api.YinBaoAPI.QueryProductByBarcodes([]string{storeSku.YbBarCode})
|
||||
// if err != nil && len(queryProductByBarcodeResult) > 0 {
|
||||
// if queryProductByBarcodeResult[0].Enable == model.SkuStatusDeleted {
|
||||
// api.YinBaoAPI.SaveProduct(userId, keyword, saveProductParam)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
|
||||
if strings.Contains(err.Error(), addErr1) {
|
||||
queryProductByBarcodeResult, err := api.YinBaoAPI.QueryProductByBarcodes([]string{storeSku.YbBarCode})
|
||||
if err != nil && len(queryProductByBarcodeResult) > 0 {
|
||||
if queryProductByBarcodeResult[0].Enable == model.SkuStatusDeleted {
|
||||
api.YinBaoAPI.BatchUpdateProductEnable(vendorStoreID, utils.Int64ToStr(queryProductByBarcodeResult[0].UID), model.SkuStatusNormal)
|
||||
storeSku.VendorSkuID = utils.Int64ToStr(queryProductByBarcodeResult[0].UID)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
|
||||
}
|
||||
} else {
|
||||
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)
|
||||
err = uploadYbImage(vendorStoreID, storeSku.YbBarCode, storeSku.Img)
|
||||
|
||||
Reference in New Issue
Block a user