|
@@ -1103,9 +1103,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
taskQueryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId)
|
|
|
.eq(ExamTask::getExamId, examTask.getExamId())
|
|
|
.eq(ExamTask::getPaperNumber, examTask.getPaperNumber());
|
|
|
- if (Objects.nonNull(examTask.getId())) {
|
|
|
- taskQueryWrapper.lambda().ne(ExamTask::getId, examTask.getId());
|
|
|
- }
|
|
|
ExamTask task = this.getOne(taskQueryWrapper);
|
|
|
if (task != null) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷编号已存在");
|
|
@@ -1158,18 +1155,11 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
examTask.setReview(basicPrintConfig.getReview());
|
|
|
examTask.setUserId(sysUser.getId());
|
|
|
examTask.setStatus(ExamStatusEnum.SUBMIT);
|
|
|
- examTask.setCreateId(sysUser.getId());
|
|
|
- examTask.setCreateTime(System.currentTimeMillis());
|
|
|
-
|
|
|
- examTask.setCardRuleId(basicPrintConfig.getCardRuleId());
|
|
|
+ examTask.insertInfo(sysUser.getId());
|
|
|
|
|
|
if (Objects.isNull(examTask.getFlowId())) {
|
|
|
if (Objects.nonNull(basicPrintConfig.getReview()) && basicPrintConfig.getReview()) {
|
|
|
- Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
|
- examTask,
|
|
|
- TFCustomTypeEnum.ELECTRON_FLOW,
|
|
|
- examTask.getUserId(),
|
|
|
- false);
|
|
|
+ Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(), examTask, TFCustomTypeEnum.ELECTRON_FLOW, examTask.getUserId(), false);
|
|
|
map = activitiService.customFlowStart(map);
|
|
|
examTask.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
|
|
|
map.computeIfAbsent(SystemConstant.FLOW_JOIN_TYPE, v -> FlowJoinTypeEnum.NEW);
|
|
@@ -1187,8 +1177,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
examTaskDetail.setId(SystemConstant.getDbUuid());
|
|
|
examTaskDetail.setUnexposedPaperType(examTaskDetail.getPaperType());
|
|
|
examTaskDetail.setExamTaskId(examTask.getId());
|
|
|
- examTaskDetail.setCreateId(sysUser.getId());
|
|
|
- examTaskDetail.setCreateTime(System.currentTimeMillis());
|
|
|
+ examTaskDetail.insertInfo(sysUser.getId());
|
|
|
examTaskDetailService.save(examTaskDetail);
|
|
|
|
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
@@ -1267,7 +1256,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
List<ExamDetailCourseDto> examDetailCourseList = examDetailService.listByExamIdAndCourseCode(schoolId, examTask.getExamId(), examTask.getCourseCode());
|
|
|
if (!CollectionUtils.isEmpty(examDetailCourseList)) {
|
|
|
examDetailCourseList.stream().filter(m -> StringUtils.isNotBlank(m.getClazzId())).forEach(m -> {
|
|
|
-// usedClassIds.addAll(Arrays.asList(m.getClazzId().split(",")));
|
|
|
for (String s : m.getClazzId().split(",")) {
|
|
|
usedClassIdsMap.put(s, String.format("%s(%s)", m.getRealName(), m.getLoginName()));
|
|
|
}
|
|
@@ -1330,18 +1318,11 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
examDetailCourse.setClazzId(examDetailList.getClassId());
|
|
|
examDetailCourse.setTotalSubjects(examDetailList.getStudentCount());
|
|
|
examDetailCourse.setCreateId(sysUser.getId());
|
|
|
+ examDetailCourseService.save(examDetailCourse);
|
|
|
|
|
|
// 更新实际考生数量
|
|
|
- List<ExamTaskStudentObjectParam> examTaskStudentObjectParamList = examDetailList.getExamTaskStudentObjectParamList();
|
|
|
- List<ExamStudent> examStudents = printCommonService.createBatchStudentByStudentList(examPrintPlan.getExamId(), examTask, examDetailList.getExtendFields(), examTaskStudentObjectParamList, examDetailCourse.getId(), sysUser);
|
|
|
-
|
|
|
- Set<String> classNameSet = new HashSet<>();
|
|
|
- for (ExamStudent examStudent : examStudents) {
|
|
|
- classNameSet.add(examStudent.getTeachClazzName());
|
|
|
- }
|
|
|
-
|
|
|
- examDetailCourse.setClazzName(!CollectionUtils.isEmpty(classNameSet) ? String.join(",", classNameSet) : examDetailList.getClassName());
|
|
|
- examDetailCourseService.save(examDetailCourse);
|
|
|
+ List<Long> examTaskStudentObjectParamList = examDetailList.getExamTaskStudentObjectParamList();
|
|
|
+ List<ExamStudent> examStudents = examStudentService.saveStudentForExamApply(examTask, examDetailList.getExtendFields(), examTaskStudentObjectParamList, examDetailCourse.getId(), sysUser);
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(examStudents)) {
|
|
|
examStudentService.saveBatch(examStudents);
|
|
@@ -1375,8 +1356,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
examDetail.setPrintPlanId(examPrintPlan.getId());
|
|
|
examDetail.setPrintPlanName(examPrintPlan.getName());
|
|
|
examDetail.setExamId(examPrintPlan.getExamId());
|
|
|
-// examDetail.setExamPlace("考点1"); // 默认填充班级所在校区
|
|
|
-// examDetail.setExamRoom("考场1"); // 默认填充班级
|
|
|
examDetail.setStatus(ExamDetailStatusEnum.NEW);
|
|
|
if (!ExamCategoryEnum.REBUILD.equals(basicExam.getCategory())) {
|
|
|
examDetail.setExamStartTime(examDetailParams.getExamStartTime());
|
|
@@ -1633,7 +1612,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
basicExamStudentQuery.setCourseId(courseId);
|
|
|
basicExamStudentQuery.setTeacherName(teacher);
|
|
|
basicExamStudentQuery.setTeachClassName(teachClassName);
|
|
|
- basicExamStudentQuery.setTeachClassName(className);
|
|
|
+ basicExamStudentQuery.setClassName(className);
|
|
|
basicExamStudentQuery.setPaperNumber(paperNumber);
|
|
|
List<BasicExamStudentResult> basicStudentResultList = basicExamStudentService.listByParams(basicExamStudentQuery);
|
|
|
if (!CollectionUtils.isEmpty(basicStudentResultList)) {
|
|
@@ -2100,21 +2079,21 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
* @param examTaskDetail
|
|
|
*/
|
|
|
void validSubmitParam(ExamTaskDetail examTaskDetail, String printContent) {
|
|
|
- if (StringUtils.isBlank(examTaskDetail.getPaperType())) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("没有设置卷型");
|
|
|
+ List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(examTaskDetail.getPaperAttachmentIds());
|
|
|
+ if (StringUtils.isBlank(examTaskDetail.getPaperType()) || CollectionUtils.isEmpty(paperInfoVoList)) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("请先设置卷型并上传相关文件");
|
|
|
}
|
|
|
|
|
|
- List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(examTaskDetail.getPaperAttachmentIds());
|
|
|
for (PaperInfoVo paperInfoVo : paperInfoVoList) {
|
|
|
// 校验试卷必须绑定题卡
|
|
|
Long cardId = Long.valueOf(paperInfoVo.getCardId());
|
|
|
if (Objects.isNull(cardId)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("没有绑定题卡");
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("卷型[" + paperInfoVo.getName() + "]没有绑定题卡");
|
|
|
}
|
|
|
// 校验题卡是否提交
|
|
|
ExamCard examCard = examCardService.getById(cardId);
|
|
|
if (!ExamCardStatusEnum.SUBMIT.name().equals(examCard.getStatus().name())) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("绑定的题卡未提交");
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("卷型[" + paperInfoVo.getName() + "]绑定的题卡未提交");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2127,9 +2106,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
// 未上传试卷的类型个数
|
|
|
long count = paperInfoVoList.stream().filter(m -> Objects.isNull(m.getAttachmentId())).count();
|
|
|
if (printContent.contains("PAPER")) {
|
|
|
- if (CollectionUtils.isEmpty(paperInfoVoList)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("没有设置卷型");
|
|
|
- }
|
|
|
if (count > 0) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("有部分卷型未上传试卷文件");
|
|
|
}
|