|
@@ -15,6 +15,7 @@ import com.qmth.distributed.print.business.entity.*;
|
|
|
import com.qmth.distributed.print.business.enums.*;
|
|
|
import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
+import com.qmth.distributed.print.business.templete.callback.CallbackCreatePdf;
|
|
|
import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
|
|
|
import com.qmth.distributed.print.business.util.ConvertUtil;
|
|
|
import com.qmth.distributed.print.business.util.ExcelUtil;
|
|
@@ -884,42 +885,38 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void checkDataByExamination(List<Long> examDetailIds, SysUser user) throws IOException {
|
|
|
+ public void checkDataByExamination(Long examDetailId, SysUser user) throws IOException {
|
|
|
boolean judge = true;
|
|
|
- Long printPlanId = null;
|
|
|
- Long schoolId = null;
|
|
|
- for (Long examDetailId : examDetailIds) {
|
|
|
- ExamDetail examDetail = examDetailService.getById(examDetailId);
|
|
|
- if (Objects.isNull(examDetail)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("考务-考场不存在");
|
|
|
- }
|
|
|
- printPlanId = examDetail.getPrintPlanId();
|
|
|
- List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(new QueryWrapper<ExamDetailCourse>().lambda()
|
|
|
- .eq(ExamDetailCourse::getExamDetailId, examDetailId)
|
|
|
- .eq(ExamDetailCourse::getSchoolId, examDetail.getSchoolId()));
|
|
|
- if (examDetailCourseList.size() < 1) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("考务-课程不存在");
|
|
|
- }
|
|
|
- for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
|
|
|
- String courseCode = examDetailCourse.getCourseCode();
|
|
|
- String paperNumber = examDetailCourse.getPaperNumber();
|
|
|
- schoolId = examDetailCourse.getSchoolId();
|
|
|
- ExamTask examTask = this.getOne(new QueryWrapper<ExamTask>().lambda()
|
|
|
- .eq(ExamTask::getSchoolId, schoolId)
|
|
|
- .eq(ExamTask::getCourseCode, courseCode)
|
|
|
- .eq(ExamTask::getPaperNumber, paperNumber));
|
|
|
- if (examTask == null) {
|
|
|
- judge = false;
|
|
|
- } else if (!ExamStatusEnum.FINISH.equals(examTask.getStatus())) {
|
|
|
- judge = false;
|
|
|
- }
|
|
|
+ ExamDetail examDetail = examDetailService.getById(examDetailId);
|
|
|
+ if (Objects.isNull(examDetail)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考务-考场不存在");
|
|
|
+ }
|
|
|
+ List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(new QueryWrapper<ExamDetailCourse>().lambda()
|
|
|
+ .eq(ExamDetailCourse::getExamDetailId, examDetailId)
|
|
|
+ .eq(ExamDetailCourse::getSchoolId, examDetail.getSchoolId()));
|
|
|
+ if (examDetailCourseList.size() < 1) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考务-课程不存在");
|
|
|
+ }
|
|
|
+ for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
|
|
|
+ String courseCode = examDetailCourse.getCourseCode();
|
|
|
+ String paperNumber = examDetailCourse.getPaperNumber();
|
|
|
+ Long schoolId = examDetailCourse.getSchoolId();
|
|
|
+ ExamTask examTask = this.getOne(new QueryWrapper<ExamTask>().lambda()
|
|
|
+ .eq(ExamTask::getSchoolId, schoolId)
|
|
|
+ .eq(ExamTask::getCourseCode, courseCode)
|
|
|
+ .eq(ExamTask::getPaperNumber, paperNumber));
|
|
|
+ if (examTask == null) {
|
|
|
+ judge = false;
|
|
|
+ } else if (!ExamStatusEnum.FINISH.equals(examTask.getStatus())) {
|
|
|
+ judge = false;
|
|
|
}
|
|
|
}
|
|
|
if (judge) {
|
|
|
- Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.CREATE_PDF, printPlanId, user);
|
|
|
- map.computeIfAbsent("examDetailIds", v -> examDetailIds);
|
|
|
- Long finalSchoolId = schoolId;
|
|
|
- map.computeIfAbsent("schoolId", v -> finalSchoolId);
|
|
|
+ Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.CREATE_PDF, examDetail.getPrintPlanId(), user);
|
|
|
+ if (Objects.nonNull(examDetail.getId())) {
|
|
|
+ map.computeIfAbsent("examDetailId", v -> examDetail.getId());
|
|
|
+ }
|
|
|
+ map.computeIfAbsent("schoolId", v -> examDetail.getSchoolId());
|
|
|
asyncCreatePdfTempleteService.createPdf(map, null);
|
|
|
}
|
|
|
}
|