|
@@ -1352,6 +1352,56 @@ public class KmtExerciseMapperServiceImpl implements KmtExerciseMapperService {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private ExerciseQuetionDto parseMapToExerciseQuestion (Map map) {
|
|
|
|
+ ExerciseQuetionDto temp = new ExerciseQuetionDto();
|
|
|
|
+ if (map != null){
|
|
|
|
+ String bookCourseId;
|
|
|
|
+ KmtExerciseBookCourse kmtExerciseBookCourse;
|
|
|
|
+
|
|
|
|
+ temp.setQuestionId(map.getOrDefault("id", "").toString());
|
|
|
|
+ temp.setCourseName(map.getOrDefault("courseName", "").toString());
|
|
|
|
+ temp.setHandleUserId(map.getOrDefault("handleUserId", "").toString());
|
|
|
|
+ temp.setAuditingUserId(map.getOrDefault("auditingUserId", "").toString());
|
|
|
|
+ temp.setAnalysisUserId(map.getOrDefault("analysisUserId", "").toString());
|
|
|
|
+ temp.setAnalysisAuditerId(map.getOrDefault("analysisAuditerId", "").toString());
|
|
|
|
+ bookCourseId = map.getOrDefault("bookCourseId", "").toString();
|
|
|
|
+ temp.setCourseId(bookCourseId);
|
|
|
|
+ if (StringUtils.isNotBlank(bookCourseId)) {
|
|
|
|
+ // 查询练习册单元课时信息
|
|
|
|
+ kmtExerciseBookCourse = kmtExerciseBookCourseService.getById(bookCourseId);
|
|
|
|
+ if (kmtExerciseBookCourse != null) {
|
|
|
|
+ temp.setBookName(kmtExerciseBookCourse.getBookName());
|
|
|
|
+ temp.setUnit(kmtExerciseBookCourse.getUnit());
|
|
|
|
+ temp.setPeriod(kmtExerciseBookCourse.getPeriod());
|
|
|
|
+ temp.setGrade(kmtExerciseBookCourse.getGrade());
|
|
|
|
+ temp.setSemester(kmtExerciseBookCourse.getSemester());
|
|
|
|
+ temp.setVersionName(knowledgeVersion.getVersionNameBySubjectAndVersionNum(temp.getCourseName(), kmtExerciseBookCourse.getVersion()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ temp.setBigQuestionIndex(map.getOrDefault("bigQuestionIndex", "").toString());
|
|
|
|
+ temp.setSmallQuestionIndex(Integer.parseInt(map.getOrDefault("num", "0").toString()) + "");
|
|
|
|
+ temp.setQuestion(map.getOrDefault("question", "").toString());
|
|
|
|
+ temp.setQuestionText(map.getOrDefault("questionText", "").toString());
|
|
|
|
+ temp.setAnswer(map.getOrDefault("optionAnswer", "").toString());
|
|
|
|
+ temp.setAnswerJson(map.getOrDefault("answerJson", "").toString());
|
|
|
|
+ temp.setQuestionStatus(Integer.parseInt(map.getOrDefault("dealStatus", "0").toString()));
|
|
|
|
+ temp.setCreateTime(map.getOrDefault("createTime", "").toString());
|
|
|
|
+ temp.setReason(map.getOrDefault("remark", "").toString());
|
|
|
|
+ temp.setQuestionAnalysis(map.getOrDefault("analysis", "").toString());
|
|
|
|
+ temp.setAnalysisJson(map.getOrDefault("analysisJson", "").toString());
|
|
|
|
+ temp.setQuestionTypes(Integer.parseInt(map.getOrDefault("questionType", "0").toString()));
|
|
|
|
+ temp.setDifficultyLevels(Integer.parseInt(map.getOrDefault("difficultyLevel", "0").toString()));
|
|
|
|
+ temp.setRealExamTypes(map.getOrDefault("realExamType", "").toString());
|
|
|
|
+ temp.setTrainingSkills(map.getOrDefault("trainingSkill", "").toString());
|
|
|
|
+ temp.setParentId(map.getOrDefault("parentId", "").toString());
|
|
|
|
+ temp.setQuestionImage(map.getOrDefault("image", "").toString());
|
|
|
|
+ temp.setFromUserId(map.getOrDefault("fromUserId", "").toString());
|
|
|
|
+ temp.setToUserId(map.getOrDefault("toUserId", "").toString());
|
|
|
|
+ temp.setUpdateType(map.getOrDefault("updateType", "").toString());
|
|
|
|
+ }
|
|
|
|
+ return temp;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据科目年级版本上下册查询kmt题目列表
|
|
* 根据科目年级版本上下册查询kmt题目列表
|
|
* @param request
|
|
* @param request
|
|
@@ -1484,16 +1534,16 @@ public class KmtExerciseMapperServiceImpl implements KmtExerciseMapperService {
|
|
@Override
|
|
@Override
|
|
public List<ExerciseBookCourseClassDto> findClassifyQuestionsByIds(List<String> questionIds) {
|
|
public List<ExerciseBookCourseClassDto> findClassifyQuestionsByIds(List<String> questionIds) {
|
|
List<Map> tmpList = exerciseQuestionSearchService.findAllExerciseQuestionsByQuestionIds(questionIds);
|
|
List<Map> tmpList = exerciseQuestionSearchService.findAllExerciseQuestionsByQuestionIds(questionIds);
|
|
- List<ExerciseQuetionDto> temps = this.parseMapToExerciseQuestionList(tmpList);
|
|
|
|
|
|
+// List<ExerciseQuetionDto> temps = this.parseMapToExerciseQuestionList(tmpList);
|
|
List<ExerciseQuetionDto> questions = new ArrayList<>();
|
|
List<ExerciseQuetionDto> questions = new ArrayList<>();
|
|
ExerciseQuetionDto qTmp = null;
|
|
ExerciseQuetionDto qTmp = null;
|
|
- for (String questionId : questionIds){
|
|
|
|
- for (ExerciseQuetionDto temp : temps){
|
|
|
|
- if (questionId.equals(temp.getQuestionId())){
|
|
|
|
- qTmp = new ExerciseQuetionDto();
|
|
|
|
- BeanUtils.copyProperties(temp, qTmp);
|
|
|
|
- questions.add(qTmp);
|
|
|
|
- break;
|
|
|
|
|
|
+ if (tmpList != null){
|
|
|
|
+ for (String questionId : questionIds){
|
|
|
|
+ for (Map map : tmpList){
|
|
|
|
+ if (questionId.equals(map.getOrDefault("id", "").toString())){
|
|
|
|
+ questions.add(this.parseMapToExerciseQuestion(map));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|