update 调整顺序

develop
hhb@hotmail.com 3 days ago
parent 7216c673c2
commit 1f9d22e272

@ -819,6 +819,10 @@ public class TeacherServiceImpl implements TeacherService {
Map<String, Long> degreeCount = new HashMap<>();
Map<String, Long> subjectCount = new HashMap<>();
Map<String, Long> teachingAgeCount = new HashMap<>();
teachingAgeCount.put("0-5年", 0L);
teachingAgeCount.put("5-10年", 0L);
teachingAgeCount.put("10-15年", 0L);
teachingAgeCount.put("15年以上", 0L);
Map<String, Long> averageTeachingAgeCount = new HashMap<>();
if(StringUtils.isNotEmpty(teacherDto.getGrade()) && StringUtils.isNotEmpty(teacherDto.getSubjectId())) {
for (PtTeacherInfo teacher : ptTeacherInfos) {
@ -845,22 +849,21 @@ public class TeacherServiceImpl implements TeacherService {
//获取教龄分类信息
if (teacher.getTeachingAge() != null) {
int age = teacher.getTeachingAge();
String teachingAge = "";
if (age >= 0 && age <= 5) {
String teachingAge;
if (age <= 5) {
teachingAge = "0-5年";
} else if (age > 5 && age <= 10) {
} else if (age <= 10) {
teachingAge = "5-10年";
} else if (age > 10 && age <= 15) {
} else if (age <= 15) {
teachingAge = "10-15年";
} else {
teachingAge = "15年以上";
}
Long count = teachingAgeCount.getOrDefault(teachingAge, 0L);
teachingAgeCount.put(teachingAge, count + 1);
// 直接累加(键已存在)
teachingAgeCount.put(teachingAge, teachingAgeCount.get(teachingAge) + 1);
totalTeachingAge += teacher.getTeachingAge();
totalTeachingAge += age;
validTeachers++;
//计算评价教龄
}
// 计算平均教龄(新增逻辑)
long averageTeachingAge = validTeachers > 0 ? Math.round((float) totalTeachingAge / validTeachers) : 0;
@ -900,22 +903,21 @@ public class TeacherServiceImpl implements TeacherService {
//获取教龄分类信息
if (teacher.getTeachingAge() != null) {
int age = teacher.getTeachingAge();
String teachingAge = "";
if (age >= 0 && age <= 5) {
String teachingAge;
if (age <= 5) {
teachingAge = "0-5年";
} else if (age > 5 && age <= 10) {
} else if (age <= 10) {
teachingAge = "5-10年";
} else if (age > 10 && age <= 15) {
} else if (age <= 15) {
teachingAge = "10-15年";
} else {
teachingAge = "15年以上";
}
Long count = teachingAgeCount.getOrDefault(teachingAge, 0L);
teachingAgeCount.put(teachingAge, count + 1);
// 直接累加(键已存在)
teachingAgeCount.put(teachingAge, teachingAgeCount.get(teachingAge) + 1);
totalTeachingAge += teacher.getTeachingAge();
totalTeachingAge += age;
validTeachers++;
//计算评价教龄
}
// 计算平均教龄(新增逻辑)
long averageTeachingAge = validTeachers > 0 ? Math.round((float) totalTeachingAge / validTeachers) : 0;
@ -950,22 +952,21 @@ public class TeacherServiceImpl implements TeacherService {
//获取教龄分类信息
if (teacher.getTeachingAge() != null) {
int age = teacher.getTeachingAge();
String teachingAge = "";
if (age >= 0 && age <= 5) {
String teachingAge;
if (age <= 5) {
teachingAge = "0-5年";
} else if (age > 5 && age <= 10) {
} else if (age <= 10) {
teachingAge = "5-10年";
} else if (age > 10 && age <= 15) {
} else if (age <= 15) {
teachingAge = "10-15年";
} else {
teachingAge = "15年以上";
}
Long count = teachingAgeCount.getOrDefault(teachingAge, 0L);
teachingAgeCount.put(teachingAge, count + 1);
// 直接累加(键已存在)
teachingAgeCount.put(teachingAge, teachingAgeCount.get(teachingAge) + 1);
totalTeachingAge += teacher.getTeachingAge();
totalTeachingAge += age;
validTeachers++;
//计算评价教龄
}
// 计算平均教龄(新增逻辑)
long averageTeachingAge = validTeachers > 0 ? Math.round((float) totalTeachingAge / validTeachers) : 0;
@ -1001,22 +1002,21 @@ public class TeacherServiceImpl implements TeacherService {
//获取教龄分类信息
if (teacher.getTeachingAge() != null) {
int age = teacher.getTeachingAge();
String teachingAge = "";
if (age >= 0 && age <= 5) {
String teachingAge;
if (age <= 5) {
teachingAge = "0-5年";
} else if (age > 5 && age <= 10) {
} else if (age <= 10) {
teachingAge = "5-10年";
} else if (age > 10 && age <= 15) {
} else if (age <= 15) {
teachingAge = "10-15年";
} else {
teachingAge = "15年以上";
}
Long count = teachingAgeCount.getOrDefault(teachingAge, 0L);
teachingAgeCount.put(teachingAge, count + 1);
// 直接累加(键已存在)
teachingAgeCount.put(teachingAge, teachingAgeCount.get(teachingAge) + 1);
totalTeachingAge += teacher.getTeachingAge();
totalTeachingAge += age;
validTeachers++;
//计算评价教龄
}
// 计算平均教龄(新增逻辑)
long averageTeachingAge = validTeachers > 0 ? Math.round((float) totalTeachingAge / validTeachers) : 0;

Loading…
Cancel
Save