diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 582f971d1..8424bd9c8 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -110,6 +110,10 @@ var ( "23:30:00", } + exSyncList = []string{ + "12:00:00", + } + importantTaskMap = &sync.Map{} cancelPayTimeOutOrderList = localjx.GetHalfHoursList() @@ -213,6 +217,26 @@ func Init() { ScheduleTimerFunc("CleanStoreIsBoughtMatter", func() { cms.CleanStoreIsBoughtMatter(jxcontext.AdminCtx) }, priceReferTimeList) + ScheduleTimerFunc("exSync", func() { + var ( + db = dao.GetDB() + storeList []int + exSyncStoreIDList string + syncFlag = 0 + ) + syncFlag = model.SyncFlagPriceMask + if (time.Now().Unix()/24*3600)%10 == 0 { + syncFlag |= model.SyncFlagSaleMask + } + if configs, err := dao.QueryConfigs(dao.GetDB(), "exSyncStoreIDList", model.ConfigTypeSys, ""); err == nil { + exSyncStoreIDList = configs[0].Value + } + storeIDList := strings.Split(exSyncStoreIDList, ",") + for _, v := range storeIDList { + storeList = append(storeList, int(utils.Str2Int64(v))) + } + cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, partner.GetMultiStoreVendorIDs(), storeList, false, nil, []int{27379}, syncFlag, true, true) + }, exSyncList) } ScheduleTimerFunc("AutoSaleStoreSku", func() { cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)