diff --git a/business/partner/purchase/yb/store_sku.go b/business/partner/purchase/yb/store_sku.go index be399bf1c..49f4d34ba 100644 --- a/business/partner/purchase/yb/store_sku.go +++ b/business/partner/purchase/yb/store_sku.go @@ -77,7 +77,8 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas if len(storeSkuList) == 1 { storeSku := storeSkuList[0] 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 { return nil, err } @@ -94,7 +95,8 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas return nil, err } 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 { return nil, err } @@ -110,7 +112,8 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas } if len(result.Result) < result.PageSize { 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 { return nil, err } @@ -351,15 +354,17 @@ func ybSkuStatus2Jx(ybStatus int) (jxSkuStatus int) { 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 if result == nil { globals.SugarLogger.Warnf("vendorSku2Jx, strange result:%s", utils.Format4Output(result, true)) return nil } - if len(resultp.Productimages) > 0 { - for _, v := range resultp.Productimages { - picList = append(picList, yinbaoapi.ImageUrl+v.Path) + if len(resultp) > 0 { + if resultp[0].ImageURL != "" { + // for _, v := range resultp.Productimages { + picList = append(picList, resultp[0].ImageURL) + // } } } prefix, name, comment, specUnit, unit, specQuality := jxutils.SplitSkuName(result.Name) @@ -398,7 +403,8 @@ func loopPages(parameterType, parameterValue string, skuNameList []*partner.SkuN return err } 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 { return err }