xiangpei
2024-06-28 02d8e9c93d128ad87bd891cc45d652727862df5f
src/main/java/com/ycl/jxkg/service/impl/ExamPaperQuestionCustomerAnswerServiceImpl.java
@@ -1,21 +1,22 @@
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.enums.QuestionTypeEnum;
import com.ycl.jxkg.domain.entity.TextContent;
import com.ycl.jxkg.enums.QuestionTypeEnum;
import com.ycl.jxkg.mapper.ExamPaperQuestionCustomerAnswerMapper;
import com.ycl.jxkg.service.ExamPaperQuestionCustomerAnswerService;
import com.ycl.jxkg.service.TextContentService;
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());