Explorar o código

fix 导入题目excel

he2802 %!s(int64=3) %!d(string=hai) anos
pai
achega
4abb1f6cf3

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

@@ -614,6 +614,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
 
     @Override
     public Map<String, Object> importExcelQuestionV2NotInBank(List<QuestionImportV2> questionList, Boolean isUpdateSupport, String operName) {
+        System.out.println(questionList);
         Map<String, Object> map = new HashMap<>();
         if (Validator.isNull(questionList) || questionList.size() == 0) {
             throw new CustomException("导入数据不能为空!");
@@ -823,15 +824,18 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             if(Validator.isNotEmpty(entity.getContent())&&i>startIndex){
                 break;
             }
+            if(Validator.isEmpty(entity.getOption())){
+                continue;
+            }
             QuestionChildAddBo addBo = new QuestionChildAddBo();
             addBo.setContent(entity.getOption());
             addBo.setOptionsId(j);
             optionsList.add(addBo);
             if("是".equals(entity.getAnswer())){
                 answerList.add(j);
-                if(type==1){ //单选
+                /*if(type==1){ //单选
                     break;
-                }
+                }*/
             }
             j++;
         }