1231123
This commit is contained in:
@@ -45,6 +45,10 @@ public class ExcelUtil {
|
||||
return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
|
||||
}
|
||||
|
||||
public static <T> List<T> importExcel(InputStream is, Class<T> clazz,String sheetName) {
|
||||
return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet(sheetName).doReadSync();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用校验监听器 异步导入 同步返回
|
||||
@@ -306,7 +310,7 @@ public class ExcelUtil {
|
||||
/**
|
||||
* 重置响应体
|
||||
*/
|
||||
private static void resetResponse(String sheetName, HttpServletResponse response) throws UnsupportedEncodingException {
|
||||
public static void resetResponse(String sheetName, HttpServletResponse response) throws UnsupportedEncodingException {
|
||||
String filename = encodingFilename(sheetName);
|
||||
FileUtils.setAttachmentResponseHeader(response, filename);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
||||
|
||||
Reference in New Issue
Block a user