|
|
|
@ -146,9 +146,49 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
.collect(Collectors.groupingBy(GpTeacher::getDegree, Collectors.counting()));
|
|
|
|
|
Map<String, Integer> practiceCount = getStringIntegerMap(teacherDto, gpTeachers);
|
|
|
|
|
|
|
|
|
|
if(!genderCount.containsKey("F")) {
|
|
|
|
|
genderCount.put("F",0L);
|
|
|
|
|
}else if (!genderCount.containsKey("S")) {
|
|
|
|
|
genderCount.put("S",0L);
|
|
|
|
|
}else if (!genderCount.containsKey("M")){
|
|
|
|
|
genderCount.put("M",0L);
|
|
|
|
|
}
|
|
|
|
|
Map<String, Object> genderMap = new HashMap<>();
|
|
|
|
|
Map<String, Object> practiceMap = new HashMap<>();
|
|
|
|
|
for (GpTeacher gpTeacher : gpTeachers) {
|
|
|
|
|
genderMap.put(gpTeacher.basic.name, gpTeacher.basic.gender);
|
|
|
|
|
practiceMap.put(gpTeacher.basic.name, gpTeacher.practiceTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (GpTeacherVo teacher : teachersList) {
|
|
|
|
|
for(GpTeacher gpTeacher : gpTeachers) {
|
|
|
|
|
if(StringUtils.isNotEmpty(teacher.phone) && teacher.phone.equalsIgnoreCase(gpTeacher.mobile)) {
|
|
|
|
|
if(gpTeacher.basic.gender != null) {
|
|
|
|
|
teacher.setGender(gpTeacher.basic.gender);
|
|
|
|
|
}else {
|
|
|
|
|
teacher.setGender("");
|
|
|
|
|
}
|
|
|
|
|
if (gpTeacher.getPracticeTime() != null && gpTeacher.getPracticeTime() > 0) {
|
|
|
|
|
teacher.setPracticeTime(gpTeacher.getPracticeTime());
|
|
|
|
|
}else {
|
|
|
|
|
teacher.setPracticeTime(0L);
|
|
|
|
|
}
|
|
|
|
|
if(gpTeacher.degree != null) {
|
|
|
|
|
teacher.setDegree(gpTeacher.degree);
|
|
|
|
|
}else {
|
|
|
|
|
teacher.setDegree("");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
teachers.put("practice", practiceCount);
|
|
|
|
|
teachers.put("practiceMap", practiceMap);
|
|
|
|
|
teachers.put("genderMap", genderMap);
|
|
|
|
|
teachers.put("gender", genderCount);
|
|
|
|
|
teachers.put("degree", degreeCount);
|
|
|
|
|
teachers.put("info", teachersList);
|
|
|
|
|
teachers.remove("teachers");
|
|
|
|
|
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据转换错误");
|
|
|
|
@ -181,6 +221,16 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
teacher.setName((String) map.get("name"));
|
|
|
|
|
teacher.setPhone((String) map.get("phone"));
|
|
|
|
|
teacher.setId((String) map.get("id"));
|
|
|
|
|
teacher.setEmail((String) map.get("email"));
|
|
|
|
|
teacher.setPicture((String) map.get("picture"));
|
|
|
|
|
teacher.setIname((String) map.get("iname"));
|
|
|
|
|
teacher.setJob((String) map.get("job"));
|
|
|
|
|
//teacher.setDegree((String) map.get("degree"));
|
|
|
|
|
//teacher.setPracticeTime((String) map.get("practiceTime"));
|
|
|
|
|
//teacher.setGender((String) map.get("gender"));
|
|
|
|
|
teacher.setNote((String) map.get("note"));
|
|
|
|
|
teacher.setSubjectIds((List<String>) map.get("subjectIds"));
|
|
|
|
|
teacher.setSubjectNames((List<String>) map.get("subjectNames"));
|
|
|
|
|
// 根据实际属性进行转换
|
|
|
|
|
return teacher;
|
|
|
|
|
}
|
|
|
|
@ -214,6 +264,12 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
|
} else {
|
|
|
|
|
teacher.setTitle(null); // 或者设置一个默认值
|
|
|
|
|
}
|
|
|
|
|
Object mobileObj = map.get("mobile");
|
|
|
|
|
if (mobileObj instanceof String) {
|
|
|
|
|
teacher.setMobile((String) mobileObj);
|
|
|
|
|
} else {
|
|
|
|
|
teacher.setMobile(null); // 或者设置一个默认值
|
|
|
|
|
}
|
|
|
|
|
Object degreeObj = map.get("degree");
|
|
|
|
|
if (degreeObj instanceof String) {
|
|
|
|
|
teacher.setDegree((String) degreeObj);
|
|
|
|
|