From 19704b74bca1bb305b9e61dc9fd4caf0e4da6ea2 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, 12 Dec 2019 13:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E8=AF=84=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 29 ++++++++++-------- business/jxstore/cms/store.go | 14 +++++++-- business/jxstore/cms/store_sku.go | 3 ++ business/jxstore/misc/misc.go | 2 +- business/jxstore/report/report.go | 6 +++- business/model/dao/report.go | 37 +++++++++++----------- business/model/dao/store.go | 2 +- business/model/dao/store_sku.go | 6 ++-- business/model/error_code.go | 1 + business/model/store.go | 44 +++++++++++++-------------- controllers/cms_store.go | 3 +- controllers/jx_order.go | 4 +-- 12 files changed, 86 insertions(+), 65 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index d1ba7e230..6b4f3ad07 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -634,7 +634,7 @@ func (c *OrderManager) UpdateOrderFields(order *model.GoodsOrder, fieldList []st return err } -func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, vendorOrderID string, actID int, vendorIDs []int, storeID int, fromDate, toDate string, isAsync, isContinueWhenError bool) (hint string, err error) { +func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, vendorOrderID string, actID int, vendorIDs []int, storeID int, fromDate, toDate string, isAsync, isContinueWhenError bool) (hint string, errCode string, err error) { var ( orderList []*model.GoodsOrder fromDateParam time.Time @@ -652,10 +652,10 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, actBeginAt := actList.Data[0].BeginAt actEndAt := actList.Data[0].EndAt if fromDateParam.Sub(actBeginAt) > 0 && fromDateParam.Sub(actEndAt) > 0 { - return "", errors.New(fmt.Sprintf("结算活动有效时间范围与订单创建时间范围不一致!,活动时间范围:[%v] 至 [%v] ,订单创建时间范围 :[%v] 至 [%v]", actBeginAt, actEndAt, fromDateParam, toDateParam)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("结算活动有效时间范围与订单创建时间范围不一致!,活动时间范围:[%v] 至 [%v] ,订单创建时间范围 :[%v] 至 [%v]", actBeginAt, actEndAt, fromDateParam, toDateParam)) } if actBeginAt.Sub(toDateParam) > 0 && actEndAt.Sub(toDateParam) > 0 { - return "", errors.New(fmt.Sprintf("结算活动有效时间范围与订单创建时间范围不一致!,活动时间范围:[%v] 至 [%v] ,订单创建时间范围 :[%v] 至 [%v]", actBeginAt, actEndAt, fromDateParam, toDateParam)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("结算活动有效时间范围与订单创建时间范围不一致!,活动时间范围:[%v] 至 [%v] ,订单创建时间范围 :[%v] 至 [%v]", actBeginAt, actEndAt, fromDateParam, toDateParam)) } if fromDateParam.Sub(actBeginAt) > 0 { beginAt = fromDateParam @@ -674,17 +674,17 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, } orderList, _ = dao.QueryOrders(db, vendorOrderID, actID, vendorIDs, storeID, beginAt, endAt) } else { - return "", errors.New(fmt.Sprintf("未查询到相关结算活动,活动ID:[%d]", actID)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("未查询到相关结算活动,活动ID:[%d]", actID)) } } else if fromDate == "" && toDate == "" { actList, _ := dao.QueryActs(db, actID, 0, math.MaxInt32, 0, "", -1, nil, nil, nil, 0, 0, 0, utils.DefaultTimeValue, utils.DefaultTimeValue, utils.DefaultTimeValue, utils.DefaultTimeValue) if len(actList.Data) > 0 { orderList, _ = dao.QueryOrders(db, vendorOrderID, actID, vendorIDs, storeID, actList.Data[0].BeginAt, actList.Data[0].EndAt) } else { - return "", errors.New(fmt.Sprintf("未查询到相关结算活动,活动ID:[%d]", actID)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("未查询到相关结算活动,活动ID:[%d]", actID)) } } else { - return "", errors.New(fmt.Sprintf("间隔时间必须完整!时间范围:[%v] 至 [%v]", fromDate, toDate)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("间隔时间必须完整!时间范围:[%v] 至 [%v]", fromDate, toDate)) } } else { if fromDate != "" && toDate != "" { @@ -692,15 +692,15 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, toDateParam = utils.Str2Time(toDate) //若未传入活动ID,且时间间隔大于10天则不允许查询 if math.Ceil(toDateParam.Sub(fromDateParam).Hours()/24) > 10 { - return "", errors.New(fmt.Sprintf("查询间隔时间不允许大于10天!时间范围:[%v] 至 [%v]", fromDate, toDate)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("查询间隔时间不允许大于10天!时间范围:[%v] 至 [%v]", fromDate, toDate)) } orderList, _ = dao.QueryOrders(db, vendorOrderID, actID, vendorIDs, storeID, fromDateParam, toDateParam) } else { - return "", errors.New(fmt.Sprintf("若不按活动查询则间隔时间必须完整!时间范围:[%v] 至 [%v]", fromDate, toDate)) + return "", model.ErrCodeGeneralFailed, errors.New(fmt.Sprintf("若不按活动查询则间隔时间必须完整!时间范围:[%v] 至 [%v]", fromDate, toDate)) } } if len(orderList) <= 0 { - return "", errors.New(fmt.Sprintf("未查询到订单!,vendorOrderID : %s, actID : %d, 时间范围:[%v] 至 [%v]", vendorOrderID, actID, fromDate, toDate)) + return "", model.ErrCodePoint, errors.New(fmt.Sprintf("所选活动没有要更新结算价的订单!,vendorOrderID : %s, actID : %d, 时间范围:[%v] 至 [%v]", vendorOrderID, actID, fromDate, toDate)) } task := tasksch.NewParallelTask("刷新历史订单结算价", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { @@ -722,20 +722,23 @@ func (c *OrderManager) RefreshHistoryOrdersEarningPrice(ctx *jxcontext.Context, } } jxutils.RefreshOrderSkuRelated(order) - if _, err = dao.UpdateEntity(db, order, "EarningPrice"); err != nil { + num, err := dao.UpdateEntity(db, order, "EarningPrice") + if err != nil { return "", err } dao.Commit(db) + retVal = num return retVal, err }, orderList) tasksch.HandleTask(task, nil, true).Run() if !isAsync { - _, err = task.GetResult(0) - hint = "1" + resultNum, err2 := task.GetResult(0) + err = err2 + hint = resultNum[0].(string) } else { hint = task.GetID() } - return hint, err + return hint, model.ErrCodeSuccess, err } func RefreshOrdersWithoutJxStoreID(ctx *jxcontext.Context, fromDate, toDate string, isAsync, isContinueWhenError bool) (hint string, err error) { diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index d5a76d538..f2f809a9b 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2542,9 +2542,14 @@ func GetStorePriceScore(ctx *jxcontext.Context, storeIDs []int, fromScore, toSco return pagedInfo, err } -func CreateStorePriceScore(ctx *jxcontext.Context) (err error) { +func CreateStorePriceScore(ctx *jxcontext.Context, forRefresh bool) (err error) { db := dao.GetDB() - snapshotAt := utils.Time2Date(time.Now()) + var snapshotAt time.Time + if forRefresh { + snapshotAt = utils.Time2Date(time.Now().AddDate(0, 0, -1)) + } else { + snapshotAt = utils.Time2Date(time.Now()) + } storePriceScoreSnapshot, err := dao.GetStorePriceScoreSnapshot(db, snapshotAt) if len(storePriceScoreSnapshot) > 0 { dao.Begin(db) @@ -2556,7 +2561,10 @@ func CreateStorePriceScore(ctx *jxcontext.Context) (err error) { } } }() - dao.DeleteEntity(db, storePriceScoreSnapshot[0], "SnapshotAt") + priceReferSnapshotDeleteHis := &model.StorePriceScoreSnapshot{SnapshotAt: snapshotAt.AddDate(0, -1, 0)} + priceReferSnapshotDelete := &model.StorePriceScoreSnapshot{SnapshotAt: snapshotAt} + dao.DeleteEntity(db, priceReferSnapshotDeleteHis, "SnapshotAt") + dao.DeleteEntity(db, priceReferSnapshotDelete, "SnapshotAt") for _, v := range storePriceScoreSnapshot { dao.WrapAddIDCULDEntity(v, ctx.GetUserName()) v.SnapshotAt = snapshotAt diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 6e23b1fd0..2adaf741a 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2143,6 +2143,9 @@ func GetTopCategorysByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (skuCateg func RefershStoreSkusMidPrice(ctx *jxcontext.Context, storeIDs []int) (err error) { db := dao.GetDB() _, err = dao.RefershStoreSkusMidPrice(db, storeIDs) + if err == nil { + CreateStorePriceScore(ctx, true) + } return err } diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index e2239a0df..62923b4b9 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -140,7 +140,7 @@ func Init() { report.BeginSavePriceRefer(jxcontext.AdminCtx, nil, nil) }, createStorePriceTimeList) ScheduleTimerFunc("CreateStorePriceScore", func() { - cms.CreateStorePriceScore(jxcontext.AdminCtx) + cms.CreateStorePriceScore(jxcontext.AdminCtx, false) }, openRemoteStoreTimeList) } ScheduleTimerFunc("AutoSaleStoreSku", func() { diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index 5032713c4..f3120c702 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -64,10 +64,14 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int) (err e } } }() - dao.DeleteEntity(db, priceReferSnapshot[0], "SnapshotAt") + priceReferSnapshotDeleteHis := &model.PriceReferSnapshot{SnapshotAt: snapshotAt.AddDate(0, -1, 0)} + priceReferSnapshotDelete := &model.PriceReferSnapshot{SnapshotAt: snapshotAt} + dao.DeleteEntity(db, priceReferSnapshotDeleteHis, "SnapshotAt") + dao.DeleteEntity(db, priceReferSnapshotDelete, "SnapshotAt") 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 } diff --git a/business/model/dao/report.go b/business/model/dao/report.go index 9595d8ab9..125b42a21 100644 --- a/business/model/dao/report.go +++ b/business/model/dao/report.go @@ -188,22 +188,22 @@ func GetGetStatisticsReportForAfsOrders(db *DaoDB, storeIDs []int, fromDate time func GetStatisticsReportForStoreSkusPrice(db *DaoDB, cityCodes, skuIDs []int) (priceReferSnapshot []*model.PriceReferSnapshot, err error) { sql := ` SELECT b.city_code,a.sku_id, - MAX(a.price/100) max_price, - MIN(a.price/100) min_price, - ROUND(AVG(a.price/100),2) avg_price, - ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.price/100 ORDER BY a.price/100),',',Count(1)/2),',',-1),2) mid_price, - MAX(a.jd_price/100) max_jd_price, - MIN(a.jd_price/100) min_jd_price, - ROUND(AVG(a.jd_price/100),2) avg_jd_price, - ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.jd_price/100 ORDER BY a.jd_price/100),',',Count(1)/2),',',-1),2) mid_jd_price, - MAX(a.ebai_price/100) max_ebai_price, - MIN(a.ebai_price/100) min_ebai_price, - ROUND(AVG(a.ebai_price/100),2) avg_ebai_price, - ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.ebai_price/100 ORDER BY a.ebai_price/100),',',Count(1)/2),',',-1),2) mid_ebai_price, - MAX(a.mtwm_price/100) max_mtwm_price, - MIN(a.mtwm_price/100) min_mtwm_price, - ROUND(AVG(a.mtwm_price/100),2) avg_mtwm_price, - ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.mtwm_price/100 ORDER BY a.mtwm_price/100),',',Count(1)/2),',',-1),2) mid_mtwm_price, + MAX(a.price) max_price, + MIN(a.price) min_price, + ROUND(AVG(a.price)) avg_price, + ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT((a.price/IF(b.pay_percentage=0,100,b.pay_percentage))*100 ORDER BY (a.price/IF(b.pay_percentage=0,100,b.pay_percentage))*100),',',Count(1)/2),',',-1),2) mid_price, + MAX(a.jd_price) max_jd_price, + MIN(a.jd_price) min_jd_price, + ROUND(AVG(a.jd_price)) avg_jd_price, + ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.jd_price ORDER BY a.jd_price),',',Count(1)/2),',',-1),2) mid_jd_price, + MAX(a.ebai_price) max_ebai_price, + MIN(a.ebai_price) min_ebai_price, + ROUND(AVG(a.ebai_price)) avg_ebai_price, + ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.ebai_price ORDER BY a.ebai_price),',',Count(1)/2),',',-1),2) mid_ebai_price, + MAX(a.mtwm_price) max_mtwm_price, + MIN(a.mtwm_price) min_mtwm_price, + ROUND(AVG(a.mtwm_price)) avg_mtwm_price, + ROUND(SUBSTRING_INDEX(SUBSTRING_INDEX(GROUP_CONCAT(a.mtwm_price ORDER BY a.mtwm_price),',',Count(1)/2),',',-1),2) mid_mtwm_price, t1.max_sale_price, t1.min_sale_price, t1.avg_sale_price, @@ -214,17 +214,18 @@ func GetStatisticsReportForStoreSkusPrice(db *DaoDB, cityCodes, skuIDs []int) (p JOIN store b ON a.store_id = b.id AND b.deleted_at = ? JOIN sku d ON a.sku_id = d.id AND d.deleted_at = ? LEFT JOIN ( - SELECT SUM(t1.count),t1.sku_id,MAX(t1.sale_price/100) max_sale_price,MIN(t1.sale_price/100) min_sale_price,ROUND(AVG(t1.sale_price/100),2) avg_sale_price,MAX(t1.vendor_price/100) max_vendor_price,MIN(t1.vendor_price/100) min_vendor_price,ROUND(AVG(t1.vendor_price/100),2) avg_vendor_price + SELECT SUM(t1.count),t1.sku_id,MAX(t1.sale_price) max_sale_price,MIN(t1.sale_price) min_sale_price,ROUND(AVG(t1.sale_price)) avg_sale_price,MAX(t1.vendor_price) max_vendor_price,MIN(t1.vendor_price) min_vendor_price,ROUND(AVG(t1.vendor_price)) avg_vendor_price FROM order_sku t1 WHERE t1.order_created_at BETWEEN ? AND NOW() GROUP BY 2 )t1 ON t1.sku_id = a.sku_id - WHERE 1=1 + WHERE a.deleted_at = ? ` sqlParams := []interface{}{ utils.DefaultTimeValue, utils.DefaultTimeValue, time.Now().AddDate(0, -1, 0), + utils.DefaultTimeValue, } if len(skuIDs) > 0 { sql += " AND a.sku_id IN (" + GenQuestionMarks(len(skuIDs)) + ")" diff --git a/business/model/dao/store.go b/business/model/dao/store.go index 7892798f0..08ac3f9ae 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -522,7 +522,7 @@ func GetStorePriceScore(db *DaoDB, storeIDs []int, fromScore, toScore, sort int, func GetStorePriceScoreSnapshot(db *DaoDB, snapDate time.Time) (storePriceScoreSnapshot []*model.StorePriceScoreSnapshot, err error) { sql := ` - SELECT c.store_id,ROUND(count(c.price/100 <= a.mid_price or NULL)/count(*)*100,2) score + SELECT c.store_id,ROUND(count(c.price <= a.mid_price or NULL)/count(*)*100,2) score FROM price_refer_snapshot a JOIN store_sku_bind c ON c.sku_id = a.sku_id AND c.status = 1 AND c.deleted_at = ? JOIN store d ON c.store_id = d.id AND d.city_code = a.city_code AND d.deleted_at = ? AND d.status != ? diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index 8e010e802..e2c7c908f 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -1033,18 +1033,18 @@ func RefershStoreSkusMidPrice(db *DaoDB, storeIDs []int) (count int64, err error UPDATE store_sku_bind a JOIN store d ON d.id = a.store_id JOIN price_refer_snapshot b ON a.sku_id = b.sku_id AND b.snapshot_at = ? AND d.city_code = b.city_code - SET a.price = b.mid_price*100 + SET a.price = (b.mid_price*IF(d.pay_percentage=0,100,d.pay_percentage))/100 WHERE 1=1 ` sqlParams := []interface{}{ - utils.DefaultTimeValue, + utils.Time2Date(time.Now().AddDate(0, 0, -1)), } if len(storeIDs) > 0 { sql += " AND a.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")" sqlParams = append(sqlParams, storeIDs) } sql += ` - AND a.price > b.mid_price*100 + AND (a.price/IF(d.pay_percentage=0,100,d.pay_percentage))*100 > b.mid_price AND a.deleted_at = ? AND a.status = ? ` diff --git a/business/model/error_code.go b/business/model/error_code.go index 3afb079f1..70a49bcea 100644 --- a/business/model/error_code.go +++ b/business/model/error_code.go @@ -6,6 +6,7 @@ const ( ErrorCodeIgnore = "ignore" ErrCodeSuccess = "0" + ErrCodePoint = "1" ErrCodeGeneralFailed = "-1" ErrCodeTokenIsInvalid = "-2" ErrCodeUserNotExist = "-3" diff --git a/business/model/store.go b/business/model/store.go index 0fdee417c..80f5ff000 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -429,28 +429,28 @@ type PriceReferSnapshot struct { SnapshotAt time.Time `orm:"type(datetime)" json:"snapshotAt"` // 这个不同于CreatedAt,SnapshotAt是逻辑上的时间,CreatedAt是实际存储的时间 CityCode int `json:"cityCode"` SkuID int `orm:"column(sku_id)" json:"skuId"` - MaxPrice float64 `json:"maxPrice"` - MinPrice float64 `json:"minPrice"` - AvgPrice float64 `json:"avgPrice"` - MidPrice float64 `json:"midPrice"` - MaxJdPrice float64 `json:"maxJdPrice"` - MinJdPrice float64 `json:"minJdPrice"` - AvgJdPrice float64 `json:"avgJdPrice"` - MidJdPrice float64 `json:"midJdPrice"` - MaxEbaiPrice float64 `json:"maxEbaiPrice"` - MinEbaiPrice float64 `json:"minEbaiPrice"` - AvgEbaiPrice float64 `json:"avgEbaiPrice"` - MidEbaiPrice float64 `json:"midEbaiPrice"` - MaxMtwmPrice float64 `json:"maxMtwmPrice"` - MinMtwmPrice float64 `json:"minMtwmPrice"` - AvgMtwmPrice float64 `json:"avgMtwmPrice"` - MidMtwmPrice float64 `json:"midMtwmPrice"` - MaxSalePrice float64 `json:"maxSalePrice"` - MinSalePrice float64 `json:"minSalePrice"` - AvgSalePrice float64 `json:"avgSalePrice"` - MaxVendorPrice float64 `json:"maxVendorPrice"` - MinVendorPrice float64 `json:"minVendorPrice"` - AvgVendorPrice float64 `json:"avgVendorPrice"` + MaxPrice int `json:"maxPrice"` + MinPrice int `json:"minPrice"` + AvgPrice int `json:"avgPrice"` + MidPrice int `json:"midPrice"` + MaxJdPrice int `json:"maxJdPrice"` + MinJdPrice int `json:"minJdPrice"` + AvgJdPrice int `json:"avgJdPrice"` + MidJdPrice int `json:"midJdPrice"` + MaxEbaiPrice int `json:"maxEbaiPrice"` + MinEbaiPrice int `json:"minEbaiPrice"` + AvgEbaiPrice int `json:"avgEbaiPrice"` + MidEbaiPrice int `json:"midEbaiPrice"` + MaxMtwmPrice int `json:"maxMtwmPrice"` + MinMtwmPrice int `json:"minMtwmPrice"` + AvgMtwmPrice int `json:"avgMtwmPrice"` + MidMtwmPrice int `json:"midMtwmPrice"` + MaxSalePrice int `json:"maxSalePrice"` + MinSalePrice int `json:"minSalePrice"` + AvgSalePrice int `json:"avgSalePrice"` + MaxVendorPrice int `json:"maxVendorPrice"` + MinVendorPrice int `json:"minVendorPrice"` + AvgVendorPrice int `json:"avgVendorPrice"` } func (*PriceReferSnapshot) TableUnique() [][]string { diff --git a/controllers/cms_store.go b/controllers/cms_store.go index 01a583c86..6dd974314 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -610,12 +610,13 @@ func (c *StoreController) GetStorePriceScore() { // @Title 生成门店价格分数表 // @Description 生成门店价格分数表 // @Param token header string true "认证token" +// @Param forRefresh formData bool true "是否是刷新中位价重新生成分数表" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /CreateStorePriceScore [post] func (c *StoreController) CreateStorePriceScore() { c.callCreateStorePriceScore(func(params *tStoreCreateStorePriceScoreParams) (retVal interface{}, errCode string, err error) { - err = cms.CreateStorePriceScore(params.Ctx) + err = cms.CreateStorePriceScore(params.Ctx, params.ForRefresh) return retVal, "", err }) } diff --git a/controllers/jx_order.go b/controllers/jx_order.go index 0d9ca9227..964fc08a4 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -759,9 +759,9 @@ func (c *OrderController) RefreshHistoryOrdersEarningPrice() { c.callRefreshHistoryOrdersEarningPrice(func(params *tOrderRefreshHistoryOrdersEarningPriceParams) (retVal interface{}, errCode string, err error) { var vendorIDList []int if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList); err == nil { - retVal, err = orderman.FixedOrderManager.RefreshHistoryOrdersEarningPrice(params.Ctx, params.VendorOrderID, params.ActID, vendorIDList, params.StoreID, params.FromTime, params.ToTime, params.IsAsync, params.IsContinueWhenError) + retVal, errCode, err = orderman.FixedOrderManager.RefreshHistoryOrdersEarningPrice(params.Ctx, params.VendorOrderID, params.ActID, vendorIDList, params.StoreID, params.FromTime, params.ToTime, params.IsAsync, params.IsContinueWhenError) } - return retVal, "", err + return retVal, errCode, err }) }