fuliqi
2024-07-01 9dee3e46fdb59eb67b26f8c1958007025d1b7c29
src/main/java/com/ycl/jxkg/controller/wx/student/DashboardController.java
@@ -2,11 +2,11 @@
import com.ycl.jxkg.base.Result;
import com.ycl.jxkg.controller.wx.BaseWXApiController;
import com.ycl.jxkg.domain.TaskExam;
import com.ycl.jxkg.domain.TaskExamCustomerAnswer;
import com.ycl.jxkg.domain.TextContent;
import com.ycl.jxkg.domain.User;
import com.ycl.jxkg.domain.enums.ExamPaperTypeEnum;
import com.ycl.jxkg.domain.entity.TaskExam;
import com.ycl.jxkg.domain.entity.TaskExamCustomerAnswer;
import com.ycl.jxkg.domain.entity.TextContent;
import com.ycl.jxkg.domain.entity.User;
import com.ycl.jxkg.enums.ExamPaperTypeEnum;
import com.ycl.jxkg.domain.task.TaskItemAnswerObject;
import com.ycl.jxkg.domain.task.TaskItemObject;
import com.ycl.jxkg.service.ExamPaperService;
@@ -15,9 +15,9 @@
import com.ycl.jxkg.service.TextContentService;
import com.ycl.jxkg.utils.DateTimeUtil;
import com.ycl.jxkg.utils.JsonUtil;
import com.ycl.jxkg.vo.student.dashboard.*;
import com.ycl.jxkg.domain.vo.student.dashboard.*;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -28,7 +28,7 @@
import java.util.List;
import java.util.stream.Collectors;
@RequiredArgsConstructor
@Controller("WXStudentDashboardController")
@RequestMapping(value = "/api/wx/student/dashboard")
@ResponseBody
@@ -38,14 +38,6 @@
    private final TextContentService textContentService;
    private final TaskExamService taskExamService;
    private final TaskExamCustomerAnswerService taskExamCustomerAnswerService;
    @Autowired
    public DashboardController(ExamPaperService examPaperService, TextContentService textContentService, TaskExamService taskExamService, TaskExamCustomerAnswerService taskExamCustomerAnswerService) {
        this.examPaperService = examPaperService;
        this.textContentService = textContentService;
        this.taskExamService = taskExamService;
        this.taskExamCustomerAnswerService = taskExamCustomerAnswerService;
    }
    @RequestMapping(value = "/index", method = RequestMethod.POST)
    public Result<IndexVO> index() {
@@ -60,7 +52,7 @@
        PaperFilter timeLimitPaperFilter = new PaperFilter();
        timeLimitPaperFilter.setDateTime(new Date());
        timeLimitPaperFilter.setGradeLevel(user.getUserLevel());
        timeLimitPaperFilter.setExamPaperType(ExamPaperTypeEnum.TimeLimit.getCode());
        timeLimitPaperFilter.setExamPaperType(ExamPaperTypeEnum.Random.getCode());
        List<PaperInfo> limitPaper = examPaperService.indexPaper(timeLimitPaperFilter);
        List<PaperInfoVO> paperInfoVOS = limitPaper.stream().map(d -> {
@@ -98,12 +90,12 @@
    private List<TaskItemPaperVO> getTaskItemPaperVm(Integer tFrameId, TaskExamCustomerAnswer taskExamCustomerAnswers) {
        TextContent textContent = textContentService.selectById(tFrameId);
        TextContent textContent = textContentService.getById(tFrameId);
        List<TaskItemObject> paperItems = JsonUtil.toJsonListObject(textContent.getContent(), TaskItemObject.class);
        List<TaskItemAnswerObject> answerPaperItems = null;
        if (null != taskExamCustomerAnswers) {
            TextContent answerTextContent = textContentService.selectById(taskExamCustomerAnswers.getTextContentId());
            TextContent answerTextContent = textContentService.getById(taskExamCustomerAnswers.getTextContentId());
            answerPaperItems = JsonUtil.toJsonListObject(answerTextContent.getContent(), TaskItemAnswerObject.class);
        }