|
@@ -3443,6 +3443,8 @@ insertSysConfigSeed("gift_membership_pay_price", "198000", "送会员商品达
|
|
|
migrateUnifiedIndicatorTreeColumns();
|
|
migrateUnifiedIndicatorTreeColumns();
|
|
|
// 迁移447: 统一维度体系(P0-T3)—— 固化 5 根 + 7 body 子维度节点(幂等 seed)
|
|
// 迁移447: 统一维度体系(P0-T3)—— 固化 5 根 + 7 body 子维度节点(幂等 seed)
|
|
|
seedUnifiedDimensionRegistry();
|
|
seedUnifiedDimensionRegistry();
|
|
|
|
|
+ // 迁移448: 统一维度体系(增量)—— 另外 4 根 33 子维 + 5 根五行归属(幂等 seed,仅追加,不改动 445-447)
|
|
|
|
|
+ seedUnifiedDimensionRegistryExpansion();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -15169,6 +15171,83 @@ log.info("迁移298: 已为无 openid 的 child 账号补齐 family_members 记
|
|
|
log.info("迁移447: 统一维度注册中心 5 根 + 7 body 子维度 seed 完成");
|
|
log.info("迁移447: 统一维度注册中心 5 根 + 7 body 子维度 seed 完成");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 迁移448: 统一维度体系(增量)—— 固化另外 4 根(mind/wisdom/action/wealth)的 33 个子维度节点,
|
|
|
|
|
+ * 并补 5 根节点的五行归属(wuxing_rule_ref)。幂等 seed,仅追加,不改动 445-447。
|
|
|
|
|
+ * 子维 code = {root}.{key},legacy_alias = 后端 API 取数字段名(供 P1 健康页雷达按配置取数)。
|
|
|
|
|
+ */
|
|
|
|
|
+ void seedUnifiedDimensionRegistryExpansion() {
|
|
|
|
|
+ // 4 根 id(body 的 7 子维已在迁移447 固化;此处覆盖其余 4 根)
|
|
|
|
|
+ Long mindId = queryDimensionIdByCode("mind");
|
|
|
|
|
+ Long wisdomId = queryDimensionIdByCode("wisdom");
|
|
|
|
|
+ Long actionId = queryDimensionIdByCode("action");
|
|
|
|
|
+ Long wealthId = queryDimensionIdByCode("wealth");
|
|
|
|
|
+
|
|
|
|
|
+ // —— mind 心/心理(10,source_system='emi')——
|
|
|
|
|
+ if (mindId != null) {
|
|
|
|
|
+ upsertDimensionSeed("mind.openness", "开放性", "emi", mindId, 1, "emi", "sub", "[\"opennessScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.conscientiousness", "尽责性", "emi", mindId, 2, "emi", "sub", "[\"conscientiousnessScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.extraversion", "外向性", "emi", mindId, 3, "emi", "sub", "[\"extraversionScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.agreeableness", "宜人性", "emi", mindId, 4, "emi", "sub", "[\"agreeablenessScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.neuroticism", "神经质", "emi", mindId, 5, "emi", "sub", "[\"neuroticismScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.driveAutonomy", "自主性", "emi", mindId, 6, "emi", "sub", "[\"driveAutonomy\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.driveCompetence", "胜任感", "emi", mindId, 7, "emi", "sub", "[\"driveCompetence\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.driveRelatedness", "归属感", "emi", mindId, 8, "emi", "sub", "[\"driveRelatedness\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.emotionStability", "情绪稳定性", "emi", mindId, 9, "emi", "sub", "[\"emotionStability\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("mind.selfConceptOverall", "自我概念", "emi", mindId, 10, "emi", "sub", "[\"selfConceptOverall\"]", null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("迁移448: 未找到 mind 根节点 id,跳过 mind 子维度 seed");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // —— wisdom 智/认知(7,source_system='cognitive')——
|
|
|
|
|
+ if (wisdomId != null) {
|
|
|
|
|
+ upsertDimensionSeed("wisdom.memory", "记忆力", "cognitive", wisdomId, 1, "cognitive", "sub", "[\"memoryScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wisdom.attention", "注意力", "cognitive", wisdomId, 2, "cognitive", "sub", "[\"attentionScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wisdom.logic", "逻辑推理", "cognitive", wisdomId, 3, "cognitive", "sub", "[\"logicScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wisdom.spatial", "空间想象", "cognitive", wisdomId, 4, "cognitive", "sub", "[\"spatialScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wisdom.perception", "感知能力", "cognitive", wisdomId, 5, "cognitive", "sub", "[\"perceptionScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wisdom.focus", "专注力", "cognitive", wisdomId, 6, "cognitive", "sub", "[\"focusScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wisdom.processingSpeed", "加工速度", "cognitive", wisdomId, 7, "cognitive", "sub", "[\"processingSpeedScore\"]", null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("迁移448: 未找到 wisdom 根节点 id,跳过 wisdom 子维度 seed");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // —— action 社会性(5,source_system='relationship')——
|
|
|
|
|
+ if (actionId != null) {
|
|
|
|
|
+ upsertDimensionSeed("action.parentTrust", "亲子信任", "relationship", actionId, 1, "relationship", "sub", "[\"trustScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("action.parentIntimacy", "亲子亲密度", "relationship", actionId, 2, "relationship", "sub", "[\"intimacyScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("action.communication", "沟通质量", "relationship", actionId, 3, "relationship", "sub", "[\"communicationScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("action.healthStatus", "关系健康度", "relationship", actionId, 4, "relationship", "sub", "[\"totalScore\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("action.lastInteraction", "最近互动", "relationship", actionId, 5, "relationship", "sub", "[\"lastInteractionAt\"]", null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("迁移448: 未找到 action 根节点 id,跳过 action 子维度 seed");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // —— wealth 富(4,source_system='energy')——
|
|
|
|
|
+ if (wealthId != null) {
|
|
|
|
|
+ upsertDimensionSeed("wealth.skill", "个人能力", "energy", wealthId, 1, "energy", "sub", "[\"wealthSkill\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wealth.altruism", "利他贡献", "energy", wealthId, 2, "energy", "sub", "[\"wealthAltruism\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wealth.income", "CF值积累", "energy", wealthId, 3, "energy", "sub", "[\"wealthIncome\"]", null);
|
|
|
|
|
+ upsertDimensionSeed("wealth.fx", "财务素养", "energy", wealthId, 4, "energy", "sub", "[\"wealthFx\"]", null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("迁移448: 未找到 wealth 根节点 id,跳过 wealth 子维度 seed");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 补 5 根五行归属:按 energy_dimension.element 填 wuxing_rule_ref(idempotent,仅当为空时填)
|
|
|
|
|
+ try {
|
|
|
|
|
+ jdbcTemplate.update(
|
|
|
|
|
+ "UPDATE product_dimension_config pdc "
|
|
|
|
|
+ + "JOIN energy_dimension ed ON ed.code = pdc.dimension_code "
|
|
|
|
|
+ + "SET pdc.wuxing_rule_ref = COALESCE(pdc.wuxing_rule_ref, ed.element) "
|
|
|
|
|
+ + "WHERE pdc.dimension_code IN ('body','mind','wisdom','action','wealth') "
|
|
|
|
|
+ + "AND ed.element IS NOT NULL");
|
|
|
|
|
+ log.info("迁移448: 5 根五行归属 wuxing_rule_ref 已按 energy_dimension.element 补齐");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.warn("迁移448: 5 根五行归属补齐失败(忽略): {}", e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("迁移448: 统一维度注册中心增量 seed 完成(mind10/wisdom7/action5/wealth4 共33子维)");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/** 幂等 upsert 维度种子:按 dimension_code 存在则补 source_system/legacy_alias,不存在则插入。 */
|
|
/** 幂等 upsert 维度种子:按 dimension_code 存在则补 source_system/legacy_alias,不存在则插入。 */
|
|
|
private void upsertDimensionSeed(String code, String name, String dimensionType, Long parentId,
|
|
private void upsertDimensionSeed(String code, String name, String dimensionType, Long parentId,
|
|
|
int sort, String sourceSystem, String nodeKind,
|
|
int sort, String sourceSystem, String nodeKind,
|