Forráskód Böngészése

bugfix:人员评价,店铺评价,

刘云鑫 2 hónapja
szülő
commit
1ed9d0ab14

+ 6 - 0
alien-entity/src/main/resources/mapper/StoreStaffReviewMapper.xml

@@ -134,6 +134,7 @@
         SELECT COUNT(*)
         FROM store_staff_review
         WHERE staff_user_id = #{staffUserId}
+          AND audit_status = 1
         AND delete_flag = 0
     </select>
 
@@ -143,6 +144,7 @@
         SELECT COUNT(*)
         FROM store_staff_review
         WHERE staff_user_id = #{staffUserId}
+          AND audit_status = 1
         AND delete_flag = 0
         AND overall_rating IS NOT NULL
         AND overall_rating >= 4.5
@@ -156,6 +158,7 @@
         SELECT COUNT(*)
         FROM store_staff_review
         WHERE staff_user_id = #{staffUserId}
+          AND audit_status = 1
         AND delete_flag = 0
         AND overall_rating IS NOT NULL
         AND overall_rating >= 3
@@ -169,6 +172,7 @@
         SELECT COUNT(*)
         FROM store_staff_review
         WHERE staff_user_id = #{staffUserId}
+          AND audit_status = 1
         AND delete_flag = 0
         AND overall_rating IS NOT NULL
         AND overall_rating >= 0
@@ -181,6 +185,7 @@
         SELECT COUNT(*)
         FROM store_staff_review
         WHERE staff_user_id = #{staffUserId}
+          AND audit_status = 1
         AND delete_flag = 0
         AND review_images IS NOT NULL
         AND review_images != ''
@@ -233,6 +238,7 @@
             AND CONVERT(llr.dianzan_id, CHAR) = CONVERT(#{currentUserId}, CHAR)
             AND llr.delete_flag = 0
         WHERE ssr.delete_flag = 0
+        AND ssr.audit_status = 1
         AND ssr.staff_user_id = #{staffUserId}
         <if test="type != null">
             <choose>

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

@@ -102,7 +102,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
             // 一次遍历完成分类,避免多次流式处理
             Map<String, List<String>> urlCategoryMap = StoreRenovationRequirementServiceImpl.classifyUrls(Arrays.asList(commonRating.getImageUrls().split(",")));
             AiContentModerationUtil.AuditResult auditResult = aiContentModerationUtil.auditContent(commonRating.getContent(), urlCategoryMap.get("image"));
-            if (!auditResult.isPassed()) {
+            if (!auditResult.isPassed() &&( StringUtils.isNotEmpty(commonRating.getContent()) || urlCategoryMap.get("video").size() > 0)) {
                 // 审核不通过
                 CommonRating rating = this.getById(commonRating.getId());
                 rating.setAuditStatus(2);
@@ -339,6 +339,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
         LambdaQueryWrapper<CommonRating> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CommonRating::getBusinessId, businessId);
         wrapper.eq(CommonRating::getBusinessType, businessType);
+        wrapper.eq(CommonRating::getAuditStatus, 1);
         wrapper.eq(CommonRating::getIsShow, 1);
         List<CommonRating> commonRatings = commonRatingMapper.selectList(wrapper);
         List<Long> collect = commonRatings.stream().map(x -> x.getId()).collect(Collectors.toList());

+ 3 - 7
alien-store/src/main/java/shop/alien/store/service/impl/StoreStaffReviewServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -17,12 +18,7 @@ import shop.alien.entity.result.R;
 import shop.alien.entity.store.*;
 import shop.alien.entity.store.dto.StoreStaffReviewDto;
 import shop.alien.entity.store.vo.*;
-import shop.alien.mapper.LifeLikeRecordMapper;
-import shop.alien.mapper.StoreInfoMapper;
-import shop.alien.mapper.StoreStaffCommentMapper;
-import shop.alien.mapper.StoreStaffConfigMapper;
-import shop.alien.mapper.StoreStaffReviewMapper;
-import shop.alien.mapper.StoreUserMapper;
+import shop.alien.mapper.*;
 import shop.alien.store.service.StoreStaffCommentService;
 import shop.alien.store.service.StoreStaffReviewService;
 import shop.alien.store.util.ai.AiContentModerationUtil;
@@ -78,7 +74,7 @@ public class StoreStaffReviewServiceImpl extends ServiceImpl<StoreStaffReviewMap
         // 一次遍历完成分类,避免多次流式处理
         Map<String, List<String>> urlCategoryMap = StoreRenovationRequirementServiceImpl.classifyUrls(reviewDto.getReviewImages());
         AiContentModerationUtil.AuditResult auditResult = aiContentModerationUtil.auditContent(reviewDto.getReviewContent(), urlCategoryMap.get("image"));
-        if (!auditResult.isPassed()) {
+        if (!auditResult.isPassed() && (StringUtils.isNotEmpty(reviewDto.getReviewContent()) || urlCategoryMap.get("video").size() > 0)) {
             // 审核不通过
             StoreStaffReview staffReview = this.getById(review.getId());
             staffReview.setAuditStatus(2);