|
@@ -188,11 +188,24 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
|
|
|
// 更新试卷编号
|
|
|
String examDetailCourseIdStr = paperParam.getExamDetailCourseIds();
|
|
|
List<Long> examDetailCourseIds = Arrays.asList(examDetailCourseIdStr.split(",")).stream().map(m -> Long.valueOf(m)).collect(Collectors.toList());
|
|
|
-// List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(examTask.getSchoolId(), paperParam.getPrintPlanId(), examTask.getCourseCode(), examTask.getPaperNumber());
|
|
|
examDetailCourseService.updatePaperNumber(examDetailCourseIds, paperParam.getPaperNumber(), paperParam.getRelatePaperType());
|
|
|
|
|
|
// 更新考生关联类型
|
|
|
- examStudentService.updatePaperType(examDetailCourseIds, paperParam.getRelatePaperType());
|
|
|
+// examStudentService.updatePaperType(examDetailCourseIds, paperParam.getRelatePaperType());
|
|
|
+ ExamTaskDetail examTaskDetail = this.getByExamTaskId(newExamTask.getId());
|
|
|
+ List<String> types = Arrays.asList(paperParam.getRelatePaperType().split("/"));
|
|
|
+ for (Long examDetailCourseId : examDetailCourseIds) {
|
|
|
+ QueryWrapper<ExamStudent> studentQueryWrapper = new QueryWrapper<>();
|
|
|
+ studentQueryWrapper.lambda().eq(ExamStudent::getExamDetailCourseId, examDetailCourseId);
|
|
|
+ List<ExamStudent> students = examStudentService.list(studentQueryWrapper);
|
|
|
+ int i = 0;
|
|
|
+ for (ExamStudent student : students) {
|
|
|
+ int mod = i % examTaskDetail.getDrawCount();
|
|
|
+ student.setPaperType(types.get(mod));
|
|
|
+ examStudentService.updateById(student);
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 重新生成pdf
|
|
|
List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByIds(examDetailCourseIds);
|
|
@@ -201,6 +214,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.CREATE_PDF, paperParam.getPrintPlanId(), sysUser, listEntry.getKey());
|
|
|
map.computeIfAbsent("examDetailCourseIds", v -> listEntry.getValue());
|
|
|
+ // todo xf 多卷型
|
|
|
map.computeIfAbsent("paperType", v -> paperParam.getRelatePaperType());
|
|
|
asyncCreatePdfTempleteService.createPdf(map, null);
|
|
|
}
|