|
|
@@ -237,6 +237,21 @@ public class EnergyService {
|
|
|
return report.getOverallScore();
|
|
|
}
|
|
|
}
|
|
|
+ // 7维健康维度评分加权:将所有孩子的7维评分取均值作为家长body能量
|
|
|
+ List<HealthDimensionScore> allChildScores = new ArrayList<>();
|
|
|
+ for (FamilyMember child : children) {
|
|
|
+ try {
|
|
|
+ List<HealthDimensionScore> scores = healthDimensionScoreService.getLatestScores(child.getId());
|
|
|
+ if (scores != null) {
|
|
|
+ allChildScores.addAll(scores);
|
|
|
+ }
|
|
|
+ } catch (Exception ignored) {}
|
|
|
+ }
|
|
|
+ if (!allChildScores.isEmpty()) {
|
|
|
+ int avgScore = calcSevenDimBodyScoreFromScores(allChildScores);
|
|
|
+ if (avgScore > 0) return avgScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return calcTaskCompletionRate(parent.getId(), "parent",
|
|
|
Arrays.asList("运动", "体育", "户外", "健康"), 365);
|