From fe0a4c0495cf9f1a65343158c2a8c2d4a163e045 Mon Sep 17 00:00:00 2001 From: qirong <2032486488@qq.com> Date: 星期二, 28 十一月 2023 21:16:21 +0800 Subject: [PATCH] 优化查询 --- src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java index 15957bc..2881df0 100644 --- a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java +++ b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java @@ -128,6 +128,7 @@ examPaper.setCreateTime(now); examPaper.setCreateUser(user.getId()); examPaper.setDeleted(false); + examPaper.setUserIds(examPaperEditRequestVM.getMenuIds()); examPaperFromVM(examPaperEditRequestVM, examPaper, titleItemsVM); examPaperMapper.insertSelective(examPaper); @@ -154,6 +155,7 @@ ExamPaper examPaper = examPaperMapper.selectByPrimaryKey(id); ExamPaperEditRequestVM vm = modelMapper.map(examPaper, ExamPaperEditRequestVM.class); vm.setLevel(examPaper.getGradeLevel()); + vm.setMenuIds(examPaper.getUserIds()); TextContent frameTextContent = textContentService.selectById(examPaper.getFrameTextContentId()); List<ExamPaperTitleItemObject> examPaperTitleItemObjects = JsonUtil.toJsonListObject(frameTextContent.getContent(), ExamPaperTitleItemObject.class); List<Integer> questionIds = examPaperTitleItemObjects.stream() @@ -490,7 +492,7 @@ Integer judgment = examPaperEditRequestVM.getQuestionTypeVMS().stream().mapToInt(QuestionTypeVM::getTrueFalse).sum(); - if ((singleChoice * 2 + multipleChoice * 2 + judgment * 2) != new Integer(100)) { + if ((singleChoice * 2 + multipleChoice * 2 + judgment * 2) != new Integer(10)) { throw new QuestionException(); } -- Gitblit v1.8.0