From 008a607e1fcb46bdb180bc4e74304bc91239d2ad Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 22 五月 2024 13:33:38 +0800
Subject: [PATCH] sql bug
---
src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java | 21 +++++++++++++++++++++
1 files changed, 21 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..e8584a5 100644
--- a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java
+++ b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperServiceImpl.java
@@ -9,7 +9,9 @@
import com.mindskip.xzs.domain.exam.ExamPaperQuestionItemObject;
import com.mindskip.xzs.domain.exam.ExamPaperTitleItemObject;
import com.mindskip.xzs.domain.other.KeyValue;
+import com.mindskip.xzs.domain.vo.ExamTemplatesVO;
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 +163,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();
@@ -622,7 +627,23 @@
}
@Override
+ @Transactional
+ public void missExamByTemplateId(ExamTemplatesVO model) {
+ List<Integer> id = examPaperMapper.getExamPaperByTemplateId(model);
+ model.setPaperIds(id);
+ // 鏍规嵁鑰冭瘯id灏嗛�夋嫨鐨勮ˉ鑰冭�冪敓鐨勮�冭瘯鎴愮哗璁剧疆涓烘棤鏁�
+ examPaperAnswerMapper.setMissExamByTemplate(model);
+ }
+
+ @Override
public List<ExamPaper> list(List<Integer> deptIds) {
return examPaperMapper.list(deptIds);
}
+
+ @Override
+ public PageInfo<UserVO> selectStudent(UserVO userVO, List<Integer> adminDeptIds) {
+ userVO.setDeptIds(ObjectUtils.isNotEmpty(userVO.getDeptIds()) ? userVO.getDeptIds() : adminDeptIds);
+ return PageHelper.startPage(userVO.getPageIndex(), userVO.getPageSize()).doSelectPageInfo(() ->
+ examPaperMapper.selectStudent(userVO));
+ }
}
--
Gitblit v1.8.0