From 8546b3d285af4235a0ef615a0c6e89486ae2c806 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 17 十月 2024 21:01:37 +0800 Subject: [PATCH] 达梦不支持value改为values --- src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java b/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java index e03ff41..c005a31 100644 --- a/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java +++ b/src/main/java/com/ycl/jxkg/listener/CalculateExamPaperAnswerListener.java @@ -2,14 +2,14 @@ import com.ycl.jxkg.domain.*; 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.ExamPaperScore; +import com.ycl.jxkg.domain.entity.ExamPaperScoreDetail; 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; +import com.ycl.jxkg.service.ExamPaperScoreService; +import com.ycl.jxkg.service.ExamPaperScoreDetailService; import com.ycl.jxkg.service.TaskExamCustomerAnswerService; import com.ycl.jxkg.service.TextContentService; import org.springframework.beans.factory.annotation.Autowired; @@ -30,23 +30,23 @@ @Component public class CalculateExamPaperAnswerListener implements ApplicationListener<CalculateExamPaperAnswerCompleteEvent> { - private final ExamPaperAnswerService examPaperAnswerService; - private final ExamPaperQuestionCustomerAnswerService examPaperQuestionCustomerAnswerService; + private final ExamPaperScoreService examPaperScoreService; + private final ExamPaperScoreDetailService examPaperScoreDetailService; private final TextContentService textContentService; private final TaskExamCustomerAnswerService examCustomerAnswerService; /** * Instantiates a new Calculate exam paper answer listener. * - * @param examPaperAnswerService the exam paper answer service - * @param examPaperQuestionCustomerAnswerService the exam paper question customer answer service + * @param examPaperScoreService the exam paper answer service + * @param examPaperScoreDetailService the exam paper question customer answer service * @param textContentService the text content service * @param examCustomerAnswerService the exam customer answer service */ @Autowired - public CalculateExamPaperAnswerListener(ExamPaperAnswerService examPaperAnswerService, ExamPaperQuestionCustomerAnswerService examPaperQuestionCustomerAnswerService, TextContentService textContentService, TaskExamCustomerAnswerService examCustomerAnswerService) { - this.examPaperAnswerService = examPaperAnswerService; - this.examPaperQuestionCustomerAnswerService = examPaperQuestionCustomerAnswerService; + public CalculateExamPaperAnswerListener(ExamPaperScoreService examPaperScoreService, ExamPaperScoreDetailService examPaperScoreDetailService, TextContentService textContentService, TaskExamCustomerAnswerService examCustomerAnswerService) { + this.examPaperScoreService = examPaperScoreService; + this.examPaperScoreDetailService = examPaperScoreDetailService; this.textContentService = textContentService; this.examCustomerAnswerService = examCustomerAnswerService; } @@ -58,11 +58,11 @@ ExamPaperAnswerInfo examPaperAnswerInfo = (ExamPaperAnswerInfo) calculateExamPaperAnswerCompleteEvent.getSource(); ExamPaper examPaper = examPaperAnswerInfo.getExamPaper(); - ExamPaperAnswer examPaperAnswer = examPaperAnswerInfo.getExamPaperAnswer(); - List<ExamPaperQuestionCustomerAnswer> examPaperQuestionCustomerAnswers = examPaperAnswerInfo.getExamPaperQuestionCustomerAnswers(); + ExamPaperScore examPaperScore = examPaperAnswerInfo.getExamPaperScore(); + List<ExamPaperScoreDetail> examPaperScoreDetails = examPaperAnswerInfo.getExamPaperScoreDetails(); - examPaperAnswerService.save(examPaperAnswer); - examPaperQuestionCustomerAnswers.stream().filter(a -> QuestionTypeEnum.needSaveTextContent(a.getQuestionType())).forEach(d -> { + examPaperScoreService.save(examPaperScore); + examPaperScoreDetails.stream().filter(a -> QuestionTypeEnum.needSaveTextContent(a.getQuestionType())).forEach(d -> { TextContent textContent = new TextContent(); textContent.setContent(d.getAnswer()); textContent.setCreateTime(now); @@ -70,14 +70,14 @@ d.setTextContentId(textContent.getId()); d.setAnswer(null); }); - examPaperQuestionCustomerAnswers.forEach(d -> { - d.setExamPaperAnswerId(examPaperAnswer.getId()); + examPaperScoreDetails.forEach(d -> { + d.setExamPaperAnswerId(examPaperScore.getId()); }); - examPaperQuestionCustomerAnswerService.insertList(examPaperQuestionCustomerAnswers); + examPaperScoreDetailService.insertList(examPaperScoreDetails); switch (ExamPaperTypeEnum.fromCode(examPaper.getPaperType())) { case RandomOrder: { - examCustomerAnswerService.insertOrUpdate(examPaper, examPaperAnswer, now); + examCustomerAnswerService.insertOrUpdate(examPaper, examPaperScore, now); break; } default: -- Gitblit v1.8.0