From 03a9cd21c1589e98978dc7296bb7fb48f1dcd7fe Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 17 五月 2024 16:13:45 +0800
Subject: [PATCH] feat:创建试卷时新增选择用户查询条件

---
 src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 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 ef9e53f..beeb070 100644
--- a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java
+++ b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java
@@ -10,6 +10,7 @@
 import com.mindskip.xzs.domain.exam.ExamPaperTitleItemObject;
 import com.mindskip.xzs.domain.other.KeyValue;
 import com.mindskip.xzs.domain.vo.PaperExcelVO;
+import com.mindskip.xzs.domain.vo.UserVO;
 import com.mindskip.xzs.repository.ExamPaperAnswerMapper;
 import com.mindskip.xzs.repository.ExamPaperMapper;
 import com.mindskip.xzs.repository.QuestionMapper;
@@ -161,6 +162,9 @@
                 .flatMap(t -> t.getQuestionItems().stream()
                         .map(q -> q.getId()))
                 .collect(Collectors.toList());
+        if (ObjectUtils.isEmpty(questionIds)) {
+            throw new RuntimeException("璇ヨ瘯鍗锋病鏈夐鐩�");
+        }
         List<Question> questions = questionMapper.selectByIds(questionIds);
         //鍗曢�夋暟閲�
         Integer singleChoice = questions.stream().filter(e -> e.getQuestionType() == 1).collect(Collectors.toList()).size();
@@ -625,4 +629,10 @@
     public List<ExamPaper> list(List<Integer> deptIds) {
         return examPaperMapper.list(deptIds);
     }
+
+    @Override
+    public PageInfo<UserVO> selectStudent(UserVO userVO) {
+        return PageHelper.startPage(userVO.getPageIndex(), userVO.getPageSize()).doSelectPageInfo(() ->
+                examPaperMapper.selectStudent(userVO));
+    }
 }

--
Gitblit v1.8.0