From 12aa6d1bbe7b386f81731d797942b6a1ac7e3a2f Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 26 六月 2024 13:49:58 +0800 Subject: [PATCH] 班级学员新增bug --- src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java b/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java index 867ceca..e03ff41 100644 --- a/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java +++ b/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java @@ -1,8 +1,12 @@ package com.ycl.jxkg.listener; import com.ycl.jxkg.domain.*; -import com.ycl.jxkg.domain.enums.ExamPaperTypeEnum; -import com.ycl.jxkg.domain.enums.QuestionTypeEnum; +import com.ycl.jxkg.domain.entity.ExamPaper; +import com.ycl.jxkg.domain.entity.ExamPaperAnswer; +import com.ycl.jxkg.domain.entity.ExamPaperQuestionCustomerAnswer; +import com.ycl.jxkg.domain.entity.TextContent; +import com.ycl.jxkg.enums.ExamPaperTypeEnum; +import com.ycl.jxkg.enums.QuestionTypeEnum; import com.ycl.jxkg.event.CalculateExamPaperAnswerCompleteEvent; import com.ycl.jxkg.service.ExamPaperAnswerService; import com.ycl.jxkg.service.ExamPaperQuestionCustomerAnswerService; @@ -57,12 +61,12 @@ ExamPaperAnswer examPaperAnswer = examPaperAnswerInfo.getExamPaperAnswer(); List<ExamPaperQuestionCustomerAnswer> examPaperQuestionCustomerAnswers = examPaperAnswerInfo.getExamPaperQuestionCustomerAnswers(); - examPaperAnswerService.insertByFilter(examPaperAnswer); + examPaperAnswerService.save(examPaperAnswer); examPaperQuestionCustomerAnswers.stream().filter(a -> QuestionTypeEnum.needSaveTextContent(a.getQuestionType())).forEach(d -> { TextContent textContent = new TextContent(); textContent.setContent(d.getAnswer()); textContent.setCreateTime(now); - textContentService.insertByFilter(textContent); + textContentService.save(textContent); d.setTextContentId(textContent.getId()); d.setAnswer(null); }); @@ -72,7 +76,7 @@ examPaperQuestionCustomerAnswerService.insertList(examPaperQuestionCustomerAnswers); switch (ExamPaperTypeEnum.fromCode(examPaper.getPaperType())) { - case Task: { + case RandomOrder: { examCustomerAnswerService.insertOrUpdate(examPaper, examPaperAnswer, now); break; } -- Gitblit v1.8.0