From 4591bdf5f51628131679eda8e2b1019c59abf70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 26 Dec 2022 18:56:08 +0800 Subject: [PATCH] 1 --- business/model/dao/thing_map.go | 3 +++ business/partner/purchase/tiktok_store/store_sku2_utils.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/business/model/dao/thing_map.go b/business/model/dao/thing_map.go index b6316054c..921e0789b 100644 --- a/business/model/dao/thing_map.go +++ b/business/model/dao/thing_map.go @@ -37,6 +37,9 @@ func CreateThingMap(thingId int64, vendorThingID, appOrgCode, err string, thingT Remark: err, SyncStatus: syncStatus, } + if thingMap.VendorThingID == "" { + return nil + } WrapAddIDCULDEntity(thingMap, "jxadmin") return CreateEntity(GetDB(), thingMap) diff --git a/business/partner/purchase/tiktok_store/store_sku2_utils.go b/business/partner/purchase/tiktok_store/store_sku2_utils.go index 6c061529a..925a57512 100644 --- a/business/partner/purchase/tiktok_store/store_sku2_utils.go +++ b/business/partner/purchase/tiktok_store/store_sku2_utils.go @@ -246,7 +246,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI continue } - if err := dao.CreateThingMap(int64(storeSku.SkuID), utils.Int64ToStr(mainOrderDetail.MainProductId), storeDetail.VendorOrgCode, storeSku.VendorSkuAttrId, model.ThingTypeSku, 0); err != nil { + if err := dao.CreateThingMap(int64(storeSku.SkuID), utils.Int64ToStr(mainOrderDetail.MainProductId), storeDetail.VendorOrgCode, "线上存在本地不存在", model.ThingTypeSku, 0); err != nil { failedList = putils.GetErrMsg2FailedSingleList(storeSku, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType) } @@ -398,7 +398,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI } mainIdInt = mainOrderDetail.MainProductId storeSku.VendorMainId = utils.Int64ToStr(mainIdInt) - if err := dao.CreateThingMap(int64(storeSku.SkuID), utils.Int64ToStr(mainIdInt), storeDetail.VendorOrgCode, storeSku.VendorSkuAttrId, model.ThingTypeSku, 0); err != nil { + if err := dao.CreateThingMap(int64(storeSku.SkuID), utils.Int64ToStr(mainIdInt), storeDetail.VendorOrgCode, "更新发现不存在", model.ThingTypeSku, 0); err != nil { failedList = putils.GetErrMsg2FailedSingleList(storeSku, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType) } } else {