From df39d937f1d51f507ad1e783a43b38ba19f2af58 Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Mon, 9 Jun 2025 13:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E8=AF=95?= =?UTF-8?q?=E9=A2=98=E5=AE=A1=E6=A0=B8=E6=98=A0=E5=B0=84=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E7=82=B9=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../question/ExamQuestionServiceImpl.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java index 6449582c..8e1ff240 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java @@ -491,11 +491,36 @@ public class ExamQuestionServiceImpl implements IExamQuestionService PageResult questionExamineDOPageResult = questionExamineMapper.selectPage(questionVo); List list = questionExamineDOPageResult.getList(); List examQuestionList=new ArrayList<>(); + + List examKnowledgePoints = knowledgePointsMapper.selectKnowledgePoints(); + // 构造 ID → 名称映射 + Map idNameMap = examKnowledgePoints.stream() + .collect(Collectors.toMap(ExamKnowledgePoints::getSpId, ExamKnowledgePoints::getSpName)); if (list!=null&&list.size()>0){ for (QuestionExamineDO questionExamineDO : list) { String schoolName =questionExamineMapper.selectSchoolName(questionExamineDO.getSource()); ExamQuestion examQuestion = examQuestionMapper.selectExamQuestionByQuId(questionExamineDO.getQuId()); + String pointIdStr = examQuestion.getPointNames(); + String chapterIdStr = examQuestion.getChapteridDictText(); if (examQuestion!=null){ + try { + if (pointIdStr != null) { + Long pointId = Long.valueOf(pointIdStr); + if (idNameMap.containsKey(pointId)) { + examQuestion.setPointNamesVo(idNameMap.get(pointId)); + } + } + + if (chapterIdStr != null) { + Long chapterId = Long.valueOf(chapterIdStr); + if (idNameMap.containsKey(chapterId)) { + examQuestion.setChapteridDictTextVo(idNameMap.get(chapterId)); + } + } + } catch (NumberFormatException e) { + // 日志记录或跳过处理 + System.err.println("ID格式错误:" + e.getMessage()); + } examQuestion.setCreateTeacher(questionExamineDO.getCreateTeacher()); examQuestion.setSchoolName(schoolName); examQuestion.setSource(questionExamineDO.getSource());