diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 22b0b0181..1811c9771 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -2335,18 +2335,34 @@ func CreateUpcSkuByExcelBin(ctx *jxcontext.Context, reader io.Reader, categoryID if configs, err := dao.QueryConfigs(dao.GetDB(), "mtwmCookieStr", model.ConfigTypeCookie, ""); err == nil { api.MtwmAPI.SetCookieWithStr(configs[0].Value) } - result, err := api.MtwmAPI.GetStandardProductListWithCond(*skuName.Upc) - if result != nil { - productInfo.OriginalName = result.Name - productInfo.OriginalSpec = result.Spec - productInfo.Name = result.Name - productInfo.SpecUnit = result.SpecUnit - productInfo.Unit = result.Unit - productInfo.SpecQuality = float32(result.SpecNew) - productInfo.ImgList = strings.Split(result.Pic, ",") - productInfo.Weight = float32(result.Weight) - productInfo.BrandName = result.BrandNamePath + + //result, err := api.MtwmAPI.GetStandardProductListWithCond(*skuName.Upc) + //if result != nil { + result, err := api.JdAPI.GetJdUpcCodeByName("", *skuName.Upc, 1, 5) + if result != nil && len(result) != 0 { + productInfo.OriginalName = result[0].OriginalName + productInfo.OriginalSpec = result[0].OriginalSpec + productInfo.Name = result[0].Name + productInfo.SpecUnit = result[0].SpecUnit + productInfo.Unit = result[0].Unit + productInfo.SpecQuality = result[0].SpecQuality + productInfo.ImgList = result[0].ImgList + if result[0].Img != "" { + productInfo.ImgList = append(productInfo.ImgList, productInfo.Img) + } + productInfo.Weight = result[0].Weight + productInfo.BrandName = result[0].BrandName setImgs(skuName, productInfo.ImgList) + // productInfo.OriginalName = result.Name + // productInfo.OriginalSpec = result.Spec + // productInfo.Name = result.Name + // productInfo.SpecUnit = result.SpecUnit + // productInfo.Unit = result.Unit + // productInfo.SpecQuality = float32(result.SpecNew) + // productInfo.ImgList = strings.Split(result.Pic, ",") + // productInfo.Weight = float32(result.Weight) + // productInfo.BrandName = result.BrandNamePath + // setImgs(skuName, productInfo.ImgList) } else { retVal = []*CreateUpcSkuByExcelErr{buildCreateUpcSkuByExcelErr(v, "美团cookie过期或者没查询到")} return retVal, err