admin
2019-04-15 debb3a579f798d71072f037f74e3e6b43b5fe0ee
fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -1572,8 +1572,7 @@
   public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
      try {
         //  1、专题模块
         JSONObject root = specialService.listCacheSpecialToIndex();
         JSONObject root = specialService.listCacheSpecialToIndex(acceptData);
         
         // 2、顶部轮播图
         List<SwiperPicture> topPicList = getSwiperByCard("index_top");
@@ -1696,16 +1695,24 @@
      nextTime.set(Calendar.SECOND, 0);
      nextTime.set(Calendar.MILLISECOND, 0);
      
      JSONObject root = new JSONObject();
      root.put("time", nextTime.getTimeInMillis());
      
      JSONArray array = new JSONArray();
      JSONArray array = null;
      String timekey = "spikeGoods_hour";
      String cachekey = "spikeGoodsList" ;
      String timeValue = redisManager.getCommonString(timekey);
      if (timeValue == null || !timeValue.equals(hour+"")) {
         redisManager.cacheCommonString(timekey, hour+"", 60 * 30);
      } else {
      String cacheValue = redisManager.getCommonString(cachekey);
      if (!StringUtil.isNullOrEmpty(cacheValue)) {
         array = JSONArray.fromObject(cacheValue);
      } else {
         }
      }
      if (array == null) {
         array = new JSONArray();
         BigDecimal proportion = manageService.getFanLiRate();
         Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
               .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
@@ -1715,6 +1722,7 @@
         if (listGoods == null) {
            listGoods = new ArrayList<QualityFactory>();
         }
         /* 遍历列表数据 */
         for (QualityFactory qualityFactory : listGoods) {
               
@@ -1724,9 +1732,13 @@
            }
            array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
         }
         // 缓存半个小时
         redisManager.cacheCommonString(cachekey, array.toString(), 60 * 30);
      }
      JSONObject root = new JSONObject();
      root.put("time", nextTime.getTimeInMillis());
      root.put("listgoods", array);
      out.print(JsonUtil.loadTrueResult(root));
   }