|
|
@ -650,26 +650,27 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
teachingAgeDistribution.put("6-10", 0);
|
|
|
|
teachingAgeDistribution.put("6-10", 0);
|
|
|
|
teachingAgeDistribution.put("11+", 0);
|
|
|
|
teachingAgeDistribution.put("11+", 0);
|
|
|
|
|
|
|
|
|
|
|
|
List<School.Period> period = schoolRepository.findPeriodById(teacherDto.getCode(), teacherDto.getPeriodId());
|
|
|
|
List<School.Period> periods = schoolRepository.findPeriodById(teacherDto.getCode());
|
|
|
|
if (period.isEmpty()) {
|
|
|
|
if (periods.isEmpty()) {
|
|
|
|
throw new ServiceException(ErrorCode.PARAMS_ERROR);
|
|
|
|
throw new ServiceException(ErrorCode.PARAMS_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
School.Period periodModel = period.get(0);
|
|
|
|
|
|
|
|
List<String> gradeNames = periodModel.getGrades();
|
|
|
|
// 收集所有学段的年级名称(去重并保持顺序)
|
|
|
|
// 初始化年级统计(按示例顺序)
|
|
|
|
Set<String> allGradeNames = new LinkedHashSet<>();
|
|
|
|
//List<String> gradeNames = Arrays.asList("一年级", "二年级", "三年级", "四年级", "五年级");
|
|
|
|
for (School.Period p : periods) {
|
|
|
|
gradeNames.forEach(grade -> gradeCount.put(grade, 0));
|
|
|
|
List<String> grades = p.getGrades();
|
|
|
|
|
|
|
|
if (grades != null) {
|
|
|
|
|
|
|
|
allGradeNames.addAll(grades);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 初始化年级统计
|
|
|
|
|
|
|
|
allGradeNames.forEach(grade -> gradeCount.put(grade, 0));
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
List<PtTeacherInfo> teachers = ptTeacherRepository.findAllTeacher(
|
|
|
|
List<PtTeacherInfo> teachers = ptTeacherRepository.findAdminTeacher(
|
|
|
|
teacherDto.getCode(),
|
|
|
|
teacherDto.getCode(),
|
|
|
|
String.format(PK.PTTEACHER, teacherDto.getCode()),
|
|
|
|
String.format(PK.PTTEACHER, teacherDto.getCode())
|
|
|
|
teacherDto.getPeriodId()
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
teachers = teachers.stream()
|
|
|
|
|
|
|
|
.filter(teacher -> teacherDto.periodId.equals(teacher.getPeriodId()))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (PtTeacherInfo teacher : teachers) {
|
|
|
|
for (PtTeacherInfo teacher : teachers) {
|
|
|
|
// 构建教师基本信息
|
|
|
|
// 构建教师基本信息
|
|
|
|
Map<String, Object> teacherInfo = new HashMap<>();
|
|
|
|
Map<String, Object> teacherInfo = new HashMap<>();
|
|
|
@ -677,12 +678,6 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
teacherInfo.put("name", teacher.getName());
|
|
|
|
teacherInfo.put("name", teacher.getName());
|
|
|
|
teacherInfo.put("periodId", teacher.getPeriodId());
|
|
|
|
teacherInfo.put("periodId", teacher.getPeriodId());
|
|
|
|
|
|
|
|
|
|
|
|
// // 收集教龄数据(新增逻辑)
|
|
|
|
|
|
|
|
// if (teacher.getTeachingAge() != null && teacher.getTeachingAge() > 0) {
|
|
|
|
|
|
|
|
// totalTeachingAge += teacher.getTeachingAge();
|
|
|
|
|
|
|
|
// validTeachers++;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 在遍历教师时统计
|
|
|
|
// 在遍历教师时统计
|
|
|
|
if (teacher.getTeachingAge() != null) {
|
|
|
|
if (teacher.getTeachingAge() != null) {
|
|
|
|
if (teacher.getTeachingAge() <= 5) teachingAgeDistribution.put("0-5", teachingAgeDistribution.getOrDefault("0-5", 0) + 1);
|
|
|
|
if (teacher.getTeachingAge() <= 5) teachingAgeDistribution.put("0-5", teachingAgeDistribution.getOrDefault("0-5", 0) + 1);
|
|
|
@ -2306,11 +2301,11 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
List<PtTeacherInfo> teachers = ptTeacherInfos.stream()
|
|
|
|
List<PtTeacherInfo> teachers = ptTeacherInfos.stream()
|
|
|
|
.peek(ptTeacherInfo -> {
|
|
|
|
.peek(ptTeacherInfo -> {
|
|
|
|
Map<String, Object> scores = getTeacherOfCapabilityAssessment(teacherDto, request);
|
|
|
|
Map<String, Object> scores = getTeacherOfCapabilityAssessment(teacherDto, request);
|
|
|
|
ptTeacherInfo.setTeachingScore(parseScore(scores.get("teachingScore"), 0.0));
|
|
|
|
/*ptTeacherInfo.setTeachingScore(parseScore(scores.get("teachingScore"), 0.0));
|
|
|
|
ptTeacherInfo.setResearchScore(parseScore(scores.get("researchScore"), 0.0));
|
|
|
|
ptTeacherInfo.setResearchScore(parseScore(scores.get("researchScore"), 0.0));
|
|
|
|
ptTeacherInfo.setHonorScore(parseScore(scores.get("honorScore"), 0.0));
|
|
|
|
ptTeacherInfo.setHonorScore(parseScore(scores.get("honorScore"), 0.0));
|
|
|
|
ptTeacherInfo.setTrainingScore(parseScore(scores.get("trainingScore"), 0.0));
|
|
|
|
ptTeacherInfo.setTrainingScore(parseScore(scores.get("trainingScore"), 0.0));
|
|
|
|
ptTeacherInfo.setScientificScore(parseScore(scores.get("scientificScore"), 0.0));
|
|
|
|
ptTeacherInfo.setScientificScore(parseScore(scores.get("scientificScore"), 0.0));*/
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|