Browse Source

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

huangzhiguo 2 years ago
parent
commit
bc7ddcf7db

+ 2 - 0
src/main/java/com/caimei365/commodity/mapper/PageMapper.java

@@ -484,4 +484,6 @@ public interface PageMapper {
     String getHelpContent(Integer helpId);
 
     List<String> findLabels(String labelIds);
+
+    String findKeyWordId(String labelId);
 }

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

@@ -21,6 +21,10 @@ public class BaikeProductVo implements Serializable {
      * 关联标签库回显
      */
     private List<String> labels;
+    /**
+     * 关联标签库
+     */
+    private String labelStrs;
     /**
      * 关联标签库id
      */

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

@@ -1565,6 +1565,17 @@ public class PageServiceImpl implements PageService {
             Date date = new Date();
             baikeProductVo.setPublishTime(date);
         }
+        String[] labelIds = StringUtils.split(baikeProductVo.getLabelIds(), ",");
+        String labelStr = "";
+        if (null != labelIds && labelIds.length > 0) {
+            for (int i = 0; i < labelIds.length; i++) {
+                labelStr += pageMapper.findKeyWordId(labelIds[i]);
+                if (i != 5) {
+                    labelStr += "##";
+                }
+            }
+        }
+        baikeProductVo.setLabelStrs(labelStr);
         pageMapper.upEntryInfo(baikeProductVo);
         //删除概述图片(视频)/信息栏/正文信息
         pageMapper.delImageListByEntryId(baikeProductVo.getId());//图片
@@ -1632,6 +1643,17 @@ public class PageServiceImpl implements PageService {
             Date date = new Date();
             baikeProductVo.setPublishTime(date);
         }
+        String[] labelIds = StringUtils.split(baikeProductVo.getLabelIds(), ",");
+        String labelStr = "";
+        if (null != labelIds && labelIds.length > 0) {
+            for (int i = 0; i < labelIds.length; i++) {
+                labelStr += pageMapper.findKeyWordId(labelIds[i]);
+                if (i != 5) {
+                    labelStr += "##";
+                }
+            }
+        }
+        baikeProductVo.setLabelStrs(labelStr);
         //新增词条信息
         pageMapper.insertEntryInfo(baikeProductVo);
         //保存新的概述图册

+ 12 - 6
src/main/resources/mapper/PageMapper.xml

@@ -1335,7 +1335,7 @@
             name=#{name},
             discription=#{discription},
             typeId=#{typeId},
-            auditStatus  =1,
+            auditStatus =1,
             onlineStatus=1,
             status=#{status},
             publishTime=#{publishTime},
@@ -1345,16 +1345,17 @@
             publishSource=#{publishSource},
             shopId=#{shopId},
             seoKeyword=#{seoKeyword},
-            labelIds = #{labelIds}
+            labelIds = #{labelIds},
+            relatedLabels = #{labelStrs}
         where id = #{id}
     </update>
 
     <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)
+         alias, image, seoKeyword, publishSource, shopId, labelIds, relatedLabels)
         values (#{commodityType}, #{name}, #{discription}, #{typeId}, 0, 1, 1, #{status}, #{publishTime}, NOW(),
-                #{alias}, #{image}, #{seoKeyword}, #{publishSource}, #{shopId}, #{labelIds})
+                #{alias}, #{image}, #{seoKeyword}, #{publishSource}, #{shopId}, #{labelIds}, #{labelStrs})
     </insert>
 
     <delete id="delImageListByEntryId">
@@ -1431,7 +1432,12 @@
         select keyword
         from cm_user_search_frequency
         where trueStatus = 1
-        and delStatus = 1
-        and id in (#{labelIds})
+          and delStatus = 1
+          and id in (#{labelIds})
+    </select>
+    <select id="findKeyWordId" resultType="java.lang.String">
+        select keyword
+        from cm_user_search_frequency
+        where id = #{id}
     </select>
 </mapper>