Commit ae9bfa35 authored by 竹天卫's avatar 竹天卫

导出优化

parent 529867a9
......@@ -292,7 +292,7 @@ public class SampleServiceImpl extends ServiceImpl<SampleMapper, Sample> impleme
Map<String, Object> map = new HashMap<>(3);
map.put("start", start);
map.put("end", end);
map.put("name", sampleName);
map.put("sampleName", sampleName);
map.put("cementCode", cementCode);
List<SampleWord> list = sampleMapper.exportWordList(map);
......
......@@ -47,7 +47,7 @@ public class ExcelUtil {
byteArrayOutputStream = new ByteArrayOutputStream();
workbook.write(byteArrayOutputStream);
String suffix = ".xls";
String suffix = ".xlsx";
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition",
"attachment;filename=" + new String((fileName + suffix).getBytes(), "iso-8859-1"));
......@@ -84,7 +84,7 @@ public class ExcelUtil {
byteArrayOutputStream = new ByteArrayOutputStream();
workbook.write(byteArrayOutputStream);
String suffix = ".xls";
String suffix = ".xlsx";
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition",
"attachment;filename=" + new String((fileName + suffix).getBytes(), "iso-8859-1"));
......@@ -120,7 +120,7 @@ public class ExcelUtil {
byteArrayOutputStream = new ByteArrayOutputStream();
workbook.write(byteArrayOutputStream);
String suffix = ".xls";
String suffix = ".xlsx";
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition",
"attachment;filename=" + new String((fileName + suffix).getBytes(), "iso-8859-1"));
......@@ -464,7 +464,6 @@ public class ExcelUtil {
@SuppressWarnings("resource")
public static List<Map<Integer, String>> readData(FileInputStream fis) throws Exception {
XSSFWorkbook hwb = new XSSFWorkbook(fis);
List<Map<Integer, String>> usermap = new ArrayList<>();
// 获取第一个sheet页
XSSFSheet sheetAt = hwb.getSheetAt(0);
......@@ -507,16 +506,6 @@ public class ExcelUtil {
public static void main(String[] args) throws IOException {
//指定数据存放的位置
OutputStream outputStream = new FileOutputStream("D:\\test.xlsx");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment