Files
brapi-java/docs/dev/04-germplasm/14-pedigree_node.md
2026-05-28 11:56:17 +08:00

41 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 04 Germplasm / Seed - pedigree_node 表录入说明
来源:`docs/architecture/04-germplasm-seed-data-flow.md`
## 录入目标
`pedigree_node` 表示系谱中的一个节点,一个节点通常关联一个 germplasm并可归属 crossing_project。节点之间的 parent/child/sibling 关系由 `pedigree_edge` 记录。
## 上下游关系
| 类型 | 内容 |
| --- | --- |
| 表 | `pedigree_node` |
| Java 实体 | `PedigreeNodeEntity` |
| 前置依赖 | `germplasm`、可选 `crossing_project` |
| 下游引用 | `pedigree_edge` |
| API | `/brapi/v2/pedigree` |
## 字段录入
| 字段 | 业务意义 | 录入方式 | 校验规则 |
| --- | --- | --- | --- |
| `id` | pedigree node 主键 | 系统生成;导入可指定 | 必填、唯一 |
| `auth_user_id` | 数据所属用户 | 登录上下文自动写入 | 不允许前端手填 |
| `germplasm_id` | 对应 germplasm | Germplasm 选择器 | 建议必选,若填需存在 |
| `crossing_project_id` | 所属 crossing project | CrossingProject 选择器 | 可选 |
| `crossing_year` | 杂交年份 | 年份输入 | 可选 |
| `family_code` | 家系编号 | 文本 | 可选 |
| `pedigree_string` | 系谱字符串 | 文本 | 可选 |
## 页面与交互
- 可从 Germplasm 详情页进入 Pedigree Tab。
- 支持图谱视图和表格视图。
## 关键校验
1. 同一 germplasm 通常只应有一个 pedigree node。
2. 删除 pedigree_node 前检查 `pedigree_edge` 中 this_node 和 connceted_node 引用。
3. 导入 pedigree 时需要先创建所有节点,再创建边。