zhijiezhao 2 лет назад
Родитель
Сommit
b0b770fe9d
31 измененных файлов с 452 добавлено и 960 удалено
  1. 71 76
      src/main/java/com/caimei/www/controller/authorized/document/DocumentAuthApi.java
  2. 14 12
      src/main/java/com/caimei/www/controller/unlimited/ArticleController.java
  3. 10 10
      src/main/java/com/caimei/www/controller/unlimited/HomeController.java
  4. 0 20
      src/main/java/com/caimei/www/mapper/AccountDao.java
  5. 6 3
      src/main/java/com/caimei/www/mapper/ArticleDao.java
  6. 0 2
      src/main/java/com/caimei/www/mapper/BaikeDao.java
  7. 0 4
      src/main/java/com/caimei/www/mapper/BaseDao.java
  8. 0 35
      src/main/java/com/caimei/www/mapper/CommonDao.java
  9. 40 40
      src/main/java/com/caimei/www/mapper/DocumentAuthDao.java
  10. 2 36
      src/main/java/com/caimei/www/mapper/HomeDao.java
  11. 0 20
      src/main/java/com/caimei/www/mapper/ProductDao.java
  12. 2 16
      src/main/java/com/caimei/www/mapper/SinglePageDao.java
  13. 0 68
      src/main/java/com/caimei/www/service/CommonServiceUtil.java
  14. 14 14
      src/main/java/com/caimei/www/service/page/DocumentAuthService.java
  15. 1 1
      src/main/java/com/caimei/www/service/page/HomeService.java
  16. 20 185
      src/main/java/com/caimei/www/service/page/impl/DocumentAuthServiceImpl.java
  17. 9 9
      src/main/java/com/caimei/www/service/page/impl/HomeServiceImpl.java
  18. 0 13
      src/main/resources/mapper/AccountMapper.xml
  19. 14 0
      src/main/resources/mapper/ArticleMapper.xml
  20. 9 0
      src/main/resources/mapper/BaikeMapper.xml
  21. 8 13
      src/main/resources/mapper/BaseMapper.xml
  22. 0 34
      src/main/resources/mapper/CommonMapper.xml
  23. 0 54
      src/main/resources/mapper/DocumentAuthMapper.xml
  24. 1 0
      src/main/resources/mapper/EquipmentMapper.xml
  25. 0 89
      src/main/resources/mapper/HomeMapper.xml
  26. 118 133
      src/main/resources/mapper/ProductMapper.xml
  27. 7 0
      src/main/resources/mapper/RepairMapper.xml
  28. 1 0
      src/main/resources/mapper/ShortLinkMapper.xml
  29. 82 57
      src/main/resources/mapper/SinglePageMapper.xml
  30. 21 15
      src/main/resources/mapper/SupplierMapper.xml
  31. 2 1
      src/main/resources/static/js/document/details.js

+ 71 - 76
src/main/java/com/caimei/www/controller/authorized/document/DocumentAuthApi.java

@@ -1,16 +1,14 @@
 package com.caimei.www.controller.authorized.document;
 
 import com.caimei.www.pojo.JsonModel;
-import com.caimei.www.pojo.document.OssAuthorization;
 import com.caimei.www.service.page.DocumentAuthService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.server.reactive.ServerHttpRequest;
-import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import reactor.core.publisher.Mono;
 
+import javax.annotation.Resource;
+
 /**
  * Description
  *
@@ -21,12 +19,9 @@ import reactor.core.publisher.Mono;
 @RequestMapping("/document")
 public class DocumentAuthApi {
 
+    @Resource
     private DocumentAuthService documentAuthService;
 
-    @Autowired
-    public void setDocumentAuthService(DocumentAuthService documentAuthService) {
-        this.documentAuthService = documentAuthService;
-    }
 
     /**
      * 获取图形验证码
@@ -46,81 +41,81 @@ public class DocumentAuthApi {
         }
         return documentAuthService.ossNote(mobile, imgCode, token);
     }
-
-    /**
-     * oss手机短信验证码登录
-     */
-    @PostMapping("/mobileCodeLogin")
-    public ResponseEntity<JsonModel> mobileCodeLogin(OssAuthorization authorization) {
-        return documentAuthService.mobileCodeLogin(authorization);
-    }
+//
+//    /**
+//     * oss手机短信验证码登录
+//     */
+//    @PostMapping("/mobileCodeLogin")
+//    public ResponseEntity<JsonModel> mobileCodeLogin(OssAuthorization authorization) {
+//        return documentAuthService.mobileCodeLogin(authorization);
+//    }
 
     /**
      * 资料列表
      */
-    @GetMapping("/dataList")
-    public Mono<JsonModel> dataList(@CookieValue(value = "authorizationMobile", required = false) String mobile, String name, Integer pageNum, Integer pageSize) {
-        Boolean isLogin = documentAuthService.getAuthorizationCookie(mobile);
-        if (!isLogin) {
-            return Mono.just(JsonModel.error(-99, "请登录"));
-        }
-        return documentAuthService.dataList(name, pageNum, pageSize);
-    }
-
-    /**
-     * 资料详情
-     */
-    @GetMapping("/dataDetails")
-    public Mono<JsonModel> dataDetails(@CookieValue(value = "authorizationMobile", required = false) String mobile, Integer pdfId) {
-        Boolean isLogin = documentAuthService.getAuthorizationCookie(mobile);
-        if (!isLogin) {
-            return Mono.just(JsonModel.error(-99, "请登录"));
-        }
-        if (pdfId == null) {
-            return Mono.just(JsonModel.error("参数异常"));
-        }
-        return documentAuthService.dataDetails(pdfId);
-    }
-
-    /**
-     * 更多资料
-     */
-    @GetMapping("/moreData")
-    public Mono<JsonModel> moreData(@CookieValue(value = "authorizationMobile", required = false) String mobile, Integer archiveId) {
-        Boolean isLogin = documentAuthService.getAuthorizationCookie(mobile);
-        if (!isLogin) {
-            return Mono.just(JsonModel.error(-99, "请登录"));
-        }
-        if (archiveId == null) {
-            return Mono.just(JsonModel.error("参数异常"));
-        }
-        return documentAuthService.moreData(archiveId);
-    }
-
-
-    /**
-     * 文件下载
-     */
-    @GetMapping("/downFile")
-    public Mono<Void> downFile(Integer pdfId, ServerHttpRequest request, ServerHttpResponse response) {
-        return documentAuthService.downFile(pdfId, request, response);
-    }
-
-    /**
-     * 定时删除服务器本地文件
-     */
-    //@Scheduled(cron = "0 0 1 * * ?")
-    //@GetMapping("deleteFile")
-    public void deleteFile() {
-        documentAuthService.deleteFile();
-    }
+//    @GetMapping("/dataList")
+//    public Mono<JsonModel> dataList(@CookieValue(value = "authorizationMobile", required = false) String mobile, String name, Integer pageNum, Integer pageSize) {
+//        Boolean isLogin = documentAuthService.getAuthorizationCookie(mobile);
+//        if (!isLogin) {
+//            return Mono.just(JsonModel.error(-99, "请登录"));
+//        }
+//        return documentAuthService.dataList(name, pageNum, pageSize);
+//    }
+//
+//    /**
+//     * 资料详情
+//     */
+//    @GetMapping("/dataDetails")
+//    public Mono<JsonModel> dataDetails(@CookieValue(value = "authorizationMobile", required = false) String mobile, Integer pdfId) {
+//        Boolean isLogin = documentAuthService.getAuthorizationCookie(mobile);
+//        if (!isLogin) {
+//            return Mono.just(JsonModel.error(-99, "请登录"));
+//        }
+//        if (pdfId == null) {
+//            return Mono.just(JsonModel.error("参数异常"));
+//        }
+//        return documentAuthService.dataDetails(pdfId);
+//    }
+//
+//    /**
+//     * 更多资料
+//     */
+//    @GetMapping("/moreData")
+//    public Mono<JsonModel> moreData(@CookieValue(value = "authorizationMobile", required = false) String mobile, Integer archiveId) {
+//        Boolean isLogin = documentAuthService.getAuthorizationCookie(mobile);
+//        if (!isLogin) {
+//            return Mono.just(JsonModel.error(-99, "请登录"));
+//        }
+//        if (archiveId == null) {
+//            return Mono.just(JsonModel.error("参数异常"));
+//        }
+//        return documentAuthService.moreData(archiveId);
+//    }
+//
+//
+//    /**
+//     * 文件下载
+//     */
+//    @GetMapping("/downFile")
+//    public Mono<Void> downFile(Integer pdfId, ServerHttpRequest request, ServerHttpResponse response) {
+//        return documentAuthService.downFile(pdfId, request, response);
+//    }
+//
+//    /**
+//     * 定时删除服务器本地文件
+//     */
+//    //@Scheduled(cron = "0 0 1 * * ?")
+//    //@GetMapping("deleteFile")
+//    public void deleteFile() {
+//        documentAuthService.deleteFile();
+//    }
 
     /**
      * 文件下载
      */
-    @GetMapping("/downFileAll")
-    public Mono<JsonModel> downFileAll(Integer pdfId) {
-        return documentAuthService.downFileAll(pdfId);
-    }
+//    @GetMapping("/downFileAll")
+//    public Mono<JsonModel> downFileAll(Integer pdfId) {
+//        return documentAuthService.downFileAll(pdfId);
+//    }
 
 }

+ 14 - 12
src/main/java/com/caimei/www/controller/unlimited/ArticleController.java

