|
|
|
@ -21,10 +21,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.imageio.ImageIO; |
|
|
|
import java.io.BufferedReader; |
|
|
|
import java.io.File; |
|
|
|
import java.io.FileReader; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.*; |
|
|
|
import java.net.URLConnection; |
|
|
|
import java.nio.file.Files; |
|
|
|
import java.nio.file.Path; |
|
|
|
@ -325,21 +322,21 @@ public class GetInformationForExcelServiceImpl extends ServiceImpl<GetInformatio |
|
|
|
File excelFile = new File(s); |
|
|
|
String fileType = s.substring(s.lastIndexOf(".")+1); |
|
|
|
List<Map<Integer, String>> list = new ArrayList<>(); |
|
|
|
try { |
|
|
|
try (InputStream in = Files.newInputStream(excelFile.toPath())) { |
|
|
|
if (ExcelTypeEnum.XLS.toString().equals(fileType.toUpperCase())){ |
|
|
|
list = EasyExcel.read(excelFile) |
|
|
|
list = EasyExcel.read(in) |
|
|
|
.excelType(ExcelTypeEnum.XLS) |
|
|
|
.headRowNumber(0) |
|
|
|
.sheet() |
|
|
|
.doReadSync(); |
|
|
|
}else if (ExcelTypeEnum.XLSX.toString().equals(fileType.toUpperCase())){ |
|
|
|
list = EasyExcel.read(excelFile) |
|
|
|
list = EasyExcel.read(in) |
|
|
|
.excelType(ExcelTypeEnum.XLSX) |
|
|
|
.headRowNumber(0) |
|
|
|
.sheet() |
|
|
|
.doReadSync(); |
|
|
|
}else if (ExcelTypeEnum.CSV.toString().equals(fileType.toUpperCase())){ |
|
|
|
list = EasyExcel.read(excelFile) |
|
|
|
list = EasyExcel.read(in) |
|
|
|
.excelType(ExcelTypeEnum.CSV) |
|
|
|
.headRowNumber(0) |
|
|
|
.sheet() |
|
|
|
|