|
@@ -26,6 +26,8 @@ import com.zhongzheng.modules.base.domain.ApplyAreas;
|
|
|
import com.zhongzheng.modules.course.bo.CourseChapterSectionListAddBo;
|
|
|
import com.zhongzheng.modules.course.domain.*;
|
|
|
import com.zhongzheng.modules.course.service.*;
|
|
|
+import com.zhongzheng.modules.exam.bo.ExamKnowledgeAddBo;
|
|
|
+import com.zhongzheng.modules.exam.bo.ExamKnowledgeBusinessAddBo;
|
|
|
import com.zhongzheng.modules.exam.domain.ExamKnowledge;
|
|
|
import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
@@ -217,22 +219,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
List<QuestionImport> errorList = new ArrayList<>();
|
|
|
for (QuestionImport question : questionList) {
|
|
|
QuestionAddBo bo = new QuestionAddBo();
|
|
|
- if(Validator.isNotEmpty(question.getKnowledge())){
|
|
|
- List<String> knowledgeList = Arrays.asList(question.getKnowledge().split(","));
|
|
|
- List<Long> kIdList = new ArrayList<>();
|
|
|
- for (String knowledge : knowledgeList) {
|
|
|
- Long knowledgeId = findKnowledgeId(knowledge);
|
|
|
- if(!Validator.isNotEmpty(knowledgeId)){
|
|
|
- // errorLog+=knowledge+"-该知识点不存在\n";
|
|
|
- question.setCause("该知识点不存在");
|
|
|
- errorList.add(question);
|
|
|
- continue;
|
|
|
- }
|
|
|
- kIdList.add(knowledgeId);
|
|
|
- }
|
|
|
- //知识点ID拼接
|
|
|
- bo.setKnowledgeIds(join(",", kIdList));
|
|
|
- }
|
|
|
+
|
|
|
if(!Validator.isNotEmpty(question.getContent())){
|
|
|
// errorLog+="题目内容空白\n";
|
|
|
continue;
|
|
@@ -285,6 +272,35 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
errorList.add(question);
|
|
|
continue;
|
|
|
}
|
|
|
+ if(Validator.isNotEmpty(question.getKnowledge())){
|
|
|
+ List<String> knowledgeList = Arrays.asList(question.getKnowledge().split(","));
|
|
|
+ List<Long> kIdList = new ArrayList<>();
|
|
|
+ for (String knowledge : knowledgeList) {
|
|
|
+ Long knowledgeId = findKnowledgeId(knowledge);
|
|
|
+ if(!Validator.isNotEmpty(knowledgeId)){
|
|
|
+ //知识点不存在则导入
|
|
|
+ ExamKnowledgeAddBo addBo = new ExamKnowledgeAddBo();
|
|
|
+ addBo.setName(knowledge);
|
|
|
+ List<ExamKnowledgeBusinessAddBo> bList = new ArrayList<>();
|
|
|
+ ExamKnowledgeBusinessAddBo bAddBo = new ExamKnowledgeBusinessAddBo();
|
|
|
+ bAddBo.setBusinessId(businessId);
|
|
|
+ bAddBo.setSubjectId(subjectId);
|
|
|
+ bList.add(bAddBo);
|
|
|
+ addBo.setExamKnowledgeBusinessAddBoList(bList);
|
|
|
+ knowledgeId = iExamKnowledgeService.insertByImportQuestionAddBo(addBo);
|
|
|
+ if(Validator.isEmpty(knowledgeId)||knowledgeId==0){
|
|
|
+ // errorLog+=knowledge+"-该知识点不存在\n";
|
|
|
+ question.setCause("该知识点不存在");
|
|
|
+ errorList.add(question);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ kIdList.add(knowledgeId);
|
|
|
+ }
|
|
|
+ //知识点ID拼接
|
|
|
+ bo.setKnowledgeIds(join(",", kIdList));
|
|
|
+ }
|
|
|
questionBusinessAddBo.setEducationTypeId(eduId);
|
|
|
questionBusinessAddBo.setProjectId(projectId);
|
|
|
questionBusinessAddBo.setBusinessId(businessId);
|