Просмотр исходного кода

refactor(entity): 批量规范化 childId 历史字段为 memberId(仅代码层)

- 48 个实体的 childId 字段统一改名为 memberId,并加 @TableField("child_id") 兼容旧列;
  数据库列名保持不变,未写迁移,零库变更
- 全量同步 Service/Controller/Mapper/Task/DTO/测试中的 getChildId/setChildId 调用点
- 加 @JsonProperty("childId") 保留 JSON 契约:接口出参键名仍为 childId,前端无需改动
- PointsLogVO:删除与 memberId 同值的重复 childId 字段,改为 memberId + getChildId() 别名
  getter,JSON 同时输出 childId 与 memberId(管理端表格 prop="childId" 依赖)
- ActivityFeedbackMapper.xml:result property="childId" -> "memberId"(column 仍为 child_id)
- 日志占位符 childId={} 同步改为 memberId={},避免日志文案与实际变量名不符
- 保留不动:数据库列 child_id、接口请求键 "childId"/"childIds"、MyBatis @Param("childId")
- 与前次 ChildBadge -> MemberBadge 规范保持一致,仅代码层,不动库表
E2E Test Bot 1 неделя назад
Родитель
Сommit
d8687f7c81
100 измененных файлов с 419 добавлено и 222 удалено
  1. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java
  2. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/controller/CouponController.java
  3. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/controller/DanAssessmentController.java
  4. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/controller/EmiReportController.java
  5. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/HealthCheckinController.java
  6. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/MealRecommendController.java
  7. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/ProblemSurveyController.java
  8. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/SeedEnergyController.java
  9. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/UserController.java
  10. 13 14
      cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminController.java
  11. 8 8
      cfc-backend/src/main/java/com/etotem/cfc/controller/admin/SupplyHierarchyController.java
  12. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentAppointmentController.java
  13. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentQuotaController.java
  14. 10 10
      cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentReportController.java
  15. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentResultController.java
  16. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/CognitiveController.java
  17. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/controller/auth/AuthController.java
  18. 12 12
      cfc-backend/src/main/java/com/etotem/cfc/controller/family/FamilyUserController.java
  19. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/controller/family/PointsController.java
  20. 5 5
      cfc-backend/src/main/java/com/etotem/cfc/controller/growth/GrowthPlanController.java
  21. 4 4
      cfc-backend/src/main/java/com/etotem/cfc/controller/growth/GrowthRecordController.java
  22. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/controller/guide/GuideRecordController.java
  23. 4 4
      cfc-backend/src/main/java/com/etotem/cfc/controller/guide/GuideTeamController.java
  24. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/controller/mind/EmotionAlertController.java
  25. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/controller/reward/RewardController.java
  26. 4 4
      cfc-backend/src/main/java/com/etotem/cfc/controller/stats/StatsController.java
  27. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/dto/CompleteTaskDTO.java
  28. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/dto/CreateWishDTO.java
  29. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/dto/LoginResultDTO.java
  30. 11 3
      cfc-backend/src/main/java/com/etotem/cfc/dto/PointsLogVO.java
  31. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/dto/RecommendRequestDTO.java
  32. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/dto/WishDTO.java
  33. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/dto/WuxingSourcingAdviceVO.java
  34. 7 3
      cfc-backend/src/main/java/com/etotem/cfc/entity/ActivityFeedback.java
  35. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/ActivityProvision.java
  36. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/ActivityRegistration.java
  37. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/ArticleReadingRecord.java
  38. 4 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentAppointment.java
  39. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentExecution.java
  40. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentOrder.java
  41. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentQuota.java
  42. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentRecord.java
  43. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentResult.java
  44. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/DailyFeedback.java
  45. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/DanAssessmentExecution.java
  46. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/DanAssessmentResult.java
  47. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/EmotionAlert.java
  48. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/EmotionCheckin.java
  49. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyBalance.java
  50. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyLog.java
  51. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/FamilyChallenge.java
  52. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/FamilyChallengeProgress.java
  53. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/FinanceCheckin.java
  54. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/FollowUp.java
  55. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/GameRecord.java
  56. 4 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/GrowthPlan.java
  57. 4 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/GrowthRecord.java
  58. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/GuideHierarchy.java
  59. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/HealthAlert.java
  60. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/HealthCheckin.java
  61. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/HealthTimelineEvent.java
  62. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/InsurancePolicy.java
  63. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/MathChildLevel.java
  64. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/MathQuizLog.java
  65. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/MealLog.java
  66. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/MentalHealthScreen.java
  67. 6 2
      cfc-backend/src/main/java/com/etotem/cfc/entity/MicroActionRecord.java
  68. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/NutritionDeficiencyRecord.java
  69. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/PointsExchangeRecord.java
  70. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/PointsLog.java
  71. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/RecommendationLog.java
  72. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/ReferralTree.java
  73. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/ReportSurvey.java
  74. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/Reward.java
  75. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/ShoppingList.java
  76. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/SupplyHierarchy.java
  77. 6 2
      cfc-backend/src/main/java/com/etotem/cfc/entity/Task.java
  78. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/TaskPlanInstance.java
  79. 8 3
      cfc-backend/src/main/java/com/etotem/cfc/entity/TongueRecord.java
  80. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/TrainingPlan.java
  81. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/TrainingPlanTask.java
  82. 5 1
      cfc-backend/src/main/java/com/etotem/cfc/entity/Wish.java
  83. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleReadingRecordMapper.java
  84. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/mapper/EmotionCheckinMapper.java
  85. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/mapper/GameRecordMapper.java
  86. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/mapper/MemberBadgeMapper.java
  87. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/mapper/TrainingPlanMapper.java
  88. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/service/AIService.java
  89. 4 4
      cfc-backend/src/main/java/com/etotem/cfc/service/ActivityFeedbackService.java
  90. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/service/ActivityOrderService.java
  91. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/service/ActivityProvisionService.java
  92. 14 14
      cfc-backend/src/main/java/com/etotem/cfc/service/ActivityRegistrationService.java
  93. 14 14
      cfc-backend/src/main/java/com/etotem/cfc/service/ActivityService.java
  94. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/service/AiContextService.java
  95. 7 7
      cfc-backend/src/main/java/com/etotem/cfc/service/ArticleService.java
  96. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentAppointmentService.java
  97. 2 2
      cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentComparisonService.java
  98. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentExecutionService.java
  99. 3 3
      cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentOrderService.java
  100. 1 1
      cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentPlanGenerator.java

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

@@ -2821,7 +2821,7 @@ insertSysConfigSeed("gift_membership_pay_price", "198000", "送会员商品达
         } catch (Exception ex) {
             log.warn("health_plans.updated_at 添加失败(可能已存在): " + ex.getMessage());
         }
