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

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

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

Loading…
Cancel
Save