Explorar o código

chore: auto bump version and changelog [skip ci]

iwt hai 1 mes
pai
achega
a8330803a2

+ 23 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/EnergyService.java

@@ -400,6 +400,29 @@ public class EnergyService {
         }
     }
 
+    private int calcSevenDimBodyScoreFromScores(List<HealthDimensionScore> scores) {
+        if (scores == null || scores.isEmpty()) return 0;
+        java.util.Map<String, Double> weights = new java.util.HashMap<>();
+        weights.put("gut", 0.20);
+        weights.put("nutrition", 0.18);
+        weights.put("exercise", 0.15);
+        weights.put("sleep", 0.15);
+        weights.put("growth", 0.12);
+        weights.put("immunity", 0.10);
+        weights.put("vision", 0.10);
+        double weightedSum = 0;
+        double totalWeight = 0;
+        for (HealthDimensionScore s : scores) {
+            Double w = weights.get(s.getDimension());
+            if (w != null && s.getScore() != null) {
+                weightedSum += s.getScore() * w;
+                totalWeight += w;
+            }
+        }
+        if (totalWeight == 0) return 0;
+        return (int) Math.round(weightedSum / totalWeight);
+    }
+
     /** 孩子 心 — DAN EMI 70% + 先天 30% + 行为修正 */
     private int calcChildMind(FamilyMember child) {
         Long childId = child.getId();

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-e9a414d75ec1a400507c63cb4312bb2b9ce4f562
+eac40275112ba9468f42ed419f496e6409dc320b