瀏覽代碼

商家申诉 AI审核通过 调用评分修改后的删除接口

qinxuyang 1 周之前
父節點
當前提交
b9b191b14f

+ 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(用于后续删除点赞记录)