diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java index 0f515a7..ed50056 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/ExamController.java @@ -78,7 +78,7 @@ public class ExamController extends BaseController { @Log(title = "考试", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(@Validated ExamSaveReqDTO reqDTO) { + public AjaxResult addSave(@RequestBody @Validated ExamSaveReqDTO reqDTO) { return toAjax(examManager.saveOrUpdate(reqDTO)); } @@ -96,7 +96,7 @@ public class ExamController extends BaseController { @Log(title = "考试", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(@Validated ExamSaveReqDTO reqDTO) { + public AjaxResult editSave(@RequestBody @Validated ExamSaveReqDTO reqDTO) { return toAjax(examManager.saveOrUpdate(reqDTO)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java index bc24282..aa11124 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/exam/QuController.java @@ -96,7 +96,7 @@ public class QuController extends BaseController { @Log(title = "试题", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(@Validated QuDetailDTO reqDTO) { + public AjaxResult editSave(@RequestBody @Validated QuDetailDTO reqDTO) { return toAjax(quManager.saveOrUpdate(reqDTO)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java index 9bed3e8..7c9dd9d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ExamManager.java @@ -82,6 +82,7 @@ public class ExamManager { } else { elExam.setCreateTime(new Date()); } + elExamService.saveOrUpdate(elExam); if (CollUtil.isNotEmpty(reqDTO.getRepoList())) { List examRepos = Convert.toList(ElExamRepo.class, reqDTO.getRepoList()); examRepos.forEach(elExamRepo -> elExamRepo.setExamId(elExam.getId())); @@ -97,7 +98,7 @@ public class ExamManager { }); elExamDepartService.saveBatch(list); } - return elExamService.saveOrUpdate(elExam); + return true; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java index 0818cac..5ac1aa7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java @@ -83,6 +83,7 @@ public class QuManager { } else { qu.setCreateTime(new Date()); } + quService.saveOrUpdate(qu); if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){ List answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList()); answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId())); @@ -100,7 +101,7 @@ public class QuManager { quRepoService.saveBatch(list); reqDTO.getRepoIds().forEach(this::sortRepo); } - return quService.saveOrUpdate(qu); + return true; }