| | |
| | | import com.mindskip.xzs.service.TextContentService; |
| | | import com.mindskip.xzs.utility.DateTimeUtil; |
| | | import com.mindskip.xzs.utility.ExamUtil; |
| | | import com.mindskip.xzs.utility.HtmlUtil; |
| | | import com.mindskip.xzs.utility.JsonUtil; |
| | | import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitItemVM; |
| | | import com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentResponseVM; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<ExamPaperQuestionCustomerAnswer> studentPage(QuestionPageStudentRequestVM requestVM) { |
| | | return PageHelper.startPage(requestVM.getPageIndex(), requestVM.getPageSize(), "id desc").doSelectPageInfo(() -> |
| | | examPaperQuestionCustomerAnswerMapper.studentPage(requestVM) |
| | | public PageInfo<QuestionPageStudentResponseVM> studentPage(QuestionPageStudentRequestVM requestVM) { |
| | | return PageHelper.startPage(requestVM.getPageIndex(), requestVM.getPageSize()).doSelectPageInfo(() -> |
| | | examPaperQuestionCustomerAnswerMapper.studentPage(requestVM).stream().peek( |
| | | q -> q.setShortTitle(HtmlUtil.clear(q.getShortTitle())) |
| | | ).collect(Collectors.toList()) |
| | | ); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectAllCount() { |
| | | return examPaperQuestionCustomerAnswerMapper.selectAllCount(); |
| | | public Integer selectAllCount(List<Integer> deptIds) { |
| | | return examPaperQuestionCustomerAnswerMapper.selectAllCount(deptIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> selectMothCount() { |
| | | public List<Integer> selectMothCount(List<Integer> deptIds) { |
| | | Date startTime = DateTimeUtil.getMonthStartDay(); |
| | | Date endTime = DateTimeUtil.getMonthEndDay(); |
| | | List<KeyValue> mouthCount = examPaperQuestionCustomerAnswerMapper.selectCountByDate(startTime, endTime); |
| | | List<KeyValue> mouthCount = examPaperQuestionCustomerAnswerMapper.selectCountByDate(startTime, endTime, deptIds); |
| | | List<String> mothStartToNowFormat = DateTimeUtil.MothStartToNowFormat(); |
| | | return mothStartToNowFormat.stream().map(md -> { |
| | | KeyValue keyValue = mouthCount.stream().filter(kv -> kv.getName().equals(md)).findAny().orElse(null); |