银豹查询商品api修改
This commit is contained in:
@@ -77,7 +77,8 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
|
|||||||
if len(storeSkuList) == 1 {
|
if len(storeSkuList) == 1 {
|
||||||
storeSku := storeSkuList[0]
|
storeSku := storeSkuList[0]
|
||||||
result, err := api.YinBaoAPI.QueryProductByBarcode(storeSku.VendorSkuID)
|
result, err := api.YinBaoAPI.QueryProductByBarcode(storeSku.VendorSkuID)
|
||||||
resultp, err := getProductImages(vendorStoreID, storeSku.VendorSkuID)
|
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(result.Barcode)
|
||||||
|
// resultp, err := getProductImages(vendorStoreID, storeSku.VendorSkuID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -94,7 +95,8 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, v := range results {
|
for _, v := range results {
|
||||||
resultp, err := getProductImages(vendorStoreID, v.Barcode)
|
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(v.Barcode)
|
||||||
|
// resultp, err := getProductImages(vendorStoreID, v.Barcode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -110,7 +112,8 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
|
|||||||
}
|
}
|
||||||
if len(result.Result) < result.PageSize {
|
if len(result.Result) < result.PageSize {
|
||||||
for _, v := range result.Result {
|
for _, v := range result.Result {
|
||||||
resultp, err := getProductImages(vendorStoreID, v.Barcode)
|
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(v.Barcode)
|
||||||
|
// resultp, err := getProductImages(vendorStoreID, v.Barcode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -351,15 +354,17 @@ func ybSkuStatus2Jx(ybStatus int) (jxSkuStatus int) {
|
|||||||
return jxSkuStatus
|
return jxSkuStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
func vendorSku2Jx(result *yinbaoapi.QueryProductByBarcodeResult, resultp *yinbaoapi.FindProductResult) (skuName *partner.SkuNameInfo) {
|
func vendorSku2Jx(result *yinbaoapi.QueryProductByBarcodeResult, resultp []*yinbaoapi.QueryProductImagesByBarcodeResult) (skuName *partner.SkuNameInfo) {
|
||||||
var picList []string
|
var picList []string
|
||||||
if result == nil {
|
if result == nil {
|
||||||
globals.SugarLogger.Warnf("vendorSku2Jx, strange result:%s", utils.Format4Output(result, true))
|
globals.SugarLogger.Warnf("vendorSku2Jx, strange result:%s", utils.Format4Output(result, true))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if len(resultp.Productimages) > 0 {
|
if len(resultp) > 0 {
|
||||||
for _, v := range resultp.Productimages {
|
if resultp[0].ImageURL != "" {
|
||||||
picList = append(picList, yinbaoapi.ImageUrl+v.Path)
|
// for _, v := range resultp.Productimages {
|
||||||
|
picList = append(picList, resultp[0].ImageURL)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix, name, comment, specUnit, unit, specQuality := jxutils.SplitSkuName(result.Name)
|
prefix, name, comment, specUnit, unit, specQuality := jxutils.SplitSkuName(result.Name)
|
||||||
@@ -398,7 +403,8 @@ func loopPages(parameterType, parameterValue string, skuNameList []*partner.SkuN
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, v := range resultPages.Result {
|
for _, v := range resultPages.Result {
|
||||||
resultp, err := getProductImages(vendorStoreID, v.Barcode)
|
resultp, err := api.YinBaoAPI.QueryProductImagesByBarcode(v.Barcode)
|
||||||
|
// resultp, err := getProductImages(vendorStoreID, v.Barcode)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user