|
@@ -1340,20 +1340,22 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
throw ExceptionResultEnum.ERROR.exception("通用规则未设置");
|
|
throw ExceptionResultEnum.ERROR.exception("通用规则未设置");
|
|
}
|
|
}
|
|
|
|
|
|
- if(Objects.isNull(examTask.getId())) {
|
|
|
|
- if (StringUtils.isNotBlank(examTask.getPaperNumber())) {
|
|
|
|
- QueryWrapper<ExamTask> taskQueryWrapper = new QueryWrapper<>();
|
|
|
|
- taskQueryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).eq(ExamTask::getPaperNumber, examTask.getPaperNumber());
|
|
|
|
- ExamTask task = this.getOne(taskQueryWrapper);
|
|
|
|
- if (task != null && Objects.nonNull(examTask.getId()) && examTask.getId().longValue() != task.getId().longValue()) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("试卷编号已存在");
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- // 试卷编号生成规则:年月日(例如:20100419)+0000(例如:0001)顺序编号
|
|
|
|
- String paperNumber = printCommonService.createPaperNumber(schoolId);
|
|
|
|
- examTask.setPaperNumber(paperNumber);
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(examTask.getPaperNumber())) {
|
|
|
|
+ QueryWrapper<ExamTask> taskQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ taskQueryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).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("试卷编号已存在");
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ // 试卷编号生成规则:年月日(例如:20100419)+0000(例如:0001)顺序编号
|
|
|
|
+ String paperNumber = printCommonService.createPaperNumber(schoolId);
|
|
|
|
+ examTask.setPaperNumber(paperNumber);
|
|
|
|
+ }
|
|
|
|
+ if (Objects.nonNull(examTask.getId())) {
|
|
ExamTask task = this.getById(examTask.getId());
|
|
ExamTask task = this.getById(examTask.getId());
|
|
examTask.setFlowId(task.getFlowId());
|
|
examTask.setFlowId(task.getFlowId());
|
|
}
|
|
}
|
|
@@ -1381,16 +1383,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
|
|
|
// 提交时,校验
|
|
// 提交时,校验
|
|
if (ExamStatusEnum.SUBMIT.name().equals(examTaskDetail.getOperateType())) {
|
|
if (ExamStatusEnum.SUBMIT.name().equals(examTaskDetail.getOperateType())) {
|
|
- if (Objects.nonNull(examTask.getFlowId())) {
|
|
|
|
- // 审核一级
|
|
|
|
- Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(examTask.getFlowId())).singleResult();
|
|
|
|
- if (Objects.nonNull(task)) {
|
|
|
|
- Map<String, Object> map1 = new HashMap<>();
|
|
|
|
- map1.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
|
|
|
|
- activitiService.taskApprove(map1);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (StringUtils.isBlank(examTaskDetail.getPaperType())) {
|
|
if (StringUtils.isBlank(examTaskDetail.getPaperType())) {
|
|
throw ExceptionResultEnum.ERROR.exception("试卷类型不能为空");
|
|
throw ExceptionResultEnum.ERROR.exception("试卷类型不能为空");
|
|
}
|
|
}
|
|
@@ -1415,7 +1407,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
}
|
|
}
|
|
|
|
|
|
// 是否强制包含试卷
|
|
// 是否强制包含试卷
|
|
-
|
|
|
|
List<Map> paperAttachmentIds = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
List<Map> paperAttachmentIds = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
// 未上传试卷的类型个数
|
|
// 未上传试卷的类型个数
|
|
long count = paperAttachmentIds.stream().filter(m -> StringUtils.isBlank(m.get("attachmentId").toString())).count();
|
|
long count = paperAttachmentIds.stream().filter(m -> StringUtils.isBlank(m.get("attachmentId").toString())).count();
|
|
@@ -1432,6 +1423,16 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
throw ExceptionResultEnum.ERROR.exception("所有类型的试卷文件必须全部上传或全部不上传");
|
|
throw ExceptionResultEnum.ERROR.exception("所有类型的试卷文件必须全部上传或全部不上传");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (Objects.nonNull(examTask.getFlowId())) {
|
|
|
|
+ // 审核一级
|
|
|
|
+ Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(examTask.getFlowId())).singleResult();
|
|
|
|
+ if (Objects.nonNull(task)) {
|
|
|
|
+ Map<String, Object> map1 = new HashMap<>();
|
|
|
|
+ map1.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
|
|
|
|
+ activitiService.taskApprove(map1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
|