| @@ -25,6 +25,7 @@ import com.iformall.domain.vo.WxCardPriceTemplate; | |||||
| import com.iformall.enums.EnumMerchantCreateFrom; | import com.iformall.enums.EnumMerchantCreateFrom; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.file.aliyun.AliyunOSS; | import com.iformall.file.aliyun.AliyunOSS; | ||||
| import com.iformall.service.ExcelService; | |||||
| import com.iformall.service.TtMerchantPoiService; | import com.iformall.service.TtMerchantPoiService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | import com.iformall.service.WxCUserBasicInfoService; | ||||
| import com.iformall.service.WxCouponPasswordService; | import com.iformall.service.WxCouponPasswordService; | ||||
| @@ -79,6 +80,9 @@ public class AsyncTask { | |||||
| @Autowired | @Autowired | ||||
| private AliyunOSS aliyunOSS; | private AliyunOSS aliyunOSS; | ||||
| @Autowired | |||||
| ExcelService excelService; | |||||
| private class UserExcelHandler extends ExcelDataHandlerDefaultImpl<CUserBaseInfoT> { | private class UserExcelHandler extends ExcelDataHandlerDefaultImpl<CUserBaseInfoT> { | ||||
| @Override | @Override | ||||
| @@ -400,19 +404,7 @@ public class AsyncTask { | |||||
| } | } | ||||
| private void exportExcel(HttpServletRequest request, HttpServletResponse response,List successList, Class dataClass, String fileName) throws Exception { | private void exportExcel(HttpServletRequest request, HttpServletResponse response,List successList, Class dataClass, String fileName) throws Exception { | ||||
| ExportParams exportParams = new ExportParams(); | |||||
| exportParams.setType(ExcelType.XSSF); | |||||
| Workbook workBook = ExcelExportUtil.exportExcel(exportParams, dataClass, successList); | |||||
| response.setContentType("application/octet-stream;charset=UTF-8"); | |||||
| //response.setHeader("Content-Type", "application/vnd.ms-excel");//xls | |||||
| response.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");//xlsx | |||||
| response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("GB2312"), "8859_1")); | |||||
| response.addHeader("Pargam", "no-cache"); | |||||
| response.addHeader("Cache-Control", "no-cache"); | |||||
| OutputStream out = response.getOutputStream(); | |||||
| workBook.write(out); | |||||
| out.flush(); | |||||
| out.close(); | |||||
| excelService.exportExcel(successList, null, "sheet1", dataClass, fileName, response, false); | |||||
| } | } | ||||
| private String uploadErrorExcel(List successList, Class dataClass, String fileName) throws Exception { | private String uploadErrorExcel(List successList, Class dataClass, String fileName) throws Exception { | ||||