|
|
@ -20,6 +20,8 @@ import cn.teammodel.utils.GroupUtil;
|
|
|
|
import cn.teammodel.utils.SchoolDateUtil;
|
|
|
|
import cn.teammodel.utils.SchoolDateUtil;
|
|
|
|
import com.azure.cosmos.CosmosException;
|
|
|
|
import com.azure.cosmos.CosmosException;
|
|
|
|
import com.azure.spring.data.cosmos.core.query.CosmosPageRequest;
|
|
|
|
import com.azure.spring.data.cosmos.core.query.CosmosPageRequest;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
@ -792,7 +794,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
int count = paperTeacherRepository.getPaperCount(String.format(paperCode, teacherDto.getTmdId()));
|
|
|
|
int count = paperTeacherRepository.getPaperCount(String.format(paperCode, teacherDto.getTmdId()));
|
|
|
|
List<SugVo> sugVos = sugVoList.stream().filter(sugVo -> sugVo.getHabook().equals(teacherDto.getTmdId())).collect(Collectors.toList());
|
|
|
|
List<SugVo> sugVos = sugVoList.stream().filter(sugVo -> sugVo.getHabook().equals(teacherDto.getTmdId())).collect(Collectors.toList());
|
|
|
|
LinkedHashMap<String,Object> mapTeach = new LinkedHashMap<>();
|
|
|
|
LinkedHashMap<String,Object> mapTeach = new LinkedHashMap<>();
|
|
|
|
int[] scores = new int[10];
|
|
|
|
int[] scores = new int[11];
|
|
|
|
for (SugVo sugVo : sugVos) {
|
|
|
|
for (SugVo sugVo : sugVos) {
|
|
|
|
scores[0] += sugVo.getT_data();
|
|
|
|
scores[0] += sugVo.getT_data();
|
|
|
|
scores[1] += sugVo.getT_green();
|
|
|
|
scores[1] += sugVo.getT_green();
|
|
|
@ -804,6 +806,12 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
scores[7] += sugVo.getDouble_green_count();
|
|
|
|
scores[7] += sugVo.getDouble_green_count();
|
|
|
|
scores[8] += sugVo.getMaterial_count();
|
|
|
|
scores[8] += sugVo.getMaterial_count();
|
|
|
|
scores[9] += sugVo.getTpcplan_count();
|
|
|
|
scores[9] += sugVo.getTpcplan_count();
|
|
|
|
|
|
|
|
if (sugVo.getObserve_lessons() != null) {
|
|
|
|
|
|
|
|
Set<String> observeLessons = new HashSet<>((List<String>) sugVo.getObserve_lessons());
|
|
|
|
|
|
|
|
// 如果后续需要使用 observeLessons,可以在此处添加逻辑
|
|
|
|
|
|
|
|
scores[10] += observeLessons.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//T(数据)
|
|
|
|
//T(数据)
|
|
|
|
mapTeach.put("TData",scores[0]);
|
|
|
|
mapTeach.put("TData",scores[0]);
|
|
|
@ -821,6 +829,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
mapTeach.put("DoubleGreenCount",scores[7]);
|
|
|
|
mapTeach.put("DoubleGreenCount",scores[7]);
|
|
|
|
mapTeach.put("MaterialCount",scores[8]);
|
|
|
|
mapTeach.put("MaterialCount",scores[8]);
|
|
|
|
mapTeach.put("TpcplanCount",scores[9]);
|
|
|
|
mapTeach.put("TpcplanCount",scores[9]);
|
|
|
|
|
|
|
|
mapTeach.put("ObserveLessons",scores[10]);
|
|
|
|
mapTeach.put("Lessons",records.size());
|
|
|
|
mapTeach.put("Lessons",records.size());
|
|
|
|
//资源数量:试卷数量
|
|
|
|
//资源数量:试卷数量
|
|
|
|
mapTeach.put("paperCount",count);
|
|
|
|
mapTeach.put("paperCount",count);
|
|
|
@ -848,7 +857,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
.filter(sugVo -> teachers.contains(sugVo.getHabook()))
|
|
|
|
.filter(sugVo -> teachers.contains(sugVo.getHabook()))
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
LinkedHashMap<String,Object> mapTeach = new LinkedHashMap<>();
|
|
|
|
LinkedHashMap<String,Object> mapTeach = new LinkedHashMap<>();
|
|
|
|
int[] scores = new int[10];
|
|
|
|
int[] scores = new int[11];
|
|
|
|
for (SugVo sugVo : filteredSugVoList) {
|
|
|
|
for (SugVo sugVo : filteredSugVoList) {
|
|
|
|
scores[0] += sugVo.getT_data();
|
|
|
|
scores[0] += sugVo.getT_data();
|
|
|
|
scores[1] += sugVo.getT_green();
|
|
|
|
scores[1] += sugVo.getT_green();
|
|
|
@ -860,6 +869,11 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
scores[7] += sugVo.getDouble_green_count();
|
|
|
|
scores[7] += sugVo.getDouble_green_count();
|
|
|
|
scores[8] += sugVo.getMaterial_count();
|
|
|
|
scores[8] += sugVo.getMaterial_count();
|
|
|
|
scores[9] += sugVo.getTpcplan_count();
|
|
|
|
scores[9] += sugVo.getTpcplan_count();
|
|
|
|
|
|
|
|
if (sugVo.getObserve_lessons() != null) {
|
|
|
|
|
|
|
|
Set<String> observeLessons = new HashSet<>((List<String>) sugVo.getObserve_lessons());
|
|
|
|
|
|
|
|
// 如果后续需要使用 observeLessons,可以在此处添加逻辑
|
|
|
|
|
|
|
|
scores[10] += observeLessons.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//T(数据)
|
|
|
|
//T(数据)
|
|
|
|
mapTeach.put("TData",scores[0]);
|
|
|
|
mapTeach.put("TData",scores[0]);
|
|
|
@ -876,6 +890,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
mapTeach.put("DoubleGreenCount",scores[7]);
|
|
|
|
mapTeach.put("DoubleGreenCount",scores[7]);
|
|
|
|
mapTeach.put("MaterialCount",scores[8]);
|
|
|
|
mapTeach.put("MaterialCount",scores[8]);
|
|
|
|
mapTeach.put("TpcplanCount",scores[9]);
|
|
|
|
mapTeach.put("TpcplanCount",scores[9]);
|
|
|
|
|
|
|
|
mapTeach.put("ObserveLessons",scores[10]);
|
|
|
|
mapTeach.put("Lessons",records.size());
|
|
|
|
mapTeach.put("Lessons",records.size());
|
|
|
|
//资源数量:试卷数量
|
|
|
|
//资源数量:试卷数量
|
|
|
|
mapTeach.put("paperCount",count);
|
|
|
|
mapTeach.put("paperCount",count);
|
|
|
@ -885,7 +900,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
//查询学校试卷 备注:若是后面影响速度,可以优化改代码
|
|
|
|
//查询学校试卷 备注:若是后面影响速度,可以优化改代码
|
|
|
|
int count = paperSchoolRepository.getPaperCount(String.format(paperCode, teacherDto.getCode()),loginId,null,"school",teacherDto.getPeriodId());
|
|
|
|
int count = paperSchoolRepository.getPaperCount(String.format(paperCode, teacherDto.getCode()),loginId,null,"school",teacherDto.getPeriodId());
|
|
|
|
LinkedHashMap<String, Object> mapTeach = new LinkedHashMap<>();
|
|
|
|
LinkedHashMap<String, Object> mapTeach = new LinkedHashMap<>();
|
|
|
|
int[] scores = new int[10];
|
|
|
|
int[] scores = new int[11];
|
|
|
|
for (SugVo sugVo : sugVoList) {
|
|
|
|
for (SugVo sugVo : sugVoList) {
|
|
|
|
scores[0] += sugVo.getT_data();
|
|
|
|
scores[0] += sugVo.getT_data();
|
|
|
|
scores[1] += sugVo.getT_green();
|
|
|
|
scores[1] += sugVo.getT_green();
|
|
|
@ -897,6 +912,11 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
scores[7] += sugVo.getDouble_green_count();
|
|
|
|
scores[7] += sugVo.getDouble_green_count();
|
|
|
|
scores[8] += sugVo.getMaterial_count();
|
|
|
|
scores[8] += sugVo.getMaterial_count();
|
|
|
|
scores[9] += sugVo.getTpcplan_count();
|
|
|
|
scores[9] += sugVo.getTpcplan_count();
|
|
|
|
|
|
|
|
if (sugVo.getObserve_lessons() != null) {
|
|
|
|
|
|
|
|
Set<String> observeLessons = new HashSet<>((List<String>) sugVo.getObserve_lessons());
|
|
|
|
|
|
|
|
// 如果后续需要使用 observeLessons,可以在此处添加逻辑
|
|
|
|
|
|
|
|
scores[10] += observeLessons.size();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//T(数据)
|
|
|
|
//T(数据)
|
|
|
|
mapTeach.put("TData", scores[0]);
|
|
|
|
mapTeach.put("TData", scores[0]);
|
|
|
@ -913,6 +933,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
mapTeach.put("DoubleGreenCount",scores[7]);
|
|
|
|
mapTeach.put("DoubleGreenCount",scores[7]);
|
|
|
|
mapTeach.put("MaterialCount",scores[8]);
|
|
|
|
mapTeach.put("MaterialCount",scores[8]);
|
|
|
|
mapTeach.put("TpcplanCount",scores[9]);
|
|
|
|
mapTeach.put("TpcplanCount",scores[9]);
|
|
|
|
|
|
|
|
mapTeach.put("ObserveLessons",scores[10]);
|
|
|
|
mapTeach.put("Lessons",records.size());
|
|
|
|
mapTeach.put("Lessons",records.size());
|
|
|
|
//资源数量:试卷数量
|
|
|
|
//资源数量:试卷数量
|
|
|
|
mapTeach.put("paperCount",count);
|
|
|
|
mapTeach.put("paperCount",count);
|
|
|
@ -1010,7 +1031,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// 初始化四项数据
|
|
|
|
// 初始化四项数据
|
|
|
|
double TData = 0, TGreen = 0, Lessons = 0, paperCount = 0,LessonCount = 0,DoubleGreenCount = 0,MaterialCount = 0,PublicCount = 0;
|
|
|
|
double TData = 0, TGreen = 0, Lessons = 0, paperCount = 0,LessonCount = 0,DoubleGreenCount = 0,ObserveLessons = 0,PublicCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// 获取原始数据集合
|
|
|
|
// 获取原始数据集合
|
|
|
|
Map<String, Object> resMap = getTeachingAndResearch(teacherDto, request);
|
|
|
|
Map<String, Object> resMap = getTeachingAndResearch(teacherDto, request);
|
|
|
@ -1023,6 +1044,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
ownerIds.add(teacherDto.getTmdId());
|
|
|
|
ownerIds.add(teacherDto.getTmdId());
|
|
|
|
gpTeacherDto.setOwnerIds(ownerIds);
|
|
|
|
gpTeacherDto.setOwnerIds(ownerIds);
|
|
|
|
gpTeacherDto.setIds(ownerIds);
|
|
|
|
gpTeacherDto.setIds(ownerIds);
|
|
|
|
|
|
|
|
gpTeacherDto.setSchoolId(teacherDto.getCode());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 遍历并提取八项数据
|
|
|
|
// 遍历并提取八项数据
|
|
|
@ -1037,7 +1059,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
case "paperCount": paperCount = (Integer) value; break;
|
|
|
|
case "paperCount": paperCount = (Integer) value; break;
|
|
|
|
case "LessonCount": LessonCount = (Integer) value; break;
|
|
|
|
case "LessonCount": LessonCount = (Integer) value; break;
|
|
|
|
case "DoubleGreenCount": DoubleGreenCount = (Integer) value; break;
|
|
|
|
case "DoubleGreenCount": DoubleGreenCount = (Integer) value; break;
|
|
|
|
case "MaterialCount": MaterialCount = (Integer) value; break;
|
|
|
|
case "ObserveLessons": ObserveLessons = (Integer) value; break;
|
|
|
|
case "PublicCount": PublicCount = (Integer) value; break;
|
|
|
|
case "PublicCount": PublicCount = (Integer) value; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1052,7 +1074,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
paperCount = Math.round((paperCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
paperCount = Math.round((paperCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
LessonCount = Math.round((LessonCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
LessonCount = Math.round((LessonCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
DoubleGreenCount = Math.round((DoubleGreenCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
DoubleGreenCount = Math.round((DoubleGreenCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
MaterialCount = Math.round((MaterialCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
ObserveLessons = Math.round((ObserveLessons / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
PublicCount = Math.round((PublicCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
PublicCount = Math.round((PublicCount / teachersList.size()) * 100.0) / 100.0;
|
|
|
|
List<String> ids = teachersList.stream()
|
|
|
|
List<String> ids = teachersList.stream()
|
|
|
|
.map(GpTeacherVo::getId)
|
|
|
|
.map(GpTeacherVo::getId)
|
|
|
@ -1097,12 +1119,15 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
paperCount = Math.round((paperCount / count) * 100.0) / 100.0;
|
|
|
|
paperCount = Math.round((paperCount / count) * 100.0) / 100.0;
|
|
|
|
LessonCount = Math.round((LessonCount / count) * 100.0) / 100.0;
|
|
|
|
LessonCount = Math.round((LessonCount / count) * 100.0) / 100.0;
|
|
|
|
DoubleGreenCount = Math.round((DoubleGreenCount / count) * 100.0) / 100.0;
|
|
|
|
DoubleGreenCount = Math.round((DoubleGreenCount / count) * 100.0) / 100.0;
|
|
|
|
MaterialCount = Math.round((MaterialCount / count) * 100.0) / 100.0;
|
|
|
|
ObserveLessons = Math.round((ObserveLessons / count) * 100.0) / 100.0;
|
|
|
|
PublicCount = Math.round((PublicCount / count) * 100.0) / 100.0;
|
|
|
|
PublicCount = Math.round((PublicCount / count) * 100.0) / 100.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gpTeacherDto.setOwnerIds(tmdIds);
|
|
|
|
gpTeacherDto.setOwnerIds(tmdIds);
|
|
|
|
gpTeacherDto.setIds(tmdIds);
|
|
|
|
gpTeacherDto.setIds(tmdIds);
|
|
|
|
|
|
|
|
gpTeacherDto.setGradeIds(new ArrayList<>(Collections.singletonList( String.valueOf(Integer.parseInt(teacherDto.getGrade()) + 1))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DoubleGreenCount = DoubleGreenCount * 10;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*if (!StringUtils.isNotEmpty(teacherDto.getGrade()) && StringUtils.isNotEmpty(teacherDto.getTmdId())) {
|
|
|
|
/*if (!StringUtils.isNotEmpty(teacherDto.getGrade()) && StringUtils.isNotEmpty(teacherDto.getTmdId())) {
|
|
|
|
//获取该tmdId下的年级信息
|
|
|
|
//获取该tmdId下的年级信息
|
|
|
@ -1167,23 +1192,34 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
//研修分数获取
|
|
|
|
//研修分数获取
|
|
|
|
double TrainingScore = 0;
|
|
|
|
double TrainingScore = 0;
|
|
|
|
Map<String, Object> training = getTeacherTraining(gpTeacherDto, request);
|
|
|
|
Map<String, Object> training = getTeacherTraining(gpTeacherDto, request);
|
|
|
|
List<Map<String, Object>> trainings = (List<Map<String, Object>>) training.get("studyScores");
|
|
|
|
List<Map<String, Object>> trainings = (List<Map<String, Object>>) training.get("persons");
|
|
|
|
if (trainings != null) {
|
|
|
|
if (trainings != null) {
|
|
|
|
// 计算总分数
|
|
|
|
// 计算总分数
|
|
|
|
for (Map<String, Object> trainingMap : trainings) {
|
|
|
|
for (Map<String, Object> trainingMap : trainings) {
|
|
|
|
Object scoreObj = trainingMap.get("score");
|
|
|
|
Object scoreObj = trainingMap.get("studyHour");
|
|
|
|
if (scoreObj instanceof Integer) {
|
|
|
|
Object isJoin = trainingMap.get("isJoin");
|
|
|
|
int score = (int) scoreObj;
|
|
|
|
if(isJoin instanceof Boolean) {
|
|
|
|
TrainingScore += score;
|
|
|
|
if ((boolean) isJoin) {
|
|
|
|
|
|
|
|
double score = 60;
|
|
|
|
|
|
|
|
double hourScore = 0;
|
|
|
|
|
|
|
|
if (scoreObj instanceof Integer) {
|
|
|
|
|
|
|
|
int hour = (int) scoreObj;
|
|
|
|
|
|
|
|
if (hour > 0) {
|
|
|
|
|
|
|
|
hourScore = 40 * (1 - Math.exp(-K * hour));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
TrainingScore += (score + hourScore);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
TrainingScore += 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (TrainingScore > 0) {
|
|
|
|
if (TrainingScore > 0) {
|
|
|
|
TrainingScore = Math.round(TrainingScore / gpTeacherDto.getIds().size() * 100.0) / 100.0;
|
|
|
|
TrainingScore = Math.round(TrainingScore / gpTeacherDto.getIds().size() * 100.0) / 100.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 基础分计算
|
|
|
|
// 基础分计算
|
|
|
|
double honorScore = (honorScores > 0) ? 100.0 - 20.0 / honorScores : 60;
|
|
|
|
double honorScore = honorScores > 0 ? Math.round(100.0 - (165.0 / (honorScores + 4.5))) : 60;
|
|
|
|
|
|
|
|
|
|
|
|
// 计算各维度贡献值(使用指数衰减函数)
|
|
|
|
// 计算各维度贡献值(使用指数衰减函数)
|
|
|
|
double tDataScore = 25 * (1 - Math.exp(-K * TData));
|
|
|
|
double tDataScore = 25 * (1 - Math.exp(-K * TData));
|
|
|
@ -1192,12 +1228,12 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
double paperScore = 10 * (1 - Math.exp(-K * paperCount));
|
|
|
|
double paperScore = 10 * (1 - Math.exp(-K * paperCount));
|
|
|
|
//计算教学贡献值
|
|
|
|
//计算教学贡献值
|
|
|
|
// 基础分计算
|
|
|
|
// 基础分计算
|
|
|
|
double baseScore = (DoubleGreenCount > 0) ? 100.0 - 40.0 / DoubleGreenCount : 0;
|
|
|
|
double baseScore = 40 * (1 - Math.exp(-K * DoubleGreenCount));
|
|
|
|
|
|
|
|
|
|
|
|
// 附加分计算
|
|
|
|
// 附加分计算
|
|
|
|
double lessonScore = (LessonCount >= 1) ? (5.0 - 3.0 / LessonCount) : 0;
|
|
|
|
double lessonScore = 20 * (1 - Math.exp(-K * LessonCount));
|
|
|
|
double materialScore = (MaterialCount >= 1) ? (3.0 - 1.0 / MaterialCount) : 0;
|
|
|
|
double materialScore = 30 * (1 - Math.exp(-K * ObserveLessons));
|
|
|
|
double publicScore = (PublicCount >= 1) ? (2.0 - 1.0 / PublicCount) : 0;
|
|
|
|
double publicScore = 10 * (1 - Math.exp(-K * PublicCount));
|
|
|
|
|
|
|
|
|
|
|
|
// 总分计算(不超过100)
|
|
|
|
// 总分计算(不超过100)
|
|
|
|
double totalTeachingScore = baseScore + lessonScore + materialScore + publicScore;
|
|
|
|
double totalTeachingScore = baseScore + lessonScore + materialScore + publicScore;
|
|
|
@ -1218,7 +1254,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
result.put("researchScore", totalTeachingScore);
|
|
|
|
result.put("researchScore", totalTeachingScore);
|
|
|
|
result.put("honorScore", honorScore);
|
|
|
|
result.put("honorScore", honorScore);
|
|
|
|
result.put("trainingScore", TrainingScore);
|
|
|
|
result.put("trainingScore", TrainingScore);
|
|
|
|
result.put("scientificScore", 0);
|
|
|
|
result.put("scientificScore", 60);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
@ -1297,6 +1333,30 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
sugVo.setDouble_green_count(Integer.parseInt(dataMap.get("double_green_count").toString()));
|
|
|
|
sugVo.setDouble_green_count(Integer.parseInt(dataMap.get("double_green_count").toString()));
|
|
|
|
sugVo.setMaterial_count(Integer.parseInt(dataMap.get("material_count").toString()));
|
|
|
|
sugVo.setMaterial_count(Integer.parseInt(dataMap.get("material_count").toString()));
|
|
|
|
sugVo.setTpcplan_count(Integer.parseInt(dataMap.get("tpcplan_count").toString()));
|
|
|
|
sugVo.setTpcplan_count(Integer.parseInt(dataMap.get("tpcplan_count").toString()));
|
|
|
|
|
|
|
|
// 假设 dataMap.get("observe_lessons") 返回的是 JSON 字符串格式的数组
|
|
|
|
|
|
|
|
Object observeLessonsObj = dataMap.get("observe_lessons");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (observeLessonsObj instanceof String) {
|
|
|
|
|
|
|
|
// 如果是字符串,尝试解析为 List<String>
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String observeLessonsStr = (String) observeLessonsObj;
|
|
|
|
|
|
|
|
List<String> observeLessonsList = new ObjectMapper().readValue(
|
|
|
|
|
|
|
|
observeLessonsStr, new TypeReference<List<String>>() {}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
sugVo.setObserve_lessons(observeLessonsList);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据转换错误: observe_lessons");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (observeLessonsObj instanceof List) {
|
|
|
|
|
|
|
|
// 如果已经是 List 类型,直接设置
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
|
|
|
List<String> observeLessonsList = (List<String>) observeLessonsObj;
|
|
|
|
|
|
|
|
sugVo.setObserve_lessons(observeLessonsList);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 如果类型不匹配,抛出异常或记录日志
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "observe_lessons 数据类型不匹配");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return sugVo;
|
|
|
|
return sugVo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1349,7 +1409,7 @@ public class TeacherServiceImpl implements TeacherService {
|
|
|
|
Map<String, Object> gradeMap;
|
|
|
|
Map<String, Object> gradeMap;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String url = "open_study/find";
|
|
|
|
String url = "open_study/find";
|
|
|
|
gpTeacherDto.setGrant_type("study_average_score");
|
|
|
|
gpTeacherDto.setGrant_type("study_duration");
|
|
|
|
gradeMap = GroupUtil.getTeacherInfo(gpTeacherDto,new GroupUtil(env), request, url);
|
|
|
|
gradeMap = GroupUtil.getTeacherInfo(gpTeacherDto,new GroupUtil(env), request, url);
|
|
|
|
}catch (Exception e) {
|
|
|
|
}catch (Exception e) {
|
|
|
|
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "国培数据转换错误");
|
|
|
|
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "国培数据转换错误");
|
|
|
|