From 3872e925626caca57761a902b91bce81efc9513c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 23 Mar 2023 17:53:40 +0800 Subject: [PATCH] 1 --- business/jxstore/cms/sku.go | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 7b607854d..e75b1b06c 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1149,9 +1149,7 @@ type aa struct { // 根据名称获取商品分类[京东] func getCategoryByName(name string) string { handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler) - vendorCategoryId, err := handler.GetSkuCategoryIdByName("320406", name) - globals.SugarLogger.Debugf("getCategoryByName vendorCategoryId :%s", vendorCategoryId) - globals.SugarLogger.Debugf("getCategoryByName err :%v", err) + vendorCategoryId, _ := handler.GetSkuCategoryIdByName("320406", name) return vendorCategoryId } @@ -1165,18 +1163,14 @@ func getCategoryByImg(img ...string) string { imgs = append(imgs, v) } handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDDD).(partner.IPurchasePlatformStoreSkuHandler) - vendorCategoryId, err := handler.GetSkuCategoryIdByName("57939570", strings.Join(imgs, "|")) - globals.SugarLogger.Debugf("getCategoryByImg vendorCategoryId :%s", vendorCategoryId) - globals.SugarLogger.Debugf("getCategoryByImg err :%v", err) + vendorCategoryId, _ := handler.GetSkuCategoryIdByName("57939570", strings.Join(imgs, "|")) return vendorCategoryId } // 根据平台返回的分类id,获取本地绑定的映射分类id func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID string) (string, string, string) { - globals.SugarLogger.Debugf("getJDCategoryLoadingLocalCategoryReflex 1111: %s,%s,%s,%s", jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID) cats, err := dao.GetCategoriesByName(dao.GetDB(), "", jdCategoryId) if len(cats) == 0 || err != nil { - globals.SugarLogger.Errorf("%v", fmt.Errorf("根据京东分类id设置美团/饿了么分类错误:%d,%v", len(cats), err)) return jdsCategoryID, ebaiCategoryID, mtwmCategoryID } else { if jdsCategoryID == "" && cats[0].JdsCategoryID != 0 { @@ -1189,7 +1183,6 @@ func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCa mtwmCategoryID = utils.Int64ToStr(cats[0].MtwmCategoryID) } } - globals.SugarLogger.Debugf("getJDCategoryLoadingLocalCategoryReflex 2222: %s,%s,%s,%s", jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID) return jdsCategoryID, ebaiCategoryID, mtwmCategoryID } @@ -1228,7 +1221,6 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n mtwmCategoryID := "" ddCategoryID := "" if skuNameExt != nil { - globals.SugarLogger.Debugf("======skuNameExt :%s", utils.Format4Output(skuNameExt, false)) if skuNameExt.JdCategoryID != "" { jdCategoryId = skuNameExt.JdCategoryID } else { @@ -1250,7 +1242,6 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n ddCategoryID = getCategoryByImg(skuNameExt.DescImg, skuNameExt.Img, skuNameExt.Img2, skuNameExt.Img3, skuNameExt.Img4, skuNameExt.Img5) } } else { - globals.SugarLogger.Debugf("======payload :%s", utils.Format4Output(payload, false)) if payload["jdCategoryID"] != nil { jdCategoryId = payload["jdCategoryID"].(string) } else { @@ -1278,12 +1269,6 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n } } - globals.SugarLogger.Debugf("jdsCategoryID:%s", jdsCategoryID) - globals.SugarLogger.Debugf("ebaiCategoryID:%s", ebaiCategoryID) - globals.SugarLogger.Debugf("mtwmCategoryID:%s", mtwmCategoryID) - globals.SugarLogger.Debugf("ddCategoryID:%s", ddCategoryID) - globals.SugarLogger.Debugf("jdCategoryId:%s", jdCategoryId) - if jdsCategoryID != "" && jdsCategoryID != "0" { updateOrCreate(model.VendorIDJDShop, nameID, jdsCategoryID) flag = true