|
@@ -69,7 +69,15 @@ public class ExamStudentImportParsingFileTask extends AbstractTask {
|
|
|
importEntity.setStatus(ExamStudentImportStatus.FILE_PARSING);
|
|
|
examStudentImportRepo.saveAndFlush(importEntity);
|
|
|
|
|
|
- importExcel(importEntity);
|
|
|
+ try {
|
|
|
+ importExcel(importEntity);
|
|
|
+ } catch (Exception e) {
|
|
|
+ debugLog.error("文件解析入库异常", e);
|
|
|
+ importEntity.setStatus(ExamStudentImportStatus.ERROR);
|
|
|
+ importEntity.setStatusDesc(e.getMessage());
|
|
|
+ examStudentImportRepo.saveAndFlush(importEntity);
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -83,8 +91,6 @@ public class ExamStudentImportParsingFileTask extends AbstractTask {
|
|
|
dir + "/" + EXAM_STUDENT_IMPORT_FILES + "/" + importEntity.getFilePath());
|
|
|
String resultFilePath = PathUtil.getCanonicalPath(
|
|
|
dir + "/" + EXAM_STUDENT_IMPORT_FILES + "/" + importEntity.getResultFilePath());
|
|
|
- Workbook workBook = ExcelParser.getWorkBook(new File(destFilePath),
|
|
|
- importEntity.getFileName());
|
|
|
|
|
|
File file = new File(destFilePath);
|
|
|
|
|
@@ -95,6 +101,9 @@ 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);
|