Java Code Examples for com.github.pagehelper.Page#setPageSize()
The following examples show how to use
com.github.pagehelper.Page#setPageSize() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WxGrouponRuleService.java From BigDataPlatform with GNU General Public License v3.0 | 5 votes |
public List<GrouponRuleVo> queryList(Integer page, Integer size, String sort, String order) { List<LitemallGrouponRules> grouponRulesList = grouponRulesService.queryList(page, size, sort, order); PageInfo pageInfo = new PageInfo(grouponRulesList); Page<GrouponRuleVo> grouponList = new Page<GrouponRuleVo>(); grouponList.setPages(pageInfo.getPages()); grouponList.setPageNum(pageInfo.getPageNum()); grouponList.setPageSize(pageInfo.getPageSize()); grouponList.setTotal(pageInfo.getTotal()); for (LitemallGrouponRules rule : (List<LitemallGrouponRules>)pageInfo.getList()) { Integer goodsId = rule.getGoodsId(); LitemallGoods goods = goodsService.findById(goodsId); if (goods == null) continue; GrouponRuleVo grouponRuleVo = new GrouponRuleVo(); grouponRuleVo.setId(goods.getId()); grouponRuleVo.setName(goods.getName()); grouponRuleVo.setBrief(goods.getBrief()); grouponRuleVo.setPicUrl(goods.getPicUrl()); grouponRuleVo.setCounterPrice(goods.getCounterPrice()); grouponRuleVo.setRetailPrice(goods.getRetailPrice()); grouponRuleVo.setGrouponPrice(goods.getRetailPrice().subtract(rule.getDiscount())); grouponRuleVo.setGrouponDiscount(rule.getDiscount()); grouponRuleVo.setGrouponMember(rule.getDiscountMember()); grouponList.add(grouponRuleVo); } return grouponList; }
Example 2
Source File: WxGrouponRuleService.java From litemall with MIT License | 5 votes |
public List<GrouponRuleVo> queryList(Integer page, Integer size, String sort, String order) { Page<LitemallGrouponRules> grouponRulesList = (Page<LitemallGrouponRules>)grouponRulesService.queryList(page, size, sort, order); Page<GrouponRuleVo> grouponList = new Page<GrouponRuleVo>(); grouponList.setPages(grouponRulesList.getPages()); grouponList.setPageNum(grouponRulesList.getPageNum()); grouponList.setPageSize(grouponRulesList.getPageSize()); grouponList.setTotal(grouponRulesList.getTotal()); for (LitemallGrouponRules rule : grouponRulesList) { Integer goodsId = rule.getGoodsId(); LitemallGoods goods = goodsService.findById(goodsId); if (goods == null) continue; GrouponRuleVo grouponRuleVo = new GrouponRuleVo(); grouponRuleVo.setId(goods.getId()); grouponRuleVo.setName(goods.getName()); grouponRuleVo.setBrief(goods.getBrief()); grouponRuleVo.setPicUrl(goods.getPicUrl()); grouponRuleVo.setCounterPrice(goods.getCounterPrice()); grouponRuleVo.setRetailPrice(goods.getRetailPrice()); grouponRuleVo.setGrouponPrice(goods.getRetailPrice().subtract(rule.getDiscount())); grouponRuleVo.setGrouponDiscount(rule.getDiscount()); grouponRuleVo.setGrouponMember(rule.getDiscountMember()); grouponRuleVo.setExpireTime(rule.getExpireTime()); grouponList.add(grouponRuleVo); } return grouponList; }