Browse Source

Merge remote-tracking branch 'origin/sit' into uat-20260202

dujian 1 week ago
parent
commit
23e5831c6f

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreInfo.java

@@ -371,4 +371,8 @@ public class StoreInfo {
     @TableField("alipay_smid")
     private String alipaySmid;
 
+//    @ApiModelProperty(value = "评价首次突破10条  状态为1   未突破为 0  默认为0")
+//    @TableField("break_ten")
+//    private Integer breakTen;
+
 }

+ 1 - 1
alien-store/src/main/java/shop/alien/store/controller/PerformanceListController.java

@@ -33,7 +33,7 @@ public class PerformanceListController {
      * 查询演出列表(用户端)
      * <p>
      * 根据店铺ID查询演出列表,支持分页
-     * 只返回审核通过、已上线、未删除的演出
+     * 只返回当前店铺下已上线、未删除的演出(无审核/过期等额外筛选)
      * 返回结果包含演出名称、演出者信息、日期范围、演出时间安排等
      * </p>
      *

+ 4 - 3
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -1867,10 +1867,11 @@ public class StoreInfoController {
 
         map.put("showPriceCard", hasPriceListData(storeId));
         map.put("showStaffCard", hasStaffData(storeId));
-
-        if (isLeisure) {
+        map.put("showPerformance", hasPerformanceData(storeId));
+        // yan chu quan yao,zuo you nao hu bo,wu di le ☺.
+/*        if (isLeisure || isFood) {
             map.put("showPerformance", hasPerformanceData(storeId));
-        }
+        }*/
         if (isLifeService) {
             map.put("showFacilityServiceCard", hasFacilityData(storeId));
         }

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/PerformanceListService.java

@@ -18,7 +18,7 @@ public interface PerformanceListService {
      * 查询演出列表(用户端)
      * <p>
      * 根据店铺ID查询演出列表,支持分页
-     * 只返回审核通过、已上线、未删除的演出
+     * 只返回当前店铺下已上线、未删除的演出
      * </p>
      *
      * @param page    分页页数,必须大于0

+ 4 - 2
alien-store/src/main/java/shop/alien/store/service/StoreCommentAppealSupplementJobService.java

@@ -45,6 +45,7 @@ public class StoreCommentAppealSupplementJobService {
     private final CommonCommentMapper commonCommentMapper;
     private final LifeLikeRecordMapper lifeLikeRecordMapper;
     private final StoreInfoMapper storeInfoMapper;
+    private final CommonRatingService commonRatingService;
 
     @Value("${third-party-user-name.base-url}")
     private String userName;
@@ -393,8 +394,9 @@ public class StoreCommentAppealSupplementJobService {
         try {
             CommonRating rating = commonRatingMapper.selectById(ratingId);
             if (rating != null) {
-                int rows = commonRatingMapper.logicDeleteById(ratingId);
-                log.info("【用户补充申诉】删除评价,ratingId={},影响行数={}", ratingId, rows);
+//                int rows = commonRatingMapper.logicDeleteById(ratingId);
+                commonRatingService.updateStoreScoreAfterDelete(rating.getBusinessId());
+                log.info("【用户补充申诉】删除评价,ratingId={}", ratingId);
             }
 
             LambdaQueryWrapper<CommonComment> commentQueryWrapper = new LambdaQueryWrapper<>();

+ 11 - 2
alien-store/src/main/java/shop/alien/store/service/impl/CommonRatingServiceImpl.java

@@ -671,7 +671,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                     }
                     
                     if (totalIssuedCount > 0) {
-                        log.info("CommonRatingService 好评送券汇总:总发放数量={}, 活动数={}, userId={}, storeId={}",
+                        log.info("CommonRatingService 好评=送券汇总:总发放数量={}, 活动数={}, userId{}, storeId={}",
                                 totalIssuedCount, activities.size(), commonRating.getUserId(), businessId);
                     }
                 } catch (Exception ex) {
@@ -1223,6 +1223,10 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                    .eq(CommonRating::getIsShow, 1)
                    .eq(CommonRating::getAuditStatus, 1);
             List<CommonRating> ratings = commonRatingMapper.selectList(wrapper);
+
+           StoreInfo  storeInfoNew=storeInfoMapper.getStoreInfo(businessId);
+
+
             
             int total = ratings.size();
 
@@ -1245,6 +1249,10 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
             }
 
             if (commentCount < 10) {
+
+                if (storeInfoNew.getScoreAvg()==0.0){
+                    return;
+                }
                 // 没有评价,设置默认评分为0
                 StoreInfo storeInfo = new StoreInfo();
                 storeInfo.setId(businessId);
@@ -1256,7 +1264,8 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
                 log.info("店铺有效评价被删除<10条,重置评分为3.5,businessId={}", businessId);
                 return;
             }
-            
+
+
             // 计算平均评分
             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();

+ 19 - 3
alien-store/src/main/java/shop/alien/store/service/impl/PerformanceListServiceImpl.java

@@ -90,8 +90,8 @@ public class PerformanceListServiceImpl implements PerformanceListService {
         // 构建分页对象
         IPage<BarPerformance> performancePage = new Page<>(page, size);
 
-        // 构建查询条件
-        LambdaQueryWrapper<BarPerformance> queryWrapper = buildQueryWrapper(storeId);
+        // 构建查询条件:仅店铺 + 已上线
+        LambdaQueryWrapper<BarPerformance> queryWrapper = buildOnlineListQueryWrapper(storeId);
 
         // 执行查询
         IPage<BarPerformance> result = barPerformanceMapper.selectPage(performancePage, queryWrapper);
@@ -132,7 +132,23 @@ public class PerformanceListServiceImpl implements PerformanceListService {
     }
 
     /**
-     * 构建查询条件
+     * 构建用户端列表查询条件(/performance/list/query)
+     * 仅查询指定店铺下已上线、未删除的演出,不做审核/过期等额外筛选
+     *
+     * @param storeId 店铺ID
+     * @return 查询条件包装器
+     */
+    private LambdaQueryWrapper<BarPerformance> buildOnlineListQueryWrapper(Integer storeId) {
+        LambdaQueryWrapper<BarPerformance> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(BarPerformance::getStoreId, storeId)
+                .eq(BarPerformance::getDeleteFlag, CommonConstant.DELETE_FLAG_UNDELETE)
+                .eq(BarPerformance::getOnlineStatus, CommonConstant.PERFORMANCE_ONLINE_STATUS_ONLINE)
+                .orderByDesc(BarPerformance::getCreatedTime);
+        return queryWrapper;
+    }
+
+    /**
+     * 构建查询条件(按日期分组等场景:含审核通过、未过期等筛选)
      *
      * @param storeId 店铺ID
      * @return 查询条件包装器

+ 6 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreCommentAppealServiceImpl.java

@@ -35,6 +35,7 @@ import shop.alien.entity.store.vo.StoreCommentAppealVo;
 import shop.alien.entity.store.vo.WebSocketVo;
 import shop.alien.mapper.*;
 import shop.alien.store.config.WebSocketProcess;
+import shop.alien.store.service.CommonRatingService;
 import shop.alien.store.service.StoreCommentAppealService;
 import shop.alien.store.util.FileUploadUtil;
 import shop.alien.store.util.ai.AiAuthTokenUtil;
@@ -101,6 +102,8 @@ public class StoreCommentAppealServiceImpl extends ServiceImpl<StoreCommentAppea
 
     private final RestTemplate restTemplate;
 
+    private final CommonRatingService commonRatingService;
+
     @Value("${third-party-ai-analyze.base-url}")
     private String analyzeUrl;
 
@@ -1093,8 +1096,9 @@ public class StoreCommentAppealServiceImpl extends ServiceImpl<StoreCommentAppea
             // 1. 删除评价(逻辑删除 common_rating 表)
             CommonRating rating = commonRatingMapper.selectById(ratingId);
             if (rating != null) {
-                int rows = commonRatingMapper.logicDeleteById(ratingId);
-                log.info("删除评价结果,ratingId={},影响行数={}", ratingId, rows);
+                commonRatingService.updateStoreScoreAfterDelete(rating.getBusinessId());
+//                int rows = commonRatingMapper.logicDeleteById(ratingId);
+                log.info("删除评价结果,ratingId={},影响行数={}", ratingId);
             }
             
             // 2. 查询该评价下的所有评论ID(用于后续删除点赞记录)