|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.sztzjy.fund_investment.service.serviceImpl.tea;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.sztzjy.fund_investment.config.Constant;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.*;
|
|
|
|
@ -23,6 +24,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author xcj
|
|
|
|
@ -152,62 +155,81 @@ public class ClassScoreServiceImpl implements ClassScoreService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /* 成绩详情页面
|
|
|
|
|
// * @author xcj
|
|
|
|
|
// * @Date 2023/11/27
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
|
|
|
|
|
// UserExample userTableExample = new UserExample();
|
|
|
|
|
// UserExample.Criteria criteria = userTableExample.createCriteria();
|
|
|
|
|
// UserExample.Criteria orCriteria = userTableExample.createCriteria();
|
|
|
|
|
// criteria.andRoleIdEqualTo(4);
|
|
|
|
|
// if (StringUtils.isNotBlank(classId)) {
|
|
|
|
|
// criteria.andClassIdEqualTo(classId);
|
|
|
|
|
// } else {
|
|
|
|
|
// criteria.andSchoolIdEqualTo(schoolId);
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(studentIdOrName)) {
|
|
|
|
|
// criteria.andNameEqualTo(studentIdOrName);
|
|
|
|
|
// orCriteria.andStudentIdEqualTo(studentIdOrName);
|
|
|
|
|
// }
|
|
|
|
|
// userTableExample.or(orCriteria);
|
|
|
|
|
// List<User> userTables = userMapper.selectByExample(userTableExample);
|
|
|
|
|
//
|
|
|
|
|
// List<UserDto> userDtoList = new ArrayList<>();
|
|
|
|
|
// for (User userTable : userTables) {
|
|
|
|
|
// UserDto userDto = new UserDto();
|
|
|
|
|
// BeanUtils.copyProperties(userTable, userDto);
|
|
|
|
|
// Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());
|
|
|
|
|
// String flowId = flow.getFlowId();
|
|
|
|
|
// TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
// trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG);
|
|
|
|
|
// List<TrainingReport> trainingReports = reportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
// PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
// performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
|
|
|
|
|
// List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
// if (!performanceScores.isEmpty()) {
|
|
|
|
|
// PerformanceScore performanceScore = performanceScores.get(0);
|
|
|
|
|
// if (trainingReports.isEmpty()) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// for (TrainingReport trainingReport : trainingReports) {
|
|
|
|
|
// userDto.setReportId(trainingReport.getId());
|
|
|
|
|
// userDto.setReportName(trainingReport.getReportName());
|
|
|
|
|
// }
|
|
|
|
|
// userDto.setFlowId(flowId);
|
|
|
|
|
// userDto.setScore(performanceScore.getTotalScore());
|
|
|
|
|
// userDto.setPerformanceScoreId(performanceScore.getId());
|
|
|
|
|
// userDtoList.add(userDto);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (userDtoList.size() <= 0) {
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
// userDtoList.sort(new StuUserDtoComparator()); //比较器按得分排序
|
|
|
|
|
// return PageUtil.pageHelper(userDtoList, index, size); //分页
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 成绩详情页面
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/27
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
|
|
|
|
|
UserExample userTableExample = new UserExample();
|
|
|
|
|
UserExample.Criteria criteria = userTableExample.createCriteria();
|
|
|
|
|
UserExample.Criteria orCriteria = userTableExample.createCriteria();
|
|
|
|
|
criteria.andRoleIdEqualTo(4);
|
|
|
|
|
if (StringUtils.isNotBlank(classId)) {
|
|
|
|
|
criteria.andClassIdEqualTo(classId);
|
|
|
|
|
} else {
|
|
|
|
|
criteria.andSchoolIdEqualTo(schoolId);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(studentIdOrName)) {
|
|
|
|
|
criteria.andNameEqualTo(studentIdOrName);
|
|
|
|
|
orCriteria.andStudentIdEqualTo(studentIdOrName);
|
|
|
|
|
}
|
|
|
|
|
userTableExample.or(orCriteria);
|
|
|
|
|
List<User> userTables = userMapper.selectByExample(userTableExample);
|
|
|
|
|
List<UserDto> userDtoList = new ArrayList<>();
|
|
|
|
|
for (User userTable : userTables) {
|
|
|
|
|
UserDto userDto = new UserDto();
|
|
|
|
|
BeanUtils.copyProperties(userTable, userDto);
|
|
|
|
|
Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid());
|
|
|
|
|
String flowId = flow.getFlowId();
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG);
|
|
|
|
|
List<TrainingReport> trainingReports = reportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
|
|
|
|
|
performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
|
|
|
|
|
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
|
|
|
|
|
if (!performanceScores.isEmpty()) {
|
|
|
|
|
PerformanceScore performanceScore = performanceScores.get(0);
|
|
|
|
|
if (trainingReports.isEmpty()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (TrainingReport trainingReport : trainingReports) {
|
|
|
|
|
userDto.setReportId(trainingReport.getId());
|
|
|
|
|
userDto.setReportName(trainingReport.getReportName());
|
|
|
|
|
}
|
|
|
|
|
userDto.setFlowId(flowId);
|
|
|
|
|
userDto.setScore(performanceScore.getTotalScore());
|
|
|
|
|
userDto.setPerformanceScoreId(performanceScore.getId());
|
|
|
|
|
userDtoList.add(userDto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (userDtoList.size() <= 0) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
userDtoList.sort(new StuUserDtoComparator()); //比较器按得分排序
|
|
|
|
|
return PageUtil.pageHelper(userDtoList, index, size); //分页
|
|
|
|
|
PageHelper.startPage(index,size);
|
|
|
|
|
List<UserDto> studentScoreDetails = userMapper.getStudentScoreDetails(schoolId, classId, studentIdOrName);
|
|
|
|
|
PageInfo <UserDto>pageInfo =new PageInfo(studentScoreDetails);
|
|
|
|
|
return pageInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 成绩详情导出功能
|
|
|
|
|
* @author xcj
|
|
|
|
|
* @Date 2023/11/27
|
|
|
|
|