Merge branch 'gyj' into test
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package cn.ysk.cashier.utils;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.ysk.cashier.dto.shop.ExportTableStsDataDto;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
@@ -8,13 +7,10 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.ysk.cashier.utils.FileUtil.SYS_TEM_DIR;
|
||||
|
||||
/**
|
||||
* @author yijiegong
|
||||
*/
|
||||
@@ -64,14 +60,10 @@ public class FileUtils {
|
||||
response.setHeader("Content-Disposition", "attachment;filename=file.xlsx");
|
||||
|
||||
try (ServletOutputStream out = response.getOutputStream()) {
|
||||
//
|
||||
// workbook.write(outputStream);
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
} catch (IOException e) {
|
||||
// 更详细的错误处理
|
||||
e.printStackTrace();
|
||||
// 可以考虑返回一个错误响应给客户端
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user