From 2a7b0a64b14b22ec45f8a0f6e4764bc3cd16919c Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期一, 27 十月 2025 17:08:24 +0800
Subject: [PATCH] 调整

---
 framework/src/main/resources/mapper/lmk/MySubscribeMapper.xml                            |   28 +++++++++
 framework/src/main/resources/mapper/lmk/VideoMapper.xml                                  |   99 +++++++++++++++++++++++++++++---
 framework/src/main/java/cn/lili/modules/lmk/domain/form/WxVideoForm.java                 |    5 +
 framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java |    2 
 manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java           |   17 +++++
 framework/src/main/resources/mapper/lmk/PrizeDrawMapper.xml                              |    2 
 framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java           |    7 ++
 framework/src/main/java/cn/lili/modules/lmk/service/impl/MySubscribeServiceImpl.java     |    9 +++
 framework/src/main/resources/mapper/lmk/ScanPrizeMapper.xml                              |    2 
 9 files changed, 157 insertions(+), 14 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/WxVideoForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/WxVideoForm.java
index 4ef60fe..49480db 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/domain/form/WxVideoForm.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/WxVideoForm.java
@@ -42,6 +42,11 @@
 //    @NotBlank(message = "瑙嗛灏侀潰涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     private String cover;
 
+
+    @ApiModelProperty("鏉冮噸")
+//    @NotBlank(message = "鏉冮噸", groups = {Add.class, Update.class})
+    private Double weight;
+
     @ApiModelProperty("瑙嗛鍐呭绫诲瀷锛氳棰戙�佸浘鐗�")
     @NotBlank(message = "瑙嗛绫诲瀷涓嶈兘涓虹┖")
     private String videoContentType;
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MySubscribeServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MySubscribeServiceImpl.java
index 81e2c3c..e43f526 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MySubscribeServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MySubscribeServiceImpl.java
@@ -1,6 +1,8 @@
 package cn.lili.modules.lmk.service.impl;
 
 import cn.lili.common.security.context.UserContext;
+import cn.lili.common.utils.StringUtils;
+import cn.lili.utils.COSUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import cn.lili.modules.lmk.domain.entity.MySubscribe;
 import cn.lili.modules.lmk.mapper.MySubscribeMapper;
@@ -29,6 +31,7 @@
 
     private final MySubscribeMapper mySubscribeMapper;
 
