| | |
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.Date;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | @RequestMapping(value = "getRecommendIndex")
|
| | | public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | // 专题模块
|
| | | // 1、专题模块
|
| | | JSONObject root = specialService.listCacheSpecialToIndex();
|
| | |
|
| | | // 顶部轮播图
|
| | | |
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> topPicList = getSwiperByCard("index_top");
|
| | | if (topPicList == null) {
|
| | | topPicList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | | root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | |
|
| | | // 邀请、分享轮播图
|
| | | List<SwiperPicture> invitePicList = getInvitePicList(uid, acceptData);
|
| | | |
| | | // 3、邀请有奖
|
| | | List<SwiperPicture> invitePicList = null;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
|
| | | // 如果IOS当前版本处于审核状态就不返回
|
| | | } else {
|
| | | invitePicList = getSwiperByCard("index_invite"); |
| | | }
|
| | | |
| | | if (invitePicList == null) {
|
| | | invitePicList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | | } |
| | | root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList));
|
| | |
|
| | | // 底部网页链接
|
| | | |
| | | // 4、IOS的底部网页链接
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("ios".equalsIgnoreCase(platform)) {
|
| | | root.put("htmlLink", configService.get("index_html_link_ios"));
|
| | |
| | |
|
| | | List<SwiperPicture> invitePicList = getSwiperByCard("index_invite");
|
| | |
|
| | | if (uid != null) {
|
| | | try {
|
| | | // 用户自定义:不看邀请有奖
|
| | | UserSettingsVO vo = userCustomSettingsService.getMySettings(uid);
|
| | | if (vo != null && vo.getNoInvitationBonus() != null && vo.getNoInvitationBonus() == 1 |
| | | && invitePicList != null && invitePicList.size() > 0) {
|
| | | Iterator<SwiperPicture> iterator = invitePicList.iterator();
|
| | | while (iterator.hasNext()) {
|
| | | SwiperPicture swiperPicture = iterator.next();
|
| | | JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
|
| | | if (jumpDetail != null && "invite".equals(jumpDetail.getType())) {
|
| | | iterator.remove();
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (UserCustomSettingsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | return invitePicList;
|
| | | }
|
| | |
| | | TaoBaoGoodsBrief tb = null;
|
| | | if (goodsList.size() > 0) {
|
| | | tb = goodsList.get(0);
|
| | |
|
| | | }
|
| | |
|
| | | if (tb == null) {
|