| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Log(title = "社区活动管理信息-社区活动报名信息导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "社区活动报名信息导出") |
| | | @PostMapping("/exportRegistration") |
| | | public void exportRegistration(@RequestBody RegistrationPageListQuery query){ |
| | | List<TRegistrationExport> registrationExports = communityActivityRegistrationService.exportRegistration(query); |
| | | for (TRegistrationExport registrationExport : registrationExports) { |
| | | if(Objects.nonNull(registrationExport.getCreateTime())){ |
| | | registrationExport.setCreateTimeStr(DateUtils.localDateTimeToString(registrationExport.getCreateTime())); |
| | | @Log(title = "社区活动管理信息-社区活动报名信息导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "社区活动报名信息导出") |
| | | @PostMapping("/exportRegistration") |
| | | public void exportRegistration(@RequestBody RegistrationPageListQuery query){ |
| | | List<TRegistrationExport> registrationExports = communityActivityRegistrationService.exportRegistration(query); |
| | | for (TRegistrationExport registrationExport : registrationExports) { |
| | | if(Objects.nonNull(registrationExport.getCreateTime())){ |
| | | registrationExport.setCreateTimeStr(DateUtils.localDateTimeToString(registrationExport.getCreateTime())); |
| | | } |
| | | } |
| | | } |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TRegistrationExport.class, registrationExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("社区活动报名信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TRegistrationExport.class, registrationExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | outputStream.close(); |
| | | String fileName = URLEncoder.encode("社区活动报名信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |