|
@@ -872,15 +872,14 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
}
|
|
}
|
|
// }
|
|
// }
|
|
|
|
|
|
- UpdateWrapper<ExamTask> updateWrapper = new UpdateWrapper<>();
|
|
|
|
- updateWrapper.lambda()
|
|
|
|
- .set(ExamTask::getStatus, ExamStatusEnum.SUBMIT)
|
|
|
|
- .set(ExamTask::getOpenAb, examTaskApplyPram.getOpenAb())
|
|
|
|
- .set(ExamTask::getUpdateId, sysUser.getId())
|
|
|
|
- .set(ExamTask::getUpdateTime, System.currentTimeMillis())
|
|
|
|
- .set(ExamTask::getExamTaskContent, examTaskApplyPram.getExamTaskContent())
|
|
|
|
- .eq(ExamTask::getId, examTask.getId());
|
|
|
|
- this.update(updateWrapper);
|
|
|
|
|
|
+ examTask.setStatus(ExamStatusEnum.SUBMIT);
|
|
|
|
+ examTask.setOpenAb(examTaskApplyPram.getOpenAb());
|
|
|
|
+ examTask.setPaperConfirmAttachmentIds(examTaskApplyPram.getPaperConfirmAttachmentIds());
|
|
|
|
+ examTask.setRemark(examTaskApplyPram.getRemark());
|
|
|
|
+ examTask.setUpdateId(sysUser.getId());
|
|
|
|
+ examTask.setUpdateTime(System.currentTimeMillis());
|
|
|
|
+ examTask.setExamTaskContent(examTaskApplyPram.getExamTaskContent());
|
|
|
|
+ this.updateById(examTask);
|
|
|
|
|
|
examTaskDetailService.deleteByExamTaskId(examTaskApplyPram.getExamTaskId());
|
|
examTaskDetailService.deleteByExamTaskId(examTaskApplyPram.getExamTaskId());
|
|
// 新建试卷
|
|
// 新建试卷
|
|
@@ -909,8 +908,15 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
|
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
|
|
List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
|
|
|
|
+ List<Long> cardIds = paperInfoVoList.stream().filter(m -> StringUtils.isNotBlank(m.getCardId())).map(m -> Long.parseLong(m.getCardId())).collect(Collectors.toList());
|
|
|
|
+ for (Long cardId : cardIds) {
|
|
|
|
+ ExamCard examCard = examCardService.getById(cardId);
|
|
|
|
+ if(!examTask.getOpenAb().equals(examCard.getOpenAb())){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(examTask.getOpenAb() && !examCard.getOpenAb() ? "命题任务开启了AB卷,请选择AB卷题卡或者编辑题卡开启AB卷": "命题任务未开启了AB卷,请选择单题卡或者编辑题卡关闭AB卷");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 将题卡更新为已绑定
|
|
// 将题卡更新为已绑定
|
|
- examCardService.updateUsedById(paperInfoVoList.stream().filter(m -> StringUtils.isNotBlank(m.getCardId())).map(m -> Long.parseLong(m.getCardId())).collect(Collectors.toList()));
|
|
|
|
|
|
+ examCardService.updateUsedById(cardIds);
|
|
// 更新题库试卷表
|
|
// 更新题库试卷表
|
|
for (PaperInfoVo paperInfoVo : paperInfoVoList) {
|
|
for (PaperInfoVo paperInfoVo : paperInfoVoList) {
|
|
if (StringUtils.isNotBlank(paperInfoVo.getUuid())) {
|
|
if (StringUtils.isNotBlank(paperInfoVo.getUuid())) {
|
|
@@ -990,8 +996,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
public ExamTaskDetailCardDto applyGetOne(Long examTaskId, String source) {
|
|
public ExamTaskDetailCardDto applyGetOne(Long examTaskId, String source) {
|
|
ExamTaskDetailCardDto detailCardDto = this.baseMapper.applyGetOne(examTaskId, source);
|
|
ExamTaskDetailCardDto detailCardDto = this.baseMapper.applyGetOne(examTaskId, source);
|
|
if (detailCardDto != null) {
|
|
if (detailCardDto != null) {
|
|
- ExamTask examTask = examTaskService.getById(examTaskId);
|
|
|
|
- BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examTask.getExamId());
|
|
|
|
|
|
+ BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(Long.valueOf(detailCardDto.getExamId()));
|
|
if (basicPrintConfig != null) {
|
|
if (basicPrintConfig != null) {
|
|
detailCardDto.setPrintContent(basicPrintConfig.getPrintContent());
|
|
detailCardDto.setPrintContent(basicPrintConfig.getPrintContent());
|
|
detailCardDto.setReview(basicPrintConfig.getReview());
|
|
detailCardDto.setReview(basicPrintConfig.getReview());
|
|
@@ -1297,8 +1302,16 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
|
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
|
|
List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(paperAttachmentIds);
|
|
|
|
+
|
|
|
|
+ List<Long> cardIds = paperInfoVoList.stream().filter(m -> StringUtils.isNotBlank(m.getCardId())).map(m -> Long.parseLong(m.getCardId())).collect(Collectors.toList());
|
|
|
|
+ for (Long cardId : cardIds) {
|
|
|
|
+ ExamCard examCard = examCardService.getById(cardId);
|
|
|
|
+ if(examTask.getOpenAb().equals(examCard.getOpenAb())){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(examTask.getOpenAb() && !examCard.getOpenAb() ? "命题任务开启了AB卷,请选择AB卷题卡或者编辑题卡开启AB卷": "命题任务未开启了AB卷,请选择单题卡或者编辑题卡关闭AB卷");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 将题卡更新为已绑定
|
|
// 将题卡更新为已绑定
|
|
- examCardService.updateUsedById(paperInfoVoList.stream().filter(m -> StringUtils.isNotBlank(m.getCardId())).map(m -> Long.parseLong(m.getCardId())).collect(Collectors.toList()));
|
|
|
|
|
|
+ examCardService.updateUsedById(cardIds);
|
|
// 更新题库试卷表
|
|
// 更新题库试卷表
|
|
for (PaperInfoVo paperInfoVo : paperInfoVoList) {
|
|
for (PaperInfoVo paperInfoVo : paperInfoVoList) {
|
|
if (StringUtils.isNotBlank(paperInfoVo.getUuid())) {
|
|
if (StringUtils.isNotBlank(paperInfoVo.getUuid())) {
|
|
@@ -1413,7 +1426,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
if (basicStudentIdUserMap.containsKey(i)) {
|
|
if (basicStudentIdUserMap.containsKey(i)) {
|
|
BasicExamStudent basicExamStudent = basicExamStudentService.getById(i);
|
|
BasicExamStudent basicExamStudent = basicExamStudentService.getById(i);
|
|
if (basicExamStudent != null) {
|
|
if (basicExamStudent != null) {
|
|
-// throw ExceptionResultEnum.ERROR.exception("教学班[" + basicExamStudent.getTeachClassName() + "]内有考生已被[" + basicStudentIdUserMap.get(i) + "]选择");
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("教学班[" + basicExamStudent.getTeachClassName() + "]内有考生已被[" + basicStudentIdUserMap.get(i) + "]选择");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|