xiangpei
2024-05-31 c9d04bc519b73f7fc4841c34e2f15fca9db7aad2
src/main/java/com/ycl/jxkg/controller/wx/student/ExamPaperAnswerController.java
@@ -19,6 +19,7 @@
import com.ycl.jxkg.vo.student.exam.ExamPaperReadVO;
import com.ycl.jxkg.vo.student.exam.ExamPaperSubmitItemVO;
import com.ycl.jxkg.vo.student.exam.ExamPaperSubmitVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
@@ -30,7 +31,7 @@
import java.util.*;
import java.util.stream.Collectors;
@RequiredArgsConstructor
@Controller("WXStudentExamPaperAnswerController")
@RequestMapping(value = "/api/wx/student/exampaper/answer")
@ResponseBody
@@ -41,14 +42,6 @@
    private final ApplicationEventPublisher eventPublisher;
    private final ExamPaperService examPaperService;
    @Autowired
    public ExamPaperAnswerController(ExamPaperAnswerService examPaperAnswerService, SubjectService subjectService, ApplicationEventPublisher eventPublisher, ExamPaperService examPaperService) {
        this.examPaperAnswerService = examPaperAnswerService;
        this.subjectService = subjectService;
        this.eventPublisher = eventPublisher;
        this.examPaperService = examPaperService;
    }
    @RequestMapping(value = "/pageList", method = RequestMethod.POST)
    public Result<PageInfo<ExamPaperAnswerPageResponseVO>> pageList(@Valid ExamPaperAnswerPageVO model) {
        model.setCreateUser(getCurrentUser().getId());
@@ -56,7 +49,7 @@
        PageInfo<ExamPaperAnswerPageResponseVO> page = PageInfoHelper.copyMap(pageInfo, e -> {
            ExamPaperAnswerPageResponseVO vo = new ExamPaperAnswerPageResponseVO();
            BeanUtils.copyProperties(e, vo);
            Subject subject = subjectService.selectById(vo.getSubjectId());
            Subject subject = subjectService.getById(vo.getSubjectId());
            vo.setDoTime(ExamUtil.secondToVM(e.getDoTime()));
            vo.setSystemScore(ExamUtil.scoreToVM(e.getSystemScore()));
            vo.setUserScore(ExamUtil.scoreToVM(e.getUserScore()));
@@ -127,7 +120,7 @@
    @PostMapping(value = "/read/{id}")
    public Result<ExamPaperReadVO> read(@PathVariable Integer id) {
        ExamPaperReadVO vm = new ExamPaperReadVO();
        ExamPaperAnswer examPaperAnswer = examPaperAnswerService.selectById(id);
        ExamPaperAnswer examPaperAnswer = examPaperAnswerService.getById(id);
        ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId());
        ExamPaperSubmitVO answer = examPaperAnswerService.examPaperAnswerToVM(examPaperAnswer.getId());
        vm.setPaper(paper);