From c6974a68972be7f26e61df42de7d9e1605379725 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期一, 03 六月 2024 11:27:58 +0800 Subject: [PATCH] 分页工具类 --- src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java | 25 ++++++++++--------------- 1 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java b/src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java index bad9048..3757532 100644 --- a/src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java +++ b/src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java @@ -1,9 +1,10 @@ package com.ycl.jxkg.service.impl; -import com.ycl.jxkg.domain.ExamPaperQuestionCustomerAnswer; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ycl.jxkg.domain.entity.ExamPaperQuestionCustomerAnswer; import com.ycl.jxkg.domain.other.ExamPaperAnswerUpdate; import com.ycl.jxkg.domain.other.KeyValue; -import com.ycl.jxkg.domain.TextContent; +import com.ycl.jxkg.domain.entity.TextContent; import com.ycl.jxkg.domain.enums.QuestionTypeEnum; import com.ycl.jxkg.mapper.ExamPaperQuestionCustomerAnswerMapper; import com.ycl.jxkg.service.ExamPaperQuestionCustomerAnswerService; @@ -11,11 +12,11 @@ import com.ycl.jxkg.utils.DateTimeUtil; import com.ycl.jxkg.utils.ExamUtil; import com.ycl.jxkg.utils.JsonUtil; -import com.ycl.jxkg.vo.student.exam.ExamPaperSubmitItemVO; -import com.ycl.jxkg.vo.student.question.answer.QuestionPageStudentRequestVO; +import com.ycl.jxkg.domain.vo.student.exam.ExamPaperSubmitItemVO; +import com.ycl.jxkg.domain.vo.student.question.answer.QuestionPageStudentRequestVO; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.Date; @@ -23,17 +24,11 @@ import java.util.stream.Collectors; @Service -public class ExamPaperQuestionCustomerAnswerServiceImpl extends BaseServiceImpl<ExamPaperQuestionCustomerAnswer> implements ExamPaperQuestionCustomerAnswerService { +@RequiredArgsConstructor +public class ExamPaperQuestionCustomerAnswerServiceImpl extends ServiceImpl<ExamPaperQuestionCustomerAnswerMapper, ExamPaperQuestionCustomerAnswer> implements ExamPaperQuestionCustomerAnswerService { private final ExamPaperQuestionCustomerAnswerMapper examPaperQuestionCustomerAnswerMapper; private final TextContentService textContentService; - - @Autowired - public ExamPaperQuestionCustomerAnswerServiceImpl(ExamPaperQuestionCustomerAnswerMapper examPaperQuestionCustomerAnswerMapper, TextContentService textContentService) { - super(examPaperQuestionCustomerAnswerMapper); - this.examPaperQuestionCustomerAnswerMapper = examPaperQuestionCustomerAnswerMapper; - this.textContentService = textContentService; - } @Override @@ -97,13 +92,13 @@ examPaperSubmitItemVO.setContentArray(ExamUtil.contentToArray(examPaperQuestionCustomerAnswer.getAnswer())); break; case GapFilling: - TextContent textContent = textContentService.selectById(examPaperQuestionCustomerAnswer.getTextContentId()); + TextContent textContent = textContentService.getById(examPaperQuestionCustomerAnswer.getTextContentId()); List<String> correctAnswer = JsonUtil.toJsonListObject(textContent.getContent(), String.class); examPaperSubmitItemVO.setContentArray(correctAnswer); break; default: if (QuestionTypeEnum.needSaveTextContent(examPaperQuestionCustomerAnswer.getQuestionType())) { - TextContent content = textContentService.selectById(examPaperQuestionCustomerAnswer.getTextContentId()); + TextContent content = textContentService.getById(examPaperQuestionCustomerAnswer.getTextContentId()); examPaperSubmitItemVO.setContent(content.getContent()); } else { examPaperSubmitItemVO.setContent(examPaperQuestionCustomerAnswer.getAnswer()); -- Gitblit v1.8.0