qinxuyang преди 2 часа
родител
ревизия
12a2366c51

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

@@ -110,5 +110,9 @@ public class CommonRating implements Serializable {
     @ApiModelProperty(value = "审核失败原因")
     @TableField(value = "audit_reason")
     private String auditReason;
+
+    @ApiModelProperty(value = "审核拒绝次数")
+    @TableField(value = "reject_num")
+    private Integer rejectNum;
 }
 

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/CommonRatingVo.java

@@ -42,4 +42,6 @@ public class CommonRatingVo extends CommonRating {
     private Integer appealStatus;
     @ApiModelProperty(name = "appealFlag", value = "是否已申诉:0-未申诉, 1-已申诉")
     private Integer appealFlag;
+    @ApiModelProperty(value = "审核拒绝次数")
+    private Integer rejectNum;
 }

+ 16 - 0
alien-store/src/main/java/shop/alien/store/service/StoreCommentAppealSupplementJobService.java

@@ -159,6 +159,10 @@ public class StoreCommentAppealSupplementJobService {
                     updateAppeal.setAppealStatus(1);
                     updateAppeal.setFinalResult("已驳回");
                     log.info("【用户补充申诉】用户赢,申诉驳回,申诉ID: {}", appeal.getId());
+                    Integer ratingId = appeal.getCommentId();
+                    if (ratingId != null) {
+                        incrementRatingRejectNum(ratingId);
+                    }
                 }
 
                 storeCommentAppealMapper.updateByRecordIdNew(appeal.getId(),
@@ -390,6 +394,18 @@ public class StoreCommentAppealSupplementJobService {
         return baseUrl + "/" + recordId + "/completed";
     }
 
+    private void incrementRatingRejectNum(Integer ratingId) {
+        try {
+            LambdaUpdateWrapper<CommonRating> wrapper = new LambdaUpdateWrapper<>();
+            wrapper.eq(CommonRating::getId, ratingId)
+                    .setSql("reject_num = IFNULL(reject_num, 0) + 1");
+            int rows = commonRatingMapper.update(null, wrapper);
+            log.info("【用户补充申诉】申诉失败,评价拒绝次数+1,ratingId={},影响行数={}", ratingId, rows);
+        } catch (Exception e) {
+            log.error("【用户补充申诉】更新评价拒绝次数失败,ratingId={}", ratingId, e);
+        }
+    }
+
     private void deleteRatingAndComments(Integer ratingId) {
         try {
             CommonRating rating = commonRatingMapper.selectById(ratingId);