|
@@ -388,11 +388,19 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
wrapper.eq(CommonRating::getIsShow, 1);
|
|
wrapper.eq(CommonRating::getIsShow, 1);
|
|
|
List<CommonRating> commonRatings = commonRatingMapper.selectList(wrapper);
|
|
List<CommonRating> commonRatings = commonRatingMapper.selectList(wrapper);
|
|
|
List<Long> collect = commonRatings.stream().map(x -> x.getId()).collect(Collectors.toList());
|
|
List<Long> collect = commonRatings.stream().map(x -> x.getId()).collect(Collectors.toList());
|
|
|
- // 查询没有回复的评价数量
|
|
|
|
|
- wrapper.eq(CommonRating::getDeleteFlag,0);
|
|
|
|
|
- wrapper.ge(CommonRating::getScore,0.5);
|
|
|
|
|
- wrapper.le(CommonRating::getScore,2.5);
|
|
|
|
|
- Integer noReplyCount = commonRatingMapper.getRatingWithNoReply(wrapper);
|
|
|
|
|
|
|
+ // 查询没有回复的差评数量(使用新 wrapper,避免复用导致条件累积问题)
|
|
|
|
|
+ // 注意:因为 deleteFlag 字段有 @TableLogic 注解,LambdaQueryWrapper.eq() 对该字段可能失效
|
|
|
|
|
+ // 而 getRatingWithNoReply 是自定义 XML 查询,不会自动补充逻辑删除条件
|
|
|
|
|
+ // 所以这里使用 .apply() 直接写 SQL 条件,确保 delete_flag = 0 生效
|
|
|
|
|
+ LambdaQueryWrapper<CommonRating> noReplyWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ noReplyWrapper.eq(CommonRating::getBusinessId, businessId);
|
|
|
|
|
+ noReplyWrapper.eq(CommonRating::getBusinessType, businessType);
|
|
|
|
|
+ noReplyWrapper.eq(CommonRating::getAuditStatus, 1);
|
|
|
|
|
+ noReplyWrapper.eq(CommonRating::getIsShow, 1);
|
|
|
|
|
+ noReplyWrapper.apply("delete_flag = 0");
|
|
|
|
|
+ noReplyWrapper.ge(CommonRating::getScore, 0.5);
|
|
|
|
|
+ noReplyWrapper.le(CommonRating::getScore, 2.5);
|
|
|
|
|
+ Integer noReplyCount = commonRatingMapper.getRatingWithNoReply(noReplyWrapper);
|
|
|
|
|
|
|
|
// 如果为空直接返回
|
|
// 如果为空直接返回
|
|
|
Map<String, Object> ratingCount = new HashMap<>();
|
|
Map<String, Object> ratingCount = new HashMap<>();
|