Bladeren bron

Merge remote-tracking branch 'origin/developerL' into developer

kaick 1 jaar geleden
bovenliggende
commit
6adb49fb72

+ 1 - 1
src/main/java/com/caimei365/commodity/model/po/CmPraiseStatistics.java

@@ -22,7 +22,7 @@ public class CmPraiseStatistics implements Serializable
     /**  */
     private String id;
 
-    /** 分类: 1 (cm_product_archive_content)美业资料 */
+    /** 分类: 1 (cm_product_archive_content)美业资料,2信息中心首页轮播图(cm_brand_landing)*/
     private String type;
 
     /** 归属者Id(type字段表Id) */

+ 4 - 0
src/main/java/com/caimei365/commodity/model/vo/BaikeImageVo.java

@@ -13,4 +13,8 @@ public class BaikeImageVo {
      * 图片
      */
     private String image;
+    /**
+     * 图片类型:1产品/仪器认证,2效果展示
+     */
+    private String type;
 }

+ 5 - 1
src/main/java/com/caimei365/commodity/model/vo/BaikeProductVo.java

@@ -6,7 +6,6 @@ import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * Description
@@ -37,6 +36,11 @@ public class BaikeProductVo implements Serializable {
      */
     private Integer commodityType;
 
+    /**
+     * banner
+     */
+    private String banner;
+
     /**
      * 产品/仪器图片
      */

+ 2 - 0
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -1747,6 +1747,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeImageVo> imageList = baikeProductVo.getImageList();
         if (null != imageList && imageList.size() > 0) {
             for (BaikeImageVo baikeImageVo : imageList) {
+                baikeImageVo.setType("2");
                 baikeImageVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertImage(baikeImageVo);
             }
@@ -1819,6 +1820,7 @@ public class PageServiceImpl implements PageService {
         List<BaikeImageVo> imageList = baikeProductVo.getImageList();
         if (null != imageList && imageList.size() > 0) {
             for (BaikeImageVo baikeImageVo : imageList) {
+                baikeImageVo.setType("2");
                 baikeImageVo.setEntryId(baikeProductVo.getId());
                 pageMapper.insertImage(baikeImageVo);
             }

+ 1 - 1
src/main/java/com/caimei365/commodity/service/impl/SearchQueryServiceImpl.java

@@ -396,7 +396,7 @@ public class SearchQueryServiceImpl implements SearchQueryService {
         String queryStr = "a_type:'" + id + "'";
         ArrayList<String> fetchFields = Lists.newArrayList("id", "a_id", "a_title", "a_image", "a_publisher", "a_publish_date", "a_intro", "a_pv", "a_type_id", "a_type_text", "a_label_ids", "a_label_text");
         // 阿里云搜索
-        String sort = null == sortType ?"a_id": "a_publish_date" ;
+        String sort = null == sortType ?"a_id": 1 == sortType ?"a_publish_date" :"a_pv";
         ResponseJson<String> result = scrollArticleForParams(queryStr, fetchFields, pageNum, pageSize, sort,  sortType);
         if (0 == result.getCode()) {
             return result;

+ 33 - 0
src/main/java/com/caimei365/commodity/utils/BeanUtil.java

@@ -0,0 +1,33 @@
+package com.caimei365.commodity.utils;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author :Kaick
+ * @date :Created in 2023/10/27
+ * @description:BeanUtil
+ */
+public class BeanUtil {
+
+    public static <T, S> T setValue(S source, Class<T> clazz) {
+        if (null == source) {
+            return null;
+        }
+        T target = BeanUtils.instantiate(clazz);
+        BeanUtils.copyProperties(source, target);
+        return target;
+    }
+
+    public static <T, S> List<T> setValues(List<S> sourceList, Class<T> target) {
+        if (CollectionUtils.isEmpty(sourceList)) {
+            return null;
+        }
+        List<T> targetList = new ArrayList<>(sourceList.size());
+        sourceList.forEach(s -> targetList.add(setValue(s, target)));
+        return targetList;
+    }
+}

+ 7 - 4
src/main/resources/mapper/PageMapper.xml

@@ -1223,6 +1223,7 @@
         p.publishTime,
         p.publishSource,
         p.shopId,
+        p.banner,
         p.image,
         t.name as typeName,
         p.addTime
@@ -1279,6 +1280,7 @@
                p.publishTime,
                p.addTime,
                p.alias,
+               p.banner,
                p.image,
                t.name     as typeName,
                p.publishSource,
@@ -1409,6 +1411,7 @@
             publishTime=#{publishTime},
             addTime=NOW(),
             alias=#{alias},
+            banner=#{banner},
             image=#{image},
             publishSource=#{publishSource},
             shopId=#{shopId},
@@ -1421,9 +1424,9 @@
     <insert id="insertEntryInfo" useGeneratedKeys="true" keyProperty="id">
         insert into cm_baike_product
         (commodityType, name, discription, typeId, actualPv, auditStatus, onlineStatus, status, publishTime, addTime,
-         alias, image, seoKeyword, publishSource, shopId, labelIds, relatedLabels)
+         alias,banner, image, seoKeyword, publishSource, shopId, labelIds, relatedLabels)
         values (#{commodityType}, #{name}, #{discription}, #{typeId}, 0, 1, 1, #{status}, #{publishTime}, NOW(),
-                #{alias}, #{image}, #{seoKeyword}, #{publishSource}, #{shopId}, #{labelIds}, #{labelStrs})
+                #{alias}, #{banner}, #{image}, #{seoKeyword}, #{publishSource}, #{shopId}, #{labelIds}, #{labelStrs})
     </insert>
 
     <delete id="delImageListByEntryId">
@@ -1457,8 +1460,8 @@
     </delete>
 
     <insert id="insertImage">
-        insert into cm_baike_product_image(productId, image)
-        values (#{entryId}, #{image})
+        insert into cm_baike_product_image(productId, image,type )
+        values (#{entryId}, #{image}, #{type})
     </insert>
 
     <insert id="insertVideo">

+ 2 - 3
src/main/resources/mapper/SearchMapper.xml

@@ -436,13 +436,12 @@
             </if>
         </where>
 
-        order by a.pubdate
         <if test="sortType != null">
             <if test="sortType == 1">
-                desc
+                order by a.pubdate desc
             </if>
             <if test="sortType != 1">
-                asc
+                order by  (IFNULL(c.pv, 0) +IFNULL(c.num, 0) + IFNULL(a.basePv, 0) + IFNULL(a.basePraise, 0))  desc
             </if>
         </if>