This commit is contained in:
苏尹岚
2021-03-01 17:15:45 +08:00
parent af45ed3350
commit 38f5f58644
2 changed files with 6 additions and 2 deletions

View File

@@ -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
}

View File

@@ -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)