aa
This commit is contained in:
@@ -3587,7 +3587,7 @@ func DisabledStoreWithoutVendor(ctx *jxcontext.Context, isContinueWhenError, isA
|
|||||||
task := tasksch.NewParallelTask("DisabledStoreWithoutVendor", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
task := tasksch.NewParallelTask("DisabledStoreWithoutVendor", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
store := batchItemList[0].(*model.Store)
|
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 {
|
if len(storeMaps) == 0 {
|
||||||
store.Status = model.StoreStatusDisabled
|
store.Status = model.StoreStatusDisabled
|
||||||
dao.UpdateEntity(db, store, "Status")
|
dao.UpdateEntity(db, store, "Status")
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ var (
|
|||||||
"09:00:00",
|
"09:00:00",
|
||||||
}
|
}
|
||||||
dailyWorkTimeList = []string{
|
dailyWorkTimeList = []string{
|
||||||
"20:30:00",
|
"21:30:00",
|
||||||
}
|
}
|
||||||
dailyWorkTimeList2 = []string{
|
dailyWorkTimeList2 = []string{
|
||||||
"2:00:00",
|
"2:00:00",
|
||||||
@@ -162,7 +162,39 @@ func IsImportantTaskRunning(taskName string) bool {
|
|||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
if globals.IsProductEnv() {
|
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)
|
//ScheduleTimerFunc("doDailyWork2", doDailyWork2, dailyWorkTimeList2)
|
||||||
|
|
||||||
@@ -335,10 +367,10 @@ func Init() {
|
|||||||
jdsCookie = configs[0].Value
|
jdsCookie = configs[0].Value
|
||||||
api.JdShopAPI.SetCookieWithStr(jdsCookie)
|
api.JdShopAPI.SetCookieWithStr(jdsCookie)
|
||||||
}
|
}
|
||||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil {
|
//if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||||
yinbaoCookie := configs[0].Value
|
// yinbaoCookie := configs[0].Value
|
||||||
api.YinBaoAPI.SetCookie(".POSPALAUTH30220", yinbaoCookie)
|
// api.YinBaoAPI.SetCookie(".POSPALAUTH30220", yinbaoCookie)
|
||||||
}
|
//}
|
||||||
if globals.Jd2OrgCode != "" {
|
if globals.Jd2OrgCode != "" {
|
||||||
api.Jd2API.SetJdCookie(jd2StorePageCookie)
|
api.Jd2API.SetJdCookie(jd2StorePageCookie)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user