From 4cdb6bdb33205ec2347fbfef6c9775e50e43a984 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Wed, 3 Jul 2024 08:24:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9C=A8=E7=BA=BF=E8=80=83=E8=AF=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/exam/ExamController.java | 4 ++-- .../main/java/com/ruoyi/web/controller/exam/QuController.java | 2 +- .../java/com/ruoyi/web/controller/manager/ExamManager.java | 3 ++- .../main/java/com/ruoyi/web/controller/manager/QuManager.java | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) 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; }