【修改】试题审核映射知识点字段
This commit is contained in:
@@ -491,11 +491,36 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
PageResult<QuestionExamineDO> questionExamineDOPageResult = questionExamineMapper.selectPage(questionVo);
|
||||
List<QuestionExamineDO> list = questionExamineDOPageResult.getList();
|
||||
List<ExamQuestion> examQuestionList=new ArrayList<>();
|
||||
|
||||
List<ExamKnowledgePoints> examKnowledgePoints = knowledgePointsMapper.selectKnowledgePoints();
|
||||
// 构造 ID → 名称映射
|
||||
Map<Long, String> 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());
|
||||
|
Reference in New Issue
Block a user