yb plucode

This commit is contained in:
苏尹岚
2020-03-27 17:24:12 +08:00
parent 21ff04a78d
commit ebdc369384

View File

@@ -27,11 +27,13 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
if globals.EnableYbStoreWrite {
storeSku := storeSkuList[0]
buildYbConfigs(storeID)
buildYbApiCookie(ctx)
result, err := api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
if err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
} else {
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)
updateYbSkuPluCode(vendorStoreID, storeSku.YbBarCode)
}
}
return failedList, err
@@ -368,3 +370,8 @@ func convertVendorCatList(remoteCats []*yinbaoapi.LoadCategorysWithOptionResult)
}
return cats
}
func updateYbSkuPluCode(vendorStoreID, ybBarCode string) (err error) {
err = api.YinBaoAPI.SaveProduct(vendorStoreID, ybBarCode)
return err
}