spec.md 2.2 KB

ADDED Requirements

Requirement: Configured reagent manual requisition

配置试剂批次 SHALL 支持与普通试剂相同的 manual_out 领用:按 batch 扣减 remaining_qty 与 catalog stock_qty,写入 biz_production_material_usage(source_type=manual_out)。

领用选项 API GET /production-material-requisition-options SHALL 支持 materialType=configured_reagent。

Scenario: Requisition options for configured reagent

  • WHEN 前端请求 materialType=configured_reagent
  • THEN 仅返回配置试剂的 manual_out 领用记录

Requirement: Production task step configured reagent sub-table

系统 SHALL 新建 biz_production_task_step_configured_reagent(或等价命名),字段对齐步骤试剂子表语义:

  • configured_reagent_code、configured_reagent_name、spec、standard_usage、actual_usage、unit
  • requisition_usage_id — 执行态必填(有 actual_usage 且目录存在时)

工艺/步骤模板 可 预置配置试剂标准用量(二期工艺库扩展前,允许步骤内手工维护行)。

Scenario: Step save with requisition

  • WHEN 用户在工单步骤配置试剂 Tab 填写 actual_usage 并选择领用记录后保存
  • THEN 写入 step 子表行与 step_save usage(parent_usage_id),不二次扣库存

Requirement: Step replace API

系统 SHALL 提供:

  • PUT /production-tasks/{task_id}/steps/{step_id}/configured-reagents — 全量替换步骤配置试剂行

请求体 SHALL 支持 requisitionUsageId(alias);服务端调用 register_step_usage_from_requisition。

目录内配置试剂有 actual_usage 时 必须 选领用记录(与试剂/耗材规则一致)。

Scenario: Reject step usage without requisition for catalog item

  • WHEN 步骤行 configured_reagent_code 对应目录存在且填写了 actual_usage 但未选领用
  • THEN API 返回 400

Requirement: My material usage includes configured reagent

【我的物料领用记录】SHALL 包含 material_type=configured_reagent 的 manual_out 与 step_save 行,Tag 展示「配置试剂」。

Scenario: Filter my usage by configured reagent

  • WHEN 用户筛选物料类型为配置试剂
  • THEN 仅展示 configured_reagent 相关流水