diff --git a/business/partner/purchase/ebai/store_sku2.go b/business/partner/purchase/ebai/store_sku2.go index 7c1046bd5..d08d63e93 100644 --- a/business/partner/purchase/ebai/store_sku2.go +++ b/business/partner/purchase/ebai/store_sku2.go @@ -83,6 +83,14 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { if globals.EnableEbaiStoreWrite { err = api.EbaiAPI.ShopCategoryUpdate(utils.Int2Str(storeID), utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), formatCatName(storeCat.Name), jxCatSeq2Ebai(storeCat.Seq)) + // todo, 饿百将一个分类重复改名,也会报分类名重复错,特殊处理一下,不过因为GetStoreCategory其实会拉取所有的门店分类,是比较耗时的操作 + if utils.IsErrMatch(err, "1", []string{"分类名称已经存在"}) { + if cat, err2 := p.GetStoreCategory(ctx, storeID, vendorStoreID, storeCat.Name); err2 == nil { + if cat.VendorCatID == storeCat.VendorCatID { + err = nil + } + } + } } return err } diff --git a/controllers/cms_sync.go b/controllers/cms_sync.go index e14381286..079ae7e04 100644 --- a/controllers/cms_sync.go +++ b/controllers/cms_sync.go @@ -36,8 +36,8 @@ func (c *SyncController) SyncStoresSkus() { }) } -// @Title 同步商家商品信息 -// @Description 同步商家商品信息 +// @Title 同步商家分类信息 +// @Description 同步商家分类信息 // @Param token header string true "认证token" // @Param storeIDs formData string true "门店ID列表" // @Param vendorIDs formData string true "厂商ID列表"