|
@@ -58,9 +58,9 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
Boolean needSubjective = jsonParams.get("needSubjective").asBoolean(false);
|
|
Boolean needSubjective = jsonParams.get("needSubjective").asBoolean(false);
|
|
log.info("examId = {}, courseCodes = {}, needSubjective = {}", examId, courseCodes, needSubjective);
|
|
log.info("examId = {}, courseCodes = {}, needSubjective = {}", examId, courseCodes, needSubjective);
|
|
|
|
|
|
- // 待导出的课程列表(未指定课程则按考试的全部课程)
|
|
|
|
|
|
+ // 待处理的课程列表(未指定课程则按考试的全部课程)
|
|
List<CourseVO> todoCourses;
|
|
List<CourseVO> todoCourses;
|
|
- List<CourseVO> courses = this.getExamCourseList(user.getKey(), user.getToken(), examId);
|
|
|
|
|
|
+ List<CourseVO> courses = commonService.getExamCourseList(user.getKey(), user.getToken(), examId);
|
|
if (StringUtils.isNotBlank(courseCodes)) {
|
|
if (StringUtils.isNotBlank(courseCodes)) {
|
|
todoCourses = new ArrayList<>();
|
|
todoCourses = new ArrayList<>();
|
|
String[] courseCodeList = StringUtils.split(courseCodes, ",");
|
|
String[] courseCodeList = StringUtils.split(courseCodes, ",");
|
|
@@ -74,10 +74,10 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
} else {
|
|
} else {
|
|
todoCourses = courses;
|
|
todoCourses = courses;
|
|
}
|
|
}
|
|
- log.info("待导出的课程列表数为:{}", todoCourses.size());
|
|
|
|
|
|
+ log.info("待处理的课程数为:{}", todoCourses.size());
|
|
|
|
|
|
for (CourseVO course : todoCourses) {
|
|
for (CourseVO course : todoCourses) {
|
|
- // 按考试课程逐个导出
|
|
|
|
|
|
+ // 按考试课程逐个处理
|
|
this.export(examId, course, needSubjective, user, tempDir);
|
|
this.export(examId, course, needSubjective, user, tempDir);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -283,33 +283,6 @@ public class ExportStudentAnswerAndScoreDetailTask {
|
|
return all;
|
|
return all;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取考试相关的课程列表
|
|
|
|
- */
|
|
|
|
- private List<CourseVO> getExamCourseList(String key, String token, Long examId) {
|
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
|
- params.put("examId", examId);
|
|
|
|
- params.put("pageNo", 1);
|
|
|
|
- params.put("pageSize", 1000);
|
|
|
|
-
|
|
|
|
- Map<String, String> headers = new HashMap<>();
|
|
|
|
- headers.put("key", key);
|
|
|
|
- headers.put("token", token);
|
|
|
|
-
|
|
|
|
- String url = sysProperty.getServerUrl() + "/api/ecs_exam_work/exam/course/list";
|
|
|
|
- String json = HttpHelper.post(url, headers, params);
|
|
|
|
-
|
|
|
|
- JsonMapper jsonMapper = new JsonMapper();
|
|
|
|
- Pager<CourseVO> page = jsonMapper.parseJson(json, new TypeReference<Pager<CourseVO>>() {
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- if (page != null && page.getContent() != null) {
|
|
|
|
- return page.getContent();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return new ArrayList<>();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private String numbersToLetters(String numberStr) {
|
|
private String numbersToLetters(String numberStr) {
|
|
if (StringUtils.isEmpty(numberStr)) {
|
|
if (StringUtils.isEmpty(numberStr)) {
|
|
return "";
|
|
return "";
|