From 4a907607e3ad7849939881d72b7703a059fc9f0a Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 15 Jun 2021 14:11:28 +0800 Subject: [PATCH] aa --- business/jxstore/cms/store.go | 2 +- business/jxstore/misc/misc.go | 44 ++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 52ede6421..b2957d20f 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -3587,7 +3587,7 @@ func DisabledStoreWithoutVendor(ctx *jxcontext.Context, isContinueWhenError, isA task := tasksch.NewParallelTask("DisabledStoreWithoutVendor", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { store := batchItemList[0].(*model.Store) - storeMaps, err := dao.GetStoresMapList(db, []int{model.VendorIDYB, model.VendorIDJD, model.VendorIDJX, model.VendorIDEBAI, model.VendorIDMTWM}, []int{store.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "") + storeMaps, err := dao.GetStoresMapList(db, []int{model.VendorIDYB, model.VendorIDJD, model.VendorIDJX, model.VendorIDEBAI, model.VendorIDMTWM, model.VendorIDJDShop}, []int{store.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "") if len(storeMaps) == 0 { store.Status = model.StoreStatusDisabled dao.UpdateEntity(db, store, "Status") diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index a9baae16d..8d55df089 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -44,7 +44,7 @@ var ( "09:00:00", } dailyWorkTimeList = []string{ - "20:30:00", + "21:30:00", } dailyWorkTimeList2 = []string{ "2:00:00", @@ -162,7 +162,39 @@ func IsImportantTaskRunning(taskName string) bool { func Init() { if globals.IsProductEnv() { - ScheduleTimerFunc("doDailyWork", doDailyWork, dailyWorkTimeList) + ScheduleTimerFunc("doDailyWork", func() { + globals.SugarLogger.Debug("doDailyWork") + + //同步商品额外前缀和水印图(打标记) + cms.SyncSkuExperfixAndWatermark(jxcontext.AdminCtx) + + dao.SetStoresMapSyncStatus(dao.GetDB(), nil, nil, model.SyncFlagStoreStatus) + cms.CurVendorSync.SyncStore2(jxcontext.AdminCtx, dao.GetDB(), []int{model.VendorIDMTWM, model.VendorIDJD, model.VendorIDEBAI}, nil, true, true) + + if beego.BConfig.RunMode == "prod" { + syncStoreSku() + } + InitEx() + cms.SyncStoresCourierInfo(jxcontext.AdminCtx, nil, false, true) + netprinter.RebindAllPrinters(jxcontext.AdminCtx, false, true) + + //只传toDate默认刷新toDate到5天以前的订单 + orderman.RefreshOrdersWithoutJxStoreID(jxcontext.AdminCtx, "", "", true, true) + //禁用没有绑定的门店 + cms.DisabledStoreWithoutVendor(jxcontext.AdminCtx, true, true) + //刷新物料订单状态 + localjx.RefreshAllMatterOrderStatus(jxcontext.AdminCtx) + //同步美团配送与否状态及美团门店是否存在 + cms.SetMTPSStatus(jxcontext.AdminCtx, 0, 0) + //售后单如果超过12小时没有审核,就自动通过 + RefreshAfsOrderStatusAccess(jxcontext.AdminCtx) + //刷新京东商城订单结算价 + orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, utils.Time2Str(time.Now().AddDate(0, 0, -2)), utils.Time2Str(time.Now())) + //刷新门店分组管理 + cms.RefreshStoreBind(jxcontext.AdminCtx) + //刷新京东会员 + report.RefreshJDMembers(jxcontext.AdminCtx) + }, dailyWorkTimeList) //ScheduleTimerFunc("doDailyWork2", doDailyWork2, dailyWorkTimeList2) @@ -335,10 +367,10 @@ func Init() { jdsCookie = configs[0].Value api.JdShopAPI.SetCookieWithStr(jdsCookie) } - if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil { - yinbaoCookie := configs[0].Value - api.YinBaoAPI.SetCookie(".POSPALAUTH30220", yinbaoCookie) - } + //if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil { + // yinbaoCookie := configs[0].Value + // api.YinBaoAPI.SetCookie(".POSPALAUTH30220", yinbaoCookie) + //} if globals.Jd2OrgCode != "" { api.Jd2API.SetJdCookie(jd2StorePageCookie) }