@@ -32,7 +32,9 @@ import java.util.List;
 @Controller
 public class ArticleController extends BaseController {
 
-    /** 错误页面 */
+    /**
+     * 错误页面
+     */
     private static final String ERROR_PATH = "article/error";
     private static final String ARTICLE_LIST_PATH = "article/list";
     private static final String ARTICLE_DETAIL_PATH = "article/detail";
@@ -52,7 +54,7 @@ public class ArticleController extends BaseController {
         List<BaseLink> data = articleService.getArticleLabels().getData();
         List<ImageLink> Ads = articleService.getLastestInfoAds().getData();
         model.addAttribute("ads", Ads);
-        model.addAttribute("labels",data);
+        model.addAttribute("labels", data);
         model.addAttribute("articleType", typeList);
         model.addAttribute("typeId", id);
         model.addAttribute("labelId", 0);
@@ -70,7 +72,7 @@ public class ArticleController extends BaseController {
         List<BaseLink> data = articleService.getArticleLabels().getData();
         List<ImageLink> Ads = articleService.getLastestInfoAds().getData();
         model.addAttribute("ads", Ads);
-        model.addAttribute("labels",data);
+        model.addAttribute("labels", data);
         model.addAttribute("articleType", typeList);
         model.addAttribute("typeId", 0);
         model.addAttribute("labelId", id);
@@ -88,7 +90,7 @@ public class ArticleController extends BaseController {
         List<BaseLink> data = articleService.getArticleLabels().getData();
         List<ImageLink> Ads = articleService.getLastestInfoAds().getData();
         model.addAttribute("ads", Ads);
-        model.addAttribute("labels",data);
+        model.addAttribute("labels", data);
         model.addAttribute("articleType", typeList);
         model.addAttribute("typeId", 0);
         model.addAttribute("labelId", 0);
@@ -104,7 +106,7 @@ public class ArticleController extends BaseController {
     public String toArticleDetail(@PathVariable("id") Integer id, final Model model, ServerWebExchange serverWebExchange, ServerHttpResponse response) {
         List<BaseLink> typeList = articleService.getArticleTypes();
         Article article = articleService.getArticleInfo(id);
-        if(article == null){
+        if (article == null) {
             // return super.errorPath();
             return "redirect:/info/404.html";
         }
@@ -132,26 +134,26 @@ public class ArticleController extends BaseController {
         source = source(referer);
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         String format = dateFormat.format(new Date());
-        articleService.insertRecord(ip,subReferer,source,format);
-        log.info("文章详情访问来源记录完成========》"+source);
+        articleService.insertRecord(ip, subReferer, source, format);
+        log.info("文章详情访问来源记录完成========》" + source);
         List<BaseLink> data = articleService.getArticleLabels().getData();
         List<ImageLink> Ads = articleService.getLastestInfoAds().getData();
-        List<Article> articles=articleService.getInfoById(id);
+        List<Article> articles = articleService.getInfoById(id);
         String relatedLabels = articleService.relatedLabel(id);
-        model.addAttribute("articles",articles);
+        model.addAttribute("articles", articles);
         model.addAttribute("ads", Ads);
-        model.addAttribute("labels",data);
+        model.addAttribute("labels", data);
         model.addAttribute("article", article);
         model.addAttribute("articleType", typeList);
         model.addAttribute("articleId", id);
         model.addAttribute("relatedLabels", relatedLabels);
-        model.addAttribute("typeId", (article!=null ? article.getTypeId() : 0));
+        model.addAttribute("typeId", (article != null ? article.getTypeId() : 0));
         model.addAttribute("labelId", 0);
         return ARTICLE_DETAIL_PATH;
     }
 
     /**
-     *  404
+     * 404
      */
     @GetMapping("/info/404.html")
     public String errorPage(final Model model) {

+ 10 - 10
src/main/java/com/caimei/www/controller/unlimited/HomeController.java

@@ -104,16 +104,16 @@ public class HomeController extends BaseController {
         model.addAttribute("msg", "腾讯公益");
         return SEARCH_CHILDREN;
     }
-
-    /**
-     * 首页左侧广告图
-     * @return
-     */
-    @GetMapping("/home/advertising")
-    @ResponseBody
-    public JsonModel<List<ImageLink>> getAdvertising() {
-        return homeService.getAdvertising();
-    }
+//
+//    /**
+//     * 首页左侧广告图
+//     * @return
+//     */
+//    @GetMapping("/home/advertising")
+//    @ResponseBody
+//    public JsonModel<List<ImageLink>> getAdvertising() {
+//        return homeService.getAdvertising();
+//    }
 
 
     private String source(String link) {

+ 0 - 20
src/main/java/com/caimei/www/mapper/AccountDao.java

@@ -1,20 +0,0 @@
-package com.caimei.www.mapper;
-
-import com.caimei.www.pojo.account.Account;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * Description
- *
- * @author : Charles
- * @date : 2020/7/24
- */
-@Mapper
-public interface AccountDao {
-    /**
-     * 根据Id查找用户
-     * @param userId
-     * @return
-     */
-    Account getUserById(Integer userId);
-}

+ 6 - 3
src/main/java/com/caimei/www/mapper/ArticleDao.java

@@ -81,12 +81,14 @@ public interface ArticleDao {
 
     /**
      * 文章点赞
+     *
      * @param infoId
      */
     void articleLike(Integer infoId);
 
     /**
      * 根据文章标签查找标签Id
+     *
      * @param labelTexts
      * @return
      */
@@ -94,16 +96,17 @@ public interface ArticleDao {
 
     /**
      * 文章浏览量增加
+     *
      * @param infoId
      */
     void articlePv(Integer infoId);
 
     String getLabelById(Integer id);
 
-    List<Article> getArticleRelatedLimit(@Param("id")Integer id, @Param("labels")String[] strings);
+    List<Article> getArticleRelatedLimit(@Param("id") Integer id, @Param("labels") String[] strings);
 
-    String relatedLabel(@Param("id")Integer id);
+    String relatedLabel(@Param("id") Integer id);
 
     void insertRecord(@Param("IP") String IP, @Param("referer") String referer,
-                      @Param("accessSource") String accessSource,@Param("accessTime") String accessTime,@Param("pageType") String pageType);
+                      @Param("accessSource") String accessSource, @Param("accessTime") String accessTime, @Param("pageType") String pageType);
 }

+ 0 - 2
src/main/java/com/caimei/www/mapper/BaikeDao.java

@@ -42,7 +42,6 @@ public interface BaikeDao {
 
     List<BaikeProduct> getAutoRecommendList(Integer publishSource, @Param("shopId") Integer shopId, @Param("typeId") Integer typeId, @Param("productId") Integer productId);
 
-
     List<BaikeProductVo> getAuthUserList(Integer typeId);
 
     List<BaikeHotSearch> getHotWords();
@@ -65,6 +64,5 @@ public interface BaikeDao {
 
     BaikeTypeVo geTypeListByid(Integer typeId);
 
-
     void initializationPV(Integer productId);
 }

+ 0 - 4
src/main/java/com/caimei/www/mapper/BaseDao.java

@@ -25,10 +25,6 @@ public interface BaseDao {
      * 获取头部菜单
      */
     List<TopMenu> getTopMenus();
-    /**
-     * 获取二级菜单
-     */
-    List<SubMenu> getSubMenus(@Param("topId") Integer topId);
 
     /**
      * 获取底部链接分类

+ 0 - 35
src/main/java/com/caimei/www/mapper/CommonDao.java

@@ -1,35 +0,0 @@
-package com.caimei.www.mapper;
-
-import com.caimei.www.pojo.order.ActivityPrice;
-import com.caimei.www.pojo.order.LadderPrice;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * Description
- *
- * @author : Charles
- * @date : 2020/7/28
- */
-@Mapper
-public interface CommonDao {
-
-    /**
-     * 根据商品ID查询活动价
-     * @return
-     */
-    ActivityPrice getActivityPriceByProductId(Integer productId);
-
-    /**
-     * 根据商品ID查询阶梯价
-     * @return
-     */
-    List<LadderPrice> getladderPricesByProductId(Integer productId);
-    /**
-     * 根据商品ID和用户ID 查询复购价
-     * @return
-     */
-    Double getRepurchasePrice(@Param("productId") Integer productId, @Param("userId") Integer userId);
-}

+ 40 - 40
src/main/java/com/caimei/www/mapper/DocumentAuthDao.java

@@ -15,44 +15,44 @@ import java.util.List;
  */
 @Mapper
 public interface DocumentAuthDao {
-
-    /**
-     * 判断手机号是否有权限
-     *
-     * @param mobile
-     * @return
-     */
-    OssAuthorization findOssAuthorizationByMobile(String mobile);
-
-    /**
-     * 查询资料列表
-     *
-     * @param name 商品名称,资料库名称,资料名称
-     * @return
-     */
-    List<OssArchive> findOssArchive(String name);
-
-    /**
-     * 查询该资料库下的所有文件
-     *
-     * @param archiveId 资料库id
-     * @return
-     */
-    List<OssArchivePdf> findOssArchivePdf(Integer archiveId);
-
-    /**
-     * 查询该文件资料
-     *
-     * @param pdfId
-     * @return
-     */
-    OssArchivePdf findOssArchivePdfById(Integer pdfId);
-
-    /**
-     * 根据id获取资料库
-     *
-     * @param archiveId
-     * @return
-     */
-    OssArchive getOssArchive(Integer archiveId);
+//
+//    /**
+//     * 判断手机号是否有权限
+//     *
+//     * @param mobile
+//     * @return
+//     */
+//    OssAuthorization findOssAuthorizationByMobile(String mobile);
+//
+//    /**
+//     * 查询资料列表
+//     *
+//     * @param name 商品名称,资料库名称,资料名称
+//     * @return
+//     */
+//    List<OssArchive> findOssArchive(String name);
+//
+//    /**
+//     * 查询该资料库下的所有文件
+//     *
+//     * @param archiveId 资料库id
+//     * @return
+//     */
+//    List<OssArchivePdf> findOssArchivePdf(Integer archiveId);
+//
+//    /**
+//     * 查询该文件资料
+//     *
+//     * @param pdfId
+//     * @return
+//     */
+//    OssArchivePdf findOssArchivePdfById(Integer pdfId);
+//
+//    /**
+//     * 根据id获取资料库
+//     *
+//     * @param archiveId
+//     * @return
+//     */
+//    OssArchive getOssArchive(Integer archiveId);
 }

+ 2 - 36
src/main/java/com/caimei/www/mapper/HomeDao.java

@@ -1,8 +1,6 @@
 package com.caimei.www.mapper;
 
-import com.caimei.www.pojo.page.PageFloor;
 import com.caimei.www.pojo.page.ImageLink;
-import com.caimei.www.pojo.page.ProductList;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -20,40 +18,8 @@ public interface HomeDao {
      * 首页轮播
      */
     List<ImageLink> getHomeBanners();
-    /**
-     * 首页左侧广告图
-     */
-    List<ImageLink> getAdvertising();
 
     void insertRecord(@Param("IP") String IP, @Param("referer") String referer,
-                     @Param("accessSource") String accessSource,@Param("accessTime") String accessTime,@Param("pageType") String pageType);
-//    /**
-//     * 首页楼层
-//     */
-//    List<PageFloor> getHomePageFloor();
-//    /**
-//     * 大专题二级楼层
-//     */
-//    List<PageFloor> getHomeBigTopicFloor();
-//    /**
-//     * 首页推荐专区
-//     */
-//    List<ProductList> getRecommendeds();
-//    /**
-//     * type6大专题数据列表
-//     */
-//    List<ImageLink> getBigTopicData(@Param("topId") Integer topId);
-//    /**
-//     * type4商品专题
-//     */
-//    List<ImageLink> getCommodityTopicData();
-//    /**
-//     * type5小专题
-//     */
-//    List<ImageLink> getSmallTopicData();
-//    /**
-//     * type3优质供应商
-//     */
-//    List<ImageLink> getSuppliersTopData();
-
+                      @Param("accessSource") String accessSource, @Param("accessTime") String accessTime,
+                      @Param("pageType") String pageType);
 }

+ 0 - 20
src/main/java/com/caimei/www/mapper/ProductDao.java

@@ -54,26 +54,6 @@ public interface ProductDao {
      */
     List<String> getProductDetailImages(Integer productId);
 
-    /**
-     * 详情-价格
-     *
-     * @param productId
-     * @return
-     */
-    CartItem getPriceItemById(Integer productId);
-
-
-    /**
-     * 下面的用完即删
-     */
-    List<Bigtype> findBigtype();
-
-    List<SmallType> findSmalltype();
-    /**
-     * 修复商品图片(临时)
-     */
-    List<String> getProductInfo();
-
     Integer getRecommendType(Integer productId);
 
     List<Sku> findSkus(Integer productId);

+ 2 - 16
src/main/java/com/caimei/www/mapper/SinglePageDao.java

@@ -33,22 +33,6 @@ public interface SinglePageDao {
      */
     PageContent getTopicPageById(Integer id);
 
-    /**
-     * 二级专题楼层
-     *
-     * @param id
-     * @return
-     */
-    List<PageFloor> getFloorByPageId(Integer id);
-
-    /**
-     * 二级专题楼层下的数据
-     *
-     * @param floorId
-     * @return
-     */
-    List<ImageLink> getDataByFloorId(Integer floorId);
-
     /**
      * 采美直播
      *
@@ -94,7 +78,9 @@ public interface SinglePageDao {
      * 产品仪器页
      */
     Integer getInstrumentPageIdById(Integer id);
+
     String getPageTitleById(Integer id);
+
     /**
      * 活动专题页
      */

+ 0 - 68
src/main/java/com/caimei/www/service/CommonServiceUtil.java

@@ -1,68 +0,0 @@
-package com.caimei.www.service;
-
-import com.caimei.www.mapper.CommonDao;
-import com.caimei.www.pojo.order.ActivityPrice;
-import com.caimei.www.pojo.order.CartItem;
-import com.caimei.www.pojo.order.LadderPrice;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.stream.IntStream;
-
-/**
- * Description
- *
- * @author : Charles
- * @date : 2020/7/28
- */
-@Service
-public class CommonServiceUtil {
-    @Resource
-    private CommonDao commonDao;
-    /**
-     * 设置购物车商品价格
-     * @param cartItem
-     * @param userId
-     */
-    public void setCartItemPrice(CartItem cartItem, Integer userId) {
-        // 活动价
-        ActivityPrice activity = commonDao.getActivityPriceByProductId(cartItem.getProductId());
-        if (null != activity) {
-            cartItem.setPrice(activity.getPrice());
-            cartItem.setActivityFlag(1);
-            cartItem.setLadderFlag(0);
-        } else if (cartItem.getLadderFlag() == 1) {
-            // 阶梯价
-            List<LadderPrice> ladderPrices = commonDao.getladderPricesByProductId(cartItem.getProductId());
-            if (!CollectionUtils.isEmpty(ladderPrices)){
-                IntStream.range(0, ladderPrices.size()).forEach(i->{
-                    boolean isThisLadder;
-                    if (i == ladderPrices.size()-1) {
-                        ladderPrices.get(i).setMaxNum(0);
-                        isThisLadder = (cartItem.getNumber()>ladderPrices.get(i).getBuyNum());
-                    } else {
-                        ladderPrices.get(i).setMaxNum(ladderPrices.get(i+1).getBuyNum());
-                        isThisLadder = (cartItem.getNumber()>ladderPrices.get(i).getBuyNum() && cartItem.getNumber()<ladderPrices.get(i).getMaxNum());
-                    }
-                    if (isThisLadder){
-                        cartItem.setPrice(ladderPrices.get(i).getBuyPrice());
-                    }
-                });
-                cartItem.setMin(ladderPrices.get(0).getBuyNum());
-                cartItem.setLadderPrices(ladderPrices);
-            } else {
-                cartItem.setLadderFlag(0);
-            }
-        } else {
-            // 复购价
-            Double repurchase = commonDao.getRepurchasePrice(cartItem.getProductId(), userId);
-            if (null != repurchase && repurchase>0) {
-                cartItem.setPrice(repurchase);
-            }
-        }
-    }
-}
-
-

+ 14 - 14
src/main/java/com/caimei/www/service/page/DocumentAuthService.java

@@ -21,7 +21,7 @@ public interface DocumentAuthService {
      * @param authorizationMobile cookie中的数据
      * @return
      */
-    Boolean getAuthorizationCookie(String authorizationMobile);
+//    Boolean getAuthorizationCookie(String authorizationMobile);
 
     /**
      * 获取图形验证码
@@ -44,7 +44,7 @@ public interface DocumentAuthService {
      * @param authorization 用户信息
      * @return
      */
-    ResponseEntity<JsonModel> mobileCodeLogin(OssAuthorization authorization);
+//    ResponseEntity<JsonModel> mobileCodeLogin(OssAuthorization authorization);
 
     /**
      * 资料列表
@@ -54,7 +54,7 @@ public interface DocumentAuthService {
      * @param pageSize 分页参数
      * @return
      */
-    Mono<JsonModel> dataList(String name, Integer pageNum, Integer pageSize);
+//    Mono<JsonModel> dataList(String name, Integer pageNum, Integer pageSize);
 
     /**
      * 资料详情
@@ -62,7 +62,7 @@ public interface DocumentAuthService {
      * @param pdfId 文件id
      * @return
      */
-    Mono<JsonModel> dataDetails(Integer pdfId);
+//    Mono<JsonModel> dataDetails(Integer pdfId);
 
     /**
      * 更多资料
@@ -70,7 +70,7 @@ public interface DocumentAuthService {
      * @param archiveId 资料库id
      * @return
      */
-    Mono<JsonModel> moreData(Integer archiveId);
+//    Mono<JsonModel> moreData(Integer archiveId);
 
 
     /**
@@ -79,14 +79,14 @@ public interface DocumentAuthService {
      * @param pdfId 文件id
      * @return
      */
-    Mono<Void> downFile(Integer pdfId, ServerHttpRequest request, ServerHttpResponse response);
+//    Mono<Void> downFile(Integer pdfId, ServerHttpRequest request, ServerHttpResponse response);
+//
+//    /**
+//     * 定时删除服务器文件
+//     *
+//     * @return
+//     */
+//    void deleteFile();
 
-    /**
-     * 定时删除服务器文件
-     *
-     * @return
-     */
-    void deleteFile();
-
-    Mono<JsonModel> downFileAll(Integer pdfId);
+//    Mono<JsonModel> downFileAll(Integer pdfId);
 }

+ 1 - 1
src/main/java/com/caimei/www/service/page/HomeService.java

@@ -28,7 +28,7 @@ public interface HomeService {
     /**
      * 首页左侧广告图
      */
-    JsonModel<List<ImageLink>> getAdvertising();
+//    JsonModel<List<ImageLink>> getAdvertising();
 
     /**
      * 右侧侧边栏数据

+ 20 - 185
src/main/java/com/caimei/www/service/page/impl/DocumentAuthServiceImpl.java

@@ -3,26 +3,14 @@ package com.caimei.www.service.page.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.aliyun.oss.OSS;
 import com.aliyun.oss.OSSClientBuilder;
-import com.aliyun.oss.model.GetObjectRequest;
-import com.aliyun.oss.model.OSSObject;
-import com.caimei.www.mapper.DocumentAuthDao;
 import com.caimei.www.pojo.JsonModel;
-import com.caimei.www.pojo.document.CookieBuilder;
-import com.caimei.www.pojo.document.OssArchive;
 import com.caimei.www.pojo.document.OssArchivePdf;
-import com.caimei.www.pojo.document.OssAuthorization;
 import com.caimei.www.service.page.DocumentAuthService;
 import com.caimei.www.service.redis.RedisService;
-import com.caimei.www.utils.ImageUtil;
 import com.caimei.www.utils.RandomCodeGenerator;
 import com.caimei.www.utils.VerifyCodeUtils;
-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.*;
-import org.springframework.http.server.reactive.ServerHttpRequest;
-import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.stereotype.Service;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
@@ -31,16 +19,12 @@ import org.springframework.web.client.RestTemplate;
 import reactor.core.publisher.Mono;
 
 import javax.annotation.Resource;
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
+
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -52,8 +36,6 @@ import java.util.Map;
 @Slf4j
 @Service
 public class DocumentAuthServiceImpl implements DocumentAuthService {
-    @Resource
-    private DocumentAuthDao documentAuthDao;
 
     @Resource
     private RedisService redisService;
@@ -79,14 +61,7 @@ public class DocumentAuthServiceImpl implements DocumentAuthService {
     @Value("${caimei.coreServer}")
     private String coreServer;
 
-    @Override
-    public Boolean getAuthorizationCookie(String authorizationMobile) {
-        if (!StringUtils.isEmpty(authorizationMobile)) {
-            OssAuthorization ossAuthorization = documentAuthDao.findOssAuthorizationByMobile(authorizationMobile);
-            return ossAuthorization != null;
-        }
-        return false;
-    }
+
 
     @Override
     public Mono<JsonModel> getImgVerifyCode() {
@@ -144,72 +119,6 @@ public class DocumentAuthServiceImpl implements DocumentAuthService {
         return Mono.just(JsonModel.error("验证码不正确"));
     }
 
-    @Override
-    public ResponseEntity<JsonModel> mobileCodeLogin(OssAuthorization authorization) {
-        HttpHeaders headers = new HttpHeaders();
-        if (StringUtils.isEmpty(authorization.getMobile()) || StringUtils.isEmpty(authorization.getCode())) {
-            return new ResponseEntity<>(JsonModel.error("参数异常"), headers, HttpStatus.OK);
-        }
-        String mobileCode = (String) redisService.get(authorization.getMobile() + ":mobileCode");
-        if (!StringUtils.isEmpty(mobileCode) && authorization.getCode().equals(mobileCode)) {
-            OssAuthorization ossAuthorization = documentAuthDao.findOssAuthorizationByMobile(authorization.getMobile());
-            if (ossAuthorization != null) {
-                String cookie = new CookieBuilder().setKey("authorizationMobile")
-                        .setValue(authorization.getMobile())
-                        .setMaxAge(60 * 60 * 24 * 30 * 1000L)
-                        .setPath("/")
-                        .build();
-                headers.add("Set-Cookie", cookie);
-                return new ResponseEntity<>(JsonModel.success(), headers, HttpStatus.OK);
-            } else {
-                return new ResponseEntity<>(JsonModel.error(-2, "登录失败,您可能没有查看资料的权限"), headers, HttpStatus.OK);
-            }
-        } else {
-            return new ResponseEntity<>(JsonModel.error("短信验证码不正确"), headers, HttpStatus.OK);
-        }
-    }
-
-    @Override
-    public Mono<JsonModel> dataList(String name, Integer pageNum, Integer pageSize) {
-        pageNum = pageNum == null ? 1 : pageNum;
-        pageSize = pageSize == null ? 20 : pageSize;
-        PageHelper.startPage(pageNum, pageSize);
-        List<OssArchive> ossArchiveList = documentAuthDao.findOssArchive(name);
-        PageInfo<OssArchive> pageInfo = null;
-        if (ossArchiveList != null && ossArchiveList.size() > 0) {
-            for (OssArchive ossArchive : ossArchiveList) {
-                if (!StringUtils.isEmpty(ossArchive.getMainImage())) {
-                    ossArchive.setMainImage(ImageUtil.getImageURL("product", ossArchive.getMainImage(), 0, domain));
-                }
-                List<OssArchivePdf> pdfList = documentAuthDao.findOssArchivePdf(ossArchive.getId());
-                if (pdfList != null && pdfList.size() > 0) {
-                    pdfList.forEach(this::setOssArchivePdfUrl);
-                    ossArchive.setIsShowDowns(false);
-                } else {
-                    ossArchive.setIsShowDowns(true);
-                }
-                ossArchive.setPdfList(pdfList);
-            }
-            pageInfo = new PageInfo<>(ossArchiveList);
-        }
-        return Mono.just(JsonModel.success(pageInfo));
-    }
-
-    @Override
-    public Mono<JsonModel> dataDetails(Integer pdfId) {
-        Map<String, Object> map = new HashMap<>(2);
-        OssArchivePdf ossArchivePdf = documentAuthDao.findOssArchivePdfById(pdfId);
-        setOssArchivePdfUrl(ossArchivePdf);
-        OssArchive ossArchive = documentAuthDao.getOssArchive(ossArchivePdf.getArchiveId());
-        if (!StringUtils.isEmpty(ossArchive.getMainImage())) {
-            ossArchive.setMainImage(ImageUtil.getImageURL("product", ossArchive.getMainImage(), 0, domain));
-        }
-        map.put("ossArchivePdf", ossArchivePdf);
-        map.put("ossArchive", ossArchive);
-
-        return Mono.just(JsonModel.success(map));
-    }
-
 
     /**
      * 设置预览链接
@@ -238,96 +147,22 @@ public class DocumentAuthServiceImpl implements DocumentAuthService {
         ossClient.shutdown();
     }
 
-    @Override
-    public Mono<JsonModel> moreData(Integer archiveId) {
-        OssArchive ossArchive = documentAuthDao.getOssArchive(archiveId);
-        if (ossArchive != null) {
-            if (!StringUtils.isEmpty(ossArchive.getMainImage())) {
-                ossArchive.setMainImage(ImageUtil.getImageURL("product", ossArchive.getMainImage(), 0, domain));
-            }
-            List<OssArchivePdf> pdfList = documentAuthDao.findOssArchivePdf(ossArchive.getId());
-            if (pdfList != null && pdfList.size() > 0) {
-                pdfList.forEach(this::setOssArchivePdfUrl);
-            }
-            ossArchive.setPdfList(pdfList);
-        }
-        return Mono.just(JsonModel.success(ossArchive));
-    }
-
-    @Override
-    public Mono<Void> downFile(Integer pdfId, ServerHttpRequest request, ServerHttpResponse response) {
-        try {
-            OssArchivePdf ossArchivePdf = documentAuthDao.findOssArchivePdfById(pdfId);
-            // 创建OSSClient实例。
-            OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
-            File file = new File("src/main/resources/static/file");
-            if (!file.exists()) {
-                file.mkdir();
-            }
-            // 下载OSS文件到本地文件。如果指定的本地文件存在会覆盖,不存在则新建。
-            ossClient.getObject(new GetObjectRequest(bucketName, ossArchivePdf.getOssName()), new File("src/main/resources/static/file/" + ossArchivePdf.getName()));
-            // 关闭OSSClient。
-            ossClient.shutdown();
-            File pdfFile = new File("src/main/resources/static/file/" + ossArchivePdf.getName());
-            //输出文件名乱码问题处理
-            response.getHeaders().set(HttpHeaders.CONTENT_DISPOSITION,
-                    "attachment; filename=" + new String(pdfFile.getName().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
-            ZeroCopyHttpOutputMessage zeroCopyResponse = (ZeroCopyHttpOutputMessage) response;
-            response.getHeaders().setContentType(MediaType.APPLICATION_PDF);
-            return zeroCopyResponse.writeWith(pdfFile, 0, pdfFile.length());
-        } catch (Exception e) {
-            e.printStackTrace();
-            return Mono.error(e);
-        }
-    }
-
-    @Override
-    public void deleteFile() {
-        File file = new File("src/main/resources/static/file");
-        //取得这个目录下的所有子文件对象
-        File[] files = file.listFiles();
-        //遍历该目录下的文件对象
-        if (files != null && files.length > 0) {
-            for (File f : files) {
-                //打印文件名
-                String name = file.getName();
-                log.info("定时删除服务器临时文件,文件名>>>>>" + name);
-                //判断子目录是否存在子目录,如果是文件则删除
-                f.delete();
-            }
-        }
-        //删除空文件夹
-        file.delete();
-    }
-
-    @Override
-    public Mono<JsonModel> downFileAll(Integer pdfId) {
-        Map<String, Object> map = new HashMap<>(2);
-        StringBuilder date = new StringBuilder();
-        try {
-            OssArchivePdf ossArchivePdf = documentAuthDao.findOssArchivePdfById(pdfId);
-            map.put("name", ossArchivePdf.getName());
-            // 创建OSSClient实例。
-            OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
-            // ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
-            OSSObject ossObject = ossClient.getObject(bucketName, ossArchivePdf.getOssName());
-            // 读取文件内容。
-            BufferedReader reader = new BufferedReader(new InputStreamReader(ossObject.getObjectContent()));
-            while (true) {
-                String line = reader.readLine();
-                if (line == null) {
-                    break;
-                }
-                date.append(line);
-            }
-            // 数据读取完成后,获取的流必须关闭,否则会造成连接泄漏,导致请求无连接可用,程序无法正常工作。
-            reader.close();
-            // 关闭OSSClient。
-            ossClient.shutdown();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        map.put("date", date);
-        return Mono.just(JsonModel.success(JsonModel.success(map)));
-    }
+//    @Override
+//    public void deleteFile() {
+//        File file = new File("src/main/resources/static/file");
+//        //取得这个目录下的所有子文件对象
+//        File[] files = file.listFiles();
+//        //遍历该目录下的文件对象
+//        if (files != null && files.length > 0) {
+//            for (File f : files) {
+//                //打印文件名
+//                String name = file.getName();
+//                log.info("定时删除服务器临时文件,文件名>>>>>" + name);
+//                //判断子目录是否存在子目录,如果是文件则删除
+//                f.delete();
+//            }
+//        }
+//        //删除空文件夹
+//        file.delete();
+//    }
 }

+ 9 - 9
src/main/java/com/caimei/www/service/page/impl/HomeServiceImpl.java

@@ -83,14 +83,14 @@ public class HomeServiceImpl implements HomeService {
         homeDao.insertRecord(IP, referer, accessSource,accessTime,"1");
     }
 
-    /**
-     * 首页左侧广告图
-     */
-    @Override
-    @Cacheable(value = "getAdvertising", key="'www'", unless="#result == null")
-    public JsonModel<List<ImageLink>> getAdvertising() {
-        List<ImageLink> list = homeDao.getAdvertising();
-        return JsonModel.success(list);
-    }
+//    /**
+//     * 首页左侧广告图
+//     */
+//    @Override
+//    @Cacheable(value = "getAdvertising", key="'www'", unless="#result == null")
+//    public JsonModel<List<ImageLink>> getAdvertising() {
+//        List<ImageLink> list = homeDao.getAdvertising();
+//        return JsonModel.success(list);
+//    }
 
 }

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

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.www.mapper.AccountDao">
-	<select id="getUserById" resultType="com.caimei.www.pojo.account.Account">
-        select  userID as id,
-        		bindMobile as mobile,
-        		email as email,
-        		password as password,
-        		userIdentity as identity
-        from user
-        where userID = #{userId}
-	</select>
-</mapper>

+ 14 - 0
src/main/resources/mapper/ArticleMapper.xml

@@ -9,6 +9,7 @@
 		where a.enabledStatus = 1
 		order by a.sort desc
 	</select>
+
     <select id="getTopClickRate" resultType="java.lang.Integer">
 		select IFNULL(clickRate, 1)
 		from info_label
@@ -16,6 +17,7 @@
 		order by clickRate desc
 		limit 1
     </select>
+
     <select id="getArticleLabels" resultType="com.caimei.www.pojo.page.BaseLink">
 		select id,name,clickRate as sort,link,jumpStatus as typeId
 		from info_label
@@ -23,6 +25,7 @@
 		order by recommendLabelStatus desc, hotLabelStatus desc, createDate desc
 		limit 30
     </select>
+
     <select id="getArticleRecommended" resultType="com.caimei.www.pojo.page.ImageLink">
 		select  a.id,
 				a.title,
@@ -37,6 +40,7 @@
 		</if>
 		order by a.pubdate desc
 	</select>
+
     <select id="getArticleRelated" resultType="com.caimei.www.pojo.page.Article">
         select
 			a.id as id,
@@ -66,6 +70,7 @@
 		</where>
 		order by a.pubdate desc
 	</select>
+
 	<select id="getLastestInfoADs" resultType="com.caimei.www.pojo.page.ImageLink">
 		select a.id, a.serviceObject as title, a.guidanceImage as image, a.link
 		from info_ad a
@@ -74,23 +79,27 @@
 		order by a.soft,a.createDate desc
 		limit 3
 	</select>
+
     <update id="clickArticleAd">
 		update info_ad
 		set clickRate = IFNULL(clickRate, 0) + 1,
 			updateDate = NOW()
 		where id = #{id}
 	</update>
+
 	<update id="clickArticleLabel">
 		update info_label
 		set clickRate = IFNULL(clickRate, 0) + 1,
 			updateDate = NOW()
 		where id = #{id}
 	</update>
+
     <update id="articleLike">
 		UPDATE info_praise
 		SET num = num+1
 		WHERE infoId = #{infoId}
 	</update>
+
 	<update id="articlePv">
 		UPDATE info_praise
 		SET pv = pv+1
@@ -126,6 +135,7 @@
 		  AND a.enabledStatus = 1
 		  and a.auditStatus = 2
 	</select>
+
 	<select id="findLabelIdsByName" resultType="java.lang.Integer">
 		select id
 		from info_label
@@ -137,9 +147,11 @@
 		group by name
 		order by clickRate desc
 	</select>
+
 	<select id="getLabelById" resultType="java.lang.String">
 		SELECT label FROM info WHERE id=#{id}
 	</select>
+
 	<select id="getArticleRelatedLimit" resultType="com.caimei.www.pojo.page.Article">
 		select
 		a.id as id,
@@ -171,9 +183,11 @@
 		order by a.pubdate desc
 		limit 3
 	</select>
+
 	<select id="relatedLabel" resultType="java.lang.String">
 		SELECT relatedLabels FROM info WHERE id=#{id}
 	</select>
+
 	<insert id="insertRecord">
 		INSERT INTO cm_behavior_record_ref (IP, referer, accessSource, accessTime,pageType)
 		VALUES(#{IP}, #{referer}, #{accessSource}, #{accessTime},#{pageType})

+ 9 - 0
src/main/resources/mapper/BaikeMapper.xml

@@ -4,6 +4,7 @@
 	<update id="encyclopediaPv">
 		update cm_baike_product set actualPv = actualPv + 1 where id = #{id}
 	</update>
+
 	<select id="getBaikeProductDetail" resultType="com.caimei.www.pojo.baike.BaikeProduct">
 		select a.id              AS "productId",
 			   a.commodityType   AS "commodityType",
@@ -48,22 +49,27 @@
 	<select id="findParamList" resultType="com.caimei.www.pojo.baike.BaikeProductParam">
 		select productId, name, content from cm_baike_product_param where productId = #{id}
 	</select>
+
 	<select id="findImageList" resultType="java.lang.String">
 		select image from cm_baike_product_image where productId = #{productId} and type = #{imageType}
 	</select>
+
 	<select id="findQuestionList" resultType="com.caimei.www.pojo.baike.BaikeProductQuestion">
 		select productId, question, answer
 		from cm_baike_product_question
 		where productId = #{productId}
 	</select>
+
 	<select id="getBaikeType" resultType="com.caimei.www.pojo.baike.BaikeType">
 		select name from cm_baike_type where id = #{typeId}
 	</select>
+
     <select id="findVideoList" resultType="com.caimei.www.pojo.baike.BaikeProductFile">
 		select fileTitle, fileName, ossName
 		from cm_baike_product_file
 		where productId = #{productId}
 	</select>
+
 	<select id="getManualRecommendList" resultType="com.caimei.www.pojo.baike.BaikeProduct">
         select p.id                    as productId,
                p.commodityType,
@@ -80,6 +86,7 @@
           and p.status = 1
         order by -cbpr.sort desc;
 	</select>
+
 	<select id="getAutoRecommendList" resultType="com.caimei.www.pojo.baike.BaikeProduct">
 		select p.id as productId, p.commodityType, p.image, p.name, p.discription, p.publishTime, (p.basePv + p.actualPv) as pv
 		from cm_baike_product p
@@ -180,6 +187,7 @@
 		select  id,productId as entryId,textType,dictionaryContent,referenceId,parentId,dictionaryType from cm_baike_text_info
 		where productId=#{id}
 	</select>
+
 	<select id="getReferenceListById"  resultType="com.caimei.www.pojo.baike.CmBaikeReferenceInfo">
 		select
 			id,
@@ -204,6 +212,7 @@
 		from cm_baike_reference_info
 		where productId=#{id}
 	</select>
+
 	<select id="getVideoListById" resultType="com.caimei.www.pojo.baike.BaikeVideoVo">
 		select id, productId as entryId, fileTitle, fileName, ossName,ossUrl
 		from cm_baike_product_file

+ 8 - 13
src/main/resources/mapper/BaseMapper.xml

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.www.mapper.BaseDao">
+
     <select id="getSearchKeyword" resultType="java.lang.String">
         select name from keyword
         where validFlag=1
         order by sortIndex desc
     </select>
+
     <select id="getTopMenus" resultType="com.caimei.www.pojo.page.TopMenu">
 		select
             id,
@@ -19,25 +21,14 @@
 		order by sort asc,createDate desc
 		limit 8
     </select>
-    <select id="getSubMenus" resultType="com.caimei.www.pojo.page.SubMenu">
-		select
-            id,
-            firstNavigationId as topId,
-            navigationName as name,
-            navigationImage as image,
-            link,
-            sort
-		from new_page_secondary_navigation
-		where wwwEnabledStatus='1' and delFlag = 0
-		and firstNavigationId = #{topId}
-		order by sort desc,createDate desc
-    </select>
+
     <select id="getHelpPageTypes" resultType="com.caimei.www.pojo.page.BaseLink">
 		SELECT
 		c_helpPageTypeID as id,
 		c_helpPageTypeName as name
 		FROM c_helppagetype
     </select>
+
     <select id="getHelpPagesByType" resultType="com.caimei.www.pojo.page.BaseLink">
 		select
             helpPageID as id,
@@ -48,14 +39,17 @@
 		and helpPageTypeID = #{typeId}
 		order by sortIndex
     </select>
+
     <select id="getFriendLinks" resultType="com.caimei.www.pojo.page.BaseLink">
 		select id,name,link
 		from new_page_friendship_link
 		where delFlag = 0 order by id
     </select>
+
     <select id="getBaikeSearchHotWord" resultType="com.caimei.www.pojo.baike.BaikeHotSearch">
         select keyWord,jumpType,productId,jumpLink from cm_baike_hot_search where status = 1 order by -sort desc,addTime desc
     </select>
+
     <select id="getBaikeBannerImage" resultType="com.caimei.www.pojo.baike.BaikeBanner">
         select if(#{commodityType} = 1, productPcBanner, instrumentPcBanner) as pcBanner,
                if(#{commodityType} = 1, productAppBanner, instrumentAppBanner) as appBanner,
@@ -63,6 +57,7 @@
         from cm_baike_banner
         where if(#{commodityType} = 1,productStatus,instrumentStatus) = 1
     </select>
+
     <select id="getBaikeTypeList" resultType="com.caimei.www.pojo.baike.BaikeType">
         select id as typeId, name
         from cm_baike_type

+ 0 - 34
src/main/resources/mapper/CommonMapper.xml

@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.www.mapper.CommonDao">
-	<select id="getActivityPriceByProductId" resultType="com.caimei.www.pojo.order.ActivityPrice">
-        select	ca.id,
-        		cpa.productId,
-        		cpa.actPrice as price,
-        		ca.startTime as beginTime,
-        		ca.endTime as endTime
-        from cm_product_activity cpa
-        left join cm_activity ca on cpa.activityId = ca.id
-        where cpa.productId = #{productId}
-        and ca.startTime <![CDATA[ <= ]]> NOW()
-        and NOW() <![CDATA[ <= ]]> ca.endTime
-        and cpa.delFlag = 0
-	</select>
-	<select id="getladderPricesByProductId" resultType="com.caimei.www.pojo.order.LadderPrice">
-        select
-        	id, productId, ladderNum, buyNum, buyPrice
-        from product_ladder_price
-        where productId = #{productId} and userType = 3 and delFlag = 0
-        order by ladderNum asc
-	</select>
-	<select id="getRepurchasePrice" resultType="java.lang.Double">
-        select
-          r.currentPrice
-        from repeat_purchase_price r
-        left join product p on p.productID = r.productId
-        where r.productId = #{productId} and userId = #{userId}
-        and ((p.costCheckFlag=1 and r.currentPrice <![CDATA[ >= ]]> p.costPrice) or p.costCheckFlag=0)
-        and r.delFlag = 0
-	</select>
-
-</mapper>

+ 0 - 54
src/main/resources/mapper/DocumentAuthMapper.xml

@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.www.mapper.DocumentAuthDao">
-    <select id="findOssAuthorizationByMobile" resultType="com.caimei.www.pojo.document.OssAuthorization">
-        SELECT * FROM cm_oss_authorization WHERE mobile = #{mobile}
-    </select>
-
-    <select id="findOssArchive" resultType="com.caimei.www.pojo.document.OssArchive">
-        SELECT DISTINCT
-          coa.*,
-          p.name AS productName,
-          p.mainImage AS mainImage,
-          s.name AS shopName,
-          s.shopID AS shopId
-        FROM
-          cm_oss_archive coa
-          LEFT JOIN product p ON coa.productId = p.productID
-          LEFT JOIN shop s ON p.shopID = s.shopID
-          LEFT JOIN cm_oss_archive_pdf coap ON coap.archiveId = coa.id
-          <if test="name != null and name != ''">
-              WHERE (coa.name LIKE CONCAT('%',#{name},'%')
-               OR p.name LIKE CONCAT('%',#{name},'%')
-               OR coap.name LIKE CONCAT('%',#{name},'%'))
-          </if>
-        ORDER BY
-          coa.updateDate DESC
-    </select>
-
-    <select id="findOssArchivePdf" resultType="com.caimei.www.pojo.document.OssArchivePdf">
-        SELECT * FROM cm_oss_archive_pdf WHERE archiveId = #{archiveId} ORDER BY uploadTime DESC
-    </select>
-
-    <select id="findOssArchivePdfById" resultType="com.caimei.www.pojo.document.OssArchivePdf">
-        SELECT * FROM cm_oss_archive_pdf WHERE id = #{pdfId}
-    </select>
-
-    <select id="getOssArchive" resultType="com.caimei.www.pojo.document.OssArchive">
-        SELECT
-          coa.*,
-          p.name AS productName,
-          p.mainImage AS mainImage,
-          s.name AS shopName,
-          s.shopID AS shopId
-        FROM
-          cm_oss_archive coa
-          LEFT JOIN product p ON coa.productId = p.productID
-          LEFT JOIN shop s ON p.shopID = s.shopID
-        WHERE
-          coa.id = #{archiveId}
-    </select>
-
-</mapper>

+ 1 - 0
src/main/resources/mapper/EquipmentMapper.xml

@@ -6,6 +6,7 @@
 		from cm_page
 		where id = #{equipmentId} and type='2' and enabledStatus=1
     </select>
+
     <select id="getParametersByEquipmentId" resultType="com.caimei.www.pojo.page.Parameter">
         select id,
                pageId as parentId,

+ 0 - 89
src/main/resources/mapper/HomeMapper.xml

@@ -8,97 +8,8 @@
 		order by sort desc, createDate desc
     </select>
 
-	<select id="getAdvertising" resultType="com.caimei.www.pojo.page.ImageLink">
-		select id, adTitle as title, link, adImage as image
-		from new_page_advertising
-		where delFlag = 0
-		order by sort, createDate desc
-	</select>
-
 	<insert id="insertRecord">
 		INSERT INTO cm_behavior_record_ref (IP, referer, accessSource, accessTime,pageType)
 		VALUES(#{IP}, #{referer}, #{accessSource}, #{accessTime},#{pageType})
 	</insert>
-	<!--	<select id="getHomePageFloor" resultType="com.caimei.www.pojo.page.PageFloor">-->
-<!--		select id, type, floorTitle as title, floorDetail as detail-->
-<!--		from new_page_floor-->
-<!--		where delFlag = 0 and wwwEnabledStatus = '1'-->
-<!--		order by sort-->
-<!--	</select>-->
-<!--	<select id="getHomeBigTopicFloor" resultType="com.caimei.www.pojo.page.PageFloor">-->
-<!--		select id, title, description as detail-->
-<!--		from cm_page_big_topic-->
-<!--		where delFlag = 0 and enabledStatus = '1'-->
-<!--		order by sort-->
-<!--	</select>-->
-<!--	<select id="getRecommendeds" resultType="com.caimei.www.pojo.page.ProductList">-->
-<!--		select-->
-<!--			p.productID as id,-->
-<!--			p.`name` as `name`,-->
-<!--			br.name as brand,-->
-<!--			p.mainImage as image,-->
-<!--			p.price,-->
-<!--			p.unit as unit,-->
-<!--			p.priceFlag,-->
-<!--			p.actType as actType-->
-<!--		from product p-->
-<!--		left join cm_brand as br on p.brandID = br.id-->
-<!--		where p.validFlag != 0-->
-<!--		and p.actFlag = 1-->
-<!--		and (p.actType = 1 or p.actType = 2)-->
-<!--		and p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')-->
-<!--		order by p.actSort-->
-<!--	</select>-->
-<!--	<select id="getBigTopicData" resultType="com.caimei.www.pojo.page.ImageLink">-->
-<!--		select-->
-<!--            id,-->
-<!--            title,-->
-<!--            link,-->
-<!--            image-->
-<!--		from cm_page_big_topic_floor-->
-<!--		<where>-->
-<!--			delFlag = 0 and enabledStatus = '1'-->
-<!--			<if test = "topId != null and topId != ''">-->
-<!--				and bigTopicId = #{topId}-->
-<!--			</if>-->
-<!--		</where>-->
-<!--		order by sort ,enabledStatus ,createDate-->
-<!--		limit 0,5-->
-<!--	</select>-->
-<!--    <select id="getCommodityTopicData" resultType="com.caimei.www.pojo.page.ImageLink">-->
-<!--		select-->
-<!--            id,-->
-<!--            title,-->
-<!--            link,-->
-<!--            image,-->
-<!--            beginTime,-->
-<!--            endTime-->
-<!--		from new_page_commodity_topic-->
-<!--		where wwwEnabledStatus = 1-->
-<!--		and <![CDATA[ endTime > sysdate() ]]>-->
-<!--		and <![CDATA[ beginTime < sysdate() ]]>-->
-<!--		order by sort-->
-<!--		limit 0,3-->
-<!--    </select>-->
-<!--	<select id="getSmallTopicData" resultType="com.caimei.www.pojo.page.ImageLink">-->
-<!--		select-->
-<!--            id,-->
-<!--            title,-->
-<!--            link,-->
-<!--            image-->
-<!--		from new_page_small_topic-->
-<!--		where wwwEnabledStatus = 1-->
-<!--		order by sort-->
-<!--		limit 0,4-->
-<!--	</select>-->
-<!--	<select id="getSuppliersTopData" resultType="com.caimei.www.pojo.page.ImageLink">-->
-<!--		select-->
-<!--            id,-->
-<!--            supplierName as title,-->
-<!--            link,-->
-<!--            image-->
-<!--		from new_page_quality_supplier-->
-<!--		where delFlag = 0 and wwwEnabledStatus = 1-->
-<!--		order by sort-->
-<!--	</select>-->
 </mapper>

+ 118 - 133
src/main/resources/mapper/ProductMapper.xml

@@ -1,142 +1,127 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.www.mapper.ProductDao">
-	<select id="getProductDetailById" resultType="com.caimei.www.pojo.page.ProductDetail">
-		select
-			p.productID as id,
-			p.`name` as `name`,
-			p.mainImage as image,
-			p.priceFlag,
-
-			p.tags as tags,
-			p.productRemarks as remarks,
-			p.validFlag as validFlag,
-			p.productCode as productCode,
-			p.step as step,
-			p.recommendType as recommendType,
-			p.visibility as visibility,
-			p.trainingMethod,
-			p.trainingType,
-			p.trainingFee,
-			p.productDetail as productDetailChose,
-
-			d.detailInfo as detailInfo,
-			d.commonDetailInfo as commonDetailInfo,
-			d.orderInfo as orderInfo,
-			d.serviceInfo as serviceInfo,
-
-			p.brandID as brandId,
-			br.name as brandName,
-			t.tinyTypeID as tinyTypeId,
-			t.name as tinyTypeText,
-			s.smallTypeID as smallTypeId,
-			s.name as smallTypeText,
-			b.bigTypeID as bigTypeId,
-			b.name as bigTypeText,
-			p.productType,
-			p.shopID as shopId,
-			sh.name as shopTitle,
-			sh.businessScope as businessScope,
-			sh.authorizationCertificateImage as license,
-			CONCAT(pr.name, ci.name) as shopAddress
-
-
-		from product p
-
-		left join productdetailinfo d on p.productID=d.productID
-		left join cm_brand as br on p.brandID = br.id
-
-        left join bigtype as b on p.bigTypeID = b.bigTypeID
-        left join smalltype as s on p.smallTypeID = s.smallTypeID
-        left join tinytype as t on p.tinyTypeID = t.tinyTypeID
-
-
-        left join shop as sh on p.shopID = sh.shopID
-        left join town as tn on sh.townId = tn.townID
-        left join city as ci on tn.cityID = ci.cityID
-        left join province as pr on ci.provinceID = pr.provinceID
-
-		where p.productID = #{productId}
-	</select>
-	<select id="getProductRecommendsById" resultType="com.caimei.www.pojo.page.ProductList">
-        select
-			p.productID as id,
-			p.`name` as `name`,
-			p.productType,
-			p.mainImage as image
+    <select id="getProductDetailById" resultType="com.caimei.www.pojo.page.ProductDetail">
+        select p.productID                      as id,
+               p.`name`                         as `name`,
+               p.mainImage                      as image,
+               p.priceFlag,
+
+               p.tags                           as tags,
+               p.productRemarks                 as remarks,
+               p.validFlag                      as validFlag,
+               p.productCode                    as productCode,
+               p.step                           as step,
+               p.recommendType                  as recommendType,
+               p.visibility                     as visibility,
+               p.trainingMethod,
+               p.trainingType,
+               p.trainingFee,
+               p.productDetail                  as productDetailChose,
+
+               d.detailInfo                     as detailInfo,
+               d.commonDetailInfo               as commonDetailInfo,
+               d.orderInfo                      as orderInfo,
+               d.serviceInfo                    as serviceInfo,
+
+               p.brandID                        as brandId,
+               br.name                          as brandName,
+               t.tinyTypeID                     as tinyTypeId,
+               t.name                           as tinyTypeText,
+               s.smallTypeID                    as smallTypeId,
+               s.name                           as smallTypeText,
+               b.bigTypeID                      as bigTypeId,
+               b.name                           as bigTypeText,
+               p.productType,
+               p.shopID                         as shopId,
+               sh.name                          as shopTitle,
+               sh.businessScope                 as businessScope,
+               sh.authorizationCertificateImage as license,
+               CONCAT(pr.name, ci.name)         as shopAddress
+
+
+        from product p
+
+                 left join productdetailinfo d on p.productID = d.productID
+                 left join cm_brand as br on p.brandID = br.id
+
+                 left join bigtype as b on p.bigTypeID = b.bigTypeID
+                 left join smalltype as s on p.smallTypeID = s.smallTypeID
+                 left join tinytype as t on p.tinyTypeID = t.tinyTypeID
+
+
+                 left join shop as sh on p.shopID = sh.shopID
+                 left join town as tn on sh.townId = tn.townID
+                 left join city as ci on tn.cityID = ci.cityID
+                 left join province as pr on ci.provinceID = pr.provinceID
+
+        where p.productID = #{productId}
+    </select>
+
+    <select id="getProductRecommendsById" resultType="com.caimei.www.pojo.page.ProductList">
+        select p.productID as id,
+               p.`name`    as `name`,
+               p.productType,
+               p.mainImage as image
 
         from product as p
-        left join cm_product_recommend as pr on pr.recommendProductID = p.productID
-        where
-            pr.productID = #{productId}
-          and p.validFlag  = 2
+                 left join cm_product_recommend as pr on pr.recommendProductID = p.productID
+        where pr.productID = #{productId}
+          and p.validFlag = 2
           and p.visibility = 3
         order by pr.sort desc
-	</select>
-	<select id="getAutoProductRecommends" resultType="com.caimei.www.pojo.page.ProductList">
-		select
-			p.productID as id,
-			p.`name` as `name`,
-			p.mainImage as image,
-			IFNULL(p.visibility,3) as visibility,
-			p.productType
-		from product as p
-		where p.validFlag  = 2
-		  and p.commodityType = (select commodityType from product as p1 where p1.productID = #{productId})
-		  and p.smallTypeID = (select smallTypeID from product as p2 where p2.productID = #{productId})
-		  and p.visibility = 3
-		order by p.sellNumber desc limit 0,7
-	</select>
-	<select id="getProductParameters" resultType="com.caimei.www.pojo.page.Parameter">
-		select id as id,
-		productId as parentId,
-		paramsName as `name`,
-		paramsContent as content,
-		delFlag as type
-		from cm_product_related_parameters
-		where productId = #{productId} and delFlag='0'
-	</select>
-	<select id="getProductDetailImages" resultType="java.lang.String">
-		select image
-		from productimage
-		where productID = #{productId}
-		order by mainFlag desc ,sortIndex is null,sortIndex
-	</select>
-    <select id="getPriceItemById" resultType="com.caimei.www.pojo.order.CartItem">
-		select
-			p.productID as productId,
-			p.price,
-			p.unit as unit,
-			p.step as step,
-			p.minBuyNumber as min,
-			p.priceFlag,
-			p.ladderPriceFlag as ladderFlag,
-			p.validFlag as validFlag,
-			p.productType,
-			p.stock as stock
-		from product p
-		where p.productID = #{productId}
-	</select>
-
-
-	<select id="findBigtype" resultType="com.caimei.www.pojo.classify.Bigtype">
-		SELECT bigTypeID, name FROM bigtype ORDER BY sortIndex
-	</select>
-
-	<select id="findSmalltype" resultType="com.caimei.www.pojo.classify.SmallType">
-		SELECT smallTypeID,name FROM smalltype ORDER BY sortIndex
-	</select>
-    <select id="getProductInfo" resultType="java.lang.String">
-        select detailinfo from productdetailinfo where detailinfo like '%img-b.caimei365.com%'
-	</select>
-	<select id="getRecommendType" resultType="java.lang.Integer">
-		select recommendType from product where productId=#{productId}
-	</select>
-	<select id="findSkus" resultType="com.caimei.www.pojo.page.Sku">
-		select unit,price,ifnull(stock,0) as stock,
-		       ifnull(minBuyNumber,(select buyNum from product_ladder_price where productId=#{productId} order by buynum asc limit 1)) as minBuyNumber
-		from cm_sku
-		where productId= #{productId}
-	</select>
+    </select>
+
+    <select id="getAutoProductRecommends" resultType="com.caimei.www.pojo.page.ProductList">
+        select p.productID             as id,
+               p.`name`                as `name`,
+               p.mainImage             as image,
+               IFNULL(p.visibility, 3) as visibility,
+               p.productType
+        from product as p
+        where p.validFlag = 2
+          and p.commodityType = (select commodityType from product as p1 where p1.productID = #{productId})
+          and p.smallTypeID = (select smallTypeID from product as p2 where p2.productID = #{productId})
+          and p.visibility = 3
+        order by p.sellNumber desc
+        limit 0,7
+    </select>
+
+    <select id="getProductParameters" resultType="com.caimei.www.pojo.page.Parameter">
+        select id            as id,
+               productId     as parentId,
+               paramsName    as `name`,
+               paramsContent as content,
+               delFlag       as type
+        from cm_product_related_parameters
+        where productId = #{productId}
+          and delFlag = '0'
+    </select>
+
+    <select id="getProductDetailImages" resultType="java.lang.String">
+        select image
+        from productimage
+        where productID = #{productId}
+        order by mainFlag desc, sortIndex is null, sortIndex
+    </select>
+
+    <select id="getRecommendType" resultType="java.lang.Integer">
+        select recommendType
+        from product
+        where productId = #{productId}
+    </select>
+
+    <select id="findSkus" resultType="com.caimei.www.pojo.page.Sku">
+        select unit,
+               price,
+               ifnull(stock, 0)                as stock,
+               ifnull(minBuyNumber, (select buyNum
+                                     from product_ladder_price
+                                     where productId = #{productId}
+                                     order by buynum asc
+                                     limit 1)) as minBuyNumber
+        from cm_sku
+        where productId = #{productId}
+    </select>
 
 </mapper>

+ 7 - 0
src/main/resources/mapper/RepairMapper.xml

@@ -31,17 +31,20 @@
             </if>
         </where>
     </select>
+
     <select id="getRepairUser" resultType="com.caimei.www.pojo.link.RepairUserVo">
         SELECT
             userID AS userId, userName, account, mobile, registerUserTypeID AS registerUserTypeId
         FROM user WHERE userID = #{userId}
     </select>
+
     <select id="findOrderNoInToday" resultType="java.lang.String">
         SELECT IFNULL(orderNo,"")
         FROM cm_instrument_maintenance
         WHERE DATE_FORMAT(submitDate,'%Y%m%d') = #{date} AND submitDate is not null
         ORDER BY id DESC limit 1
     </select>
+
     <select id="findMaintenanceDetail" resultType="com.caimei.www.pojo.link.RepairVo">
         SELECT
             id,
@@ -81,11 +84,13 @@
         FROM cm_instrument_maintenance
         WHERE id = #{id}
     </select>
+
     <select id="checkMobileSubmitTime" resultType="java.lang.Integer">
         SELECT count(id)
         FROM cm_instrument_maintenance
         WHERE userMobile = #{mobile} AND orderNo LIKE concat(#{date},"%")
     </select>
+
     <insert id="insertMaintenance">
         INSERT INTO cm_instrument_maintenance(
             orderNo,
@@ -157,6 +162,7 @@
              #{townName}
          )
     </insert>
+
     <insert id="insertMaintenanceLink">
         INSERT INTO cm_instrument_maintenance_links(
             id,
@@ -172,6 +178,7 @@
              #{cmInstrumentMaintenanceId}
          )
     </insert>
+
     <update id="updateMaintenace">
         update cm_instrument_maintenance
         SET serviceRating = #{serviceRating},

+ 1 - 0
src/main/resources/mapper/ShortLinkMapper.xml

@@ -15,6 +15,7 @@
         SET onClick = (onClick + 1)
         WHERE markId = #{markId}
     </update>
+
     <update id="updateShortLink">
         update cm_short_link
         set viewTime = now()

+ 82 - 57
src/main/resources/mapper/SinglePageMapper.xml

@@ -2,63 +2,74 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.www.mapper.SinglePageDao">
     <select id="getFreePageById" resultType="com.caimei.www.pojo.page.PageContent">
-        select  a.id, a.type, a.title, a.keywords, a.description, ifnull(f.content,'') as content, a.backgroundColour, a.backgroundImage
+        select a.id,
+               a.type,
+               a.title,
+               a.keywords,
+               a.description,
+               ifnull(f.content, '') as content,
+               a.backgroundColour,
+               a.backgroundImage
         from cm_page a
-        left join cm_page_freedom f on a.id=f.pageId
-        where a.type=4 and a.enabledStatus=1 and f.type=1
-        and a.id=#{id}
+                 left join cm_page_freedom f on a.id = f.pageId
+        where a.type = 4
+          and a.enabledStatus = 1
+          and f.type = 1
+          and a.id = #{id}
     </select>
+
     <select id="getTopicPageById" resultType="com.caimei.www.pojo.page.PageContent">
-        select  a.id, a.type, a.title, a.keywords, a.description, a.headImage as image, a.headText as content, a.backgroundColour, a.backgroundImage
+        select a.id,
+               a.type,
+               a.title,
+               a.keywords,
+               a.description,
+               a.headImage as image,
+               a.headText  as content,
+               a.backgroundColour,
+               a.backgroundImage
         from cm_page a
-        where a.type=1 and a.enabledStatus=1
-        and a.id=#{id}
+        where a.type = 1
+          and a.enabledStatus = 1
+          and a.id = #{id}
     </select>
+
     <select id="getLivePageData" resultType="com.caimei.www.pojo.page.PageContent">
-        select  a.id, a.type, a.title, a.keywords, a.description, a.headImage as image, a.headText as content
+        select a.id, a.type, a.title, a.keywords, a.description, a.headImage as image, a.headText as content
         from cm_page a
-        where a.id=1 and a.type=3 and a.enabledStatus=1
-    </select>
-    <select id="getFloorByPageId" resultType="com.caimei.www.pojo.page.PageFloor">
-        select id, pageId as type, title, link
-        from cm_page_centre
-        where pageId=#{id}
-        and enabledStatus=1
-        order by sort desc,createDate desc
-    </select>
-    <select id="getDataByFloorId" resultType="com.caimei.www.pojo.page.ImageLink">
-        select  a.id as id,
-                a.title as title,
-                a.link as link,
-                a.image as image
-        from cm_page_image a
-        right join cm_page_centre_image b on b.imageId=a.id
-        where b.centreId=#{floorId} and  a.enabledStatus=1
-        order  by a.sort desc,a.createDate desc
+        where a.id = 1
+          and a.type = 3
+          and a.enabledStatus = 1
     </select>
+
     <select id="getLiveTeachers" resultType="com.caimei.www.pojo.page.ImageLink">
-        select  a.id as id,
-                a.title as title,
-                a.link as link,
-                a.image as image
+        select a.id    as id,
+               a.title as title,
+               a.link  as link,
+               a.image as image
         from cm_page_image a
-        where a.type=3 and a.enabledStatus=1
-        order by a.sort desc,a.createDate desc
+        where a.type = 3
+          and a.enabledStatus = 1
+        order by a.sort desc, a.createDate desc
     </select>
+
     <select id="getHelpPageById" resultType="com.caimei.www.pojo.page.PageContent">
-        select
-            helpPageID as id,
-            helpPageTypeID as type,
-            title,
-            contentTxt as description,
-            content
+        select helpPageID     as id,
+               helpPageTypeID as type,
+               title,
+               contentTxt     as description,
+               content
         from helppage
-        where helpPageID=#{id}
-        and validFlag=1 and showFlag=1
+        where helpPageID = #{id}
+          and validFlag = 1
+          and showFlag = 1
     </select>
+
     <select id="getMaxSuggestionId" resultType="java.lang.Integer">
-        select MAX(suggestionID) from suggestion
+        select MAX(suggestionID)
+        from suggestion
     </select>
+
     <insert id="suggestionSave" parameterType="com.caimei.www.pojo.save.Suggestion">
         insert into suggestion
         (suggestionID, suggestionTypeID, userID, title, content, linkMan, mobile, addTime)
@@ -73,33 +84,47 @@
     </insert>
 
     <select id="findMobileContent" resultType="string">
-        SELECT content FROM cm_page_freedom WHERE pageId = #{id} AND type = 2
+        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 id
+        from cm_page a
+        where a.type = 5
+          and a.enabledStatus = 1
+          and a.id = #{id}
     </select>
+
     <select id="getPageTitleById" resultType="java.lang.String">
-        select title from cm_page where id=#{id}
+        select title
+        from cm_page
+        where 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 id
+        from cm_page a
+        where a.type = 6
+          and a.enabledStatus = 1
+          and a.id = #{id}
     </select>
+
     <select id="getPageTypeSort" resultType="java.lang.Integer">
-        select typeSort from cm_page
-        where id = #{pageId} and enabledStatus = '1'
+        select typeSort
+        from cm_page
+        where id = #{pageId}
+          and enabledStatus = '1'
     </select>
+
     <select id="getBeautyPageIdById" resultType="java.lang.Integer">
-        select id from cm_page a
-        where
-            a.type=7 and a.enabledStatus=1
-          and a.id=#{id}
+        select id
+        from cm_page a
+        where a.type = 7
+          and a.enabledStatus = 1
+          and a.id = #{id}
     </select>
 
 </mapper>

+ 21 - 15
src/main/resources/mapper/SupplierMapper.xml

@@ -2,27 +2,33 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.www.mapper.SupplierDao">
     <select id="getSupplierById" resultType="com.caimei.www.pojo.page.SupplierDetail">
-        select
-            s.shopID as id,
-            s.userID as userId,
-            s.name,
-            s.sname as abbr,
-            s.logo,
-            s.address,
-            s.businessScope,
-            s.businessLicenseImage as businessLicense,
-            s.taxCertificateImage as taxCertificate,
-            s.authorizationCertificateImage as license,
-            s.info,
-            s.productDesc
+        select s.shopID                        as id,
+               s.userID                        as userId,
+               s.name,
+               s.sname                         as abbr,
+               s.logo,
+               s.address,
+               s.businessScope,
+               s.businessLicenseImage          as businessLicense,
+               s.taxCertificateImage           as taxCertificate,
+               s.authorizationCertificateImage as license,
+               s.info,
+               s.productDesc
         from shop s
         where shopID = #{supplierId}
     </select>
+
     <select id="getShopCertById" resultType="java.lang.String">
-        SELECT image FROM shopcert WHERE shopID = #{shopId} AND shopCertTypeID = #{shopCertTypeId}
+        SELECT image
+        FROM shopcert
+        WHERE shopID = #{shopId}
+          AND shopCertTypeID = #{shopCertTypeId}
     </select>
+
     <select id="medicalPracticeLicense" resultType="java.lang.String">
-        SELECT medicalPracticeLicenseImg1 FROM shop WHERE shopID = #{shopId}
+        SELECT medicalPracticeLicenseImg1
+        FROM shop
+        WHERE shopID = #{shopId}
     </select>
 
 </mapper>

+ 2 - 1
src/main/resources/static/js/document/details.js

@@ -12,7 +12,8 @@ var documentList = new Vue({
 
     },
     methods: {
-        GetDocumentDataDetailsInfo:function(){//查询资料详情
+        GetDocumentDataDetailsInfo:function(){
+            //查询资料详情
             var _self = this;
             DocumentApi.GetDocumentDataDetails({pdfId:_self.pdfId},function(response){
                 if(response.code == 0){