This commit is contained in:
邹宗楠
2022-10-27 14:13:26 +08:00
parent b07f9963cb
commit 82d3eb2289
16 changed files with 507 additions and 372 deletions

View File

@@ -331,6 +331,37 @@ func OnCreateThing(ctx *jxcontext.Context, db *dao.DaoDB, vendorInfoList []*mode
return err
}
func OnCreateThing2Tiktok(ctx *jxcontext.Context, db *dao.DaoDB, appOrgCode string, vendorThingList map[string]int64, thingType, syncFlag int8, vendorFlag bool) (err error) {
if thingType == model.ThingTypeSkuName {
return nil
}
errList := errlist.New()
for k, v := range vendorThingList {
thingMap := &model.ThingMap{
ThingID: v,
ThingType: thingType,
VendorID: model.VendorIDDD,
VendorOrgCode: appOrgCode,
VendorThingID: k,
}
if thingType == model.ThingTypeCategory && !vendorFlag {
syncFlag = 0
}
thingMap.SyncStatus = syncFlag
dao.WrapAddIDCULDEntity(thingMap, ctx.GetUserName())
if err2 := dao.CreateEntity(db, thingMap); err2 != nil {
if err2 := getThingMap(db, thingMap); err2 == nil {
thingMap.SyncStatus = 2
thingMap.LastOperator = ctx.GetUserName()
_, err2 = dao.UpdateEntity(db, thingMap)
errList.AddErr(err2)
}
}
}
err = errList.GetErrListAsOne()
return err
}
func onUpdateThing(ctx *jxcontext.Context, db *dao.DaoDB, vendorInfoList []*model.VendorOrgCode, thingID int64, thingType int8, syncStatus int8) (err error) {
if thingType == model.ThingTypeSkuName {
return nil