@Override public IListPage pageQuery(Map<String, Object> param, int pageNo) throws Exception { int pageSize = Consts.PAGE_SIZE; int total = voucherDao.pageCount(param); int start = (pageNo - 1) * pageSize; param.put("startRow", start); param.put("endRow", pageSize); List<VoucherModel> data = voucherDao.pageQuery(param); DDUtil cache = SpringUtil.getCache(); for (int index = 0; index < data.size(); index++) { VoucherModel obj = data.get(index); obj.setStatus(cache.getContent(VOUCHER_STATUS, obj.getStatus())); obj.setVoucher_type(cache.getContent(VOUCHER_TYPE, obj.getVoucher_type())); } return new ListPage(start, total, pageSize, data); }
@Override public boolean add(VoucherModel model) throws Exception { model.setCreate_date(DateUtil.todayStr()); return voucherDao.save(model); }