|
@@ -1044,14 +1044,16 @@ public abstract class ExportPaperAbstractService {
|
|
|
objectiveQuestionStructureList.add(new ObjectiveQuestionStructure(paperExp, paperDetailExp, unit, paperType));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
ExcelWriter objectiveExcelExporter = new ExcelWriter(ObjectiveQuestionStructure.class);
|
|
|
- try {
|
|
|
- File file = new File(TEMP_FILE_EXP + objectiveFilename);
|
|
|
- FileOutputStream out = new FileOutputStream(file);
|
|
|
+ File file = new File(TEMP_FILE_EXP + objectiveFilename);
|
|
|
+ try (FileOutputStream out = new FileOutputStream(file);) {
|
|
|
objectiveExcelExporter.write(objectiveFilename, objectiveQuestionStructureList, out);
|
|
|
+
|
|
|
String objectiveFilePath = sysProperty.getUploadPath() + extractConfig.getOrgId() + "/" + objectiveFilename;
|
|
|
UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
upyun.writeFile(objectiveFilePath, file, true);
|
|
|
+
|
|
|
ExamFile examFile = new ExamFile(paperExp.getId(), extractConfig, objectiveFilePath, ExamFileType.PAPER_STRUCTURE_OBJECTIVE, EXCEL_SUFFIX);
|
|
|
examFile.setGroupCode(examPaper.getGroupCode());
|
|
|
examFile.setFileName(extractConfig.getCourseName() + "_" + extractConfig.getCourseCode() + "_" + ExamFileType.PAPER_STRUCTURE_OBJECTIVE + "_" + examPaper.getGroupCode() + EXCEL_SUFFIX);
|
|
@@ -1082,14 +1084,16 @@ public abstract class ExportPaperAbstractService {
|
|
|
subjectiveQuestionStructureList.add(new SubjectiveQuestionStructure(paperExp, paperDetailExp, unit, paperType));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
ExcelWriter subjectiveExcelExporter = new ExcelWriter(SubjectiveQuestionStructure.class);
|
|
|
- try {
|
|
|
- File file = new File(TEMP_FILE_EXP + subjectiveFileName);
|
|
|
- FileOutputStream out = new FileOutputStream(file);
|
|
|
+ File file = new File(TEMP_FILE_EXP + subjectiveFileName);
|
|
|
+ try (FileOutputStream out = new FileOutputStream(file);) {
|
|
|
subjectiveExcelExporter.write(subjectiveFileName, subjectiveQuestionStructureList, out);
|
|
|
+
|
|
|
String subjectiveFilePath = sysProperty.getUploadPath() + extractConfig.getOrgId() + "/" + subjectiveFileName;
|
|
|
UpYun upyun = new UpYun(sysProperty.getBucketName(), sysProperty.getUserName(), sysProperty.getPassword());
|
|
|
upyun.writeFile(subjectiveFilePath, file, true);
|
|
|
+
|
|
|
ExamFile examFile = new ExamFile(paperExp.getId(), extractConfig, subjectiveFilePath, ExamFileType.PAPER_STRUCTURE_SUBJECTIVE, EXCEL_SUFFIX);
|
|
|
examFile.setGroupCode(examPaper.getGroupCode());
|
|
|
examFile.setFileName(extractConfig.getCourseName() + "_" + extractConfig.getCourseCode() + "_" + ExamFileType.PAPER_STRUCTURE_SUBJECTIVE + "_" + examPaper.getGroupCode() + EXCEL_SUFFIX);
|