yj
2020-03-06 207dc8655711cddac2653e18b51e58a88dba2084
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -147,7 +147,7 @@
         // 猜你喜欢
         String idfa = acceptData.getIdfa();
         String imei = acceptData.getImei();
         result = guessLikeDeviceTB(idfa, imei, page);
         result = guessLikeDeviceTB(idfa, imei, acceptData.getUtdid(), page);
      } else {
         // 大淘客页码只能为10,50,100,200
         result = commonTemplateContentService.getContentList(type, cid, page, 10);
@@ -162,7 +162,9 @@
      JSONArray array = new JSONArray();
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
      List<TaoBaoGoodsBrief> goodsList = result.getGoodsList();
      List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      if (result != null)
         goodsList = result.getGoodsList();
      ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
@@ -178,7 +180,7 @@
      }
      root.put("list", array);
      root.put("count", result.getCount());
      root.put("count", result != null ? result.getCount() : 0);
      out.print(JsonUtil.loadTrueResult(root));
   }
@@ -215,7 +217,7 @@
                  .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            for (JDGoods goods : goodsList) {
               array.add(gson.toJson(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO)));
            }
@@ -242,7 +244,8 @@
         // 2、顶部轮播图
         List<SwiperPicture> bannerList = null;
         if (Constant.IS_TEST) {
            bannerList = swiperPictureService.getByBannerCardAndVersion("index_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
            bannerList = swiperPictureService.getByBannerCardAndVersion("index_top", acceptData.getPlatform(),
                  Integer.parseInt(acceptData.getVersion()));
         }
         if (bannerList == null) {
@@ -263,9 +266,9 @@
         if (goodsList != null && goodsList.size() > 0) {
            Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
                  .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
            ConfigParamsDTO paramsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
                  acceptData.getVersion());
            for (PDDGoodsDetail goods : goodsList) {
               array.add(gson.toJson(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO)));
            }
@@ -285,8 +288,8 @@
    * @return
    */
   @Cacheable(value = "commonContentCache", key = "#idfa+'-'+#imei+'-'+#page")
   private CommonContentResult guessLikeDeviceTB(String idfa, String imei, Integer page) {
      TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa);
   private CommonContentResult guessLikeDeviceTB(String idfa, String imei, String utdid, Integer page) {
      TaoBaoSearchResult searchResult = TaoKeApiUtil.guessDeviceLike(page, Constant.PAGE_SIZE, imei, idfa, utdid);
      if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null
            && searchResult.getTaoBaoGoodsBriefs().size() > 0) {
         CommonContentResult result = new CommonContentResult();