|
|
|
@ -401,7 +401,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
record.setAcademicYearId(academicYearId);
|
|
|
|
|
record.setPraiseCount(appraiseTreeNode.isPraise() ? 1 : 0);
|
|
|
|
|
record.setCriticizeCount(appraiseTreeNode.isPraise() ? 0 : 1);
|
|
|
|
|
record.setScore(ObjectUtils.isEmpty(appraiseTreeNode.getScore()) ? 0 : appraiseTreeNode.getScore());
|
|
|
|
|
record.setScore(appraiseTreeNode.isPraise() ? 1 : 0);
|
|
|
|
|
record.setNodes(items);
|
|
|
|
|
record.setCode(String.format(PK.PK_APPRAISE_RECORD, schoolId));
|
|
|
|
|
appraiseRecordRepository.save(record);
|
|
|
|
@ -486,8 +486,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
|
|
|
|
|
public List<StudentReportVo> Reports(ReportDto reportDto) {
|
|
|
|
|
// 获取当前登录用户和学校信息
|
|
|
|
|
User user = SecurityUtil.getLoginUser();
|
|
|
|
|
String schoolId = user.getSchoolId();
|
|
|
|
|
//User user = SecurityUtil.getLoginUser();
|
|
|
|
|
String schoolId = "hbcn";
|
|
|
|
|
|
|
|
|
|
// 获取学生 ID 列表
|
|
|
|
|
List<String> studentIds = reportDto.getIds();
|
|
|
|
@ -577,6 +577,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
Map<String, Integer> criticalDistribution = StudentReportVo.ofFiveEducation();
|
|
|
|
|
List<AppraiseRecordItem> records = Collections.emptyList();
|
|
|
|
|
int praiseCount = 0;
|
|
|
|
|
int criticizeCount = 0;
|
|
|
|
|
int score = 0;
|
|
|
|
|
float beyondPercent = 0.0f;
|
|
|
|
|
AchievementRule curAchievement = rules.get(rules.size() - 1); // 默认使用最低成就规则
|
|
|
|
|
int n = 1;
|
|
|
|
@ -608,6 +610,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
|
|
|
|
|
// 计算学生排名
|
|
|
|
|
praiseCount = appraiseRecord.getPraiseCount();
|
|
|
|
|
criticizeCount = appraiseRecord.getCriticizeCount();
|
|
|
|
|
score = appraiseRecord.getScore();
|
|
|
|
|
int greaterCount = appraiseRecordRepository.findClassRecord(String.format(PK.PK_APPRAISE_RECORD, schoolId), academicYearId, classId, praiseCount);
|
|
|
|
|
int stuInClassCount = classStudentCountMap.get(classId);
|
|
|
|
|
beyondPercent = (float) (stuInClassCount - greaterCount) / stuInClassCount;
|
|
|
|
@ -653,7 +657,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
.studentId(studentId)
|
|
|
|
|
.className(student.getClassId()) // 假设班级名可以从学生信息中获取
|
|
|
|
|
.praiseCount(praiseCount)
|
|
|
|
|
.score(appraiseRecordOpt.isPresent() ? appraiseRecordOpt.get().getScore() : 0) // 默认分数为 0
|
|
|
|
|
.criticizeCount(criticizeCount)
|
|
|
|
|
.score(score) // 默认分数为 0
|
|
|
|
|
.beyondPercent(beyondPercent)
|
|
|
|
|
.topPraiseTeacher(new StudentReportVo.Teacher(null, null)) // 默认值为 null
|
|
|
|
|
.topCriticalTeacher(new StudentReportVo.Teacher(null, null)) // 默认值为 null
|
|
|
|
|