Browse Source

fix 导入

he2802 3 năm trước cách đây
mục cha
commit
de37860a36

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -506,6 +506,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         }
                         //答案和题型
                         else if(content.startsWith("正确答案")){
+                            if(Validator.isEmpty(qContent)){
+                                errorLog+="第"+index+"条题目内容空白\n";
+                                i++;
+                                continue;
+                            }
                             answerQuestion = content.replace("正确答案:", "");
                             if(Validator.isEmpty(answerQuestion)){
                                 throw new CustomException("正确答案错误");
@@ -641,13 +646,14 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                            continue;
                        }
                        bo.setType(type);
+                       qContent = removeNo(qContent);
                        if(Validator.isEmpty(qContent)){
                            errorLog+="第"+index+"条题目内容空白\n";
                            i++;
                            continue;
                        }
                        bo.setStatus(1);
-                       bo.setContent(removeNo(qContent));
+                       bo.setContent(qContent);
                        bo.setAnswerQuestion(answerQuestion);
                        bo.setAnalysisContent(analysisContent);
                        bo.setOptionsList(optionsList);