@RequestMapping(value = "/qinggansub.do", method = RequestMethod.GET) public String qinggansub( HttpSession hs, HttpServletRequest request, HttpServletResponse response) { String city_id = (request.getParameter("city_id") == null || "".equals(request.getParameter("city_id"))) ? "1" : request.getParameter("city_id"); int category_id = (request.getParameter("category_id") == null || "".equals(request.getParameter("category_id"))) ? 1 : Integer.parseInt(request.getParameter("category_id")); String pageNum = (request.getParameter("pageNum") == null || "".equals(request.getParameter("pageNum"))) ? "1" : request.getParameter("pageNum"); Map<Object, Object> params = new HashMap<Object, Object>(); params.put("city_id", city_id); params.put("id", category_id); Category category = this.commonService.selectObject("category.getById", params); String pageCount = "10"; List<CommonInfo> qinggansubList = commonInfoService.getCommonInfoList(category_id, "", city_id, pageNum, pageCount); String totalCount = commonInfoService.getCommonTotalCount(category_id, city_id); d4p = new Division4Page(pageNum + "", Integer.parseInt(totalCount), Integer.parseInt(pageCount)); d4p.setList(qinggansubList); request.setAttribute("qinggansubList", qinggansubList); request.setAttribute("city_id", city_id); request.setAttribute("category", category); request.setAttribute("totalCount", totalCount); request.setAttribute("d4p", d4p); return "errenshijie/qinggansub"; }
@RequestMapping(value = "/yaogunyueCategory.do", method = RequestMethod.GET) public String saishiCategory( HttpServletRequest request, HttpServletResponse response, ModelMap map) { String category_id = request.getParameter("category_id"); String city_id = (request.getParameter("city_id") == null || "".equals(request.getParameter("city_id"))) ? "1" : request.getParameter("city_id"); String pageNum = (request.getParameter("pageNum") == null || "".equals(request.getParameter("pageNum"))) ? "1" : request.getParameter("pageNum"); Map<Object, Object> params = new HashMap<Object, Object>(); params.put("city_id", city_id); params.put("id", category_id); Category c = this.commonService.selectObject("category.getById", params); map.put("c", c); String pageCount = "10"; List<CommonInfo> list = commonInfoService.getCommonInfoList( Integer.parseInt(category_id), "", city_id, pageNum, pageCount); String total = commonInfoService.getCommonTotalCount(Integer.parseInt(category_id), city_id); d4p = new Division4Page(pageNum + "", Integer.parseInt(total), Integer.parseInt(pageCount)); d4p.setList(list); map.put("d4p", d4p); map.put("total", total); map.put("list", list); map.put("city_id", city_id); // 焦点图 params.put("category_id", Const.JIAODIAN_YAOGUN); params.put("pageIndex", 0); params.put("pageCount", Const.JIAODIAN_PAGECOUNT); List<FocusPhoto> listFocus = this.commonService.selectObjects("focusPhoto.getListByCId", params); request.setAttribute("listFocus", listFocus); return "yaogunyue/yaogunyuesub"; }