he2802 3 жил өмнө
parent
commit
cac059cd92

+ 2 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java

@@ -181,7 +181,7 @@ public class QuestionController extends BaseController {
     @PostMapping("/importWordData")
     public AjaxResult importWordData(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) throws Exception
     {
-        iQuestionService.importWordQuestion(file,  eduId,  projectId,  businessId, subjectId);
-        return AjaxResult.success();
+        String errorLog = iQuestionService.importWordQuestion(file,  eduId,  projectId,  businessId, subjectId);
+        return AjaxResult.success(errorLog);
     }
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java

@@ -65,5 +65,5 @@ public interface IQuestionService extends IService<Question> {
 
     List<GoodsUserQuestionVo> listGoodsUserQuestionVo(GoodsQueryBo bo);
 
-    void importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
+    String importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
 }

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

@@ -347,7 +347,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     @Override
-    public void importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
+    public String importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
+        String errorLog = ""; //错误提示
         String buffer = "";
         String importNo = ServletUtils.getEncoded("IMPORT");
         try{
@@ -368,7 +369,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 List<QuestionChildAddBo> optionsList =new ArrayList<>(); //题目选项
                 String content = ""; //每行正文
                 String qContent = ""; //题目正文
-                String errorLog = ""; //错误提示
                 String answerQuestion = null; //答案
                 String analysisContent = ""; //解析文本
                 int i = 0;
@@ -677,6 +677,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
        }catch (IOException e){
             System.out.println("此文件不是word文件!A"+e.getMessage()+e.toString()+e.getLocalizedMessage());
         }
+        return errorLog;
     }
 
     private String removeNo(String txt){