|
@@ -1,5 +1,6 @@
|
|
package com.xjrsoft.module.xycxedu.service.impl;
|
|
package com.xjrsoft.module.xycxedu.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -9,20 +10,30 @@ import com.xjrsoft.common.page.ConventPage;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
import com.xjrsoft.module.base.entity.BaseClass;
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
|
+import com.xjrsoft.module.student.dto.BaseStudentUserPageDto;
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
|
+import com.xjrsoft.module.student.service.IStudentManagerService;
|
|
|
|
+import com.xjrsoft.module.student.vo.BaseStudentUserPageVo;
|
|
|
|
+import com.xjrsoft.module.xycxedu.dto.ClassStudentScorePageDto;
|
|
import com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto;
|
|
import com.xjrsoft.module.xycxedu.dto.ExamStatisticsPageDto;
|
|
import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
|
|
import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreDto;
|
|
import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreEnterDto;
|
|
import com.xjrsoft.module.xycxedu.dto.ExamSubjectScoreEnterDto;
|
|
import com.xjrsoft.module.xycxedu.entity.ExamSubjectScore;
|
|
import com.xjrsoft.module.xycxedu.entity.ExamSubjectScore;
|
|
import com.xjrsoft.module.xycxedu.mapper.ExamSubjectScoreMappper;
|
|
import com.xjrsoft.module.xycxedu.mapper.ExamSubjectScoreMappper;
|
|
import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
|
|
import com.xjrsoft.module.xycxedu.service.IExamSubjectScoreService;
|
|
|
|
+import com.xjrsoft.module.xycxedu.vo.ClassStudentScorePageVo;
|
|
|
|
+import com.xjrsoft.module.xycxedu.vo.ClassStudentScoreTitleVo;
|
|
import com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo;
|
|
import com.xjrsoft.module.xycxedu.vo.ExamStatisticsPageVo;
|
|
import com.xjrsoft.module.xycxedu.vo.ExamSubjectScoreEnterImportVo;
|
|
import com.xjrsoft.module.xycxedu.vo.ExamSubjectScoreEnterImportVo;
|
|
import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
|
|
import com.xjrsoft.module.xycxedu.vo.ExamSubjectScorePageVo;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Set;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @title: 晓羊策学考试计划表
|
|
* @title: 晓羊策学考试计划表
|
|
@@ -33,6 +44,9 @@ import java.util.List;
|
|
@Service
|
|
@Service
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectScoreMappper, ExamSubjectScore> implements IExamSubjectScoreService {
|
|
public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectScoreMappper, ExamSubjectScore> implements IExamSubjectScoreService {
|
|
|
|
+
|
|
|
|
+ private final IStudentManagerService studentManagerService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Long getUserIdByIdNumber(String idNumber) {
|
|
public Long getUserIdByIdNumber(String idNumber) {
|
|
return this.baseMapper.getUserIdByIdNumber(idNumber);
|
|
return this.baseMapper.getUserIdByIdNumber(idNumber);
|
|
@@ -97,4 +111,54 @@ public class ExamSubjectScoreServiceImpl extends MPJBaseServiceImpl<ExamSubjectS
|
|
PageOutput<ExamSubjectScoreEnterImportVo> pageOutput = ConventPage.getPageOutput(voIPage, ExamSubjectScoreEnterImportVo.class);
|
|
PageOutput<ExamSubjectScoreEnterImportVo> pageOutput = ConventPage.getPageOutput(voIPage, ExamSubjectScoreEnterImportVo.class);
|
|
return pageOutput;
|
|
return pageOutput;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<ClassStudentScoreTitleVo> getClassStudentScoreCourse(ClassStudentScorePageDto dto) {
|
|
|
|
+ return this.baseMapper.getClassStudentScoreCourse(dto);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<ExamSubjectScore> getClassStudentScoreList(ClassStudentScorePageDto dto) {
|
|
|
|
+ return this.baseMapper.getClassStudentScoreList(dto);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public PageOutput<ClassStudentScorePageVo> getClassStudentScorePage(ClassStudentScorePageDto dto) {
|
|
|
|
+
|
|
|
|
+ BaseStudentUserPageDto studentDto = BeanUtil.toBean(dto, BaseStudentUserPageDto.class);
|
|
|
|
+ Page<BaseStudentUserPageVo> studentPage = studentManagerService.getStudentPage(new Page<>(dto.getLimit(), dto.getSize()), studentDto);
|
|
|
|
+
|
|
|
|
+ Set<Long> userIdSet = studentPage.getRecords().stream().map(x -> Long.parseLong(x.getId())).collect(Collectors.toSet());
|
|
|
|
+ dto.setUserIdList(new ArrayList<>(userIdSet));
|
|
|
|
+ List<ExamSubjectScore> allScoreList = this.baseMapper.getClassStudentScoreList(dto);
|
|
|
|
+ Map<Long, List<ExamSubjectScore>> listMap = allScoreList.stream().collect(Collectors.groupingBy(ExamSubjectScore::getUserId));
|
|
|
|
+ PageOutput<ClassStudentScorePageVo> pageOutput = ConventPage.getPageOutput(studentPage, ClassStudentScorePageVo.class);
|
|
|
|
+
|
|
|
|
+ for (ClassStudentScorePageVo vo : pageOutput.getList()) {
|
|
|
|
+ long userId = Long.parseLong(vo.getId());
|
|
|
|
+ List<ClassStudentScoreTitleVo> scoreList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<ExamSubjectScore> scores = listMap.get(userId);
|
|
|
|
+ if(scores == null){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ for (ExamSubjectScore score : scores) {
|
|
|
|
+ scoreList.add(
|
|
|
|
+ new ClassStudentScoreTitleVo(){{
|
|
|
|
+ if(score.getScore() != null){
|
|
|
|
+ setScore(Float.toString(score.getScore()));
|
|
|
|
+ }
|
|
|
|
+ if(score.getExamPlanId() == null){
|
|
|
|
+ setCourseId(score.getMilexamid() + "" + score.getCourseSubjectId());
|
|
|
|
+ }else{
|
|
|
|
+ setCourseId(score.getExamPlanId() + "" + score.getCourseSubjectId());
|
|
|
|
+ }
|
|
|
|
+ setName(score.getCoursename());
|
|
|
|
+ }}
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ vo.setScoreList(scoreList);
|
|
|
|
+ }
|
|
|
|
+ return pageOutput;
|
|
|
|
+ }
|
|
}
|
|
}
|