|
@@ -168,6 +168,9 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
|
|
paperStructDtoNewList = SDFrame.read(paperStructDtoNewList).sortDesc(Sorter.sortDescBy(PaperStructDto::getMainNumber).sortDesc(PaperStructDto::getMainNumber)).toLists();
|
|
paperStructDtoNewList = SDFrame.read(paperStructDtoNewList).sortDesc(Sorter.sortDescBy(PaperStructDto::getMainNumber).sortDesc(PaperStructDto::getMainNumber)).toLists();
|
|
TCPaperStruct tcPaperStruct = new TCPaperStruct(examId, cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDtoNewList), totalScore, 60d, sysUser.getId());
|
|
TCPaperStruct tcPaperStruct = new TCPaperStruct(examId, cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDtoNewList), totalScore, 60d, sysUser.getId());
|
|
TCPaperStruct tcPaperStructDb = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
TCPaperStruct tcPaperStructDb = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
+ if (Objects.isNull(tcPaperStructDb)) {
|
|
|
|
+ tcPaperStructDb = tcPaperStructService.queryPaperStruct(cultureProgramId, courseId, null, null);
|
|
|
|
+ }
|
|
if (Objects.nonNull(tcPaperStructDb) && !tcPaperStructDb.equals(tcPaperStruct)) {
|
|
if (Objects.nonNull(tcPaperStructDb) && !tcPaperStructDb.equals(tcPaperStruct)) {
|
|
if (Objects.nonNull(tcPaperStructDb.getPaperStruct()) && !Objects.equals(tcPaperStructDb.getPaperStruct(), tcPaperStruct.getPaperStruct())) {
|
|
if (Objects.nonNull(tcPaperStructDb.getPaperStruct()) && !Objects.equals(tcPaperStructDb.getPaperStruct(), tcPaperStruct.getPaperStruct())) {
|
|
throw ExceptionResultEnum.ERROR.exception("导入的试卷结构不一致,请检查");
|
|
throw ExceptionResultEnum.ERROR.exception("导入的试卷结构不一致,请检查");
|
|
@@ -176,7 +179,12 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
|
|
if (Objects.nonNull(tcPaperStructDb) && Objects.nonNull(tcPaperStructDb.getPaperStructDimension())) {
|
|
if (Objects.nonNull(tcPaperStructDb) && Objects.nonNull(tcPaperStructDb.getPaperStructDimension())) {
|
|
tcPaperStruct.updateInfo(tcPaperStructDb.getPaperStructDimension(), sysUser.getId());
|
|
tcPaperStruct.updateInfo(tcPaperStructDb.getPaperStructDimension(), sysUser.getId());
|
|
}
|
|
}
|
|
- tcPaperStructService.remove(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
|
|
+ if (Objects.nonNull(tcPaperStructDb)) {
|
|
|
|
+ tcPaperStructService.removeById(tcPaperStructDb.getId());
|
|
|
|
+ } else {
|
|
|
|
+ tcPaperStructService.remove(cultureProgramId, courseId, paperNumber, examId);
|
|
|
|
+ tcPaperStructService.remove(cultureProgramId, courseId, null, null);
|
|
|
|
+ }
|
|
tcPaperStructService.save(tcPaperStruct);
|
|
tcPaperStructService.save(tcPaperStruct);
|
|
}
|
|
}
|
|
}
|
|
}
|