| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import cn.idev.excel.FastExcel; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 |
| | | String fileName = URLEncoder.encode("微波设备使用记录", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), MwCollectRecordVO.class).sheet("微波设备使用记录").doWrite(list); |
| | | FastExcel.write(response.getOutputStream(), MwCollectRecordVO.class).sheet("微波设备使用记录").doWrite(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | String fileName = URLEncoder.encode("处置分析报表", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream()) |
| | | FastExcel.write(response.getOutputStream()) |
| | | .head(head) |
| | | .autoCloseStream(Boolean.TRUE) |
| | | .sheet("处置分析报表") |