|
|
@ -489,18 +489,33 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
criticalNodeMap.put(nodeName, criticalNodeMap.getOrDefault(nodeName, 0) + 1);
|
|
|
|
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());
|
|
|
|
rules = rules.stream().sorted(Comparator.comparing(AchievementRule::getLevel).reversed()).collect(Collectors.toList());
|
|
|
|
AchievementRule curAchievement = rules.get(rules.size() - 1);
|
|
|
|
int ruleSize = rules.size();
|
|
|
|
for (AchievementRule rule : rules) {
|
|
|
|
AchievementRule curAchievement = rules.get(ruleSize - 1);
|
|
|
|
Integer promotionCount = rule.getPromotionCount();
|
|
|
|
|
|
|
|
int flag = praiseCount / promotionCount;
|
|
|
|
int n = 1;
|
|
|
|
// 说明当前规则成就匹配
|
|
|
|
for (int i = 0; i <= ruleSize - 1; i++) {
|
|
|
|
|
|
|
|
// 直接从第二个开始算
|
|
|
|
|
|
|
|
AchievementRule curRule = rules.get(i);
|
|
|
|
|
|
|
|
int flag = praiseCount / curRule.getPromotionCount();
|
|
|
|
if (flag >= 1) {
|
|
|
|
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;
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
AppraiseRecordItem tmp1 = records.stream().filter(item -> item.getCreatorId().equals(topPraiseTeacherId)).findFirst().orElse(null);
|
|
|
@ -524,6 +539,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
.praiseDistribution(praiseDistribution)
|
|
|
|
.praiseDistribution(praiseDistribution)
|
|
|
|
.criticalDistribution(criticalDistribution)
|
|
|
|
.criticalDistribution(criticalDistribution)
|
|
|
|
.curAchievement(curAchievement)
|
|
|
|
.curAchievement(curAchievement)
|
|
|
|
|
|
|
|
.achievementN(n)
|
|
|
|
.records(records)
|
|
|
|
.records(records)
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|