public static void moreMessage(CommonSearchDto cs, int pageNo) { if (cs == null) { cs = new CommonSearchDto(); } cs.pageNo = pageNo; List<MessageIndexDto> messageIndexDtoList = MessageIndexService.commonList(cs); render(messageIndexDtoList, cs, pageNo); }
/** * 资讯索引列表 * * @param cs * @param pageNo */ public static void messageIndex(CommonSearchDto cs, int pageNo) { cs = cs == null ? new CommonSearchDto() : cs; /*增加了一个标识字段,如果没有修改自定义时间,但是点击自定义,它会给startTime赋值custom,所以我定义了一个标识字段,用于保存 自定义的开始时间,当它没有修改但是点击了,我就把custom改为tempField,*/ if ("custom".equals(cs.startTime)) { cs.startTime = cs.tempField; } cs.timeValue = cs.startTime; F.T2<List<MessageIndexDto>, Integer> t2 = getMessageIndexList(cs, pageNo); List<MessageIndexDto> messageIndexDtoList = t2._1; int moreType = t2._2; // 我的订阅 UserComposeInfo uci = fetchUserComposeInfo(); List<UserTemplate> utList = null; if (uci == null) { utList = Lists.newArrayList(); } else { utList = TemplateService.fetchUserTemplateList(uci, TemplateService.TemplateType.messageIndex); } render(messageIndexDtoList, cs, pageNo, utList, moreType); }
/** * excel 导出 * * @param cs */ public static void exportMessageIndex(CommonSearchDto cs, int pageNo) { if (cs == null) { cs = new CommonSearchDto(); } cs.pageSize = 1000; F.T2<List<MessageIndexDto>, Integer> t2 = getMessageIndexList(cs, pageNo); List<MessageIndexDto> list = t2._1; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); renderArgs.put("dateFormat", dateFormat); renderArgs.put(RenderExcel.RA_FILENAME, "资讯索引.xls"); request.format = EXCEL_FILE_SUFFIX; render(list); }
@Util private static F.T2<List<MessageIndexDto>, Integer> getMessageIndexList( CommonSearchDto cs, int pageNo) { List<MessageIndexDto> messageIndexDtoList = null; if (cs != null && StringUtils.isNotBlank(cs.keyWord)) { cs.searchType = 1; } int moreType = cs.searchType; long advanceId = cs.advanceId; switch (moreType) { case 2: messageIndexDtoList = doAdvanceInfoSearch(advanceId, cs, pageNo); break; case 3: messageIndexDtoList = doDirectAdvanceSearch(pageNo, cs); break; default: messageIndexDtoList = doCommonInfoSearch(cs); } return F.T2(messageIndexDtoList, moreType); }