This commit is contained in:
邹宗楠
2022-11-07 17:29:46 +08:00
parent 8674dbe329
commit c1a4797932
2 changed files with 17 additions and 3 deletions

View File

@@ -6619,14 +6619,22 @@ func SyncTiktokMainIdToLocal(ctx *jxcontext.Context, param *tiktok_store.MainSku
if err != nil {
return err
}
db := dao.GetDB()
for _, code := range codes {
result, err := tiktok_store.QueryAllMainSkuList(code.VendorOrgCode, param)
globals.SugarLogger.Debugf("=====%s", utils.Format4Output(result, false))
if err != nil {
continue
}
return OnCreateThing2Tiktok(ctx, dao.GetDB(), code.VendorOrgCode, result, model.ThingTypeSku, model.SyncFlagNewMask, false)
// 删除当前时间段数据
jxutils.CallMsgHandlerAsync(func() {
if err := DeleteThingByData(ctx, db, code.VendorOrgCode, utils.Timestamp2Time(param.StartTime), utils.Timestamp2Time(param.EndTime)); err != nil {
globals.SugarLogger.Error("删除需要同步的数据 := %s", err.Error())
}
if err := OnCreateThing2Tiktok(ctx, db, code.VendorOrgCode, result, model.ThingTypeSku, model.SyncFlagNewMask, false); err != nil {
globals.SugarLogger.Error("初始他抖音平台主订单已经子订单id信息错误:= %s", err.Error())
}
}, "")
}
return nil
}