admin
2019-06-24 beee6afac3f7d1b7fa30f768df91cd55e6c6d2db
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java
@@ -101,6 +101,8 @@
         navList = getCommonNav();
      } else if (type == CommonContentTypeEnum.yunDongKuXie) {
         navList = getCommonNav();
      } else if (type == CommonContentTypeEnum.qiCheHuWai) {
         navList = getCommonNav();
      }
      return navList;
@@ -118,17 +120,13 @@
      } else if (type == CommonContentTypeEnum.jingPinXieBao) {
         return getJingPinXieBaoContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.chaoNanReMai) {
         return getJingPinXieBaoContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.shuMaShouJi) {
         return getJingPinXieBaoContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.yunDongKuXie) {
         return getJingPinXieBaoContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.chaoNanReMai) {
         return getChaoNanReMaiContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.shuMaShouJi) {
         return getShuMaShouJiContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.yunDongKuXie) {
         return getYunDongKuXieContent(cid, page, pageSize);
      } else if (type == CommonContentTypeEnum.qiCheHuWai) {
         return getQiCheHuWaiContent(cid, page, pageSize);
      }
      return null;
   }
@@ -319,4 +317,35 @@
      return new CommonContentResult(goodsList, count);
   }
   /**
    * 汽车户外
    *
    * @param cid
    * @param page
    * @param pageSize
    * @return
    */
   private CommonContentResult getQiCheHuWaiContent(String cid, int page, int pageSize) {
      DaTaoKeGoodsResult result = null;
      List<Integer> cidList = new ArrayList<>();
      cidList.add(7);
      cidList.add(13);
      int sort = getCommonSort(cid);
      result = DaTaoKeApiUtil.search("", null, null, null, page, pageSize, sort);
      DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", cidList, null, null, page, pageSize, sort);
      List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      long count = 0;
      if (result != null) {
         count = result.getTotalCount() + result1.getTotalCount();
         if (result.getGoodsList() != null)
            for (DaTaoKeDetailV2 detail : result.getGoodsList())
               goodsList.add(TaoBaoUtil.convert(detail));
         if (result1.getGoodsList() != null)
            for (DaTaoKeDetailV2 detail : result1.getGoodsList())
               goodsList.add(TaoBaoUtil.convert(detail));
      }
      Collections.shuffle(goodsList);
      return new CommonContentResult(goodsList, count);
   }
}