Accept Merge Request #82: (yonghui -> mark)

Merge Request: 推荐商品分类sql修改,门店价格统计等修改
Created By: @苏尹岚
Accepted By: @苏尹岚
URL: https://rosydev.coding.net/p/jx-callback/d/jx-callback/git/merge/82
This commit is contained in:
苏尹岚
2019-12-13 11:34:38 +08:00
8 changed files with 24 additions and 25 deletions

View File

@@ -2544,14 +2544,10 @@ func GetStorePriceScore(ctx *jxcontext.Context, storeIDs []int, fromScore, toSco
return pagedInfo, err
}
func CreateStorePriceScore(ctx *jxcontext.Context, forRefresh bool) (err error) {
func CreateStorePriceScore(ctx *jxcontext.Context) (err error) {
db := dao.GetDB()
var snapshotAt time.Time
if forRefresh {
snapshotAt = utils.Time2Date(time.Now().AddDate(0, 0, -1))
} else {
snapshotAt = utils.Time2Date(time.Now())
}
snapshotAt = utils.Time2Date(time.Now().AddDate(0, 0, -1))
storePriceScoreSnapshot, err := dao.GetStorePriceScoreSnapshot(db, snapshotAt)
if len(storePriceScoreSnapshot) > 0 {
dao.Begin(db)

View File

@@ -2155,7 +2155,7 @@ func RefershStoreSkusMidPrice(ctx *jxcontext.Context, storeIDs []int) (err error
db := dao.GetDB()
_, err = dao.RefershStoreSkusMidPrice(db, storeIDs)
if err == nil {
CreateStorePriceScore(ctx, true)
CreateStorePriceScore(ctx)
}
return err
}

View File

@@ -34,8 +34,11 @@ var (
dailyWorkTimeList = []string{
"20:30:00",
}
priceReferTimeList = []string{
"01:00:00",
}
createStorePriceTimeList = []string{
"23:00:00",
"02:00:00",
}
refreshPageActTimeList = []string{
"7:00:00",
@@ -138,10 +141,10 @@ func Init() {
}, ChangeStoreSkuSaleStatusList)
ScheduleTimerFunc("BeginSavePriceRefer", func() {
report.BeginSavePriceRefer(jxcontext.AdminCtx, nil, nil)
}, createStorePriceTimeList)
}, priceReferTimeList)
ScheduleTimerFunc("CreateStorePriceScore", func() {
cms.CreateStorePriceScore(jxcontext.AdminCtx, false)
}, openRemoteStoreTimeList)
cms.CreateStorePriceScore(jxcontext.AdminCtx)
}, createStorePriceTimeList)
}
ScheduleTimerFunc("AutoSaleStoreSku", func() {
cms.AutoSaleStoreSku(jxcontext.AdminCtx, nil, false)

View File

@@ -52,7 +52,7 @@ func StatisticsReportForStoreSkusPrice(ctx *jxcontext.Context, cityCodes, skuIDs
func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int) (err error) {
db := dao.GetDB()
snapshotAt := utils.Time2Date(time.Now())
snapshotAt := utils.Time2Date(time.Now().AddDate(0, 0, -1))
priceReferSnapshot, err := dao.GetStatisticsReportForStoreSkusPrice(db, cityCodes, skuIDs)
if len(priceReferSnapshot) > 0 {
dao.Begin(db)
@@ -71,7 +71,6 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int) (err e
for _, v := range priceReferSnapshot {
dao.WrapAddIDCULDEntity(v, ctx.GetUserName())
v.SnapshotAt = snapshotAt
fmt.Println(v)
if err = dao.CreateEntity(db, v); err != nil {
return err
}