From 38f5f58644289d90f8fcd7d62c0c66f3804f08f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 1 Mar 2021 17:15:45 +0800 Subject: [PATCH] aa --- business/jxstore/cms/sku.go | 7 ++++++- business/jxstore/cms/sync2.go | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index db69910f0..f165ed05c 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -2969,8 +2969,13 @@ func LoadStoreVendorCategories(ctx *jxcontext.Context, vendorOrgCode string, ven return err } dao.Commit(db) + catList, _ := dao.GetSkuCategoryWithVendor(db, []int{vendorID}, []string{vendorOrgCode}, -1, nil, false) for _, v := range storeCats { - OnUpdateThing(ctx, db, vendorOrgCodes, int64(v.CategoryID), model.ThingTypeCategory) + if len(catList) > 0 { + OnUpdateThing(ctx, db, vendorOrgCodes, int64(v.CategoryID), model.ThingTypeCategory) + } else { + OnCreateThing(ctx, db, vendorOrgCodes, int64(v.CategoryID), model.ThingTypeCategory, model.SyncFlagNewMask, false) + } } return err } diff --git a/business/jxstore/cms/sync2.go b/business/jxstore/cms/sync2.go index 906193066..dde1eea01 100644 --- a/business/jxstore/cms/sync2.go +++ b/business/jxstore/cms/sync2.go @@ -352,7 +352,6 @@ func onUpdateThing(ctx *jxcontext.Context, db *dao.DaoDB, vendorInfoList []*mode updateThingMapEntity(db, thingMap) } else { if dao.IsNoRowsError(err2) { - OnCreateThing(ctx, db, vendorInfoList, thingID, thingType, model.SyncFlagNewMask, true) err2 = nil } else { errList.AddErr(err2)