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 {