From 3eb3bc8c62c2c4fc3e882f653251450c2e71d5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 10 Aug 2020 16:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E8=A5=BF=E6=8A=98=E6=89=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 20 +++++++++++++++++++ business/jxstore/misc/misc.go | 5 +++++ business/partner/purchase/jx/localjx/order.go | 20 +++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index c83249ed8..afa0a3628 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -1505,3 +1505,23 @@ func loadExcelForCreateAct(rowNum, mixType int, row []string, sheetParam *SheetP } actStoreSkuList = append(actStoreSkuList, actStoreSku) } + +func ChangeJxPriceByDiscountAct(ctx *jxcontext.Context) { + var ( + db = dao.GetDB() + pageSize = 9999 + ) + page, err := dao.QueryActs(db, 0, 0, pageSize, -1, "", model.VendorIDJX, []int{model.YES}, []int{model.ActSkuDiscount}, nil, 0, nil, 0, utils.ZeroTimeValue, utils.ZeroTimeValue, time.Now().AddDate(0, -3, 0), time.Now()) + if err != nil { + return + } + if len(page.Data) == 0 { + return + } + //第一档时间内 + if (time.Now().Hour() >= 10 && time.Now().Hour() < 20) || (time.Now().Hour() == 20 && time.Now().Minute() < 1) { + + } else { //第二档时间内 + + } +} diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 47642005c..4aa61d2ec 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -122,6 +122,7 @@ var ( importantTaskMap = &sync.Map{} cancelPayTimeOutOrderList = localjx.GetHalfHoursList() + discountActJxList = localjx.GetDiscountActHoursList() ebaiStorePageCookieExdTOKEN string ebaiStorePageCookieWMUSS2 string @@ -263,6 +264,10 @@ func Init() { cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false) }, autoSaleStoreSkuTimeList) + ScheduleTimerFunc("ChangeJxPriceByDiscountAct", func() { + act.ChangeJxPriceByDiscountAct(jxcontext.AdminCtx) + }, discountActJxList) + if beego.BConfig.RunMode == "jxgy" { ScheduleTimerFunc("SyncMatterC4ToGy", func() { cms.SyncMatterC4ToGy(jxcontext.AdminCtx, true, true) diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index dbcc1f598..ffe2833c7 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -1371,6 +1371,26 @@ func GetHalfHoursList() (strs []string) { return strs } +func GetDiscountActHoursList() (str []string) { + for k := 1; k < 3; k++ { + for i := 0; i < 10; i++ { + for j := 0; j < 6; j++ { + if k == 1 && i == 0 && j == 0 { + continue + } + if k == 2 && i > 2 { + break + } + if k == 2 && i == 2 && j > 0 { + break + } + str = append(str, utils.Int2Str(k)+utils.Int2Str(i)+":"+utils.Int2Str(j)+"0"+":00") + } + } + } + return str +} + func RefreshAllMatterOrderStatus(ctx *jxcontext.Context) (err error) { var ( db = dao.GetDB()