|
|
|
@ -489,18 +489,33 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
criticalNodeMap.put(nodeName, criticalNodeMap.getOrDefault(nodeName, 0) + 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 计算成就项 (排序
|
|
|
|
|
// 计算成就项 (排序 120(20x3) 60(10x4) 25(5x5) 121
|
|
|
|
|
rules = rules.stream().sorted(Comparator.comparing(AchievementRule::getLevel).reversed()).collect(Collectors.toList());
|
|
|
|
|
AchievementRule curAchievement = rules.get(rules.size() - 1);
|
|
|
|
|
for (AchievementRule rule : rules) {
|
|
|
|
|
Integer promotionCount = rule.getPromotionCount();
|
|
|
|
|
int flag = praiseCount / promotionCount;
|
|
|
|
|
// 说明当前规则成就匹配
|
|
|
|
|
int ruleSize = rules.size();
|
|
|
|
|
AchievementRule curAchievement = rules.get(ruleSize - 1);
|
|
|
|
|
|
|
|
|
|
int n = 1;
|
|
|
|
|
for (int i = 0; i <= ruleSize - 1; i++) {
|
|
|
|
|
// 直接从第二个开始算
|
|
|
|
|
AchievementRule curRule = rules.get(i);
|
|
|
|
|
int flag = praiseCount / curRule.getPromotionCount();
|
|
|
|
|
if (flag >= 1) {
|
|
|
|
|
curAchievement = rule;
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
curAchievement = curRule;
|
|
|
|
|
AchievementRule lastRule = rules.get(i + 1);
|
|
|
|
|
n = (praiseCount - lastRule.getPromotionCount()) / curRule.getLevelCount() + 1;
|
|
|
|
|
} else {
|
|
|
|
|
AchievementRule nextRule = rules.get(i - 1);
|
|
|
|
|
curAchievement = nextRule;
|
|
|
|
|
n = (praiseCount - curRule.getPromotionCount()) / nextRule.getLevelCount() + 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (i == ruleSize - 1) {
|
|
|
|
|
n = praiseCount / curRule.getLevelCount() + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 汇总数据
|
|
|
|
|
String topPraiseTeacherId = praiseTeacherMap.entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey).orElse(null);
|
|
|
|
|
AppraiseRecordItem tmp1 = records.stream().filter(item -> item.getCreatorId().equals(topPraiseTeacherId)).findFirst().orElse(null);
|
|
|
|
@ -524,6 +539,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
.praiseDistribution(praiseDistribution)
|
|
|
|
|
.criticalDistribution(criticalDistribution)
|
|
|
|
|
.curAchievement(curAchievement)
|
|
|
|
|
.achievementN(n)
|
|
|
|
|
.records(records)
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|