|
|
@ -1,5 +1,6 @@
|
|
|
|
package cn.teammodel.service.impl;
|
|
|
|
package cn.teammodel.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
import cn.teammodel.common.ErrorCode;
|
|
|
|
import cn.teammodel.common.ErrorCode;
|
|
|
|
import cn.teammodel.common.IdRequest;
|
|
|
|
import cn.teammodel.common.IdRequest;
|
|
|
@ -431,6 +432,9 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
// 查询成就规则
|
|
|
|
// 查询成就规则
|
|
|
|
Appraise appraise = RepositoryUtil.findOne(appraiseRepository.findRulesById(schoolId, periodId), "当前成就规则还未创建");
|
|
|
|
Appraise appraise = RepositoryUtil.findOne(appraiseRepository.findRulesById(schoolId, periodId), "当前成就规则还未创建");
|
|
|
|
List<AchievementRule> rules = appraise.getAchievementRules();
|
|
|
|
List<AchievementRule> rules = appraise.getAchievementRules();
|
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(rules)) {
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.OPERATION_ERROR.getCode(), "当前成就规则为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
StudentReportVo reportVo = new StudentReportVo();
|
|
|
|
StudentReportVo reportVo = new StudentReportVo();
|
|
|
|
// 计算雷达图
|
|
|
|
// 计算雷达图
|
|
|
|
Map<String, Integer> praiseDistribution = new HashMap<>();
|
|
|
|
Map<String, Integer> praiseDistribution = new HashMap<>();
|
|
|
@ -452,7 +456,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
// 计算成就项 (排序
|
|
|
|
// 计算成就项 (排序
|
|
|
|
rules = rules.stream().sorted(Comparator.comparing(AchievementRule::getLevel).reversed()).collect(Collectors.toList());
|
|
|
|
rules = rules.stream().sorted(Comparator.comparing(AchievementRule::getLevel).reversed()).collect(Collectors.toList());
|
|
|
|
Integer praiseCount = appraiseRecord.getPraiseCount();
|
|
|
|
Integer praiseCount = appraiseRecord.getPraiseCount();
|
|
|
|
AchievementRule curAchievement = rules.get(0);
|
|
|
|
AchievementRule curAchievement = rules.get(rules.size() - 1);
|
|
|
|
for (AchievementRule rule : rules) {
|
|
|
|
for (AchievementRule rule : rules) {
|
|
|
|
Integer promotionCount = rule.getPromotionCount();
|
|
|
|
Integer promotionCount = rule.getPromotionCount();
|
|
|
|
int flag = praiseCount / promotionCount;
|
|
|
|
int flag = praiseCount / promotionCount;
|
|
|
|