he2802 vor 3 Jahren
Ursprung
Commit
01a56eb8f4

+ 8 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -506,11 +506,6 @@ 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("正确答案错误");
@@ -524,7 +519,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                     type = 1; //单选
                                 }
                             }else{
-                                System.out.println(answerQuestion+"我的大大问题A");
                                 if("正确".equals(answerQuestion)){
                                     answerQuestion = "1";
                                     type = 3; //判断
@@ -638,7 +632,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             qContent += content;
                         }
                     }else{
-                       System.out.println("换行");
+                       qContent = removeNo(qContent);
+                       if(Validator.isEmpty(qContent)){
+                           errorLog+="第"+index+"条题目内容空白\n";
+                           i++;
+                           continue;
+                       }
                        QuestionAddBo bo = new QuestionAddBo();
                        if(type==-1){
                            errorLog+="第"+index+"条题目选项错误\n";
@@ -646,12 +645,7 @@ 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(qContent);
                        bo.setAnswerQuestion(answerQuestion);
@@ -661,7 +655,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                        bo.setImportNo(importNo);
                        bo.setPublishStatus(1);
                        bo.setBusinessList(businessList);
-                       errorLog = insertByAddBoImport(bo,i);
+                       insertByAddBoImport(bo,i);
 
                         //清空数据
                         isOption = false;