소스 검색

Merge branch 'developerA' of http://git.caimei365.com/chao/caimei-caimei365-www into developerA

yuwenjun 4 년 전
부모
커밋
0d51a70e46

+ 23 - 2
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -1,8 +1,10 @@
 package com.caimei.www.controller.unlimited;
 
 import com.caimei.www.controller.BaseController;
+import com.caimei.www.pojo.page.PageContent;
 import com.caimei.www.pojo.page.ProductDetail;
 import com.caimei.www.service.page.ProductService;
+import com.caimei.www.service.page.SinglePageService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -34,11 +36,18 @@ public class ProductController extends BaseController {
 
     private ProductService productService;
 
+    private SinglePageService singlePageService;
+
     @Autowired
     public void setProductService(ProductService productService) {
         this.productService = productService;
     }
 
+    @Autowired
+    public void setSinglePageService(SinglePageService singlePageService) {
+        this.singlePageService = singlePageService;
+    }
+
     /**
      * 商品分类列表/搜索结果 页面
      */
@@ -73,7 +82,11 @@ public class ProductController extends BaseController {
      * 仪器页
      */
     @GetMapping("/product/instrument.html")
-    public String instrument() {
+    public String instrument(Integer id) {
+        Integer pageId = singlePageService.getInstrumentPageIdById(id);
+        if (pageId == null) {
+            return super.errorPath();
+        }
         return INSTRUMENT_PAGE_PATH;
     }
 
@@ -81,7 +94,11 @@ public class ProductController extends BaseController {
      * 美体节活动页
      */
     @GetMapping("/product/temporary.html")
-    public String temporary() {
+    public String temporary(Integer id) {
+        Integer pageId = singlePageService.getInstrumentPageIdById(id);
+        if (pageId == null) {
+            return super.errorPath();
+        }
         return TEMPORARY_PAGE_PATH;
     }
 
@@ -115,6 +132,10 @@ public class ProductController extends BaseController {
      */
     @GetMapping("activity/activityTopic.html")
     public String activityTopic(final Model model, Integer id) {
+        Integer pageId = singlePageService.getActivityPageIdById(id);
+        if (pageId == null) {
+            return super.errorPath();
+        }
         model.addAttribute("pageId", id);
         return ACTIVITY_TOP_PATH;
     }

+ 8 - 0
src/main/java/com/caimei/www/mapper/SinglePageDao.java

@@ -90,4 +90,12 @@ public interface SinglePageDao {
      */
     String findMobileContent(Integer id);
 
+    /**
+     * 产品仪器页
+     */
+    Integer getInstrumentPageIdById(Integer id);
+    /**
+     * 活动专题页
+     */
+    Integer getActivityPageIdById(Integer id);
 }

+ 9 - 3
src/main/java/com/caimei/www/service/page/SinglePageService.java

@@ -3,8 +3,6 @@ package com.caimei.www.service.page;
 import com.caimei.www.pojo.JsonModel;
 import com.caimei.www.pojo.page.ImageLink;
 import com.caimei.www.pojo.page.PageContent;
-import com.caimei.www.pojo.page.PageFloor;
-import com.github.pagehelper.PageInfo;
 import org.springframework.http.server.reactive.ServerHttpResponse;
 import reactor.core.publisher.Mono;
 
@@ -30,5 +28,13 @@ public interface SinglePageService {
     Mono<Void> downloadByWriteWith(ServerHttpResponse response) throws UnsupportedEncodingException, FileNotFoundException;
     /** 获取讲师列表 */
     JsonModel<List<ImageLink>> getLiveTeachers();
-
+    /**
+     * 产品仪器页
+     * @return
+     */
+    Integer getInstrumentPageIdById(Integer id);
+    /**
+     * 活动专题页
+     */
+    Integer getActivityPageIdById(Integer id);
 }

+ 18 - 6
src/main/java/com/caimei/www/service/page/impl/SinglePageServiceImpl.java

@@ -4,11 +4,7 @@ import com.caimei.www.mapper.SinglePageDao;
 import com.caimei.www.pojo.JsonModel;
 import com.caimei.www.pojo.page.ImageLink;
 import com.caimei.www.pojo.page.PageContent;
-import com.caimei.www.pojo.page.PageFloor;
 import com.caimei.www.service.page.SinglePageService;
-import com.caimei.www.utils.ImageUtil;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
@@ -16,7 +12,6 @@ import org.springframework.http.MediaType;
 import org.springframework.http.ZeroCopyHttpOutputMessage;
 import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 import reactor.core.publisher.Mono;
 
@@ -24,7 +19,6 @@ import javax.annotation.Resource;
 import java.io.File;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
-import java.text.SimpleDateFormat;
 import java.util.List;
 
 /**
@@ -107,4 +101,22 @@ public class SinglePageServiceImpl implements SinglePageService {
         return JsonModel.success(teacherList);
     }
 
+    @Override
+    public Integer getInstrumentPageIdById(Integer id) {
+        if (id == null) {
+            return null;
+        }
+        Integer pageId = singlePageDao.getInstrumentPageIdById(id);
+        return pageId;
+    }
+
+    @Override
+    public Integer getActivityPageIdById(Integer id) {
+        if (id == null) {
+            return null;
+        }
+        Integer pageId = singlePageDao.getActivityPageIdById(id);
+        return pageId;
+    }
+
 }

+ 13 - 0
src/main/resources/mapper/SinglePageMapper.xml

@@ -76,4 +76,17 @@
         SELECT content FROM cm_page_freedom WHERE pageId = #{id} AND type = 2
     </select>
 
+    <select id="getInstrumentPageIdById" resultType="java.lang.Integer">
+        select id from cm_page a
+        where
+            a.type=5 and a.enabledStatus=1
+            and a.id=#{id}
+    </select>
+    <select id="getActivityPageIdById" resultType="java.lang.Integer">
+        select id from cm_page a
+        where
+            a.type=6 and a.enabledStatus=1
+          and a.id=#{id}
+    </select>
+
 </mapper>

+ 1 - 1
src/main/resources/static/js/product/qualityauthorize.js

@@ -55,7 +55,7 @@ var qualityAuthorize = new Vue({
                 this.isCmComtent = true;
                 this.cmContent = `
                 <p>目前,在市面上经常发现不少伪劣医疗美容产品/仪器,让众多的消费者无法辨别产品/仪器的真假,并且给品牌方及品牌代理商造成不少困扰</p>
-                <p>为了提高消费者对产品/仪器的可信度。由美信息技术有限公司发起并提供技术支持,且得到各品牌与代理商的认可及授权后,共同打造正品
+                <p>为了提高消费者对产品/仪器的可信度。由美信息技术有限公司发起并提供技术支持,且得到各品牌与代理商的认可及授权后,共同打造正品
                 联盟平台。将产品/仪器的品牌授牌信息纳入到正品联盟平台。消费者可通过授权牌上二维码扫码得知该产品/仪器的品牌授权信息。通过这些信
                 息即可得知产品/仪器的真假,是否为品牌以及品牌代理商授权过的正品,从而解决消费者与品牌/品牌代理商的困扰。</p>
                 `;

BIN
target/www-0.0.1-SNAPSHOT.jar