|
@@ -1091,16 +1091,16 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
List<CommonRating> ratings = commonRatingMapper.selectList(wrapper);
|
|
List<CommonRating> ratings = commonRatingMapper.selectList(wrapper);
|
|
|
|
|
|
|
|
int total = ratings.size();
|
|
int total = ratings.size();
|
|
|
- if (total == 0) {
|
|
|
|
|
|
|
+ if (total < 10) {
|
|
|
// 没有评价,设置默认评分为0
|
|
// 没有评价,设置默认评分为0
|
|
|
StoreInfo storeInfo = new StoreInfo();
|
|
StoreInfo storeInfo = new StoreInfo();
|
|
|
storeInfo.setId(businessId);
|
|
storeInfo.setId(businessId);
|
|
|
- storeInfo.setScoreAvg(0.0);
|
|
|
|
|
- storeInfo.setScoreOne(0.0);
|
|
|
|
|
- storeInfo.setScoreTwo(0.0);
|
|
|
|
|
- storeInfo.setScoreThree(0.0);
|
|
|
|
|
|
|
+ storeInfo.setScoreAvg(3.0);
|
|
|
|
|
+ storeInfo.setScoreOne(3.0);
|
|
|
|
|
+ storeInfo.setScoreTwo(3.0);
|
|
|
|
|
+ storeInfo.setScoreThree(3.0);
|
|
|
storeInfoMapper.updateById(storeInfo);
|
|
storeInfoMapper.updateById(storeInfo);
|
|
|
- log.info("店铺无有效评价,重置评分为0,businessId={}", businessId);
|
|
|
|
|
|
|
+ log.info("店铺无有效评价,重置评分为3.0,businessId={}", businessId);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|