wangwei 7 年之前
父節點
當前提交
d03f62d42b

+ 2 - 9
examcloud-task-service/src/main/java/cn/com/qmth/examcloud/task/service/job/ExamStudentImportParsingFileTask.java

@@ -10,8 +10,6 @@ import java.util.Map;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -107,13 +105,8 @@ public class ExamStudentImportParsingFileTask extends AbstractTask {
 			return;
 		}
 
-		Workbook workBook = ExcelParser.getWorkBook(new File(destFilePath),
-				importEntity.getFileName());
-
-		Sheet sheet = workBook.getSheetAt(0);
-
-		List<String[]> lineList = ExcelParser.readSheet(sheet, 13);
-		ExcelParser.close(workBook);
+		List<String[]> lineList = ExcelParser.readSheetBySax(PathUtil.getCanonicalPath(file), 1,
+				13);
 
 		if (CollectionUtils.isEmpty(lineList)) {
 			importEntity.setStatus(ExamStudentImportStatus.ERROR);