|
@@ -449,6 +449,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
storeInfo.setScoreOne(new BigDecimal(scoreOne).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
storeInfo.setScoreOne(new BigDecimal(scoreOne).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
storeInfo.setScoreTwo(new BigDecimal(scoreTwo).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
storeInfo.setScoreTwo(new BigDecimal(scoreTwo).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
storeInfo.setScoreThree(new BigDecimal(scoreThree).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
storeInfo.setScoreThree(new BigDecimal(scoreThree).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
|
|
|
|
+ storeInfo.setBreakTen(1);
|
|
|
storeInfoMapper.updateById(storeInfo);
|
|
storeInfoMapper.updateById(storeInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -580,7 +581,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (totalIssuedCount > 0) {
|
|
if (totalIssuedCount > 0) {
|
|
|
- log.info("CommonRatingService 好评送券汇总:总发放数量={}, 活动数={}, userId={}, storeId={}",
|
|
|
|
|
|
|
+ log.info("CommonRatingService 好评=送券汇总:总发放数量={}, 活动数={}, userId{}, storeId={}",
|
|
|
totalIssuedCount, activities.size(), commonRating.getUserId(), businessId);
|
|
totalIssuedCount, activities.size(), commonRating.getUserId(), businessId);
|
|
|
}
|
|
}
|
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
@@ -1132,6 +1133,10 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
.eq(CommonRating::getIsShow, 1)
|
|
.eq(CommonRating::getIsShow, 1)
|
|
|
.eq(CommonRating::getAuditStatus, 1);
|
|
.eq(CommonRating::getAuditStatus, 1);
|
|
|
List<CommonRating> ratings = commonRatingMapper.selectList(wrapper);
|
|
List<CommonRating> ratings = commonRatingMapper.selectList(wrapper);
|
|
|
|
|
+
|
|
|
|
|
+ StoreInfo storeInfoNew=storeInfoMapper.getStoreInfo(businessId);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
int total = ratings.size();
|
|
int total = ratings.size();
|
|
|
|
|
|
|
@@ -1153,7 +1158,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (commentCount < 10) {
|
|
|
|
|
|
|
+ if (commentCount < 10 && storeInfoNew.getBreakTen()==1) {
|
|
|
// 没有评价,设置默认评分为0
|
|
// 没有评价,设置默认评分为0
|
|
|
StoreInfo storeInfo = new StoreInfo();
|
|
StoreInfo storeInfo = new StoreInfo();
|
|
|
storeInfo.setId(businessId);
|
|
storeInfo.setId(businessId);
|
|
@@ -1165,7 +1170,13 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
log.info("店铺有效评价被删除<10条,重置评分为3.5,businessId={}", businessId);
|
|
log.info("店铺有效评价被删除<10条,重置评分为3.5,businessId={}", businessId);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ //如果没到10条有效评价,则不更新评分,还继续为0
|
|
|
|
|
+ if (commentCount < 10) {
|
|
|
|
|
+ return ;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 计算平均评分
|
|
// 计算平均评分
|
|
|
double scoreSum = ratings.stream().mapToDouble(r -> r.getScore() != null ? r.getScore() : 0.0).sum();
|
|
double scoreSum = ratings.stream().mapToDouble(r -> r.getScore() != null ? r.getScore() : 0.0).sum();
|
|
|
double scoreOneSum = ratings.stream().mapToDouble(r -> r.getScoreOne() != null ? r.getScoreOne() : 0.0).sum();
|
|
double scoreOneSum = ratings.stream().mapToDouble(r -> r.getScoreOne() != null ? r.getScoreOne() : 0.0).sum();
|