|
|
|
@@ -2,6 +2,7 @@ package com.simple.service.impl; |
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.ExcelExportUtil; |
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams; |
|
|
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.simple.common.ErrorCode; |
|
|
|
@@ -19,6 +20,8 @@ import com.simple.enums.EnumPayStatus; |
|
|
|
import com.simple.exception.MallinkException; |
|
|
|
import com.simple.mapper.*; |
|
|
|
import com.simple.service.*; |
|
|
|
import com.simple.utils.DataUtil; |
|
|
|
import com.simple.utils.DateUtils; |
|
|
|
import org.apache.log4j.Logger; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -64,6 +67,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
@Autowired |
|
|
|
WxPayOrderMapper wxPayOrderMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMallMapper wxMallMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxCouponOrder> listAsPage(WxCouponOrder record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -241,17 +247,19 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
WxCouponOrder wxCouponOrder = new WxCouponOrder(); |
|
|
|
wxCouponOrder.setTenantId(tenantId); |
|
|
|
List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); |
|
|
|
|
|
|
|
WxMall wxMall = new WxMall(); |
|
|
|
wxMall.setTenantId(tenantId); |
|
|
|
wxMall = wxMallMapper.findList(wxMall).get(0); |
|
|
|
String filepath="./uploads/"; |
|
|
|
File savefile = new File(filepath); |
|
|
|
if (!savefile.exists()) { |
|
|
|
savefile.mkdirs(); |
|
|
|
} |
|
|
|
|
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), WxCouponOrderBVo.class, list); |
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("","",ExcelType.XSSF), WxCouponOrderBVo.class, list); |
|
|
|
FileOutputStream fos = null; |
|
|
|
try { |
|
|
|
String filename=UUID.randomUUID()+".xlsx"; |
|
|
|
String filename=wxMall.getName()+ DateUtils.getSystemTime("yyyyMMDDHHmmss") +".xlsx"; |
|
|
|
filepath=filepath+filename; |
|
|
|
fos = new FileOutputStream(filepath); |
|
|
|
workbook.write(fos); |
|
|
|
|