-        // 迁移251c: finance_checkins.child_id 允许NULL(家长本人打卡不选孩子,Service已支持childId为空;原NOT NULL无默认值导致INSERT报错)
+        // 迁移251c: finance_checkins.child_id 允许NULL(家长本人打卡不选孩子,Service已支持memberId为空;原NOT NULL无默认值导致INSERT报错)
         try {
             jdbcTemplate.execute("ALTER TABLE finance_checkins MODIFY COLUMN child_id BIGINT NULL COMMENT '孩子ID,家长本人打卡时为NULL'");
             log.info("已修改finance_checkins.child_id字段允许NULL");

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/CouponController.java

@@ -57,8 +57,8 @@ public class CouponController {
                                                 @RequestBody Map<String, Object> params) {
         Long couponId = ParamUtils.getLong(params.get("couponId"));
         Object memberId = params.get("memberId");
-        Long childId = memberId != null ? Long.valueOf(memberId.toString()) : null;
-        PointsExchangeRecord record = pointsExchangeService.exchangeCoupon(userId, childId, couponId);
+        Long memberId = memberId != null ? Long.valueOf(memberId.toString()) : null;
+        PointsExchangeRecord record = pointsExchangeService.exchangeCoupon(userId, memberId, couponId);
         return Result.success(java.util.Collections.singletonMap("recordId", record.getId()));
     }
 

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/controller/DanAssessmentController.java

@@ -190,7 +190,7 @@ public class DanAssessmentController {
             return Result.success(null);
         }
         // 权限校验:本人 / 家庭管理员 / 被授权成员可见
-        Long memberId = result.getFamilyMemberId() != null ? result.getFamilyMemberId() : result.getChildId();
+        Long memberId = result.getFamilyMemberId() != null ? result.getFamilyMemberId() : result.getMemberId();
         Long resultFamilyId = familyId;
         if (resultFamilyId == null && memberId != null) {
             com.etotem.cfc.entity.FamilyMember fm = familyMemberMapper.selectById(memberId);
@@ -268,7 +268,7 @@ public class DanAssessmentController {
             item.put("id", app.getId());
             item.put("userId", app.getUserId());
             item.put("familyId", app.getFamilyId());
-            item.put("memberId", app.getChildId());
+            item.put("memberId", app.getMemberId());
             item.put("guideId", app.getGuideId());
             item.put("packageId", app.getPackageId());
             item.put("appointmentDate", app.getAppointmentDate());
@@ -444,7 +444,7 @@ public class DanAssessmentController {
         }
         List<DanAssessmentResult> list = danAssessmentResultMapper.selectList(
                 new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<DanAssessmentResult>()
-                        .eq(DanAssessmentResult::getChildId, memberId)
+                        .eq(DanAssessmentResult::getMemberId, memberId)
                         .eq(DanAssessmentResult::getDimension, dimension)
                         .eq(DanAssessmentResult::getDraftStatus, "confirmed")
                         .orderByDesc(DanAssessmentResult::getCreatedAt));

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/controller/EmiReportController.java

@@ -45,11 +45,11 @@ public class EmiReportController {
             return Result.error("childIds不能为空");
         }
         @SuppressWarnings("unchecked")
-        java.util.List<Long> childIds = (java.util.List<Long>) body.get("childIds");
-        if (childIds == null || childIds.isEmpty()) {
+        java.util.List<Long> memberIds = (java.util.List<Long>) body.get("childIds");
+        if (memberIds == null || memberIds.isEmpty()) {
             return Result.success(new java.util.ArrayList<>());
         }
-        List<EmiReportDTO> list = emiReportService.getFamilyLatestEmiReports(childIds);
+        List<EmiReportDTO> list = emiReportService.getFamilyLatestEmiReports(memberIds);
         return Result.success(list);
     }
 }

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/HealthCheckinController.java

@@ -45,7 +45,7 @@ public class HealthCheckinController {
         HealthCheckin checkin = new HealthCheckin();
         checkin.setUserId(userId);
         Long memberId = ParamUtils.getLong(params.get("memberId"), currentMemberId);
-        checkin.setChildId(memberId);
+        checkin.setMemberId(memberId);
         if (memberId == null) {
             return Result.error("memberId不能为空");
         }

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/MealRecommendController.java

@@ -94,7 +94,7 @@ public class MealRecommendController {
         logEntry.setUserId(userId);
         Long memberId = ParamUtils.getLong(params.get("memberId"), currentMemberId);
         if (memberId != null) {
-            logEntry.setChildId(memberId);
+            logEntry.setMemberId(memberId);
         }
         logEntry.setMealType((String) params.get("mealType"));
         logEntry.setFoods(params.get("foods") != null ? params.get("foods").toString() : "[]");

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/ProblemSurveyController.java

@@ -147,7 +147,7 @@ public class ProblemSurveyController {
         RecommendRequestDTO recReq = new RecommendRequestDTO();
         recReq.setType("product");
         recReq.setDimensionCode(template != null ? template.getDimension() : null);
-        recReq.setChildId(memberId);
+        recReq.setMemberId(memberId);
         recReq.setSize(10);
         try {
             Map<String, Object> rec = contentRecommendService.recommend(recReq, userId, familyId);

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/SeedEnergyController.java

@@ -87,7 +87,7 @@ public class SeedEnergyController {
         task.setCreatorId(executorId);
         task.setExecutorType(executorType);
         task.setExecutorId(executorId);
-        task.setChildId(null);
+        task.setMemberId(null);
         task.setTitle(title);
         task.setDescription("");
         task.setPoints(10);

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/UserController.java

@@ -316,7 +316,7 @@ public class UserController {
         );
         stats.put("growthRecords", growthRecords);
 
-        // 7. 参加挑战数(按家庭成员childId统计)
+        // 7. 参加挑战数(按家庭成员memberId统计)
         Integer challengesJoined = 0;
         for (FamilyMember m : members) {
             Long cnt = familyChallengeProgressMapper.selectCount(

+ 13 - 14
cfc-backend/src/main/java/com/etotem/cfc/controller/admin/AdminController.java

@@ -383,7 +383,7 @@ public class AdminController {
 
         // 记录积分流水
         PointsLog log = new PointsLog();
-        log.setChildId(id);
+        log.setMemberId(id);
         log.setAmount(amount);
         log.setType("adjust");
         log.setDescription(reason);
@@ -578,13 +578,13 @@ public class AdminController {
             reward.setExchangedAt(new Date());
         } else {
             // 拒绝,返还积分
-            FamilyMember child = familyMemberMapper.selectById(reward.getChildId());
+            FamilyMember child = familyMemberMapper.selectById(reward.getMemberId());
             if (child != null) {
                 child.setTotalPoints(child.getTotalPoints() + reward.getPointsRequired());
                 familyMemberMapper.updateById(child);
 
                 PointsLog log = new PointsLog();
-                log.setChildId(reward.getChildId());
+                log.setMemberId(reward.getMemberId());
                 log.setAmount(reward.getPointsRequired());
                 log.setType("refund");
                 log.setDescription("奖励兑换被拒绝,积分退还");
@@ -630,7 +630,7 @@ public class AdminController {
             }
         }
         
-        // 安全解析childId(成员ID)
+        // 安全解析memberId(成员ID)
         if (params.get("memberId") != null) {
             if (params.get("memberId") instanceof Number) {
                 memberId = ((Number) params.get("memberId")).longValue();
@@ -690,7 +690,7 @@ public class AdminController {
         Page<PointsLog> pageParam = new Page<>(page, size);
         LambdaQueryWrapper<PointsLog> wrapper = new LambdaQueryWrapper<>();
         if (memberIds != null) {
-            wrapper.in(PointsLog::getChildId, memberIds);
+            wrapper.in(PointsLog::getMemberId, memberIds);
         }
         if (type != null && !type.isEmpty()) {
             wrapper.eq(PointsLog::getType, type);
@@ -702,7 +702,7 @@ public class AdminController {
         // 批量补充成员姓名与所属家庭名称
         Set<Long> logMemberIds = new HashSet<>();
         for (PointsLog log : result.getRecords()) {
-            Long logMemberId = log.getChildId() != null ? log.getChildId() : log.getFamilyMemberId();
+            Long logMemberId = log.getMemberId() != null ? log.getMemberId() : log.getFamilyMemberId();
             if (logMemberId != null) logMemberIds.add(logMemberId);
         }
         Map<Long, FamilyMember> memberMap = new HashMap<>();
@@ -729,8 +729,7 @@ public class AdminController {
         for (PointsLog log : result.getRecords()) {
             PointsLogVO vo = new PointsLogVO();
             vo.setId(log.getId());
-            vo.setChildId(log.getChildId());
-            vo.setMemberId(log.getChildId() != null ? log.getChildId() : log.getFamilyMemberId());
+            vo.setMemberId(log.getMemberId() != null ? log.getMemberId() : log.getFamilyMemberId());
             vo.setAmount(log.getAmount());
             vo.setType(log.getType());
             vo.setCategory(log.getCategory());
@@ -1933,7 +1932,7 @@ public class AdminController {
             Map<String, Object> item = new HashMap<>();
             item.put("id", app.getId());
             item.put("familyId", app.getFamilyId());
-            item.put("memberId", app.getChildId());
+            item.put("memberId", app.getMemberId());
             item.put("appointmentDate", app.getAppointmentDate());
             item.put("appointmentTime", app.getAppointmentTime());
             item.put("durationMinutes", app.getDurationMinutes());
@@ -1948,8 +1947,8 @@ public class AdminController {
             item.put("userName", user != null ? user.getNickname() : "未知用户");
 
             // 关联查询家庭成员名称(家庭成员)
-            if (app.getChildId() != null) {
-                FamilyMember child = familyMemberMapper.selectById(app.getChildId());
+            if (app.getMemberId() != null) {
+                FamilyMember child = familyMemberMapper.selectById(app.getMemberId());
                 item.put("childName", child != null ? child.getNickname() : "未知");
             } else {
                 item.put("childName", "");
@@ -2030,7 +2029,7 @@ public class AdminController {
             item.put("id", app.getId());
             item.put("familyId", app.getFamilyId());
             item.put("userId", app.getUserId());
-            item.put("memberId", app.getChildId());
+            item.put("memberId", app.getMemberId());
             item.put("guideId", app.getGuideId());
             item.put("teacherId", app.getTeacherId());
             item.put("packageId", app.getPackageId());
@@ -2048,8 +2047,8 @@ public class AdminController {
             item.put("userName", user != null ? user.getNickname() : "未知用户");
 
             // 关联查询家庭成员昵称
-            if (app.getChildId() != null) {
-                FamilyMember child = familyMemberMapper.selectById(app.getChildId());
+            if (app.getMemberId() != null) {
+                FamilyMember child = familyMemberMapper.selectById(app.getMemberId());
                 item.put("childName", child != null ? child.getNickname() : "未知");
             } else {
                 item.put("childName", "");

+ 8 - 8
cfc-backend/src/main/java/com/etotem/cfc/controller/admin/SupplyHierarchyController.java

@@ -44,11 +44,11 @@ public class SupplyHierarchyController {
         try {
             Long systemId = ParamUtils.getLong(params.get("systemId"));
             Long parentId = ParamUtils.getLong(params.get("parentId"));
-            Long childId = ParamUtils.getLong(params.get("childId"));
-            if (systemId == null || parentId == null || childId == null) {
+            Long memberId = ParamUtils.getLong(params.get("childId"));
+            if (systemId == null || parentId == null || memberId == null) {
                 return Result.error("参数不完整");
             }
-            supplyHierarchyService.setHierarchy(systemId, parentId, childId);
+            supplyHierarchyService.setHierarchy(systemId, parentId, memberId);
             return Result.success();
         } catch (IllegalArgumentException e) {
             return Result.error(e.getMessage());
@@ -61,11 +61,11 @@ public class SupplyHierarchyController {
     public Result<Void> removeRelation(@RequestBody Map<String, Object> params) {
         try {
             Long systemId = ParamUtils.getLong(params.get("systemId"));
-            Long childId = ParamUtils.getLong(params.get("childId"));
-            if (systemId == null || childId == null) {
+            Long memberId = ParamUtils.getLong(params.get("childId"));
+            if (systemId == null || memberId == null) {
                 return Result.error("参数不完整");
             }
-            supplyHierarchyService.removeRelation(systemId, childId);
+            supplyHierarchyService.removeRelation(systemId, memberId);
             return Result.success();
         } catch (Exception e) {
             return Result.error("移除失败");
@@ -165,7 +165,7 @@ public class SupplyHierarchyController {
         }
 
         for (SupplyHierarchy h : children) {
-            User childUser = userMap.get(h.getChildId());
+            User childUser = userMap.get(h.getMemberId());
             if (childUser == null) continue;
 
             Map<String, Object> node = new HashMap<>();
@@ -174,7 +174,7 @@ public class SupplyHierarchyController {
             node.put("realName", childUser.getRealName());
             node.put("phone", childUser.getPhone());
             node.put("level", h.getLevel());
-            node.put("children", buildTree(h.getChildId(), childrenMap, userMap, visited));
+            node.put("children", buildTree(h.getMemberId(), childrenMap, userMap, visited));
             result.add(node);
         }
         return result;

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentAppointmentController.java

@@ -148,7 +148,7 @@ public class AssessmentAppointmentController {
     private Map<String, Object> toMap(AssessmentAppointment appt) {
         Map<String, Object> map = new HashMap<>();
         map.put("id", appt.getId());
-        map.put("memberId", appt.getChildId());
+        map.put("memberId", appt.getMemberId());
         map.put("guideId", appt.getGuideId());
         map.put("assessorId", appt.getAssessorId());
         map.put("appointmentDate", appt.getAppointmentDate());

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentQuotaController.java

@@ -63,7 +63,7 @@ public class AssessmentQuotaController {
         vo.setId(q.getId());
         vo.setQuotaNo(q.getQuotaNo());
         vo.setFamilyId(q.getFamilyId());
-        vo.setMemberId(q.getChildId());
+        vo.setMemberId(q.getMemberId());
         vo.setProductOrderId(q.getProductOrderId());
         vo.setProductId(q.getProductId());
         vo.setProductName(q.getProductName());

+ 10 - 10
cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentReportController.java

@@ -62,7 +62,7 @@ public class AssessmentReportController {
     @PostMapping("/plans/list")
     public Result<List<TaskPlanInstance>> getMyPlans(
             @RequestParam(value = "familyId", required = false) Long familyId,
-            @RequestParam(value = "childId", required = false) Long childId,
+            @RequestParam(value = "childId", required = false) Long memberId,
             @RequestBody(required = false) Map<String, Object> body,
             HttpServletRequest request) {
         try {
@@ -70,8 +70,8 @@ public class AssessmentReportController {
             if (familyId == null && body != null && body.get("familyId") != null) {
                 familyId = ((Number) body.get("familyId")).longValue();
             }
-            if (childId == null && body != null && body.get("childId") != null) {
-                childId = ((Number) body.get("childId")).longValue();
+            if (memberId == null && body != null && body.get("childId") != null) {
+                memberId = ((Number) body.get("childId")).longValue();
             }
             if (familyId == null) {
                 Object attr = request.getAttribute("familyId");
@@ -83,10 +83,10 @@ public class AssessmentReportController {
                 return Result.error("缺少familyId参数且无法从登录态获取家庭信息");
             }
 
-            // 如果传了 childId,只查该家庭成员的方案;否则查整个家庭的方案
+            // 如果传了 memberId,只查该家庭成员的方案;否则查整个家庭的方案
             List<TaskPlanInstance> plans;
-            if (childId != null) {
-                plans = taskPlanService.getChildPlans(childId);
+            if (memberId != null) {
+                plans = taskPlanService.getChildPlans(memberId);
             } else {
                 plans = taskPlanService.getFamilyPlans(familyId);
             }
@@ -95,7 +95,7 @@ public class AssessmentReportController {
             plans.sort((a, b) -> b.getCreatedAt().after(a.getCreatedAt()) ? 1 : -1);
             return Result.success(plans);
         } catch (Exception e) {
-            log.error("获取测评方案失败: familyId={}, childId={}", familyId, childId, e);
+            log.error("获取测评方案失败: familyId={}, memberId={}", familyId, memberId, e);
             return Result.error("获取方案失败:" + e.getMessage());
         }
     }
@@ -117,7 +117,7 @@ public class AssessmentReportController {
         }
 
         DanAssessmentResult result = new DanAssessmentResult();
-        result.setChildId(memberId);
+        result.setMemberId(memberId);
         result.setStatus("draft");
         result.setSource(DanAssessmentResult.SOURCE_PARENT_UPLOAD);
         result.setProcessDesc(notes);
@@ -190,10 +190,10 @@ public class AssessmentReportController {
 
         // 用户确认后立即自动生成测评方案(无需规划师审核)
         try {
-            User child = userMapper.selectById(result.getChildId());
+            User child = userMapper.selectById(result.getMemberId());
             Long familyId = child != null ? child.getFamilyId() : null;
             if (familyId != null) {
-                TaskPlanInstance plan = planGenerator.generate(result, familyId, result.getChildId());
+                TaskPlanInstance plan = planGenerator.generate(result, familyId, result.getMemberId());
                 log.info("已为测评结果{}自动生成方案 planId={}", resultId, plan.getId());
             }
         } catch (Exception e) {

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/AssessmentResultController.java

@@ -44,7 +44,7 @@ public class AssessmentResultController {
         }
 
         AssessmentResultDTO dto = new AssessmentResultDTO();
-        dto.setMemberId(result.getChildId());
+        dto.setMemberId(result.getMemberId());
         dto.setChildName(result.getChildName());
         dto.setOverallScore(result.getOverallScore());
         dto.setAttentionScore(result.getAttentionScore());
@@ -74,7 +74,7 @@ public class AssessmentResultController {
         }
 
         LambdaQueryWrapper<DanAssessmentResult> wrapper = new LambdaQueryWrapper<DanAssessmentResult>()
-                .eq(DanAssessmentResult::getChildId, memberId)
+                .eq(DanAssessmentResult::getMemberId, memberId)
                 .eq(DanAssessmentResult::getStatus, "completed")
                 .orderByDesc(DanAssessmentResult::getAssessmentDate)
                 .last("LIMIT " + size);

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/controller/assessment/CognitiveController.java

@@ -50,7 +50,7 @@ public class CognitiveController {
         }
 
         Map<String, Object> scores = new LinkedHashMap<>();
-        scores.put("memberId", result.getChildId());
+        scores.put("memberId", result.getMemberId());
         scores.put("childName", result.getChildName());
         scores.put("attentionScore", result.getAttentionScore());
         scores.put("focusScore", result.getFocusScore());
@@ -75,7 +75,7 @@ public class CognitiveController {
         for (Map.Entry<Long, DanAssessmentResult> entry : results.entrySet()) {
             DanAssessmentResult r = entry.getValue();
             Map<String, Object> item = new LinkedHashMap<>();
-            item.put("memberId", r.getChildId());
+            item.put("memberId", r.getMemberId());
             item.put("childName", r.getChildName());
             item.put("attentionScore", r.getAttentionScore());
             item.put("focusScore", r.getFocusScore());
@@ -191,7 +191,7 @@ public class CognitiveController {
 
         List<DanAssessmentResult> results = danAssessmentResultMapper.selectList(
                 new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<DanAssessmentResult>()
-                        .eq(DanAssessmentResult::getChildId, memberId)
+                        .eq(DanAssessmentResult::getMemberId, memberId)
                         .eq(DanAssessmentResult::getStatus, "completed")
                         .orderByDesc(DanAssessmentResult::getAssessmentDate)
                         .last("LIMIT " + limit)

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/auth/AuthController.java

@@ -214,7 +214,7 @@ public class AuthController {
         return Result.success(success);
     }
 
-    /**
+    /**
      * JWT Token 验证
      * 从 Authorization header 提取 Bearer token,验证并返回用户信息
      */
@@ -251,7 +251,7 @@ public class AuthController {
     @PostMapping("/verify-password")
     public Result<Boolean> verifyPassword(@RequestBody VerifyPasswordDTO dto,
                                           @RequestAttribute("userId") Long userId) {
-        boolean valid = userService.verifyPassword(userId, dto.getPassword());
+        boolean valid = userService.verifyPassword(userId, dto.getPassword());
         return Result.success(valid);
     }
 

+ 12 - 12
cfc-backend/src/main/java/com/etotem/cfc/controller/family/FamilyUserController.java

@@ -22,7 +22,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import com.etotem.cfc.util.ParamUtils;
+import com.etotem.cfc.util.ParamUtils;
 
 @Tag(name = "家庭用户管理", description = "家庭用户信息、家庭成员管理等接口")
 @RestController
@@ -54,7 +54,7 @@ public class FamilyUserController {
     @Operation(summary = "更新用户信息")
     @PostMapping("/update")
     public Result<Boolean> updateUserInfo(@RequestAttribute("userId") Long userId,
-        @RequestBody UpdateUserDTO dto) {
+        @RequestBody UpdateUserDTO dto) {
         boolean success = userService.updateUserInfo(userId, dto);
         return Result.success(success);
     }
@@ -78,12 +78,12 @@ public class FamilyUserController {
         } catch (Exception e) {
             return Result.error(e.getMessage());
         }
-    }
+    }
 
     @Operation(summary = "创建新家庭")
     @PostMapping("/create-family")
     public Result<Long> createFamily(@RequestAttribute("userId") Long userId,
-        @RequestBody Map<String, String> body) {
+        @RequestBody Map<String, String> body) {
         String familyName = body.getOrDefault("name", "我的家庭");
         Long familyId = userService.createFamilyForUser(userId, familyName);
         return Result.success(familyId);
@@ -95,12 +95,12 @@ public class FamilyUserController {
     public Result<String> switchMode(@RequestAttribute("userId") Long userId,
         @RequestBody Map<String, String> body) {
         return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
-    }
+    }
 
     @Operation(summary = "切换用户角色 (支持 parent/child/teacher)")
     @PostMapping("/switch-role")
     public Result<String> switchRole(@RequestAttribute("userId") Long userId,
-        @RequestBody Map<String, String> body) {
+        @RequestBody Map<String, String> body) {
         String role = body.get("role");
         String result = userService.switchRole(userId, role);
         if (result == null) {
@@ -120,7 +120,7 @@ public class FamilyUserController {
     @Deprecated
     @PostMapping("/switch-to-child")
     public Result<Long> switchToFamilyMember(@RequestAttribute("userId") Long userId,
-        @RequestBody Map<String, Long> body) {
+        @RequestBody Map<String, Long> body) {
         return Result.error(410, "该接口已废弃,请使用 /api/family/member/switch");
     }
 
@@ -147,12 +147,12 @@ public class FamilyUserController {
             return Result.error("密码错误");
         }
         return Result.success(true);
-    }
+    }
 
     @Operation(summary = "创建家庭成员")
     @PostMapping("/children")
     public Result<FamilyMemberInfoDTO> createFamilyMember(@RequestAttribute("userId") Long userId,
-        @RequestBody CreateFamilyMemberDTO dto) {
+        @RequestBody CreateFamilyMemberDTO dto) {
         FamilyMemberInfoDTO child = userService.createFamilyMember(userId, dto);
         return Result.success(child);
     }
@@ -167,7 +167,7 @@ public class FamilyUserController {
     @Operation(summary = "更新家庭成员信息")
     @PostMapping("/children/update")
     public Result<Boolean> updateFamilyMember(@RequestAttribute("userId") Long userId,
-        @RequestBody UpdateFamilyMemberDTO dto) {
+        @RequestBody UpdateFamilyMemberDTO dto) {
         Long memberId = dto.getFamilyMemberId();
         boolean success = userService.updateFamilyMember(userId, memberId, dto);
         return Result.success(success);
@@ -231,7 +231,7 @@ public class FamilyUserController {
     @Operation(summary = "更新成员可见性")
     @PostMapping("/members/update-visibility")
     public Result<Boolean> updateVisibility(@RequestAttribute("userId") Long userId,
-        @RequestBody Map<String, Object> body) {
+        @RequestBody Map<String, Object> body) {
         Long memberId = ParamUtils.getLong(body.get("memberId"));
         String memberType = (String) body.get("memberType");
         Integer showToFamily = Integer.valueOf(body.get("showToFamily").toString());
@@ -242,7 +242,7 @@ public class FamilyUserController {
     @Operation(summary = "踢出家庭成员(仅管理员可操作)")
     @PostMapping("/kick")
     public Result<Boolean> kickMember(@RequestAttribute("userId") Long userId,
-        @RequestBody Map<String, Long> body) {
+        @RequestBody Map<String, Long> body) {
         Long targetUserId = body.get("targetUserId");
         if (targetUserId == null) {
             return Result.error("缺少目标用户ID");

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/controller/family/PointsController.java

@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
 import java.util.Map;
-import com.etotem.cfc.util.ParamUtils;
+import com.etotem.cfc.util.ParamUtils;
 
 @RestController
 @RequestMapping("/api/points")
@@ -72,5 +72,5 @@ public class PointsController {
         Integer size = params.get("size") != null ? Integer.valueOf(params.get("size").toString()) : 10;
         Page<PointsLog> logs = pointsService.getPointsLogsByCategory(memberId, category, page, size);
         return Result.success(logs);
-    }
-}
+    }
+}

+ 5 - 5
cfc-backend/src/main/java/com/etotem/cfc/controller/growth/GrowthPlanController.java

@@ -34,7 +34,7 @@ public class GrowthPlanController {
     @PostMapping("/create")
     public Result<GrowthPlan> createPlan(@RequestBody GrowthPlan plan,
                                           @RequestAttribute("userId") Long userId) {
-        if (plan.getChildId() == null) {
+        if (plan.getMemberId() == null) {
             return Result.error("请选择家庭成员");
         }
         plan.setTeacherId(userId);
@@ -45,14 +45,14 @@ public class GrowthPlanController {
     @Operation(summary = "获取家庭成员的成长方案列表")
     @PostMapping("/child/{memberId}")
     public Result<List<GrowthPlan>> getChildPlans(@PathVariable Long memberId) {
-        List<GrowthPlan> plans = growthPlanService.getByChildId(memberId);
+        List<GrowthPlan> plans = growthPlanService.getByMemberId(memberId);
         return Result.success(plans);
     }
 
     @Operation(summary = "获取成员当前活跃方案")
     @PostMapping("/child/{memberId}/active")
     public Result<GrowthPlan> getActivePlan(@PathVariable Long memberId) {
-        GrowthPlan plan = growthPlanService.getActivePlanByChildId(memberId);
+        GrowthPlan plan = growthPlanService.getActivePlanByMemberId(memberId);
         if (plan == null) {
             return Result.error("暂无活跃方案");
         }
@@ -131,7 +131,7 @@ public class GrowthPlanController {
         List<Map<String, Object>> withChildName = result.getRecords().stream().map(plan -> {
             Map<String, Object> map = new java.util.HashMap<>();
             map.put("id", plan.getId());
-            map.put("childId", plan.getChildId());
+            map.put("childId", plan.getMemberId());
             map.put("planTitle", plan.getPlanTitle());
             map.put("planContent", plan.getPlanContent());
             map.put("durationMonths", plan.getDurationMonths());
@@ -145,7 +145,7 @@ public class GrowthPlanController {
             // 查询家庭成员昵称
             List<com.etotem.cfc.entity.User> users = userMapper.selectList(
                 new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<com.etotem.cfc.entity.User>()
-                    .eq(com.etotem.cfc.entity.User::getId, plan.getChildId()));
+                    .eq(com.etotem.cfc.entity.User::getId, plan.getMemberId()));
             String childName = users.stream()
                 .map(u -> u.getNickname())
                 .findFirst()

+ 4 - 4
cfc-backend/src/main/java/com/etotem/cfc/controller/growth/GrowthRecordController.java

@@ -49,7 +49,7 @@ public class GrowthRecordController {
     public Result<GrowthRecord> createRecord(@RequestBody GrowthRecord record,
                                               @RequestAttribute("userId") Long userId) {
         record.setParentId(userId);
-        if (record.getChildId() == null) {
+        if (record.getMemberId() == null) {
             return Result.error("请选择家庭成员");
         }
         GrowthRecord result = growthRecordService.createRecord(record);
@@ -69,7 +69,7 @@ public class GrowthRecordController {
         GrowthRecord record = new GrowthRecord();
         Long memberId = ParamUtils.getLong(body.get("memberId"), currentMemberId);
         if (memberId != null) {
-            record.setChildId(memberId);
+            record.setMemberId(memberId);
         }
         if (body.get("school") != null) record.setSchool(body.get("school").toString());
         if (body.get("grade") != null) record.setGrade(Integer.valueOf(body.get("grade").toString()));
@@ -80,7 +80,7 @@ public class GrowthRecordController {
         if (body.get("schoolStreet") != null) record.setSchoolStreet(body.get("schoolStreet").toString());
 
         record.setParentId(userId);
-        if (record.getChildId() == null) {
+        if (record.getMemberId() == null) {
             return Result.error("请选择家庭成员");
         }
 
@@ -112,7 +112,7 @@ public class GrowthRecordController {
             Long discountAmount = ParamUtils.getLong(body.get("discountAmount"), 0L);
 
             com.etotem.cfc.entity.AssessmentOrder order = assessmentOrderService.createOrder(
-                    familyId, userId, record.getChildId(), guideId, packageId,
+                    familyId, userId, record.getMemberId(), guideId, packageId,
                     guideName, null, totalPrice, discountAmount);
 
             Map<String, Object> orderInfo = new HashMap<>();

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/guide/GuideRecordController.java

@@ -54,7 +54,7 @@ public class GuideRecordController {
         if (saved != null) {
             try {
                 Long memberId = saved.getFamilyMemberId() != null && saved.getFamilyMemberId() > 0
-                        ? saved.getFamilyMemberId() : saved.getChildId();
+                        ? saved.getFamilyMemberId() : saved.getMemberId();
                 cfPathwayEarnService.earnAssessmentReportCf(memberId, saved);
             } catch (Exception e) {
                 log.error("发放CF值失败(完成测评建档)", e);
@@ -86,7 +86,7 @@ public class GuideRecordController {
         }
         DanAssessmentResult result = new DanAssessmentResult();
         result.setId(danResult.getId());
-        result.setChildId(danResult.getChildId());
+        result.setMemberId(danResult.getMemberId());
         result.setTeacherId(danResult.getTeacherId());
         result.setAppointmentId(danResult.getAppointmentId());
         result.setAttentionScore(danResult.getAttentionScore());

+ 4 - 4
cfc-backend/src/main/java/com/etotem/cfc/controller/guide/GuideTeamController.java

@@ -113,7 +113,7 @@ public class GuideTeamController {
         if (isPlanner) {
             // 检查是否已有团队关系(在guide_hierarchy中被添加为child)
             LambdaQueryWrapper<GuideHierarchy> teamCheck = new LambdaQueryWrapper<>();
-            teamCheck.eq(GuideHierarchy::getChildId, userId)
+            teamCheck.eq(GuideHierarchy::getMemberId, userId)
                      .eq(GuideHierarchy::getStatus, "active");
             SortUtil.applySort(teamCheck);
             GuideHierarchy existingTeam = guideHierarchyService.getOne(teamCheck);
@@ -153,7 +153,7 @@ public class GuideTeamController {
         // 检查是否已在该团队中
         LambdaQueryWrapper<GuideHierarchy> existCheck = new LambdaQueryWrapper<>();
         existCheck.eq(GuideHierarchy::getParentId, guideId)
-                  .eq(GuideHierarchy::getChildId, userId)
+                  .eq(GuideHierarchy::getMemberId, userId)
                   .eq(GuideHierarchy::getStatus, "active");
         if (guideHierarchyService.count(existCheck) > 0) {
             return Result.error("您已经在该团队中");
@@ -161,7 +161,7 @@ public class GuideTeamController {
 
         // 检查是否已有其他上级:每个规划师只能有一个直接上级
         GuideHierarchy existingHierarchy = guideHierarchyService.getOne(new LambdaQueryWrapper<GuideHierarchy>()
-                .eq(GuideHierarchy::getChildId, userId)
+                .eq(GuideHierarchy::getMemberId, userId)
                 .eq(GuideHierarchy::getStatus, "active"));
         if (existingHierarchy != null) {
             return Result.error("您已有上级规划师,不能加入此团队。如需更换团队,请先离开当前团队。");
@@ -181,7 +181,7 @@ public class GuideTeamController {
     @PostMapping("/leave")
     public Result<Map<String, Object>> leaveTeam(@RequestAttribute("userId") Long userId) {
         LambdaQueryWrapper<GuideHierarchy> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(GuideHierarchy::getChildId, userId)
+        wrapper.eq(GuideHierarchy::getMemberId, userId)
                .eq(GuideHierarchy::getStatus, "active");
         SortUtil.applySort(wrapper);
         GuideHierarchy hierarchy = guideHierarchyService.getOne(wrapper);

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/mind/EmotionAlertController.java

@@ -99,7 +99,7 @@ public class EmotionAlertController {
             return Result.error("告警不存在");
         }
 
-        FamilyMember child = familyMemberMapper.selectById(alert.getChildId());
+        FamilyMember child = familyMemberMapper.selectById(alert.getMemberId());
         if (child == null) {
             return Result.error("家庭成员不存在");
         }

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/controller/reward/RewardController.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 import java.util.Map;
-import com.etotem.cfc.util.ParamUtils;
+import com.etotem.cfc.util.ParamUtils;
 
 @RestController
 @RequestMapping("/api/rewards")
@@ -51,7 +51,7 @@ public class RewardController {
         Long memberId = params.get("memberId") != null ? ParamUtils.getLong(params.get("memberId")) : currentMemberId;
         Map<String, Object> result = rewardService.exchangeReward(id, memberId);
         return Result.success(result);
-    }
+    }
 
     @PostMapping("/{id}/approve")
     public Result<Boolean> approveReward(@PathVariable Long id,

+ 4 - 4
cfc-backend/src/main/java/com/etotem/cfc/controller/stats/StatsController.java

@@ -302,7 +302,7 @@ public class StatsController {
         monthCal.set(Calendar.MINUTE, 0); monthCal.set(Calendar.SECOND, 0); monthCal.set(Calendar.MILLISECOND, 0);
         Date monthStart = monthCal.getTime();
         List<PointsLog> monthLogs = pointsLogMapper.selectList(
-                new LambdaQueryWrapper<PointsLog>().eq(PointsLog::getChildId, memberId)
+                new LambdaQueryWrapper<PointsLog>().eq(PointsLog::getMemberId, memberId)
                         .ge(PointsLog::getCreatedAt, monthStart).orderByAsc(PointsLog::getCreatedAt));
         Set<String> activeDays = new HashSet<>();
         for (PointsLog log : monthLogs) {
@@ -321,7 +321,7 @@ public class StatsController {
         taskStats.put("completionRate", taskTotal > 0 ? (int)(taskCompleted * 10000 / taskTotal) / 100 : 0);
         result.put("taskStats", taskStats);
 
-        List<GameRecord> records = gameRecordService.listByChildId(memberId);
+        List<GameRecord> records = gameRecordService.listByMemberId(memberId);
         int gameTotalPoints = records.stream().mapToInt(GameRecord::getPointsEarned).sum();
         int bestScore = records.stream().mapToInt(GameRecord::getScore).max().orElse(0);
         int totalTime = records.stream().mapToInt(GameRecord::getCompletionTime).sum();
@@ -333,7 +333,7 @@ public class StatsController {
         Calendar cal = Calendar.getInstance();
         cal.add(Calendar.DAY_OF_YEAR, -7);
         List<PointsLog> recentLogs = pointsLogMapper.selectList(
-                new LambdaQueryWrapper<PointsLog>().eq(PointsLog::getChildId, memberId)
+                new LambdaQueryWrapper<PointsLog>().eq(PointsLog::getMemberId, memberId)
                         .ge(PointsLog::getCreatedAt, cal.getTime()).orderByAsc(PointsLog::getCreatedAt));
         List<Map<String, Object>> pointsTrend = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -373,7 +373,7 @@ public class StatsController {
             List<Task> tasks = taskService.getAllTasksByChild(child.getId());
             long c = tasks.stream().filter(t -> "completed".equals(t.getStatus())).count();
             s.put("taskTotal", tasks.size()); s.put("taskCompleted", c); s.put("points", child.getTotalPoints());
-            s.put("gameTotal", gameRecordService.listByChildId(child.getId()).size());
+            s.put("gameTotal", gameRecordService.listByMemberId(child.getId()).size());
             familyTotalTasks += tasks.size(); familyCompletedTasks += c;
             familyTotalGames += ((Number)s.get("gameTotal")).intValue();
             childrenStats.add(s);

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/dto/CompleteTaskDTO.java

@@ -13,4 +13,4 @@ public class CompleteTaskDTO {
     // TASK-SYS-248: content 类型: text/image/audio/video
     private String contentType;
 }
-
+

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/dto/CreateWishDTO.java

@@ -31,6 +31,6 @@ public class CreateWishDTO {
     public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; }
     public void setLinkUrl(String linkUrl) { this.linkUrl = linkUrl; }
     public void setEstimatedPrice(Long estimatedPrice) { this.estimatedPrice = estimatedPrice; }
-    public void setChildId(Long memberId) { this.memberId = memberId; }
+    public void setMemberId(Long memberId) { this.memberId = memberId; }
     public void setPointsRequired(Integer pointsRequired) { this.pointsRequired = pointsRequired; }
 }

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/dto/LoginResultDTO.java

@@ -11,7 +11,7 @@ public class LoginResultDTO {
     private Long familyId;
     private String nickname;
     private String phone;
-    private Long currentChildId; // 当前切换到的成员ID(如果切换了)
+    private Long currentMemberId; // 当前切换到的成员ID(如果切换了)
     private Boolean isNewUser; // 是否新用户
     private String openid; // 微信openid,用于前端缓存实现自动登录
     private Boolean needsRoleSelect; // 新用户是否需要选择角色

+ 11 - 3
cfc-backend/src/main/java/com/etotem/cfc/dto/PointsLogVO.java

@@ -1,5 +1,6 @@
 package com.etotem.cfc.dto;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.util.Date;
@@ -14,12 +15,19 @@ public class PointsLogVO {
 
     private Long id;
 
-    /** 成员ID(points_log.child_id,历史字段名,实际为 family_members.id) */
-    private Long childId;
 
-    /** 成员ID(兼容字段,与 childId 同值) */
+    /** 成员ID(points_log.child_id,历史字段名,实际为 family_members.id) */
     private Long memberId;
 
+    /**
+     * 历史字段名 childId 的 JSON 兼容别名(与 memberId 同值)。
+     * 管理端表格列 prop="childId" 依赖该键,保留以避免接口契约变更。
+     */
+    @JsonProperty("childId")
+    public Long getChildId() {
+        return memberId;
+    }
+
     /** 成员姓名 */
     private String memberName;
 

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/dto/RecommendRequestDTO.java

@@ -21,8 +21,8 @@ public class RecommendRequestDTO {
     public void setType(String type) { this.type = type; }
     public String getDimensionCode() { return dimensionCode; }
     public void setDimensionCode(String dimensionCode) { this.dimensionCode = dimensionCode; }
-    public Long getChildId() { return memberId; }
-    public void setChildId(Long memberId) { this.memberId = memberId; }
+    public Long getMemberId() { return memberId; }
+    public void setMemberId(Long memberId) { this.memberId = memberId; }
     public Integer getSize() { return size; }
     public void setSize(Integer size) { this.size = size; }
     public String getExcludeIds() { return excludeIds; }

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/dto/WishDTO.java

@@ -42,7 +42,7 @@ public class WishDTO {
     // Explicit setters (Lombok fallback)
     public void setId(Long id) { this.id = id; }
     public void setFamilyId(Long familyId) { this.familyId = familyId; }
-    public void setChildId(Long memberId) { this.memberId = memberId; }
+    public void setMemberId(Long memberId) { this.memberId = memberId; }
     public void setChildName(String childName) { this.childName = childName; }
     public void setCreatedBy(Long createdBy) { this.createdBy = createdBy; }
     public void setCreatorType(String creatorType) { this.creatorType = creatorType; }

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/dto/WuxingSourcingAdviceVO.java

@@ -1,7 +1,7 @@
 package com.etotem.cfc.dto;
 
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import lombok.Data;
 import java.util.List;
 

+ 7 - 3
cfc-backend/src/main/java/com/etotem/cfc/entity/ActivityFeedback.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.Date;
 
 @TableName("activity_feedback")
@@ -11,7 +13,9 @@ public class ActivityFeedback {
     private Long id;
     private Long activityId;
     private Long userId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private String ratings;
     private String comment;
     private Integer status;
@@ -24,8 +28,8 @@ public class ActivityFeedback {
     public void setActivityId(Long activityId) { this.activityId = activityId; }
     public Long getUserId() { return userId; }
     public void setUserId(Long userId) { this.userId = userId; }
-    public Long getChildId() { return childId; }
-    public void setChildId(Long childId) { this.childId = childId; }
+    public Long getMemberId() { return memberId; }
+    public void setMemberId(Long memberId) { this.memberId = memberId; }
     public String getRatings() { return ratings; }
     public void setRatings(String ratings) { this.ratings = ratings; }
     public String getComment() { return comment; }

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/ActivityProvision.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -21,7 +23,9 @@ public class ActivityProvision implements Serializable {
     private Long activityId;
     private Long buyerId;
     private Long familyId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private String status;
     private String qrCode;
     private Date checkedInAt;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/ActivityRegistration.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -13,7 +15,9 @@ public class ActivityRegistration implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
     private Long activityId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private Long userId;
     /** 报名人姓名(手动输入时必填,从家庭成员选择时自动填入) */
     private String registrantName;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/ArticleReadingRecord.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class ArticleReadingRecord implements Serializable {
 
     private Long userId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long articleId;
 

+ 4 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentAppointment.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -19,7 +20,9 @@ public class AssessmentAppointment implements Serializable {
 
     private Long userId;
     private Long familyId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     @TableField(insertStrategy = FieldStrategy.IGNORED)
     private Long teacherId;
     @TableField(insertStrategy = FieldStrategy.IGNORED)

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentExecution.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class AssessmentExecution implements Serializable {
 
     private Long quotaId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long guideId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentOrder.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -18,7 +20,9 @@ public class AssessmentOrder implements Serializable {
     private String orderNo;
     private Long familyId;
     private Long userId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private Long guideId;
     private Long packageId;
     private String guideName;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentQuota.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -19,7 +21,9 @@ public class AssessmentQuota implements Serializable {
 
     private Long familyId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long productOrderId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentRecord.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class AssessmentRecord implements Serializable {
 
     private Long familyId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long materialId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/AssessmentResult.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class AssessmentResult implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private Long teacherId;
     private Long appointmentId;
     private Integer attentionScore;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/DailyFeedback.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -19,7 +21,9 @@ public class DailyFeedback implements Serializable {
     private Long userId;
 
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 反馈日期 */
     private Date feedbackDate;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/DanAssessmentExecution.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class DanAssessmentExecution implements Serializable {
 
     private Long assessmentExecutionId;
     private Long assessmentOrderId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private Long familyId;
     private Long quotaId;
     private Long appointmentId; // 关联 assessment_appointments.id

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/DanAssessmentResult.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class DanAssessmentResult implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long familyMemberId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/EmotionAlert.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class EmotionAlert implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private String alertType;          // consecutive_low_mood / crisis_keyword / sharp_decline
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/EmotionCheckin.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class EmotionCheckin implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private String moodWeather;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyBalance.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -16,7 +18,9 @@ public class EnergyBalance implements Serializable {
     private Long id;
 
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 维度ID */
     private Long dimensionId;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/EnergyLog.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -16,7 +18,9 @@ public class EnergyLog implements Serializable {
     private Long id;
 
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 维度ID */
     private Long dimensionId;

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/FamilyChallenge.java

@@ -53,7 +53,7 @@ public class FamilyChallenge implements Serializable {
     @TableField(exist = false)
     private Integer totalProgress;
 
-    /** 非表字段:成员进度列表 [{childId, nickname, progressValue, completed}] */
+    /** 非表字段:成员进度列表 [{memberId, nickname, progressValue, completed}] */
     @TableField(exist = false)
     private List<Map<String, Object>> memberProgress;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/FamilyChallengeProgress.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class FamilyChallengeProgress implements Serializable {
 
     private Long challengeId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Integer progressValue;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/FinanceCheckin.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class FinanceCheckin implements Serializable {
 
     private Long userId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 类型: income(收入) / expense(支出) */
     private String type;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/FollowUp.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -15,7 +17,9 @@ public class FollowUp implements Serializable {
     /** 家庭ID */
     private Long familyId;
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     /** 规划师ID */
     private Long teacherId;
     /** 缺乏项ID */

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/GameRecord.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class GameRecord implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private String gameCode;
 

+ 4 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/GrowthPlan.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -16,7 +17,9 @@ public class GrowthPlan implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     @TableField(exist = false)
     private Long familyMemberId;

+ 4 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/GrowthRecord.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -16,7 +17,9 @@ public class GrowthRecord implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long familyMemberId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/GuideHierarchy.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -20,7 +22,9 @@ public class GuideHierarchy implements Serializable {
 
     private Long parentId;       // 上级成长规划师ID
 
-    private Long childId;        // 下级成长规划师ID
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId; // 下级成长规划师ID
 
     private Integer level;       // 层级深度(1表示直接下级)
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/HealthAlert.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -19,7 +21,9 @@ public class HealthAlert implements Serializable {
     private Long userId;
 
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 规则编码: R001-R006 */
     private String ruleCode;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/HealthCheckin.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class HealthCheckin implements Serializable {
 
     private Long userId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 打卡日期 */
     private Date checkinDate;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/HealthTimelineEvent.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -14,7 +16,9 @@ public class HealthTimelineEvent implements Serializable {
     private Long id;
 
     private Long userId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private String eventType;
     private String eventText;
     private String refId;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/InsurancePolicy.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class InsurancePolicy implements Serializable {
 
     private Long userId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private String policyName;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/MathChildLevel.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -14,7 +16,9 @@ public class MathChildLevel implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Integer currentLevel;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/MathQuizLog.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -14,7 +16,9 @@ public class MathQuizLog implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Integer level;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/MealLog.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.math.BigDecimal;
@@ -14,7 +16,9 @@ public class MealLog implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
     private Long userId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private String mealType;
     private Date mealDate;
     private Date mealTime;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/MentalHealthScreen.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class MentalHealthScreen implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private String screenType;         // PHQ9 / GAD7
 

+ 6 - 2
cfc-backend/src/main/java/com/etotem/cfc/entity/MicroActionRecord.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -18,8 +20,10 @@ public class MicroActionRecord implements Serializable {
     /** 用户ID */
     private Long userId;
 
-    /** 家庭成员ID (childId) */
-    private Long childId;
+    /** 家庭成员ID (memberId) */
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 行动ID (对应micro_actions.id) */
     private Long actionId;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/NutritionDeficiencyRecord.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -16,7 +18,9 @@ public class NutritionDeficiencyRecord implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Long reportId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/PointsExchangeRecord.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -13,7 +15,9 @@ public class PointsExchangeRecord implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
     private Long userId;
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     private Long familyMemberId;
     private Long productId;
     private String productName;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/PointsLog.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -15,7 +17,9 @@ public class PointsLog implements Serializable {
 @TableId(type = IdType.AUTO)
 private Long id;
 
-private Long childId;
+@TableField("child_id")
+@JsonProperty("childId")
+private Long memberId;
 
 private Long familyMemberId;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/RecommendationLog.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -22,7 +24,9 @@ public class RecommendationLog implements Serializable {
     private Long familyId;
 
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 内容类型: article/task/product/activity */
     private String contentType;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/ReferralTree.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class ReferralTree implements Serializable {
 
     private Long parentId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Integer level;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/ReportSurvey.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -25,7 +27,9 @@ public class ReportSurvey implements Serializable {
     private Long userId;
 
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     /** 调研问卷结果JSON */
     private String surveyData;

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/Reward.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -17,7 +19,9 @@ public class Reward implements Serializable {
 
     private Long familyId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private String title;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/ShoppingList.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -15,7 +17,9 @@ public class ShoppingList implements Serializable {
     /** 用户ID */
     private Long userId;
     /** 家庭成员ID */
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
     /** 健康报告ID */
     private Long reportId;
     /** 标题 */

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/SupplyHierarchy.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -19,7 +21,9 @@ public class SupplyHierarchy implements Serializable {
 
     private Long parentId;
 
-    private Long childId;
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId;
 
     private Integer level;
 

+ 6 - 2
cfc-backend/src/main/java/com/etotem/cfc/entity/Task.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -27,8 +29,10 @@ private String executorType;
 // 执行者ID (当executorType=child时对应child表ID,executorType=parent时对应user表ID)
 private Long executorId;
 
-// 保留childId字段用于兼容旧数据
-private Long childId;
+// 保留memberId字段用于兼容旧数据
+@TableField("child_id")
+@JsonProperty("childId")
+private Long memberId;
 
 private String title;
 

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/TaskPlanInstance.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -19,7 +21,9 @@ public class TaskPlanInstance implements Serializable {
 
     private Long familyId;       // 所属家庭
 
-    private Long childId;        // 适用家庭成员
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId; // 适用家庭成员
 
     private String name;         // 实例名称
 

+ 8 - 3
cfc-backend/src/main/java/com/etotem/cfc/entity/TongueRecord.java

@@ -1,16 +1,21 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.Date;
 
 @TableName("tongue_records")
 public class TongueRecord {
     @TableId(type = IdType.AUTO)
     private Long id;
+    @JsonProperty("childId")
+    private Long memberId;
+    @TableField("child_id")
+    @JsonProperty("childId")
     private Long memberId;
-    private Long childId;
     private String imageUrl;
     private String overallAssessment;
     private String status;
@@ -21,8 +26,8 @@ public class TongueRecord {
     public void setId(Long id) { this.id = id; }
     public Long getMemberId() { return memberId; }
     public void setMemberId(Long memberId) { this.memberId = memberId; }
-    public Long getChildId() { return childId; }
-    public void setChildId(Long childId) { this.childId = childId; }
+    public Long getMemberId() { return memberId; }
+    public void setMemberId(Long memberId) { this.memberId = memberId; }
     public String getImageUrl() { return imageUrl; }
     public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; }
     public String getOverallAssessment() { return overallAssessment; }

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/TrainingPlan.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -13,7 +15,9 @@ public class TrainingPlan implements Serializable {
     @TableId(type = IdType.AUTO)
     private Long id;
     private Long guideId;       // 规划师ID
-    private Long childId;       // 目标家庭成员ID
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId; // 目标家庭成员ID
     private String title;       // 方案标题
     private String description; // 方案描述
     private String status;      // draft / published / completed

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/TrainingPlanTask.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 import java.io.Serializable;
 import java.util.Date;
@@ -15,7 +17,9 @@ public class TrainingPlanTask implements Serializable {
     private Long planId;        // 方案ID
     private Long planItemId;    // 方案项目ID
     private Long taskId;        // 实际Task ID(关联tasks表)
-    private Long childId;       // 执行家庭成员
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId; // 执行家庭成员
     private String status;      // pending / completed
     private Date createdAt;
 }

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/Wish.java

@@ -1,8 +1,10 @@
 package com.etotem.cfc.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -21,7 +23,9 @@ public class Wish implements Serializable {
 
     // ========== 归属信息 ==========
     private Long familyId;
-    private Long childId;           // 目标家庭成员ID
+    @TableField("child_id")
+    @JsonProperty("childId")
+    private Long memberId; // 目标家庭成员ID
     private Long createdBy;         // 创建者用户ID
     private String creatorType;     // 创建者类型: child/parent
 

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/mapper/ArticleReadingRecordMapper.java

@@ -15,7 +15,7 @@ public interface ArticleReadingRecordMapper extends BaseMapper<ArticleReadingRec
 
     @Select("SELECT COALESCE(SUM(duration_seconds), 0) FROM article_reading_records " +
             "WHERE child_id = #{childId} AND read_at >= #{since}")
-    Integer selectTotalDurationByChildSince(@Param("childId") Long childId,
+    Integer selectTotalDurationByChildSince(@Param("childId") Long memberId,
                                             @Param("since") java.util.Date since);
 
     /**
@@ -56,5 +56,5 @@ public interface ArticleReadingRecordMapper extends BaseMapper<ArticleReadingRec
             "WHERE r.child_id = #{childId} AND r.reading_completed = 1 " +
             "AND EXISTS (SELECT 1 FROM article_quiz_records q " +
             "            WHERE q.article_id = r.article_id AND q.member_id = r.child_id AND q.cf_earned > 0)")
-    List<Long> selectCompletedArticleIdsByChild(@Param("childId") Long childId);
+    List<Long> selectCompletedArticleIdsByChild(@Param("childId") Long memberId);
 }

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/mapper/EmotionCheckinMapper.java

@@ -12,8 +12,8 @@ import java.util.List;
 public interface EmotionCheckinMapper extends BaseMapper<EmotionCheckin> {
 
     @Select("SELECT * FROM emotion_checkin WHERE child_id = #{childId} ORDER BY checkin_date DESC LIMIT #{limit}")
-    List<EmotionCheckin> selectLatestByChildId(@Param("childId") Long childId, @Param("limit") int limit);
+    List<EmotionCheckin> selectLatestByMemberId(@Param("childId") Long memberId, @Param("limit") int limit);
 
     @Select("SELECT * FROM emotion_checkin WHERE child_id = #{childId} AND checkin_date = #{checkinDate} LIMIT 1")
-    EmotionCheckin selectByChildIdAndDate(@Param("childId") Long childId, @Param("checkinDate") java.util.Date checkinDate);
+    EmotionCheckin selectByMemberIdAndDate(@Param("childId") Long memberId, @Param("checkinDate") java.util.Date checkinDate);
 }

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/mapper/GameRecordMapper.java

@@ -15,7 +15,7 @@ public interface GameRecordMapper extends BaseMapper<GameRecord> {
     @Select("SELECT game_code, MAX(score) as best_score, COUNT(*) as total_plays, " +
             "SUM(points_earned) as total_points " +
             "FROM game_records WHERE child_id = #{childId} GROUP BY game_code")
-    List<Map<String, Object>> selectBestScoresByChild(@Param("childId") Long childId);
+    List<Map<String, Object>> selectBestScoresByChild(@Param("childId") Long memberId);
 
     @Select("SELECT gr.*, fm.nickname as child_name " +
             "FROM game_records gr LEFT JOIN family_members fm ON gr.child_id = fm.id " +

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/mapper/MemberBadgeMapper.java

@@ -16,13 +16,13 @@ public interface MemberBadgeMapper extends BaseMapper<MemberBadge> {
             "JOIN badge b ON cb.badge_id = b.id " +
             "WHERE cb.child_id = #{childId} AND cb.status = 1 " +
             "GROUP BY b.category")
-    List<Map<String, Object>> selectCategoryStats(@Param("childId") Long childId);
+    List<Map<String, Object>> selectCategoryStats(@Param("childId") Long memberId);
 
     @Select("SELECT b.level, COUNT(*) as count FROM child_badge cb " +
             "JOIN badge b ON cb.badge_id = b.id " +
             "WHERE cb.child_id = #{childId} AND cb.status = 1 " +
             "GROUP BY b.level")
-    List<Map<String, Object>> selectLevelStats(@Param("childId") Long childId);
+    List<Map<String, Object>> selectLevelStats(@Param("childId") Long memberId);
 
     @Select("SELECT cb.child_id, COUNT(*) as total FROM child_badge cb " +
             "WHERE cb.child_id IN (SELECT id FROM family_members WHERE family_id = #{familyId}) " +

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/mapper/TrainingPlanMapper.java

@@ -15,7 +15,7 @@ public interface TrainingPlanMapper extends BaseMapper<TrainingPlan> {
     List<TrainingPlan> selectByGuideId(@Param("guideId") Long guideId);
 
     @Select("SELECT * FROM training_plans WHERE guide_id = #{guideId} AND child_id = #{childId} ORDER BY created_at DESC")
-    List<TrainingPlan> selectByGuideIdAndChildId(@Param("guideId") Long guideId, @Param("childId") Long childId);
+    List<TrainingPlan> selectByGuideIdAndMemberId(@Param("guideId") Long guideId, @Param("childId") Long memberId);
 
     @Select("SELECT * FROM training_plan_items WHERE plan_id = #{planId} ORDER BY sequence ASC")
     List<TrainingPlanItem> selectItemsByPlanId(@Param("planId") Long planId);

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/AIService.java

@@ -561,7 +561,7 @@ try {
      */
     public String buildMindContextPrompt(Long memberId) {
         // Get latest 7 checkins
-        List<EmotionCheckin> recent = emotionCheckinMapper.selectLatestByChildId(memberId, 7);
+        List<EmotionCheckin> recent = emotionCheckinMapper.selectLatestByMemberId(memberId, 7);
         if (recent == null || recent.isEmpty()) {
             return "用户暂无情绪打卡记录。";
         }

+ 4 - 4
cfc-backend/src/main/java/com/etotem/cfc/service/ActivityFeedbackService.java

@@ -45,15 +45,15 @@ public class ActivityFeedbackService {
         boolean hasCheckedIn = taskMapper.selectCount(new LambdaQueryWrapper<com.etotem.cfc.entity.Task>()
                 .eq(com.etotem.cfc.entity.Task::getSourceType, "activity")
                 .eq(com.etotem.cfc.entity.Task::getSourceId, activityId)
-                .eq(com.etotem.cfc.entity.Task::getChildId, memberId)
+                .eq(com.etotem.cfc.entity.Task::getMemberId, memberId)
                 .eq(com.etotem.cfc.entity.Task::getStatus, "completed")) > 0;
         if (!hasCheckedIn) {
             return Result.error("请先完成签到后再评价");
         }
-        // Dedup: 同一 activityId + childId 只保留一条;重复提交则更新
+        // Dedup: 同一 activityId + memberId 只保留一条;重复提交则更新
         ActivityFeedback existing = activityFeedbackMapper.selectOne(new LambdaQueryWrapper<ActivityFeedback>()
                 .eq(ActivityFeedback::getActivityId, activityId)
-                .eq(ActivityFeedback::getChildId, memberId)
+                .eq(ActivityFeedback::getMemberId, memberId)
                 .last("LIMIT 1"));
         ActivityFeedback feedback;
         if (existing != null) {
@@ -67,7 +67,7 @@ public class ActivityFeedbackService {
             feedback = new ActivityFeedback();
             feedback.setActivityId(activityId);
             feedback.setUserId(userId);
-            feedback.setChildId(memberId);
+            feedback.setMemberId(memberId);
             feedback.setRatings(ratings);
             feedback.setComment(comment);
             feedback.setStatus(1);

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/service/ActivityOrderService.java

@@ -318,7 +318,7 @@ public class ActivityOrderService {
             ActivityRegistration ar = new ActivityRegistration();
             ar.setActivityId(activityId);
             ar.setUserId(userId);
-            ar.setChildId(memberId);
+            ar.setMemberId(memberId);
             ar.setRegistrantName((String) item.get("name"));
             ar.setRegistrantPhone((String) item.get("phone"));
             ar.setStatus(status);
@@ -334,7 +334,7 @@ public class ActivityOrderService {
     private boolean isRegistered(Long activityId, Long memberId) {
         return registrationMapper.selectOne(new LambdaQueryWrapper<ActivityRegistration>()
             .eq(ActivityRegistration::getActivityId, activityId)
-            .eq(ActivityRegistration::getChildId, memberId)
+            .eq(ActivityRegistration::getMemberId, memberId)
             .in(ActivityRegistration::getStatus, "pending", "approved").last("LIMIT 1")) != null;
     }
 

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/ActivityProvisionService.java

@@ -99,7 +99,7 @@ public class ActivityProvisionService {
         if (!"provisioned".equals(provision.getStatus())) {
             return Result.error("当前状态不允许签到");
         }
-        provision.setChildId(memberId);
+        provision.setMemberId(memberId);
         provision.setCheckedInAt(new Date());
         provision.setStatus("signed_in");
         provision.setUpdatedAt(new Date());

+ 14 - 14
cfc-backend/src/main/java/com/etotem/cfc/service/ActivityRegistrationService.java

@@ -68,7 +68,7 @@ public class ActivityRegistrationService {
                 }
             }
             ActivityRegistration ar = new ActivityRegistration();
-            ar.setActivityId(activityId); ar.setUserId(userId); ar.setChildId(memberId);
+            ar.setActivityId(activityId); ar.setUserId(userId); ar.setMemberId(memberId);
             ar.setRegistrantName(name.trim()); ar.setRegistrantPhone(phone != null ? phone.trim() : null);
             ar.setStatus(needReview ? "pending" : "approved"); ar.setRegisteredAt(LocalDateTime.now());
             ar.setCreatedAt(LocalDateTime.now()); ar.setUpdatedAt(LocalDateTime.now());
@@ -104,7 +104,7 @@ public class ActivityRegistrationService {
             }
         }
         ActivityRegistration reg = new ActivityRegistration();
-        reg.setActivityId(activityId); reg.setUserId(userId); reg.setChildId(memberId);
+        reg.setActivityId(activityId); reg.setUserId(userId); reg.setMemberId(memberId);
         reg.setStatus(needReview ? "pending" : "approved"); reg.setRegisteredAt(LocalDateTime.now());
         reg.setCreatedAt(LocalDateTime.now()); reg.setUpdatedAt(LocalDateTime.now());
         if (!needReview) {
@@ -121,7 +121,7 @@ public class ActivityRegistrationService {
     public Result<Void> cancel(Long activityId, Long userId, Long memberId) {
         ActivityRegistration reg = registrationMapper.selectOne(new LambdaQueryWrapper<ActivityRegistration>()
                 .eq(ActivityRegistration::getActivityId, activityId)
-                .eq(ActivityRegistration::getChildId, memberId)
+                .eq(ActivityRegistration::getMemberId, memberId)
                 .eq(ActivityRegistration::getUserId, userId)
                 .in(ActivityRegistration::getStatus, "pending", "approved")
                 .last("LIMIT 1"));
@@ -226,8 +226,8 @@ public class ActivityRegistrationService {
         if (userId != null) wrapper.eq(ActivityRegistration::getUserId, userId);
         if (memberId != null) {
             // 手动录入的报名 child_id 为 NULL,也属于该用户,需一并返回
-            wrapper.and(w -> w.eq(ActivityRegistration::getChildId, memberId)
-                .or().isNull(ActivityRegistration::getChildId));
+            wrapper.and(w -> w.eq(ActivityRegistration::getMemberId, memberId)
+                .or().isNull(ActivityRegistration::getMemberId));
         }
         // 小程序「我的活动」筛选芯片:全部/待开始/待审核(pending)/已签到(checked_in)。
         // 原实现完全忽略 status,导致「待审核」「已签到」筛选失效(后端返回全部状态)。
@@ -241,7 +241,7 @@ public class ActivityRegistrationService {
         List<Map<String, Object>> records = pageResult.getRecords().stream().map(reg -> {
             Map<String, Object> item = new HashMap<>();
             item.put("id", reg.getId()); item.put("activityId", reg.getActivityId());
-            item.put("memberId", reg.getChildId()); item.put("status", reg.getStatus());
+            item.put("memberId", reg.getMemberId()); item.put("status", reg.getStatus());
             item.put("registrantName", reg.getRegistrantName());
             item.put("registrantPhone", reg.getRegistrantPhone());
             item.put("registeredAt", reg.getRegisteredAt());
@@ -276,7 +276,7 @@ public class ActivityRegistrationService {
         List<ActivityRegistration> list = registrationMapper.selectList(wrapper);
         List<Map<String, Object>> result = list.stream().map(reg -> {
             Map<String, Object> item = new HashMap<>();
-            item.put("id", reg.getId()); item.put("memberId", reg.getChildId());
+            item.put("id", reg.getId()); item.put("memberId", reg.getMemberId());
             item.put("userId", reg.getUserId()); item.put("status", reg.getStatus());
             item.put("registrantName", reg.getRegistrantName());
             item.put("registrantPhone", reg.getRegistrantPhone());
@@ -360,7 +360,7 @@ public class ActivityRegistrationService {
             item.put("id", reg.getId());
             item.put("activityId", reg.getActivityId());
             item.put("activityTitle", reg.getActivityId() != null ? titleMap.get(reg.getActivityId()) : null);
-            item.put("memberId", reg.getChildId());
+            item.put("memberId", reg.getMemberId());
             item.put("userId", reg.getUserId());
             item.put("status", reg.getStatus());
             item.put("registrantName", reg.getRegistrantName());
@@ -394,12 +394,12 @@ public class ActivityRegistrationService {
         return map.getOrDefault(activityId, "not_registered");
     }
 
-    public List<Long> getChildIdsByUser(Long userId) {
+    public List<Long> getMemberIdsByUser(Long userId) {
         if (userId == null) return new ArrayList<>();
         return registrationMapper.selectList(new LambdaQueryWrapper<ActivityRegistration>()
             .eq(ActivityRegistration::getUserId, userId)
-            .isNotNull(ActivityRegistration::getChildId))
-            .stream().map(ActivityRegistration::getChildId).distinct().collect(Collectors.toList());
+            .isNotNull(ActivityRegistration::getMemberId))
+            .stream().map(ActivityRegistration::getMemberId).distinct().collect(Collectors.toList());
     }
 
     private int rank(String status) {
@@ -434,14 +434,14 @@ public class ActivityRegistrationService {
     public boolean isRegistered(Long activityId, Long memberId) {
         return registrationMapper.selectOne(new LambdaQueryWrapper<ActivityRegistration>()
             .eq(ActivityRegistration::getActivityId, activityId)
-            .eq(ActivityRegistration::getChildId, memberId)
+            .eq(ActivityRegistration::getMemberId, memberId)
             .in(ActivityRegistration::getStatus, "pending", "approved").last("LIMIT 1")) != null;
     }
 
     public boolean isApproved(Long activityId, Long memberId) {
         return registrationMapper.selectOne(new LambdaQueryWrapper<ActivityRegistration>()
             .eq(ActivityRegistration::getActivityId, activityId)
-            .eq(ActivityRegistration::getChildId, memberId)
+            .eq(ActivityRegistration::getMemberId, memberId)
             .eq(ActivityRegistration::getStatus, "approved").last("LIMIT 1")) != null;
     }
 
@@ -471,7 +471,7 @@ public class ActivityRegistrationService {
     private ActivityRegistration findRegistration(Long activityId, Long memberId, Long userId, String status) {
         LambdaQueryWrapper<ActivityRegistration> wrapper = new LambdaQueryWrapper<ActivityRegistration>()
             .eq(ActivityRegistration::getActivityId, activityId)
-            .eq(ActivityRegistration::getChildId, memberId)
+            .eq(ActivityRegistration::getMemberId, memberId)
             .eq(ActivityRegistration::getUserId, userId);
         if (status != null) wrapper.eq(ActivityRegistration::getStatus, status);
         wrapper.last("LIMIT 1");

+ 14 - 14
cfc-backend/src/main/java/com/etotem/cfc/service/ActivityService.java

@@ -110,12 +110,12 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
         Set<Long> checkedInActivityIds = new HashSet<>();
         if (effectiveUserId != null && !activityIds.isEmpty()) {
             regStatusMap = registrationService.getRegistrationStatusMap(activityIds, effectiveUserId);
-            List<Long> childIds = registrationService.getChildIdsByUser(effectiveUserId);
-            if (!childIds.isEmpty()) {
+            List<Long> memberIds = registrationService.getMemberIdsByUser(effectiveUserId);
+            if (!memberIds.isEmpty()) {
                 checkedInActivityIds = taskMapper.selectList(new LambdaQueryWrapper<Task>()
                     .eq(Task::getSourceType, "activity")
                     .in(Task::getSourceId, activityIds)
-                    .in(Task::getChildId, childIds)
+                    .in(Task::getMemberId, memberIds)
                     .eq(Task::getStatus, "completed"))
                     .stream().map(Task::getSourceId).collect(Collectors.toSet());
             }
@@ -329,12 +329,12 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
             }
         }
 
-        // 4. Check if already checked in (dedup by sourceType + sourceId + childId)
+        // 4. Check if already checked in (dedup by sourceType + sourceId + memberId)
         Task existingTask = taskMapper.selectOne(
             new LambdaQueryWrapper<Task>()
                 .eq(Task::getSourceType, "activity")
                 .eq(Task::getSourceId, activityId)
-                .eq(Task::getChildId, memberId)
+                .eq(Task::getMemberId, memberId)
                 .last("LIMIT 1")
         );
         if (existingTask != null) {
@@ -366,7 +366,7 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
         task.setCreatorId(userId);
         task.setExecutorType("child"); // 非登录用户(不可登录成员)
         task.setExecutorId(memberId);
-        task.setChildId(memberId);
+        task.setMemberId(memberId);
         task.setTitle("活动签到: " + activity.getTitle());
         task.setDescription("自动生成 - 签到活动《" + activity.getTitle() + "》");
         task.setPoints(points);
@@ -428,7 +428,7 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
         }
         // 积分流水
         PointsLog pointsLog = new PointsLog();
-        pointsLog.setChildId(task.getChildId());
+        pointsLog.setMemberId(task.getMemberId());
         pointsLog.setTaskId(task.getId());
         pointsLog.setAmount(points);
         pointsLog.setType("earn");
@@ -438,11 +438,11 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
         pointsLogMapper.insert(pointsLog);
         // 发放能量
         try {
-            energyService.awardEnergy(task.getChildId(), "activity", activity.getId(), points,
+            energyService.awardEnergy(task.getMemberId(), "activity", activity.getId(), points,
                 "活动签到: " + activity.getTitle(), null);
         } catch (Exception e) {
-            log.warn("能量发放失败(不影响积分): childId={}, activityId={}, error={}",
-                task.getChildId(), activity.getId(), e.getMessage());
+            log.warn("能量发放失败(不影响积分): memberId={}, activityId={}, error={}",
+                task.getMemberId(), activity.getId(), e.getMessage());
         }
         // 活动下发 CF 值(F05 统一账本:数量取活动配置 activities.platform_points,幂等键:签到记录 ID)
         if (activity.getPlatformPoints() != null && activity.getPlatformPoints() > 0 && userId != null) {
@@ -467,7 +467,7 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
         Map<String, Object> result = new HashMap<>();
         if (approve) {
             Activity activity = this.getById(task.getSourceId());
-            FamilyMember child = task.getChildId() != null ? familyMemberMapper.selectById(task.getChildId()) : null;
+            FamilyMember child = task.getMemberId() != null ? familyMemberMapper.selectById(task.getMemberId()) : null;
             task.setStatus("completed");
             task.setCompletedAt(new Date());
             task.setUpdatedAt(new Date());
@@ -612,14 +612,14 @@ public class ActivityService extends ServiceImpl<ActivityMapper, Activity> {
     }
 
     private boolean hasCheckedIn(Long activityId, Long userId) {
-        List<Long> childIds = registrationService.getChildIdsByUser(userId);
-        if (childIds.isEmpty()) {
+        List<Long> memberIds = registrationService.getMemberIdsByUser(userId);
+        if (memberIds.isEmpty()) {
             return false;
         }
         return taskMapper.selectCount(new LambdaQueryWrapper<Task>()
                 .eq(Task::getSourceType, "activity")
                 .eq(Task::getSourceId, activityId)
-                .in(Task::getChildId, childIds)
+                .in(Task::getMemberId, memberIds)
                 .eq(Task::getStatus, "completed")) > 0;
     }
 

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/service/AiContextService.java

@@ -53,7 +53,7 @@ public class AiContextService {
      *
      * @param intentType 意图类型:health_report / task_progress / child_info / emotion_status / user_identity / user_facts
      * @param userId     当前用户ID
-     * @param params     可选参数(如 childId、reportId 等)
+     * @param params     可选参数(如 memberId、reportId 等)
      * @return Dify 格式的上下文数据
      */
     public Map<String, Object> getContext(String intentType, Long userId, Map<String, Object> params) {
@@ -251,7 +251,7 @@ public class AiContextService {
 
         List<EmotionCheckin> recentCheckins = emotionCheckinMapper.selectList(
             new LambdaQueryWrapper<EmotionCheckin>()
-                .eq(EmotionCheckin::getChildId, userId)
+                .eq(EmotionCheckin::getMemberId, userId)
                 .orderByDesc(EmotionCheckin::getCreatedAt)
                 .last("LIMIT " + days)
         );

+ 7 - 7
cfc-backend/src/main/java/com/etotem/cfc/service/ArticleService.java

@@ -422,7 +422,7 @@ public class ArticleService {
         ArticleReadingRecord record = new ArticleReadingRecord();
         record.setArticleId(articleId);
         record.setUserId(userId);
-        record.setChildId(memberId);
+        record.setMemberId(memberId);
         record.setContent("");
         record.setDurationSeconds(durationSeconds);
         int minSeconds = getArticleReadingMinSeconds();
@@ -455,7 +455,7 @@ public class ArticleService {
                 new LambdaQueryWrapper<Task>()
                         .eq(Task::getSourceType, "article")
                         .eq(Task::getSourceId, articleId)
-                        .eq(Task::getChildId, memberId)
+                        .eq(Task::getMemberId, memberId)
                         .last("LIMIT 1")
         );
         if (existingTask != null) {
@@ -486,7 +486,7 @@ public class ArticleService {
         task.setCreatorId(userId);
         task.setExecutorType("child"); // 非登录用户(不可登录成员)
         task.setExecutorId(memberId);
-        task.setChildId(memberId);
+        task.setMemberId(memberId);
         task.setTitle("阅读文章: " + article.getTitle());
         task.setDescription("自动生成 - 阅读文章《" + article.getTitle() + "》" + durationSeconds + "秒");
         task.setPoints(points);
@@ -526,7 +526,7 @@ public class ArticleService {
 
         // 10. Insert PointsLog
         PointsLog pointsLog = new PointsLog();
-        pointsLog.setChildId(memberId);
+        pointsLog.setMemberId(memberId);
         pointsLog.setTaskId(task.getId());
         pointsLog.setAmount(points);
         pointsLog.setType("earn");
@@ -561,7 +561,7 @@ public class ArticleService {
         // 查找当日已有记录(同文章+同家庭成员)
         LambdaQueryWrapper<ArticleReadingRecord> wrapper = new LambdaQueryWrapper<ArticleReadingRecord>()
                 .eq(ArticleReadingRecord::getArticleId, articleId)
-                .eq(ArticleReadingRecord::getChildId, memberId)
+                .eq(ArticleReadingRecord::getMemberId, memberId)
                 .apply("DATE(read_at) = CURDATE()")
                 .last("LIMIT 1");
         ArticleReadingRecord existing = articleReadingRecordMapper.selectOne(wrapper);
@@ -585,7 +585,7 @@ public class ArticleService {
             ArticleReadingRecord record = new ArticleReadingRecord();
             record.setArticleId(articleId);
             record.setUserId(userId);
-            record.setChildId(memberId);
+            record.setMemberId(memberId);
             record.setDurationSeconds(durationSeconds);
             record.setReadingCompleted(durationSeconds >= minSeconds);
             record.setReadAt(new Date());
@@ -934,7 +934,7 @@ public class ArticleService {
         if (totalDuration == null) totalDuration = 0;
 
         LambdaQueryWrapper<ArticleReadingRecord> countWrapper = new LambdaQueryWrapper<ArticleReadingRecord>()
-                .eq(ArticleReadingRecord::getChildId, memberId)
+                .eq(ArticleReadingRecord::getMemberId, memberId)
                 .ge(ArticleReadingRecord::getReadAt, since);
         Integer totalArticles = Math.toIntExact(articleReadingRecordMapper.selectCount(countWrapper));
 

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentAppointmentService.java

@@ -30,7 +30,7 @@ public class AssessmentAppointmentService extends ServiceImpl<AssessmentAppointm
 
         AssessmentAppointment appointment = new AssessmentAppointment();
         appointment.setUserId(userId);
-        appointment.setChildId(memberId);
+        appointment.setMemberId(memberId);
         appointment.setGuideId(guideId);
         appointment.setAssessorId(assessorId);
         appointment.setPackageId(packageId);
@@ -75,7 +75,7 @@ public class AssessmentAppointmentService extends ServiceImpl<AssessmentAppointm
 
         if (updated) {
             try {
-                energyService.awardEnergy(appointment.getChildId(), "appointment", appointment.getId(), 30,
+                energyService.awardEnergy(appointment.getMemberId(), "appointment", appointment.getId(), 30,
                         "完成测评", null);
             } catch (Exception e) {
                 log.warn("测评完成能量发放失败: appointmentId={}, error={}", id, e.getMessage());
@@ -119,7 +119,7 @@ public class AssessmentAppointmentService extends ServiceImpl<AssessmentAppointm
 
     public AssessmentAppointment confirmAppointmentByOrder(AssessmentOrder order) {
         AssessmentAppointment appointment = new AssessmentAppointment();
-        appointment.setChildId(order.getChildId());
+        appointment.setMemberId(order.getMemberId());
         appointment.setGuideId(order.getGuideId());
         appointment.setStatus(0); // pending
         appointment.setUserId(order.getUserId());

+ 2 - 2
cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentComparisonService.java

@@ -86,7 +86,7 @@ public class AssessmentComparisonService {
     public CompareResult compareByChild(Long memberId) {
         List<DanAssessmentResult> results = danAssessmentResultMapper.selectList(
                 new LambdaQueryWrapper<DanAssessmentResult>()
-                        .eq(DanAssessmentResult::getChildId, memberId)
+                        .eq(DanAssessmentResult::getMemberId, memberId)
                         .eq(DanAssessmentResult::getStatus, "completed")
                         .orderByAsc(DanAssessmentResult::getAssessmentDate)
         );
@@ -111,7 +111,7 @@ public class AssessmentComparisonService {
     public DimensionDelta compareByChildAndDimension(Long memberId, String dimensionCode) {
         List<DanAssessmentResult> results = danAssessmentResultMapper.selectList(
                 new LambdaQueryWrapper<DanAssessmentResult>()
-                        .eq(DanAssessmentResult::getChildId, memberId)
+                        .eq(DanAssessmentResult::getMemberId, memberId)
                         .eq(DanAssessmentResult::getStatus, "completed")
                         .orderByAsc(DanAssessmentResult::getAssessmentDate)
         );

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentExecutionService.java

@@ -20,7 +20,7 @@ public class AssessmentExecutionService {
     public AssessmentExecution create(Long quotaId, Long memberId, Long appointmentId) {
         AssessmentExecution exec = new AssessmentExecution();
         exec.setQuotaId(quotaId);
-        exec.setChildId(memberId);
+        exec.setMemberId(memberId);
         exec.setAppointmentId(appointmentId);
         exec.setStatus("pending");
         exec.setCreatedAt(new Date());
@@ -46,9 +46,9 @@ public class AssessmentExecutionService {
                 .eq(AssessmentExecution::getAppointmentId, appointmentId));
     }
 
-    public List<AssessmentExecution> getByChildId(Long memberId) {
+    public List<AssessmentExecution> getByMemberId(Long memberId) {
         return mapper.selectList(new LambdaQueryWrapper<AssessmentExecution>()
-                .eq(AssessmentExecution::getChildId, memberId)
+                .eq(AssessmentExecution::getMemberId, memberId)
                 .orderByDesc(AssessmentExecution::getCreatedAt));
     }
 }

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentOrderService.java

@@ -45,7 +45,7 @@ public class AssessmentOrderService extends ServiceImpl<AssessmentOrderMapper, A
         order.setOrderNo(generateOrderNo());
         order.setFamilyId(familyId);
         order.setUserId(userId);
-        order.setChildId(memberId);
+        order.setMemberId(memberId);
         order.setGuideId(guideId);
         order.setPackageId(packageId);
         order.setGuideName(guideName);
@@ -232,7 +232,7 @@ public class AssessmentOrderService extends ServiceImpl<AssessmentOrderMapper, A
             log.info("发货推送重复通知,订单已终态: orderNo={}, status={}", orderNo, order.getStatus());
             return true;
         }
-        // 兜底关联:订单无 appointmentId 时按 familyId+childId 找最近待确认预约(spec 计划 Step 3 二选一)
+        // 兜底关联:订单无 appointmentId 时按 familyId+memberId 找最近待确认预约(spec 计划 Step 3 二选一)
         if (order.getAppointmentId() == null) {
             linkLatestPendingAppointment(order);
         }
@@ -248,7 +248,7 @@ public class AssessmentOrderService extends ServiceImpl<AssessmentOrderMapper, A
         try {
             LambdaQueryWrapper<AssessmentAppointment> wrapper = new LambdaQueryWrapper<>();
             wrapper.eq(AssessmentAppointment::getFamilyId, order.getFamilyId())
-                   .eq(AssessmentAppointment::getChildId, order.getChildId())
+                   .eq(AssessmentAppointment::getMemberId, order.getMemberId())
                    .eq(AssessmentAppointment::getStatus, 0)
                    .orderByDesc(AssessmentAppointment::getCreatedAt)
                    .last("LIMIT 1");

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/AssessmentPlanGenerator.java

@@ -68,7 +68,7 @@ public class AssessmentPlanGenerator {
                                 Set<Long> templateIds, Map<String, Integer> scores) {
         TaskPlanInstance plan = new TaskPlanInstance();
         plan.setFamilyId(familyId);
-        plan.setChildId(memberId);
+        plan.setMemberId(memberId);
         plan.setName("DAN测评方案 - " + new java.text.SimpleDateFormat("yyyyMMdd").format(new Date()));
         plan.setStatus("generated");
         plan.setSource("assessment");

Некоторые файлы не были показаны из-за большого количества измененных файлов