Ejemplo n.º 1
0
  private int findAllByPageListSize(DiscountIn inVo) throws Exception {

    PageBean<DiscountIn> pageBean = new PageBean<DiscountIn>(0, Integer.MAX_VALUE);
    pageBean.setInVo(inVo);
    List<DiscountOut> list = discountServiceImpl.findAllByPage(pageBean);
    if (list != null) {
      return list.size();
    }
    return 0;
  }
Ejemplo n.º 2
0
  @RequestMapping("discountFindAllByPage")
  @ResponseBody
  public Object findAllByPage(HttpServletRequest request, DiscountIn inVo) throws Exception {
    int currentPage = Integer.parseInt(request.getParameter("page"));
    int pageSize = Integer.parseInt(request.getParameter("rows"));

    Map<String, Object> map = new HashMap<String, Object>();
    PageBean<DiscountIn> pageBean = new PageBean<DiscountIn>(currentPage, pageSize);
    pageBean.setInVo(inVo);
    map.put("total", findAllByPageListSize(inVo));
    map.put("rows", discountServiceImpl.findAllByPage(pageBean));
    System.out.println(map);
    return map;
  }