/** * 不保存搜索条件直接搜索 * * @param pageNo */ private static List<MessageIndexDto> doDirectAdvanceSearch(int pageNo, CommonSearchDto cs) { MessageIndexCnd cnd = new MessageIndexCnd(); cnd.newsSource = cs.newsSource; cnd.newsClassify = cs.newsClassify; cnd.bulletinClassify = cs.bulletinClassify; cnd.bulletinPlateTree = cs.reportPlateTree; cnd.reportClassify = cs.reportClassify; cnd.reportOrg = cs.reportOrg; cnd.reportPlateTree = cs.reportPlateTree; cnd.advanceType = cs.advanceType; List<BulletinClassify> bulletinList = bulletinClassifies; if (cs == null) { cs = new CommonSearchDto(); } List<MessageIndexDto> messageIndexDtoList = null; if (cs.advanceId != 0) { messageIndexDtoList = doAdvanceInfoSearch(cs.advanceId, cs, pageNo); } else { messageIndexDtoList = MessageIndexService.doAdvanceSearch(cnd, bulletinList, pageNo, cs); } /* UserComposeInfo uci = fetchUserComposeInfo(); List<UserTemplate> utList = TemplateService.fetchUserTemplateList(uci, TemplateService.TemplateType.messageIndex); int moreType = MoreType.directSearch.type;*/ return messageIndexDtoList; // render("@messageIndex", messageIndexDtoList, cs, utList, moreType); }
// 编辑订阅 public static void editMessageIndexCnd(MessageIndexCnd cnd, Long id) { Map<String, Object> json = new HashMap<String, Object>(); if (cnd == null) { json.put("success", false); json.put("msg", "订阅条件不存在,请重新输入"); } else { String content = cnd.toJson(); UserComposeInfo uci = fetchUserComposeInfo(); TemplateService.editUserTemplateById(id, content, uci); json.put("success", true); json.put("msg", "保存成功"); json.put("info", content); } renderJSON(json); }
public static void moreDirectAdvanceSearch(int pageNo, CommonSearchDto cs) { List<BulletinClassify> bulletinList = bulletinClassifies; MessageIndexCnd cnd = new MessageIndexCnd(); cnd.newsSource = cs.newsSource; cnd.newsClassify = cs.newsClassify; cnd.bulletinClassify = cs.bulletinClassify; cnd.bulletinPlateTree = cs.reportPlateTree; cnd.reportClassify = cs.reportClassify; cnd.reportOrg = cs.reportOrg; cnd.reportPlateTree = cs.reportPlateTree; cnd.advanceType = cs.advanceType; if (cs == null) { cs = new CommonSearchDto(); } List<MessageIndexDto> messageIndexDtoList = null; if (cs.advanceId != 0) { messageIndexDtoList = doAdvanceInfoSearch(cs.advanceId, cs, pageNo); } else { messageIndexDtoList = MessageIndexService.doAdvanceSearch(cnd, bulletinList, pageNo, cs); } render("@moreMessage", messageIndexDtoList, cnd, pageNo, cs); }
@Util static Map<String, Object> addCond(MessageIndexCnd cnd, String cndName, UserComposeInfo uci) { Map<String, Object> json = new HashMap<String, Object>(); // 先检查一下是否重名 if (TemplateService.hasSameName(cndName, uci, TemplateService.TemplateType.messageIndex)) { json.put("op", false); json.put("msg", "名称已存在"); json.put("cndName", cndName); json.put("sameName", true); } else { Long id = TemplateService.addUserTemplate( uci, cndName, cnd.toJson(), TemplateService.TemplateType.messageIndex); json.put("op", true); json.put("msg", "增加成功"); json.put("id", id); json.put("utInfo", cnd); } return json; }
// 保存订阅 public static void addMessageIndexCnd(MessageIndexCnd cnd, String name) { UserComposeInfo uci = fetchUserComposeInfo(); Map<String, Object> json = new HashMap<String, Object>(); if (cnd == null) { json.put("success", false); json.put("msg", "订阅条件不存在,请重新输入"); } else { String content = cnd.toJson(); long id = TemplateService.addUserTemplate( uci, name, content, TemplateService.TemplateType.messageIndex); if (id > 0) { json.put("success", true); json.put("msg", "保存成功!"); json.put("id", id); json.put("info", content); } else { json.put("success", false); json.put("mag", "保存失败!"); } } renderJSON(json); }