|
|
@@ -28,6 +28,7 @@ import shop.alien.mapper.*;
|
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
|
import shop.alien.store.service.CommonCommentService;
|
|
|
import shop.alien.store.service.CommonRatingService;
|
|
|
+import shop.alien.store.service.LifeDiscountCouponStoreFriendService;
|
|
|
import shop.alien.store.util.CommonConstant;
|
|
|
import shop.alien.store.util.ai.AiContentModerationUtil;
|
|
|
import shop.alien.store.util.ai.AiVideoModerationUtil;
|
|
|
@@ -79,6 +80,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
@Qualifier("commonVideoTaskExecutor")
|
|
|
private final ExecutorService commonVideoTaskExecutor;
|
|
|
private final AiVideoModerationUtil aiVideoModerationUtil;
|
|
|
+ private final LifeDiscountCouponStoreFriendService lifeDiscountCouponStoreFriendService;
|
|
|
|
|
|
public static final List<String> SERVICES_LIST = ImmutableList.of(
|
|
|
TextReviewServiceEnum.COMMENT_DETECTION_PRO.getService(),
|
|
|
@@ -103,6 +105,17 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
commonRating.setScoreThree(parse.getDouble("scoreThree"));
|
|
|
}
|
|
|
int i = this.save(commonRating) ? 0 : 1;
|
|
|
+ if (i == 0 && commonRating.getBusinessType() != null && commonRating.getBusinessType() == RatingBusinessTypeEnum.STORE_RATING.getBusinessType()) {
|
|
|
+ Double score = commonRating.getScore();
|
|
|
+ if (score != null && score >= 4.5 && commonRating.getUserId() != null && commonRating.getBusinessId() != null) {
|
|
|
+ try {
|
|
|
+
|
|
|
+ lifeDiscountCouponStoreFriendService.issueCouponForGoodRating(Math.toIntExact(commonRating.getUserId()), commonRating.getBusinessId());
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.warn("CommonRatingService.saveCommonRating 好评送券异常 userId={}, storeId={}, msg={}", commonRating.getUserId(), commonRating.getBusinessId(), ex.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 一次遍历完成分类,避免多次流式处理
|
|
|
Map<String, List<String>> urlCategoryMap = StoreRenovationRequirementServiceImpl.classifyUrls(Arrays.asList(commonRating.getImageUrls().split(",")));
|
|
|
AiContentModerationUtil.AuditResult auditResult = new AiContentModerationUtil.AuditResult(true, "");
|