+    private final COSUtil cosUtil;
     /**
      * 鍒嗛〉鏌ヨ
      * @param query
@@ -39,6 +42,12 @@
         query.setUserId(UserContext.getCurrentUserId());
         IPage<MySubscribeVO> page = PageUtil.getPage(query, MySubscribeVO.class);
         baseMapper.getPage(page, query);
+        page.getRecords().forEach(mySubscribeVO -> {
+            String subscribeUserAvatar = mySubscribeVO.getSubscribeUserAvatar();
+            if (StringUtils.isNotBlank(subscribeUserAvatar)&&!subscribeUserAvatar.contains("http")) {
+                mySubscribeVO.setSubscribeUserAvatar(cosUtil.getPreviewUrl(subscribeUserAvatar));
+            }
+        });
         return Result.ok().data(page.getRecords()).total(page.getTotal());
     }
 
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 6e7c7cb..c94ce90 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
@@ -989,6 +989,9 @@
         } else {
             vo.setLikeNum(0L);
         }
+        if (StringUtils.isNotBlank(vo.getAvatar())&&!vo.getAvatar().contains("http")) {
+            vo.setAvatar(cosUtil.getPreviewUrl(vo.getAvatar()));
+        }
         return Result.ok().data(vo);
     }
 
@@ -1016,7 +1019,9 @@
                 v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum()));
                 v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum()));
                 v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum()));
-                v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar()));
+                if (StringUtils.isNotBlank(v.getAuthorAvatar())&&!v.getAuthorAvatar().contains("http")) {
+                    v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar()));
+                }
                 if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) {
                     v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
                     v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey()));
diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
index b0a4a72..d4e174b 100644
--- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java
@@ -98,7 +98,9 @@
         }
         NativeSearchQueryBuilder searchQueryBuilder = createSearchQueryBuilder(searchDTO, pageVo);
         if (Objects.nonNull(searchDTO.getCanFilter()) && searchDTO.getCanFilter()) {
+            // 浣跨敤sn瀛楁鎺掑簭骞跺湪鎶樺彔鏃堕�夋嫨sn鏈�灏忕殑璁板綍
             searchQueryBuilder.withCollapseField("goodsId.keyword");
+            searchQueryBuilder.withSort(SortBuilders.fieldSort("sn.keyword").order(SortOrder.ASC));
         }
         NativeSearchQuery searchQuery = searchQueryBuilder.build();
         searchQuery.setTrackTotalHits(true);
diff --git a/framework/src/main/resources/mapper/lmk/MySubscribeMapper.xml b/framework/src/main/resources/mapper/lmk/MySubscribeMapper.xml
index 09fb7ec..1052b15 100644
--- a/framework/src/main/resources/mapper/lmk/MySubscribeMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/MySubscribeMapper.xml
@@ -29,6 +29,19 @@
     </select>
 
 
+<!--    <select id="getPage" resultMap="BaseResultMap">-->
+<!--        SELECT-->
+<!--            LMS.subscribe_user_id,-->
+<!--            LMS.id,-->
+<!--            LM.nick_name,-->
+<!--            LM.face-->
+<!--        FROM-->
+<!--            lmk_my_subscribe LMS-->
+<!--                LEFT JOIN li_member LM ON LMS.subscribe_user_id = LM.id-->
+<!--        WHERE-->
+<!--            LMS.delete_flag = 0 AND LMS.user_id = #{query.userId}-->
+<!--    </select> -->
+
     <select id="getPage" resultMap="BaseResultMap">
         SELECT
             LMS.subscribe_user_id,
@@ -39,7 +52,20 @@
             lmk_my_subscribe LMS
                 LEFT JOIN li_member LM ON LMS.subscribe_user_id = LM.id
         WHERE
-            LMS.delete_flag = 0 AND LMS.user_id = #{query.userId}
+            LM.id IS NOT NULL
+              and LMS.delete_flag = 0 AND LMS.user_id = #{query.userId}
+        UNION ALL
+        SELECT
+            LMS.subscribe_user_id,
+            LMS.id,
+            LM.nick_name,
+            LM.avatar face
+        FROM
+            lmk_my_subscribe LMS
+                LEFT JOIN li_admin_user LM ON LMS.subscribe_user_id = LM.id
+        WHERE
+            LM.id IS NOT NULL
+        and  LMS.delete_flag = 0 AND LMS.user_id = #{query.userId}
     </select>
 
     <select id="getSubscribesByUserId" parameterType="string" resultType="string">
diff --git a/framework/src/main/resources/mapper/lmk/PrizeDrawMapper.xml b/framework/src/main/resources/mapper/lmk/PrizeDrawMapper.xml
index b60831e..8fc6bbb 100644
--- a/framework/src/main/resources/mapper/lmk/PrizeDrawMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/PrizeDrawMapper.xml
@@ -57,6 +57,8 @@
         <if test="query.prizeType != null and query.prizeType != ''">
             AND LPD.prize_type = #{query.prizeType}
         </if>
+        order by
+        LPD.create_time DESC
     </select>
     <resultMap id="grantRecordMap" type="cn.lili.modules.lmk.domain.vo.GrantRecordVO">
     <result property="nickname" column="nick_name"/>
diff --git a/framework/src/main/resources/mapper/lmk/ScanPrizeMapper.xml b/framework/src/main/resources/mapper/lmk/ScanPrizeMapper.xml
index 43f18f9..573830b 100644
--- a/framework/src/main/resources/mapper/lmk/ScanPrizeMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/ScanPrizeMapper.xml
@@ -54,6 +54,8 @@
             lmk_scan_prize LSP
         WHERE
             LSP.delete_flag = 0
+        order by
+            LSP.create_time DESC
     </select>
     <resultMap id="getStorePrizeMap" type="cn.lili.modules.lmk.domain.vo.StorePrizeVO">
         <id column="id" property="id"/>
diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
index dc56251..6014df8 100644
--- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
@@ -230,6 +230,7 @@
             <if test="query.title != null and query.title != ''">AND LV.title LIKE CONCAT('%', #{query.title}, '%')</if>
             <if test="query.authorId != null and query.authorId != ''">AND LV.author_id = #{query.authorId}</if>
             <if test="query.status != null and query.status != ''">AND LV.status = #{query.status}</if>
+        order by LV.create_time DESC
     </select>
 
 <!-- todo 澶囦唤鍘熸湁鐨勫け鍘讳簡鏂囦欢-->
@@ -337,6 +338,7 @@
           AND LM.id IS NOT NULL
         ORDER BY
             recommend DESC,
+            weight DESC,
             create_time DESC
     </select>
     <select id="recommendVideoByVideoId" resultMap="WxResultMap">
@@ -661,8 +663,46 @@
             collection="videoIds" open="(" close=")" separator="," item="videoId">#{videoId}</foreach>
     </select>
 
+<!--    <select id="getAuthorVideoPage" resultMap="WxResultMap">-->
+<!--        SELECT-->
+<!--            LV.author_id,-->
+<!--            LV.cover_url,-->
+<!--            LV.video_fit,-->
+<!--            LV.video_duration,-->
+<!--            LV.video_file_key,-->
+<!--            LV.title,-->
+<!--            LV.goods_view_num,-->
+<!--            LV.goods_order_num,-->
+<!--            LV.recommend,-->
+<!--            LV.status,-->
+<!--            LV.play_num,-->
+<!--            LV.comment_num,-->
+<!--            LV.collect_num,-->
+<!--            LV.thumbs_up_num,-->
+<!--            LV.weight,-->
+<!--            LV.audit_pass_time,-->
+<!--            LV.update_time,-->
+<!--            LV.video_content_type,-->
+<!--            LV.video_type,-->
+<!--            LV.video_imgs,-->
+<!--            LV.id,-->
+<!--            LM.nick_name as authorName,-->
+<!--            LM.face as authorAvatar-->
+<!--        FROM-->
+<!--            lmk_video LV-->
+<!--                LEFT JOIN li_member LM ON LV.author_id = LM.id-->
+<!--        WHERE-->
+<!--            LV.delete_flag = 0-->
+<!--            <if test="!query.authorSelf">-->
+<!--                AND LV.status = '1'-->
+<!--            </if>-->
+<!--            AND LV.author_id = #{query.authorId}-->
+<!--            AND LV.video_type = #{query.videoType}-->
+<!--        ORDER BY-->
+<!--            LV.collect_num DESC-->
+<!--    </select>-->
     <select id="getAuthorVideoPage" resultMap="WxResultMap">
-        SELECT
+      select  * from (SELECT
             LV.author_id,
             LV.cover_url,
             LV.video_fit,
@@ -672,7 +712,7 @@
             LV.goods_view_num,
             LV.goods_order_num,
             LV.recommend,
-            LV.status,
+            LV.STATUS,
             LV.play_num,
             LV.comment_num,
             LV.collect_num,
@@ -684,20 +724,57 @@
             LV.video_type,
             LV.video_imgs,
             LV.id,
-            LM.nick_name as authorName,
-            LM.face as authorAvatar
+            LM.nick_name AS authorName,
+            LM.face AS authorAvatar
         FROM
             lmk_video LV
                 LEFT JOIN li_member LM ON LV.author_id = LM.id
         WHERE
-            LV.delete_flag = 0
-            <if test="!query.authorSelf">
-                AND LV.status = '1'
-            </if>
-            AND LV.author_id = #{query.authorId}
-            AND LV.video_type = #{query.videoType}
+        LV.delete_flag = 0
+        <if test="!query.authorSelf">
+            AND LV.status = '1'
+        </if>
+        AND LV.author_id = #{query.authorId}
+        AND LV.video_type = #{query.videoType}
+        and lm.id IS NOT NULL
+        UNION ALL
+        SELECT
+            LV.author_id,
+            LV.cover_url,
+            LV.video_fit,
+            LV.video_duration,
+            LV.video_file_key,
+            LV.title,
+            LV.goods_view_num,
+            LV.goods_order_num,
+            LV.recommend,
+            LV.STATUS,
+            LV.play_num,
+            LV.comment_num,
+            LV.collect_num,
+            LV.thumbs_up_num,
+            LV.weight,
+            LV.audit_pass_time,
+            LV.update_time,
+            LV.video_content_type,
+            LV.video_type,
+            LV.video_imgs,
+            LV.id,
+            LM.nick_name AS authorName,
+            LM.avatar AS authorAvatar
+        FROM
+            lmk_video LV
+                LEFT JOIN li_admin_user LM ON LV.author_id = LM.id
+        WHERE
+        LV.delete_flag = 0
+        <if test="!query.authorSelf">
+            AND LV.status = '1'
+        </if>
+        AND LV.author_id = #{query.authorId}
+        AND LV.video_type = #{query.videoType}
+        and   lm.id IS NOT NULL) t
         ORDER BY
-            LV.collect_num DESC
+        t.collect_num DESC
     </select>
 
     <select id="getAuthorCollectVideoPage" resultMap="WxResultMap">
diff --git a/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java
index 5417c94..c6b463f 100644
--- a/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java
+++ b/manager-api/src/main/java/cn/lili/controller/store/StoreManagerController.java
@@ -2,6 +2,7 @@
 
 import cn.lili.common.aop.annotation.DemoSite;
 import cn.lili.common.enums.ResultUtil;
+import cn.lili.common.utils.StringUtils;
 import cn.lili.common.vo.PageVO;
 import cn.lili.common.vo.ResultMessage;
 import cn.lili.modules.store.entity.dos.Store;
@@ -13,12 +14,14 @@
 import cn.lili.modules.store.entity.vos.StoreVO;
 import cn.lili.modules.store.service.StoreDetailService;
 import cn.lili.modules.store.service.StoreService;
+import cn.lili.utils.COSUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import jodd.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -47,6 +50,8 @@
     @Autowired
     private StoreDetailService storeDetailService;
 
+    @Autowired
+    private COSUtil cosUtil;
     @ApiOperation(value = "鑾峰彇搴楅摵鍒嗛〉鍒楄〃")
     @GetMapping("/all")
     public ResultMessage<List<Store>> getAll() {
@@ -64,7 +69,17 @@
     @GetMapping(value = "/get/detail/{storeId}")
     public ResultMessage<StoreDetailVO> detail(@PathVariable String storeId) {
         // todo 瀵逛簬鍒氭彁浜ゅ鏍哥殑淇℃伅闇�瑕佺瓑寰呯紦瀛樺け鏁堝悗鎵嶈兘鎿嶄綔,鍚﹀垯缂撳瓨淇℃伅杩樺湪
-        return ResultUtil.data(storeDetailService.getStoreDetailVO(storeId));
+        StoreDetailVO storeDetailVO = storeDetailService.getStoreDetailVO(storeId);
+        if (StringUtils.isNotBlank(storeDetailVO.getStoreLogo())&&!storeDetailVO.getStoreLogo().contains("http")) {
+            storeDetailVO.setStoreLogo(cosUtil.getPreviewUrl(storeDetailVO.getStoreLogo()));
+        }
+        if (StringUtils.isNotBlank(storeDetailVO.getLegalPhoto())&&!storeDetailVO.getLegalPhoto().contains("http")) {
+            storeDetailVO.setLegalPhoto(cosUtil.getPreviewUrl(storeDetailVO.getLegalPhoto()));
+        }
+        if (StringUtils.isNotBlank(storeDetailVO.getLicencePhoto())&&!storeDetailVO.getLicencePhoto().contains("http")) {
+            storeDetailVO.setLicencePhoto(cosUtil.getPreviewUrl(storeDetailVO.getLicencePhoto()));
+        }
+        return ResultUtil.data(storeDetailVO);
     }
 
     @ApiOperation(value = "娣诲姞搴楅摵")

--
Gitblit v1.8.0