From ede983793fe94dc81a27f276bb8f4d11ce31d47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 30 Apr 2020 15:50:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E5=8D=88=E8=BF=9B=E8=A1=8C=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E6=9F=90=E4=BA=9B=E9=97=A8=E5=BA=97=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BA=AC=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/misc/misc.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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)