|
@@ -192,11 +192,11 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
//获取各科成绩满分
|
|
//获取各科成绩满分
|
|
List<ScoreDataMfBo> scoreDataMfBoList = bo.getScoreDataMfBoList();
|
|
List<ScoreDataMfBo> scoreDataMfBoList = bo.getScoreDataMfBoList();
|
|
//组装一个学科 满分的MAP
|
|
//组装一个学科 满分的MAP
|
|
- Map<String,String> map = new HashMap<>();
|
|
|
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
if (scoreDataMfBoList != null && scoreDataMfBoList.size() > 0) {
|
|
if (scoreDataMfBoList != null && scoreDataMfBoList.size() > 0) {
|
|
for (ScoreDataMfBo scoreDataMfBo : scoreDataMfBoList) {
|
|
for (ScoreDataMfBo scoreDataMfBo : scoreDataMfBoList) {
|
|
scoreDataMfBo.setScoreId(scoreId);
|
|
scoreDataMfBo.setScoreId(scoreId);
|
|
- map.put(scoreDataMfBo.getXueke(),scoreDataMfBo.getManfen());
|
|
|
|
|
|
+ map.put(scoreDataMfBo.getXueke(), scoreDataMfBo.getManfen());
|
|
}
|
|
}
|
|
scoreDataMfMapper.insertBatch(MapstructUtils.convert(scoreDataMfBoList, org.dromara.system.domain.score.ScoreDataMf.class));
|
|
scoreDataMfMapper.insertBatch(MapstructUtils.convert(scoreDataMfBoList, org.dromara.system.domain.score.ScoreDataMf.class));
|
|
}
|
|
}
|
|
@@ -298,7 +298,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
//获取缓存的数据
|
|
//获取缓存的数据
|
|
Map<String, Object> cacheMap = RedisUtils.getCacheMap(CacheConstants.FEN_DUAN_NEW + scoreData.getScoreClassId());
|
|
Map<String, Object> cacheMap = RedisUtils.getCacheMap(CacheConstants.FEN_DUAN_NEW + scoreData.getScoreClassId());
|
|
//获取班级id对应的最新考试id
|
|
//获取班级id对应的最新考试id
|
|
- String scoreDataId = RedisUtils.getCacheObject(CacheConstants.SCORE_ID + scoreData.getScoreClassId());
|
|
|
|
|
|
+ String scoreDataId = RedisUtils.getCacheObject(CacheConstants.SCORE_ID + scoreData.getScoreClassId());
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
if (cacheMap != null) {
|
|
if (cacheMap != null) {
|
|
//获取redis缓存的考试id
|
|
//获取redis缓存的考试id
|
|
@@ -428,8 +428,8 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
//获取年级所有学生排名
|
|
//获取年级所有学生排名
|
|
List<ScoreDataStudentVo> scoreDataStudentVos = scoreDataStudentMapper.gradeRank(scoreData);
|
|
List<ScoreDataStudentVo> scoreDataStudentVos = scoreDataStudentMapper.gradeRank(scoreData);
|
|
Long scoreId = scoreData.getScoreId();
|
|
Long scoreId = scoreData.getScoreId();
|
|
- if (scoreId != null){
|
|
|
|
- scoreDataStudentVos = scoreDataStudentVos.stream().filter(scoreDataStudentVo -> scoreDataStudentVo.getScoreId().equals(scoreId)).sorted(Comparator.comparing(ScoreDataStudentVo::getZongfen)).collect(Collectors.toList());
|
|
|
|
|
|
+ if (scoreId != null) {
|
|
|
|
+ scoreDataStudentVos = scoreDataStudentVos.stream().filter(scoreDataStudentVo -> scoreDataStudentVo.getScoreId().equals(scoreId)).sorted(Comparator.comparing(ScoreDataStudentVo::getZongfen)).collect(Collectors.toList());
|
|
}
|
|
}
|
|
return scoreDataStudentVos;
|
|
return scoreDataStudentVos;
|
|
}
|
|
}
|
|
@@ -449,16 +449,16 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
//获取年级所有学生排名
|
|
//获取年级所有学生排名
|
|
List<ScoreDataStudentVo> scoreDataStudentVos = scoreDataStudentMapper.gradeRank(scoreData);
|
|
List<ScoreDataStudentVo> scoreDataStudentVos = scoreDataStudentMapper.gradeRank(scoreData);
|
|
Long scoreId = scoreData.getScoreId();
|
|
Long scoreId = scoreData.getScoreId();
|
|
- Map<String,Double> map = new HashMap<>();
|
|
|
|
- if (scoreId != null){
|
|
|
|
|
|
+ Map<String, Double> map = new HashMap<>();
|
|
|
|
+ if (scoreId != null) {
|
|
//过滤出本班学生id
|
|
//过滤出本班学生id
|
|
- scoreDataStudentVos = scoreDataStudentVos.stream().filter(scoreDataStudentVo -> scoreDataStudentVo.getScoreId().equals(scoreId)).sorted(Comparator.comparing(ScoreDataStudentVo::getZongfen)).collect(Collectors.toList());
|
|
|
|
|
|
+ scoreDataStudentVos = scoreDataStudentVos.stream().filter(scoreDataStudentVo -> scoreDataStudentVo.getScoreId().equals(scoreId)).sorted(Comparator.comparing(ScoreDataStudentVo::getZongfen)).collect(Collectors.toList());
|
|
//去查询对应学生的具体学科成绩/计算学科平均分
|
|
//去查询对应学生的具体学科成绩/计算学科平均分
|
|
//获取所有学生id
|
|
//获取所有学生id
|
|
List<Long> scoreDataNameIds = scoreDataStudentVos.stream().map(ScoreDataStudentVo::getScoreDataNameId).collect(Collectors.toList());
|
|
List<Long> scoreDataNameIds = scoreDataStudentVos.stream().map(ScoreDataStudentVo::getScoreDataNameId).collect(Collectors.toList());
|
|
- List<ScoreDataDetailVo> scoreDataDetailVos = scoreDataDetailMapper.selectListByscoreDataNameId(scoreDataNameIds);
|
|
|
|
|
|
+ List<ScoreDataDetailVo> scoreDataDetailVos = scoreDataDetailMapper.selectListByscoreDataNameId(scoreDataNameIds,scoreId);
|
|
//根据学科进行分组
|
|
//根据学科进行分组
|
|
- if (scoreDataDetailVos != null && scoreDataDetailVos.size() > 0){
|
|
|
|
|
|
+ if (scoreDataDetailVos != null && scoreDataDetailVos.size() > 0) {
|
|
Map<String, List<ScoreDataDetailVo>> xuekeCollect = scoreDataDetailVos.parallelStream().collect(Collectors.groupingBy(ScoreDataDetailVo::getXueke));
|
|
Map<String, List<ScoreDataDetailVo>> xuekeCollect = scoreDataDetailVos.parallelStream().collect(Collectors.groupingBy(ScoreDataDetailVo::getXueke));
|
|
for (String xueke : xuekeCollect.keySet()) {
|
|
for (String xueke : xuekeCollect.keySet()) {
|
|
List<ScoreDataDetailVo> scoreDataDetailVosXueke = xuekeCollect.get(xueke);
|
|
List<ScoreDataDetailVo> scoreDataDetailVosXueke = xuekeCollect.get(xueke);
|
|
@@ -466,7 +466,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
double sum = scoreDataDetailVosXueke.stream().mapToDouble(ScoreDataDetailVo::getScore).sum();
|
|
double sum = scoreDataDetailVosXueke.stream().mapToDouble(ScoreDataDetailVo::getScore).sum();
|
|
//计算学科平均分 = 学科总分 /人数
|
|
//计算学科平均分 = 学科总分 /人数
|
|
double xueKeAvg = sum / scoreDataNameIds.size();
|
|
double xueKeAvg = sum / scoreDataNameIds.size();
|
|
- map.put(xueke,xueKeAvg);
|
|
|
|
|
|
+ map.put(xueke, xueKeAvg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//总成绩均分
|
|
//总成绩均分
|
|
@@ -479,7 +479,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
for (ScoreDataStudentVo scoreDataStudentVo : scoreDataStudentVos) {
|
|
for (ScoreDataStudentVo scoreDataStudentVo : scoreDataStudentVos) {
|
|
scoreDataStudentVo.setAvg(String.valueOf(zongFenAvg));
|
|
scoreDataStudentVo.setAvg(String.valueOf(zongFenAvg));
|
|
List<ScoreDataDetailVo> scoreDataDetailVosList = scoreDataNameIdCollect.get(scoreDataStudentVo.getScoreDataNameId());
|
|
List<ScoreDataDetailVo> scoreDataDetailVosList = scoreDataNameIdCollect.get(scoreDataStudentVo.getScoreDataNameId());
|
|
- if (scoreDataDetailVosList != null && scoreDataDetailVosList.size() > 0){
|
|
|
|
|
|
+ if (scoreDataDetailVosList != null && scoreDataDetailVosList.size() > 0) {
|
|
for (ScoreDataDetailVo scoreDataDetailVo : scoreDataDetailVosList) {
|
|
for (ScoreDataDetailVo scoreDataDetailVo : scoreDataDetailVosList) {
|
|
scoreDataDetailVo.setAvg(String.valueOf(map.get(scoreDataDetailVo.getXueke())));
|
|
scoreDataDetailVo.setAvg(String.valueOf(map.get(scoreDataDetailVo.getXueke())));
|
|
}
|
|
}
|
|
@@ -524,6 +524,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 班级总分平均分排名统计折线
|
|
* 班级总分平均分排名统计折线
|
|
|
|
+ *
|
|
* @param scoreData
|
|
* @param scoreData
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -557,7 +558,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
//获取对应考试的学生集合
|
|
//获取对应考试的学生集合
|
|
List<ScoreDataStudentVo> scoreDataStudentVosList = collect.get(scoreId);
|
|
List<ScoreDataStudentVo> scoreDataStudentVosList = collect.get(scoreId);
|
|
//进行平均分的判断
|
|
//进行平均分的判断
|
|
- if (scoreDataStudentVosList != null && scoreDataStudentVosList.size() > 0){
|
|
|
|
|
|
+ if (scoreDataStudentVosList != null && scoreDataStudentVosList.size() > 0) {
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListUp = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() >= avg)
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListUp = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() >= avg)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListDown = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() < avg)
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListDown = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() < avg)
|
|
@@ -568,9 +569,9 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
y2.add(scoreDataStudentVosListDown.size());
|
|
y2.add(scoreDataStudentVosListDown.size());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- map.put("x",x);
|
|
|
|
- map.put("y1",y1);
|
|
|
|
- map.put("y2",y2);
|
|
|
|
|
|
+ map.put("x", x);
|
|
|
|
+ map.put("y1", y1);
|
|
|
|
+ map.put("y2", y2);
|
|
}
|
|
}
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
@@ -602,7 +603,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
//获取对应考试的学生集合
|
|
//获取对应考试的学生集合
|
|
List<ScoreDataStudentVo> scoreDataStudentVosList = collect.get(scoreId);
|
|
List<ScoreDataStudentVo> scoreDataStudentVosList = collect.get(scoreId);
|
|
//进行平均分的判断
|
|
//进行平均分的判断
|
|
- if (scoreDataStudentVosList != null && scoreDataStudentVosList.size() > 0){
|
|
|
|
|
|
+ if (scoreDataStudentVosList != null && scoreDataStudentVosList.size() > 0) {
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListUp = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() >= avg)
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListUp = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() >= avg)
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListDown = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() < avg)
|
|
List<ScoreDataStudentVo> scoreDataStudentVosListDown = scoreDataStudentVosList.stream().filter(scoreDataStudent -> scoreDataStudent.getZongfen() < avg)
|
|
@@ -617,6 +618,7 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 年级分数段统计
|
|
* 年级分数段统计
|
|
|
|
+ *
|
|
* @param scoreData
|
|
* @param scoreData
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -675,16 +677,40 @@ public class ScoreDataServiceImpl implements IScoreDataService {
|
|
}
|
|
}
|
|
//总人数
|
|
//总人数
|
|
int size = scoreDataStudentVos.size();
|
|
int size = scoreDataStudentVos.size();
|
|
- if (size > 0){
|
|
|
|
|
|
+ if (size > 0) {
|
|
DecimalFormat df = new DecimalFormat("##.0%");
|
|
DecimalFormat df = new DecimalFormat("##.0%");
|
|
- map.put("OneZ", df.format(size/a));
|
|
|
|
- map.put("TowZ", df.format(size/b));
|
|
|
|
- map.put("ThrZ", df.format(size/c));
|
|
|
|
- map.put("ForZ", df.format(size/d));
|
|
|
|
- map.put("FivZ", df.format(size/e));
|
|
|
|
- map.put("SixZ", df.format(size/f));
|
|
|
|
- map.put("SevZ", df.format(size/g));
|
|
|
|
- map.put("EigZ", df.format(size/h));
|
|
|
|
|
|
+ if (a > 0) {
|
|
|
|
+ map.put("OneZ", df.format(size / a));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (b > 0) {
|
|
|
|
+ map.put("TowZ", df.format(size / b));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (c > 0) {
|
|
|
|
+ map.put("ThrZ", df.format(size / c));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (d > 0) {
|
|
|
|
+ map.put("ForZ", df.format(size / d));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (e > 0) {
|
|
|
|
+ map.put("FivZ", df.format(size / e));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (f > 0) {
|
|
|
|
+ map.put("SixZ", df.format(size / f));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (g > 0) {
|
|
|
|
+ map.put("SevZ", df.format(size / g));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (h > 0) {
|
|
|
|
+ map.put("EigZ", df.format(size / h));
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
map.put("One", a);
|
|
map.put("One", a);
|
|
map.put("Tow", b);
|
|
map.put("Tow", b);
|