he2802 %!s(int64=3) %!d(string=hai) anos
pai
achega
98219817dd

+ 16 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -1342,7 +1342,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 String qContent = ""; //题目正文
                 String answerQuestion = null; //答案
                 String analysisContent = ""; //解析文本
-                int index = 0; //题目序列号
+                int index = 1; //题目序列号
                 List<QuestionBusinessAddBo> businessList = new ArrayList<>();
                 QuestionBusinessAddBo questionBusinessAddBo = new QuestionBusinessAddBo();
                 questionBusinessAddBo.setEducationTypeId(eduId);
@@ -1360,6 +1360,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 String strContent = "";
                 String imgUrl = "";
                 boolean hasQuestion = false;
+                boolean hasRightTag = false;
                 boolean hasError = false;
                 for (XWPFParagraph paragraph : paragraphList) {
                     content = paragraph.getText();
@@ -1419,17 +1420,20 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             if (Validator.isEmpty(qContent)) {
                                 hasError = true;
                                 errorLog += "第" + index + "条题目内容错误\n";
+                                continue;
 
                             }
                             QuestionAddBo bo = new QuestionAddBo();
                             if (type == -1) {
                                 hasError = true;
                                 errorLog += "第" + index + "条题目选项错误\n";
+                                continue;
 
                             }
                             if(!hasError){
                                 if (Validator.isEmpty(answerQuestion)) {
                                     errorLog += "第" + index + "正确答案错误\n";
+                                    continue;
 
                                 }
                                 if(type==5){
@@ -1470,16 +1474,25 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             analysisContent = "";
                             optionsList.clear();
                             nowPart = -1;
+                            hasRightTag= false;
+                        }
+                    }
+                    System.out.println(index);
+                    if (content.startsWith("正确答案:")){
+                        if(!hasRightTag){
+                            hasRightTag = true;
+                        }else{
+                            errorLog += "第" + index + "题目序号可能错误\n";
+                            hasRightTag =false;
+                            continue;
                         }
                     }
-
                     if (content.startsWith("#")) { //导入结束
                         break;
                     }
                     if(Validator.isEmpty(content)||content.equals("")){
                         continue;
                     }
-
                     if (isQuestionStart(content)||(nowPart==0&&!isLineStart(content))) {
                         hasQuestion = true;
                         if(nowPart!=0){
@@ -1617,7 +1630,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     }
                     //答案和题型
                     if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
-                        hasQuestion = true;
                         if(nowPart!=7){
                             strContent = "";
                         }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -2428,7 +2428,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             }
         }
     }
-    
+
 
     @Override
     public void longNotReadToStudentThree(UserQueryBo bo) {

+ 4 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysRoleBusiness.java

@@ -23,11 +23,12 @@ public class SysRoleBusiness implements Serializable {
 
 private static final long serialVersionUID=1L;
 
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
     /** 角色ID */
     private Long roleId;
     /** 业务层次ID */
     private Long businessId;
-    /** $column.columnComment */
-    @TableId(value = "id")
-    private Long id;
+
 }