예제 #1
0
  /**
   * 商家大全
   *
   * @return
   */
  @RequestMapping(value = "/company.htm")
  public ModelAndView company(
      ModelAndView mav, TravelCompanyQuery query, Integer page, Integer pagesize) {
    mav.setViewName("cms/1409/company");

    query.setPageSize(pagesize = Argument.isNotPositive(pagesize) ? 20 : pagesize);
    query.setNowPageIndex(page = Argument.isNotPositive(page) ? 0 : page - 1);
    query.setcType(CompanyTypeEnum.ACCOUNT.getValue());
    query.setcState(CompanyStateEnum.NORMAL.getValue());

    PaginationList<TravelCompanyDO> list = companyService.showCompanyPagination(query);
    PagesPagination pagination =
        PaginationParser.getPaginationList(
            page,
            pagesize,
            query.getAllRecordNum(),
            new IPageUrl() {

              @Override
              public String parsePageUrl(Object... objs) {
                return "/company.htm?page=" + (Integer) objs[1];
              }
            });

    mav.addObject("list", list);
    mav.addObject("pagination", pagination);
    return mav;
  }
예제 #2
0
  /**
   * orderGuide 页面
   *
   * @return
   */
  @RequestMapping(value = "/orderGuide/{id}.htm")
  public ModelAndView orderGuide(@PathVariable("id") Long id, ModelAndView mv) {
    mv.setViewName("cms/1409/orderGuide");
    mv.addObject("source", ArticlesSourceEnum.ORDER_GUIDE.getName());
    if (Argument.isNotPositive(id)) {
      return mv;
    }

    List<TravelArticlesDO> advertisementList =
        cmsService.list(new TravelArticlesQuery(ArticlesSourceEnum.ORDER_GUIDE.getValue()));
    if (advertisementList == null || advertisementList.size() == 0) {
      return mv;
    }
    TravelArticlesDO articlesDO = new TravelArticlesDO();
    Map<Long, String> navMap = new LinkedHashMap<Long, String>();
    for (TravelArticlesDO articles : advertisementList) {
      navMap.put(articles.getaId(), articles.getTitle());
      if (articles.getaId() == id) {
        articlesDO = articles;
      }
    }

    mv.addObject("nav", navMap);
    mv.addObject("articles", articlesDO);
    return mv;
  }
 /**
  * * 交通列表
  *
  * @param mav
  * @param query
  * @param page
  * @param pagesize
  * @return
  */
 @RequestMapping(value = "/trafficpage.htm")
 public ModelAndView traffic(
     ModelAndView mav, TravelTrafficQuery query, Integer page, Integer pagesize) {
   query.setcId(WebUserTools.getCid());
   query.setPageSize(Argument.isNotPositive(pagesize) ? 15 : pagesize);
   query.setNowPageIndex(Argument.isNotPositive(page) ? 0 : page - 1);
   // 分页查询
   PaginationList<TravelTrafficDO> trafficlist =
       lineService.listPagination(query, new DefaultIpageUrl());
   // 转成VOList
   List<TravelTrafficVO> trafficlistvo = BeanUtils.convert(TravelTrafficVO.class, trafficlist);
   mav.getModel().put(CustomVelocityLayoutView.USE_LAYOUT, "false");
   mav.addObject("traffic", trafficlistvo);
   mav.addObject("pagination", trafficlist.getQuery());
   mav.setViewName("account/line/trafficpage");
   return mav;
 }
 /**
  * 模板显示list
  *
  * @param mv
  * @param query
  * @param page
  * @param pagesize
  * @return
  */
 @RequestMapping(value = "/templatepage.htm")
 public ModelAndView template(
     ModelAndView mv, TravelLineQuery query, Integer page, Integer pagesize) {
   if (query.getzId() != null) {
     query.setzIds(query.getzId());
   }
   query.setlTemplateState(1);
   query.setcId(WebUserTools.getCid());
   query.setPageSize(Argument.isNotPositive(pagesize) ? 15 : pagesize);
   query.setNowPageIndex(Argument.isNotPositive(page) ? 0 : page - 1);
   // 查询线路模板
   PaginationList<TravelLineDO> list = lineService.listPagination(query, new DefaultIpageUrl());
   List<TravelLineVO> lists = BeanUtils.convert(TravelLineVO.class, list);
   mv.addObject("pagination", list.getQuery());
   mv.addObject("template", lists);
   mv.setViewName("account/line/templatepage");
   return mv;
 }
예제 #5
0
  @RequestMapping(value = "/companyDetail/{id}.htm")
  public ModelAndView companyDetail(@PathVariable("id") Long id, ModelAndView mav) {
    mav.setViewName("cms/companyDetail");
    if (Argument.isNotPositive(id)) {
      return mav;
    }

    TravelCompanyDO company = companyService.getById(id);
    mav.addObject("company", company);
    return mav;
  }
예제 #6
0
  @RequestMapping(value = "/news.htm")
  public ModelAndView news(ModelAndView mav, TravelNewsQuery query, Integer page) {
    query.setNowPageIndex(Argument.isNotPositive(page) ? 0 : page - 1);
    query.setPageSize(20);
    PaginationList<TravelNewsDO> list = cmsService.showNewsPagination(query, new DefaultIpageUrl());

    mav.getModel().put(CustomVelocityLayoutView.USE_LAYOUT, "false");
    mav.addObject("newsList", list);
    mav.addObject("pagination", list.getQuery());
    mav.setViewName("cms/1409/news");
    return mav;
  }
예제 #7
0
  /**
   * 积分商城
   *
   * @return
   */
  @RequestMapping(value = "/shop.htm")
  public ModelAndView shop(ModelAndView mav, TravelGiftQuery query, Integer page) {
    query.setPageSize(20);
    query.setNowPageIndex(Argument.isNotPositive(page) ? 0 : page - 1);
    PaginationList<TravelGiftDO> list =
        integralService.listPagination(
            query,
            new IPageUrl() {

              @Override
              public String parsePageUrl(Object... objs) {
                return "/shop.htm?page=" + (Integer) objs[1];
              }
            });
    mav.getModel().put(CustomVelocityLayoutView.USE_LAYOUT, "false");
    mav.addObject("giftList", list);
    mav.addObject("pagination", list.getQuery());

    List<TravelGiftClassDO> classDOs = integralService.list(new TravelGiftClassQuery());
    mav.addObject("gClassList", classDOs);
    mav.setViewName("cms/1409/shop");
    return mav;
  }