Browse Source

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

huangzhiguo 1 year ago
parent
commit
8236243af1

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

@@ -8,7 +8,6 @@ import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
-import org.springframework.web.bind.annotation.PostMapping;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -185,7 +184,7 @@ public interface PageMapper {
     /**
      * 获取头部菜单
      */
-    List<TopMenuVo> getTopMenus(Integer source);
+    List<TopMenuVo> getTopMenus(@Param("type") Integer type,@Param("source")Integer source);
 
     /**
      * 获取底部链接分类

+ 5 - 0
src/main/java/com/caimei365/commodity/model/vo/TopMenuVo.java

@@ -29,6 +29,11 @@ public class TopMenuVo implements Serializable {
      * 跳转链接
      */
     private String link;
+    /**
+     * 备注
+     */
+    private String remark;
+
 
     /**
      * 图标

+ 19 - 5
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -5,7 +5,6 @@ import com.aliyun.oss.OSSClientBuilder;
 import com.caimei365.commodity.components.PriceUtilService;
 import com.caimei365.commodity.mapper.*;
 import com.caimei365.commodity.model.ResponseJson;
-import com.caimei365.commodity.model.dto.Sku;
 import com.caimei365.commodity.model.po.*;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.vo.*;
@@ -21,14 +20,11 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.annotation.Resource;
-import java.net.URLDecoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Collectors;
 
 /**
@@ -241,7 +237,7 @@ public class PageServiceImpl implements PageService {
         }
         map.put("searchHotWord", searchHotWord);
         // 头部菜单
-        List<TopMenuVo> menuList = pageMapper.getTopMenus(source);
+        List<TopMenuVo> menuList = pageMapper.getTopMenus(0,source);
         menuList.forEach(item -> {
             String link = item.getLink();
             if (StringUtils.isNotBlank(link)) {
@@ -258,6 +254,24 @@ public class PageServiceImpl implements PageService {
             }
         });
         map.put("topMenuList", menuList);
+        // 快捷运营菜单
+        List<TopMenuVo> shortcutList = pageMapper.getTopMenus(2,source);
+        shortcutList.forEach(item -> {
+            String link = item.getLink();
+            if (StringUtils.isNotBlank(link)) {
+                if (source == 1) {
+                    if (link.contains("?")) {
+                        link = link + "&name=" + item.getName();
+                    } else {
+                        link = link + "?name=" + item.getName();
+                    }
+                }
+                item.setLinkType(AppletsLinkUtil.getLinkType(link));
+                item.setLinkParam(AppletsLinkUtil.getLinkParam(item.getLinkType(), link));
+                item.setLink(link);
+            }
+        });
+        map.put("shortcutList", shortcutList);
         // banner图
         List<ImageLinkVo> bannerImageList = pageMapper.getBannerImages();
         bannerImageList.forEach(image -> {

+ 7 - 1
src/main/java/com/caimei365/commodity/utils/AppletsLinkUtil.java

@@ -159,6 +159,10 @@ public class AppletsLinkUtil {
      * 招商入驻
      */
     public static final Pattern pattern46 = Pattern.compile("/supplier/attraction.html");
+    /**
+     * 快捷运营
+     */
+    public static final Pattern pattern47 = Pattern.compile("/quickOperation/operation-");
 
     /**
      * 根据链接判断链接类型
@@ -225,6 +229,8 @@ public class AppletsLinkUtil {
                 return 28;
             } else if (pattern45.matcher(link).find()) {
                 return 29;
+            } else if (pattern47.matcher(link).find()) {
+                return 30;
             } else {
                 return -1;
             }
@@ -253,7 +259,7 @@ public class AppletsLinkUtil {
                 split3 = split1[split1.length - 1].split("\\.");
             }
         }
-        if (linkType == 3 || linkType == 5 || linkType == 20 || linkType == 22 || linkType == 23 || linkType == 26 || linkType == 27) {
+        if (linkType == 3 || linkType == 5 || linkType == 20 || linkType == 22 || linkType == 23 || linkType == 26 || linkType == 27|| linkType == 30) {
             //-{id}.html
             if (split3 != null && split3.length == 2) {
                 map.put("id", split3[0]);

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

@@ -506,10 +506,16 @@
         id,
         navigationName as name,
         link,
+        remark,
         icon,
         sort
         from new_page_first_navigation
-        where delFlag = 0
+        where
+        delFlag = 0
+        <if test="type != null">
+            <if test="type == 0 ">and (type = 0 or type is null )</if>
+            <if test="type != 0 ">and type = #{type}</if>
+        </if>
         <if test="source == 1">
             and wwwEnabledStatus = 1
         </if>