update 教师分布统计返回值调整

develop
hhb@hotmail.com 3 weeks ago
parent 18b0acd648
commit cd421db42b

@ -257,6 +257,7 @@ public class TeacherServiceImpl implements TeacherService {
TeacherGradeVo teacher = new TeacherGradeVo();
teacher.setName((String) map.get("name"));
teacher.setId((String) map.get("tmdId"));
teacher.setPeriodId((String) map.get("periodId"));
// 处理 grade 字段
List<Map<String, Object>> gradeList = (List<Map<String, Object>>) map.get("grade");
if (gradeList != null) {
@ -548,6 +549,9 @@ public class TeacherServiceImpl implements TeacherService {
}
for (TeacherGradeVo grade : gradeList) {
if(teacher.getId().equals(grade.getId())) {
if(StringUtils.isNotEmpty(grade.getPeriodId())) {
teacher.setPeriodId(grade.getPeriodId());
}
List<TeacherGradeVo.IdAndName> grades = grade.getGrade();
for (TeacherGradeVo.IdAndName gg : grades) {
String id = String.valueOf(teacherDto.year - gg.getGrade());
@ -561,6 +565,9 @@ public class TeacherServiceImpl implements TeacherService {
}
}
teachersList = teachersList.stream()
.filter(teacher -> teacherDto.periodId.equals(teacher.getPeriodId()))
.collect(Collectors.toList());
Map<String, Long> gradeCount = new HashMap<>();
Map<String, Long> degreeCount = new HashMap<>();
Map<String, Long> subjectCount = new HashMap<>();

@ -22,6 +22,7 @@ public class GpTeacherVo {
public Long practiceTime ;
public String gender ;
public List<String> grade;
public String periodId ;
@Data
public static class IdNameCode{
public String id ;

@ -9,6 +9,7 @@ public class TeacherGradeVo {
private List<IdAndName> grade;
private String id;
private String name;
private String periodId;
@Data
public static class IdAndName{
public Integer grade;

Loading…
Cancel
Save