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