diff --git a/business/jxstore/misc/store_score.go b/business/jxstore/misc/store_score.go index e2a2985d4..7079b5966 100644 --- a/business/jxstore/misc/store_score.go +++ b/business/jxstore/misc/store_score.go @@ -16,6 +16,7 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" + "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/refutil" ) @@ -475,6 +476,13 @@ func ScoreStoreRange(storeInfo *cms.StoreExt) { finalScore = ItemTotalScore - int(math.Round(diff*ratio)) } } + if finalScore < 0 { + globals.SugarLogger.Infof("ScoreStoreRange abnormal finalScore:%d, storeInfo:%s", finalScore, utils.Format4Output(storeInfo, true)) + finalScore = 0 + } else if finalScore > ItemTotalScore { + globals.SugarLogger.Infof("ScoreStoreRange abnormal finalScore:%d, storeInfo:%s", finalScore, utils.Format4Output(storeInfo, true)) + finalScore = ItemTotalScore + } storeScoreDataWrapper.SetData(storeID, model.FieldStoreRange, finalScore) }