From 37de2f51fe9cecc71e38e44c9c00eb4e58dcccb5 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 16 六月 2025 11:00:36 +0800
Subject: [PATCH] 视频列表、审核展示视频悬挂的商品

---
 framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoGoodsDetailVO.java  |   30 +++++++++++++++
 framework/src/main/resources/mapper/lmk/VideoMapper.xml                        |   34 ++++++++++++++--
 framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java             |   10 ----
 framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java |    2 
 4 files changed, 61 insertions(+), 15 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoGoodsDetailVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoGoodsDetailVO.java
new file mode 100644
index 0000000..e765747
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoGoodsDetailVO.java
@@ -0,0 +1,30 @@
+package cn.lili.modules.lmk.domain.vo;
+
+import cn.lili.base.AbsVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author锛歺p
+ * @date锛�2025/6/16 9:11
+ */
+@Data
+@ApiModel("瑙嗛鍟嗗搧璇︽儏")
+public class VideoGoodsDetailVO {
+
+    @ApiModelProperty("鍟嗗搧id")
+    private String goodsId;
+
+    @ApiModelProperty("鍟嗗搧鍚嶇О")
+    private String goodsName;
+
+    @ApiModelProperty("浠锋牸")
+    private String price;
+
+    @ApiModelProperty("缂╃暐鍥�")
+    private String thumbnail;
+
+    @ApiModelProperty("鍟嗗搧鏁伴噺")
+    private Integer goodsNum;
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java
index 8c217e8..0fc6690 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/VideoVO.java
@@ -67,15 +67,7 @@
 
     /** 鍟嗗搧id */
     @ApiModelProperty("鍟嗗搧id")
-    private String goodsId;
-
-    /** 鍟嗗搧鏌ョ湅娆℃暟 */
-    @ApiModelProperty("鍟嗗搧鏌ョ湅娆℃暟")
-    private Long goodsViewNum;
-
-    /** 鍟嗗搧涓嬪崟娆℃暟 */
-    @ApiModelProperty("鍟嗗搧涓嬪崟娆℃暟")
-    private Long goodsOrderNum;
+    private List<VideoGoodsDetailVO> goodsList;
 
     /** 鏄惁鎺ㄨ崘 */
     @ApiModelProperty("鏄惁鎺ㄨ崘")
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 4b5cbe6..9132498 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
@@ -216,7 +216,7 @@
         if (page.getTotal() > 0) {
             Map<String, List<SimpleVideoTagVO>> tagMap = videoTagRefService.getTagsByVideoIds(
                     page.getRecords().stream().map(VideoVO::getId).collect(Collectors.toList())
-            ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId));;
+            ).stream().collect(Collectors.groupingBy(SimpleVideoTagVO::getVideoId));
             // 3. 鑾峰彇瑙嗛涓存椂璁块棶鍦板潃銆佽缃棰戞爣绛�
             page.getRecords().forEach(v -> {
                 v.setTagList(tagMap.get(v.getId()));
diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
index f212216..d51fd28 100644
--- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
@@ -11,10 +11,7 @@
         <result column="video_file_key" property="videoFileKey" />
         <result column="video_fit" property="videoFit" />
         <result column="title" property="title" />
-        <result column="goods_id" property="goodsId" />
-        <result column="goods_view_num" property="goodsViewNum" />
         <result column="video_duration" property="videoDuration" />
-        <result column="goods_order_num" property="goodsOrderNum" />
         <result column="recommend" property="recommend" />
         <result column="status" property="status" />
         <result column="play_num" property="playNum" />
@@ -26,7 +23,36 @@
         <result column="video_content_type" property="videoContentType" />
         <result column="video_type" property="videoType" />
         <result column="video_imgs" property="videoImgs" />
+        <collection property="goodsList" column="id" select="getVideoGoods" ofType="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO">
+
+        </collection>
     </resultMap>
+
+    <resultMap id="VideoGoodsMap" type="cn.lili.modules.lmk.domain.vo.VideoGoodsDetailVO">
+        <result column="goods_id" property="goodsId"/>
+        <result column="goods_num" property="goodsNum"/>
+        <result column="goods_name" property="goodsName"/>
+        <result column="thumbnail" property="thumbnail"/>
+        <result column="price" property="price"/>
+    </resultMap>
+
+    <select id="getVideoGoods" parameterType="string" resultMap="VideoGoodsMap">
+        SELECT
+               LVG.goods_id,
+               LVG.goods_num,
+               LVG.order_num,
+               LG.goods_name,
+               LG.thumbnail,
+               LG.price
+        FROM
+             lmk_video_goods LVG
+             INNER JOIN li_goods LG ON LVG.goods_id = LG.id AND LG.market_enable = 'UPPER' AND LG.delete_flag = 0
+        WHERE
+             LVG.video_id = #{id} AND LVG.delete_flag = 0
+        ORDER BY
+            LVG.order_num ASC
+    </select>
+
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="KitchenVideoMap" type="cn.lili.modules.lmk.domain.vo.KitchenVideoVO">
         <id column="id" property="id"/>
@@ -36,7 +62,6 @@
         <result column="video_file_key" property="videoFileKey" />
         <result column="video_fit" property="videoFit" />
         <result column="title" property="title" />
-        <result column="goods_id" property="goodsId" />
         <result column="goods_view_num" property="goodsViewNum" />
         <result column="video_duration" property="videoDuration" />
         <result column="goods_order_num" property="goodsOrderNum" />
@@ -348,7 +373,6 @@
         <result column="video_fit" property="videoFit" />
         <result column="title" property="title" />
         <result column="video_duration" property="videoDuration" />
-        <result column="goods_id" property="goodsId" />
     </resultMap>
 
     <select id="wxDetail" resultMap="WxEditResultMap">

--
Gitblit v1.8.0