错误提示,门店评分修改
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)) + ")"
|
||||
|
||||
@@ -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 != ?
|
||||
|
||||
@@ -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 = ?
|
||||
`
|
||||
|
||||
@@ -6,6 +6,7 @@ const (
|
||||
ErrorCodeIgnore = "ignore"
|
||||
|
||||
ErrCodeSuccess = "0"
|
||||
ErrCodePoint = "1"
|
||||
ErrCodeGeneralFailed = "-1"
|
||||
ErrCodeTokenIsInvalid = "-2"
|
||||
ErrCodeUserNotExist = "-3"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user