|
@@ -3934,7 +3934,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
exam.setCreateTime(DateUtils.getNowTime());
|
|
|
exam.setUpdateTime(DateUtils.getNowTime());
|
|
|
exam.setExamName(item2.getName() + "测试卷");
|
|
|
- exam.setPublishStatus(1L);
|
|
|
+ exam.setPublishStatus(1);
|
|
|
exam.setDoType(1);
|
|
|
//试卷类型
|
|
|
ExamPaper paper = iExamPaperService.getOne(new LambdaQueryWrapper<ExamPaper>()
|
|
@@ -4253,6 +4253,54 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return new HashMap<>();
|
|
|
}
|
|
|
|
|
|
+ //题目业务层次
|
|
|
+ QuestionBusinessImportVo importVo = JSON.parseObject(param, QuestionBusinessImportVo.class);
|
|
|
+ CourseEducationType educationType = iCourseEducationTypeService
|
|
|
+ .getOne(new LambdaQueryWrapper<CourseEducationType>()
|
|
|
+ .eq(CourseEducationType::getEducationName, importVo.getEducationName())
|
|
|
+ .eq(CourseEducationType::getStatus, 1)
|
|
|
+ .last("limit 1"));
|
|
|
+ CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaUpdateWrapper<CourseProjectType>()
|
|
|
+ .eq(CourseProjectType::getEducationId, educationType.getId())
|
|
|
+ .eq(CourseProjectType::getProjectName, importVo.getProjectName())
|
|
|
+ .eq(CourseProjectType::getStatus, 1)
|
|
|
+ .last("limit 1"));
|
|
|
+ CourseBusiness business = iCourseBusinessService.getOne(new LambdaUpdateWrapper<CourseBusiness>()
|
|
|
+ .eq(CourseBusiness::getProjectId, projectType.getId())
|
|
|
+ .eq(CourseBusiness::getBusinessName, importVo.getBusinessName())
|
|
|
+ .eq(CourseBusiness::getStatus, 1)
|
|
|
+ .last("limit 1"));
|
|
|
+ CourseSubject courseSubject = iCourseSubjectService.getOneByName(importVo.getSubjectName(),projectType.getId());
|
|
|
+
|
|
|
+ //试卷类型
|
|
|
+ ExamPaper paper = iExamPaperService.getOne(new LambdaUpdateWrapper<ExamPaper>().eq(ExamPaper::getPaperName, "普通练习").eq(ExamPaper::getStatus, 1).last("limit 1"));
|
|
|
+
|
|
|
+ //创建试卷
|
|
|
+ Exam exam = new Exam();
|
|
|
+ exam.setCode(ServletUtils.getEncoded("SJ"));
|
|
|
+ exam.setExamName(importVo.getExamName());
|
|
|
+ exam.setCreateTime(DateUtils.getNowTime());
|
|
|
+ exam.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ exam.setStatus(1);
|
|
|
+ exam.setExamPaperId(paper.getPaperId());
|
|
|
+ exam.setYear(2025);
|
|
|
+ exam.setPublishStatus(1);
|
|
|
+ exam.setPrefixName("安管题库");
|
|
|
+ iExamService.save(exam);
|
|
|
+
|
|
|
+
|
|
|
+ //试卷业务层次
|
|
|
+ QuestionBusiness examBus = new QuestionBusiness();
|
|
|
+ examBus.setEducationTypeId(educationType.getId());
|
|
|
+ examBus.setProjectId(projectType.getId());
|
|
|
+ examBus.setBusinessId(business.getId());
|
|
|
+ examBus.setSubjectId(courseSubject.getId());
|
|
|
+ examBus.setMajorId(exam.getExamId());
|
|
|
+ examBus.setType(2);
|
|
|
+ iQuestionBusinessService.save(examBus);
|
|
|
+
|
|
|
+ //排序
|
|
|
+ Integer b = 1;
|
|
|
for (int i = 0; i < questionList2.size(); i++) {
|
|
|
QuestionImportV4 questionImportV4 = questionList2.get(i);
|
|
|
Integer a = 0;
|
|
@@ -4433,24 +4481,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
question.setCreateTime(DateUtils.getNowTime());
|
|
|
question.setUpdateTime(DateUtils.getNowTime());
|
|
|
save(question);
|
|
|
- //题目业务层次
|
|
|
- QuestionBusinessImportVo importVo = JSON.parseObject(param, QuestionBusinessImportVo.class);
|
|
|
- CourseEducationType educationType = iCourseEducationTypeService
|
|
|
- .getOne(new LambdaQueryWrapper<CourseEducationType>()
|
|
|
- .eq(CourseEducationType::getEducationName, importVo.getEducationName())
|
|
|
- .eq(CourseEducationType::getStatus, 1)
|
|
|
- .last("limit 1"));
|
|
|
- CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaUpdateWrapper<CourseProjectType>()
|
|
|
- .eq(CourseProjectType::getEducationId, educationType.getId())
|
|
|
- .eq(CourseProjectType::getProjectName, importVo.getProjectName())
|
|
|
- .eq(CourseProjectType::getStatus, 1)
|
|
|
- .last("limit 1"));
|
|
|
- CourseBusiness business = iCourseBusinessService.getOne(new LambdaUpdateWrapper<CourseBusiness>()
|
|
|
- .eq(CourseBusiness::getProjectId, projectType.getId())
|
|
|
- .eq(CourseBusiness::getBusinessName, importVo.getBusinessName())
|
|
|
- .eq(CourseBusiness::getStatus, 1)
|
|
|
- .last("limit 1"));
|
|
|
- CourseSubject courseSubject = iCourseSubjectService.getOneByName(importVo.getSubjectName(),projectType.getId());
|
|
|
QuestionBusiness business1 = new QuestionBusiness();
|
|
|
business1.setEducationTypeId(educationType.getId());
|
|
|
business1.setProjectId(projectType.getId());
|
|
@@ -4460,6 +4490,16 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
business1.setType(1);
|
|
|
iQuestionBusinessService.save(business1);
|
|
|
|
|
|
+
|
|
|
+ //试卷题库关联关系
|
|
|
+ ExamQuestion examQuestion = new ExamQuestion();
|
|
|
+ examQuestion.setExamId(exam.getExamId());
|
|
|
+ examQuestion.setQuestionId(question.getQuestionId());
|
|
|
+ examQuestion.setSort(b);
|
|
|
+ iExamQuestionService.save(examQuestion);
|
|
|
+
|
|
|
+ //重置排序
|
|
|
+ b = b+1;
|
|
|
//重置索引
|
|
|
i = i+a-1;
|
|
|
}
|