From 015f6921c0cc90566eb46b3bed48e7d71714ca61 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期二, 29 七月 2025 11:46:43 +0800
Subject: [PATCH] 订单查询问题

---
 framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
index da35abc..8de5366 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
@@ -4,6 +4,7 @@
 import cn.lili.cache.CachePrefix;
 import cn.lili.common.properties.RocketmqCustomProperties;
 import cn.lili.common.security.context.UserContext;
+import cn.lili.common.utils.CommonUtil;
 import cn.lili.elasticsearch.EsSuffix;
 import cn.lili.modules.lmk.constant.RedisKeyExpireConstant;
 import cn.lili.modules.lmk.domain.dto.VideoEsUpdateDTO;
@@ -46,6 +47,7 @@
 import org.springframework.data.elasticsearch.core.SearchHits;
 import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
 import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import lombok.RequiredArgsConstructor;
 import cn.lili.utils.PageUtil;
@@ -54,6 +56,8 @@
 import org.springframework.util.Assert;
 
 import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -423,6 +427,12 @@
             page.getRecords().forEach(v -> {
                 v.setTagList(tagMap.get(v.getId()));
                 v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverUrl()));
+                v.getGoodsList().forEach(goods ->{
+                    if (StringUtils.isNotBlank(goods.getThumbnail())&&!goods.getThumbnail().contains("http")) {
+                        goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
+                    }
+
+                });
             });
         }
         return Result.ok().data(page.getRecords()).total(page.getTotal());
@@ -547,6 +557,16 @@
         switch (query.getVideoFrom()) {
             case "recommend":// 鍔犺浇鎺ㄨ崘瑙嗛
                 baseMapper.recommendVideo(page, query);
+                //鎺ㄨ崘瑙嗛閲嶆柊鎺掑簭
+                WxVideoVO wxVideoVO = null;
+                if (StringUtils.isNotBlank(query.getVideoId())) {
+                    wxVideoVO  = baseMapper.recommendVideoByVideoId(query);
+                }
+                List<WxVideoVO> records = page.getRecords();
+                Collections.shuffle(records);
+                if (wxVideoVO!=null) {
+                    records.set(0, wxVideoVO);
+                }
                 break;
             case "author":  // 鍔犺浇瑙嗛涓婚〉鎴戝彂甯冪殑瑙嗛
                 AuthorVideoQuery query1 = new AuthorVideoQuery();

--
Gitblit v1.8.0