소스 검색

fix word导入

he2802 3 년 전
부모
커밋
00693f584a
1개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

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

@@ -1043,6 +1043,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 errorLog += "第" + index + "条题目选项错误\n";
                             }
                             if(!hasError){
+                                if (Validator.isEmpty(answerQuestion)) {
+                                    throw new CustomException("正确答案错误");
+                                }
                                 if(type==5){
                                     answerQuestion = null;
                                 }
@@ -1057,10 +1060,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 bo.setPublishStatus(1);
                                 bo.setBusinessList(businessList);
                                 bo.setCreateTime(nowTime);
-                                answerQuestion = content.replace("正确答案:", "");
-                                if (Validator.isEmpty(answerQuestion)) {
-                                    throw new CustomException("正确答案错误");
-                                }
                                 if(type==1){
                                     list1.add(bo);
                                 }
@@ -1428,6 +1427,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
 
                             }
                             if(!hasError){
+                                if (Validator.isEmpty(answerQuestion)) {
+                                    throw new CustomException("正确答案错误");
+                                }
                                 if(type==5){
                                     answerQuestion = null;
                                 }
@@ -1442,9 +1444,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 bo.setPublishStatus(1);
                                 bo.setBusinessList(businessList);
                                 bo.setCreateTime(nowTime);
-                                if (Validator.isEmpty(answerQuestion)) {
-                                    throw new CustomException("正确答案错误");
-                                }
                                 if(type==1){
                                     list1.add(bo);
                                 }