日期:2026-10-07
状态:已确认(2026-10-07)
关联:细胞存储 / 科研捐赠「采集协议单」样本及运输信息;内部成本登记(不向客户收取)
细胞存储与科研捐赠协议单共用 SampleTransportFormSection:
biz_protocol_sample_transport / biz_research_donation_sample_transport)。kdys(快递运输)/ ryxd(人员携带)。| 项 | 结论 |
|---|---|
| 录入时机 | 录采集协议单时填写(已知会与其他单共用) |
| 关联粒度 | 样本级(可跨协议;单内也可仅部分样本) |
| 与旧运输 | 替换样本快递费用与旧运输录入;单号/站点等本阶段不做 |
| 费用性质 | 仅内部成本登记 |
| 架构 | 运费批次实体 + 协议单内新建/关联(方案 1);暂不做独立运费中心 |
biz_sample_freight| 字段 | 说明 |
|---|---|
id |
UUID PK |
transport_mode |
运输方式字典值(sample_transport_mode) |
freight_amount |
运费(元),Numeric(18,2),≥ 0 |
| 公共字段 | tenant_no、order_num、remark、create_by、create_dept_id、create_time、update_by、update_time、del_flag |
字段顺序遵循 database-conventions:id → 业务字段 → 公共字段。
biz_sample_freight_item| 字段 | 说明 |
|---|---|
id |
UUID PK |
freight_id |
运费批次 ID |
sample_source |
cell_storage | research_donation |
sample_id |
样本主键 |
sample_code |
样本编码快照(可选,便于展示) |
protocol_id |
所属协议单 ID(便于反查) |
| 公共字段 | 同上 |
约束(业务层强制,建议唯一索引):
同一租户下,(sample_source, sample_id) 且 del_flag=0 至多对应一条关联(一个样本最多挂一笔运费)。
sample_transport_mode| dict_value | dict_label |
|------------|------------|
| sfkd | 顺丰快递 |
| zxc | 专线车 |
transportMode(已有 value)或手输文案。后端解析顺序:
dict_value 命中 → 使用该项;dict_label trim 后精确匹配 → 使用已有项;dict_label = trim 后文案,dict_value = 同文案(若 value 冲突则加短后缀保证唯一),再保存运费。biz_protocol_sample_transport、biz_research_donation_sample_transport:保留不删。细胞存储 ProtocolFormDialog / ProtocolViewDialog 与科研捐赠 DonationFormDialog / DonationViewDialog 行为一致;公共组件由「配置运输信息」改为「配置运费」(可演进现有 SampleTransportFormSection)。
模式 A · 新建运费
模式 B · 关联已有运费
默认「新建」;可切换「关联已有」。
/api/admin)| 方法 | 路径 | 用途 |
|---|---|---|
| GET | /sample-freights |
分页检索(关联已有) |
| GET | /sample-freights/{id} |
详情(含关联样本:来源、协议、编码) |
| POST | /sample-freights |
新建批次并挂样本 |
| PUT | /sample-freights/{id} |
更新方式/金额 |
| POST | /sample-freights/{id}/link |
追加关联 |
| POST | /sample-freights/{id}/unlink |
取消关联;无样本则软删批次 |
请求/响应字段使用 camelCase(transportMode、freightAmount、sampleSource、sampleId、protocolId、sampleCode、linkedSampleCount 等)。
创建/更新时执行运输方式字典自动入库。
已落库样本(编辑已有协议,或协议已保存过):
transport 整包写入。未落库草稿样本(新建协议未保存):
freightDraft.clientKey 让多个草稿样本共用同一笔草稿运费。freightId:关联已有批次;或freightDraft: { clientKey, transportMode, freightAmount }:同一 clientKey 只创建一笔批次再挂样本。freightId;之后改价走独立 API。transportMode、freightAmount 必填;金额 ≥ 0。tenant_no 隔离,并套数据权限(与协议样本一致)。样本返回例如:
"freight": {
"id": "...",
"transportMode": "zxc",
"transportModeLabel": "专线车",
"freightAmount": 800,
"linkedSampleCount": 3
}
| 位置 | 改动 |
|---|---|
sample-transport-form-section |
改为运费配置(或拆出 SampleFreightFormSection);列表列与弹窗按 §4 |
ProtocolFormDialog / DonationFormDialog |
接入运费草稿与保存 payload;去掉对旧 transport 必填依赖 |
ProtocolViewDialog / DonationViewDialog |
样本运输区改为方式 + 运费 |
| API 模块 | 新增 sample-freight.ts(或等价) |
| 字典 | 初始化 sample_transport_mode;下拉允许创建 |
UI 遵循 Fresh Mint / 现有协议弹窗约定:label-position="top"、dialog-form-layout、无 backdrop blur、按钮带图标。
| 风险 | 对策 |
|---|---|
| 新建协议样本无服务端 ID | freightDraft.clientKey,协议保存时建批次 |
| 跨单改价影响他人样本 | 改价前提示同步关联样本数 |
| 字典手输脏数据/重复 | 租户内按 trim 后的 label 去重;实现阶段可再加强规范化 |
| 下游仍读旧运输 | 空值展示,不阻断;后续扩展再对齐 |
| 历史仅有旧运输 | 不迁移;人工补录运费 |
biz_sample_freight + biz_sample_freight_item(及唯一索引)。freightId / freightDraft,停止写旧运输。