| | |
| | | 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");
|
| | |
| | | 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();
|
| | |
| | | if (listGoods == null) {
|
| | | listGoods = new ArrayList<QualityFactory>();
|
| | | }
|
| | | |
| | | /* 遍历列表数据 */
|
| | | for (QualityFactory qualityFactory : listGoods) {
|
| | |
|
| | |
| | | }
|
| | | 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));
|
| | | }
|