use of com.ikoori.vip.server.modular.biz.warpper.CouponCodeWarpper in project vip by guangdada.
the class CouponCodeController method export.
/**
* 导出
*
* @Title: queryExcel
* @param request
* @param response
* @param batchNo
* @param verifyCode
* @param verifyNo
* @param couponId
* @param useStatus
* @return
* @throws IOException
* @date: 2017年10月15日 下午4:03:52
* @author: chengxg
*/
@Permission
@RequestMapping(value = "/export", method = RequestMethod.GET)
public void export(HttpServletRequest request, HttpServletResponse response, String batchNo, String verifyCode, String verifyNo, Long couponId, Integer useStatus) throws IOException {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().bigPage();
List<Map<String, Object>> result = couponCodeService.getCouponCodeList(page, batchNo, verifyCode, verifyNo, useStatus, couponId, merchant.getId(), page.getOrderByField(), page.isAsc());
List<Map<String, Object>> couponCodeList = (List<Map<String, Object>>) (new CouponCodeWarpper(result).warp());
// 定义导出excel的名字
String excelName = "券号批量导出表";
if (StringUtils.isNotBlank(batchNo)) {
excelName = excelName + "-" + batchNo;
}
// 获取需要转出的excle表头的map字段
LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
fieldMap.put("batchNo", "批次号");
if (couponId != null) {
fieldMap.put("couponName", "现金券名称");
}
fieldMap.put("verifyNo", "卡号");
fieldMap.put("verifyCode", "券码");
// 导出
PoiExcelUtil.export(excelName, couponCodeList, fieldMap, response);
}
use of com.ikoori.vip.server.modular.biz.warpper.CouponCodeWarpper in project vip by guangdada.
the class CouponCodeController method list.
/**
* 获取券码管理列表
*/
@Permission
@RequestMapping(value = "/list")
@ResponseBody
public Object list(String batchNo, String verifyCode, String verifyNo, Long couponId, Integer useStatus, Model model) {
Long userId = Long.valueOf(ShiroKit.getUser().getId());
Merchant merchant = merchantService.getMerchantUserId(userId);
Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
List<Map<String, Object>> result = couponCodeService.getCouponCodeList(page, batchNo, verifyCode, verifyNo, useStatus, couponId, merchant.getId(), page.getOrderByField(), page.isAsc());
page.setRecords((List<Map<String, Object>>) new CouponCodeWarpper(result).warp());
return super.packForBT(page);
}
Aggregations