|
@@ -47,8 +47,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
this.execute(jsonParams, user, tempDir);
|
|
|
|
|
|
// 压缩文件
|
|
|
- FileHelper.zip(new File(sysProperty.getDataDir() + "/" + tempDir),
|
|
|
- new File(sysProperty.getDataDir() + "/" + tempDir + ".zip"));
|
|
|
+ FileHelper.zip(new File(sysProperty.getDataDir() + "/" + tempDir), new File(sysProperty.getDataDir() + "/" + tempDir + ".zip"));
|
|
|
task.setFilePath(tempDir + ".zip");
|
|
|
}
|
|
|
|
|
@@ -90,20 +89,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
|
|
|
List<List<String>> excelRows = new ArrayList<>();
|
|
|
for (ExamStudentScoreVO vo : examStudentScoreList) {
|
|
|
- List<String> rowValues = Lists.newArrayList(
|
|
|
- vo.getOrgName(),
|
|
|
- vo.getCourseCode(),
|
|
|
- vo.getCourseName(),
|
|
|
- vo.getCourseLevel(),
|
|
|
- vo.getIdentityNumber(),
|
|
|
- vo.getStudentCode(),
|
|
|
- vo.getStudentName(),
|
|
|
- vo.getGrade(),
|
|
|
- vo.getSpecialtyName(),
|
|
|
- vo.getIsAbsent(),
|
|
|
- vo.getObjectiveScore().replace("--", "0"),
|
|
|
- vo.getSubjectiveScore().replace("--", "0"),
|
|
|
- vo.getFinalExamScore().replace("--", "0"));
|
|
|
+ List<String> rowValues = Lists.newArrayList(vo.getOrgName(), vo.getCourseCode(), vo.getCourseName(), vo.getCourseLevel(), vo.getIdentityNumber(), vo.getStudentCode(), vo.getStudentName(), vo.getGrade(), vo.getSpecialtyName(), vo.getIsAbsent(), vo.getObjectiveScore().replace("--", "0"), vo.getSubjectiveScore().replace("--", "0"), vo.getFinalExamScore().replace("--", "0"));
|
|
|
excelRows.add(rowValues);
|
|
|
|
|
|
if (vo.getExamRecordDataId() == null) {
|
|
@@ -123,6 +109,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ // dynamicExcelHeaders.add(String.format("%s%s-%s-ID", question.getQuestionType().getDesc(), question.getMainNumber(), question.getOrder()));
|
|
|
// dynamicExcelHeaders.add(String.format("%s%s-%s答案", question.getQuestionType().getDesc(), question.getMainNumber(), question.getOrder()));
|
|
|
dynamicExcelHeaders.add(String.format("%s%s-%s作答", question.getQuestionType().getDesc(), question.getMainNumber(), question.getOrder()));
|
|
|
dynamicExcelHeaders.add(String.format("%s%s-%s得分", question.getQuestionType().getDesc(), question.getMainNumber(), question.getOrder()));
|
|
@@ -156,6 +143,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
studentAnswer = numbersToLetters(question.getStudentAnswer());
|
|
|
}
|
|
|
|
|
|
+ // dynamicColumnValues.add(question.getQuestionId());
|
|
|
// dynamicColumnValues.add(correctAnswer);
|
|
|
dynamicColumnValues.add(studentAnswer);
|
|
|
if (correctAnswer.equals(studentAnswer)) {
|
|
@@ -165,6 +153,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
}
|
|
|
} else {
|
|
|
if (needSubjective) {
|
|
|
+ // dynamicColumnValues.add(question.getQuestionId());
|
|
|
// String correctAnswer = question.getCorrectAnswer() != null ? question.getCorrectAnswer() : "";
|
|
|
// dynamicColumnValues.add(Jsoup.clean(correctAnswer, Safelist.simpleText()));
|
|
|
String studentAnswer = question.getStudentAnswer() != null ? question.getStudentAnswer() : "";
|
|
@@ -182,11 +171,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
excelHeaders.addAll(dynamicExcelHeaders);
|
|
|
|
|
|
final String filePath = sysProperty.getDataDir() + "/" + tempDir + "/" + examId + "_" + course.getCourseCode() + ".xlsx";
|
|
|
- EasyExcel.write(filePath)
|
|
|
- .head(ExcelHelper.buildHeaders(excelHeaders))
|
|
|
- .registerWriteHandler(ExcelHelper.sheetStrategy())
|
|
|
- .registerWriteHandler(ExcelHelper.styleStrategy())
|
|
|
- .sheet().doWrite(excelRows);
|
|
|
+ EasyExcel.write(filePath).head(ExcelHelper.buildHeaders(excelHeaders)).registerWriteHandler(ExcelHelper.sheetStrategy()).registerWriteHandler(ExcelHelper.styleStrategy()).sheet().doWrite(excelRows);
|
|
|
|
|
|
log.info("examId:{} courseId:{} courseCode:{} totalRows:{} 已处理!", examId, course.getCourseId(), course.getCourseCode(), excelRows.size());
|
|
|
|
|
@@ -293,8 +278,7 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
|
List<Integer> numbers = new ArrayList<>();
|
|
|
if (numberStr.startsWith("[") && numberStr.endsWith("]")) {
|
|
|
// Json数据格式,如:[0,1,2,3,4,5,6,7,8,9,...,25]
|
|
|
- String[] values = numberStr.replace("[", "")
|
|
|
- .replace("]", "").split(",");
|
|
|
+ String[] values = numberStr.replace("[", "").replace("]", "").split(",");
|
|
|
for (String value : values) {
|
|
|
if (value.matches("^\\d+$")) {
|
|
|
numbers.add(Integer.parseInt(value.trim()));
|