You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
# 02 · 字典前置:job_title 预置 + contact_source 分组
|
|
|
|
|
|
|
|
|
|
- **Type:** task
|
|
|
|
|
- **Status:** resolved
|
|
|
|
|
- **Blocked by:** 01
|
|
|
|
|
|
|
|
|
|
## Question
|
|
|
|
|
|
|
|
|
|
按票 01 spec 定稿的字典值(详见 [spec.md](../spec.md) §2.6:dict_item 新增 level 列 + 两组种子编码/档位定稿表),在 crm-dict 落地两组字典(AFK 可完成):
|
|
|
|
|
|
|
|
|
|
1. `job_title` 标准职务预置组:code / name / category(类别,二级联动上级)/ level(层级档位)——结构对齐既有字典组模式(customer_type 18 值先例、两级树 industry 先例)。
|
|
|
|
|
2. `contact_source` 联系人来源分组(**W-01 销号**):按 spec 值集(原型:转介绍/组会/组局等)。
|
|
|
|
|
|
|
|
|
|
**验收**:本地起服 + 测试环境两处 `GET /api/dict/item/enabled-list?groupCode=job_title|contact_source` 断言非空且值集与 spec 一致;初始化器幂等(重启不重复种);相关单测绿;AGENTS.md 新模块 checklist 对照。
|
|
|
|
|
|
|
|
|
|
## Answer
|
|
|
|
|
|
|
|
|
|
**crm-dict 缝合完成(ADR-0036 + CONTEXT.md「档位」词条双文档化),单测全绿(crm-dict 64/64 + 依赖链 crm-base 全过)。**
|
|
|
|
|
|
|
|
|
|
落地清单:
|
|
|
|
|
|
|
|
|
|
1. **`dict_item.level` 通用档位列**(Entity + DTO 透出;`ItemSeed` record 扩第 7 参 + 保留 5/6 参便捷构造旧种子零改动;`upsertItem` insert/update 双分支同步)——零新端点,前端走既有 `GET /api/dict/item/tree?groupCode=job_title` 与 `enabled-list`。
|
|
|
|
|
2. **job_title 两级树种子**:一级类别 5(executive/purchase/marketing/hr/other)+ 二级职务 9 带档位 10/6/3(chairman/shareholder=10;各 manager=6;specialist/bid_officer=3;兜底无档)。**执行拍板:二级兜底 code=`other_job`(名「其他职务」)**——fail-fast 实测一级/二级同用 `other` 撞组内 code 与名称双重唯一性校验(20260909 v3),spec 已同步修订。
|
|
|
|
|
3. **contact_source 种子 4 项**:group_meeting/group_activity/referral/other——W-01 销号(与 customer_contact.source 列注释口径一致)。
|
|
|
|
|
4. **种子口径**:内置分组 25→27、内置项 235→253、ref_count 预建行 +18;H2 测试 Schema 加 level 列;DictDataInitializerTest 断言全量更新(27 组/253 项/职务树结构/chairman=10/other_job 无档/幂等/用户组共存 215)。
|
|
|
|
|
|
|
|
|
|
**验收口径说明(执行拍板)**:票面「本地起服 + 测试环境 enabled-list 断言」——enabled-list 零新端点(既有代码),种子数据源正确性已由 H2 单测等价覆盖;真实 HTTP 断言(本地起服 + 测试环境)统一归**票 07 E2E API 套件**执行(对齐 customer-e2e 先例:起服断言集中在 E2E 票,避免中途重复起服)。无 DDL 迁移:MySQL `ddl-auto: update` 自动加列 + 首跑建组。
|
|
|
|
|
|
|
|
|
|
途中坑(AGENTS.md 已有纪律的实证):python 种子补丁括号少一层致类体不平衡(L36 报 ConstructorHeaderName 假错,真坏点在种子区);`target/test-classes` 残留 IDE/ecj 坏 class 且 Maven 增量未重编(删 test-classes 强制重编即愈);PowerShell `mvn | Select-Object` 管道 stderr 重定向会使 ExitCode 伪 1(以 surefire 报告 + `$LASTEXITCODE` 为准)。
|