系统 SHALL 新建:
biz_production_material_prep — 配制单头biz_production_material_prep_line — 配制明细(子物料实际消耗)配制单头 SHALL 含:prep_no、configured_material_id、prep_time、output_qty、output_unit、batch_no、expire_date、stock_in_no(产出入库编号)、status(draft/completed/cancelled)、remark 及公共字段。
配制行 SHALL 含:prep_id、component_material_id、component_material_type、requisition_usage_id(关联 biz_production_material_usage 领用记录 id)、actual_qty、usage_unit、remark 及公共字段。
配制确认(completed)时,每个 prep_line SHALL 提供非空 requisition_usage_id,且该记录须为对应子物料的 manual_out 领用、同一 tenant、del_flag=0。
同一配制单内 requisition_usage_id 不得 重复。
确认配制 SHALL 在单事务内:
biz_production_material_usage:change_type=use,source_type=prep_consume,parent_usage_id=requisition_usage_id,不减少子物料 batch/catalog 库存(stock_before 等于 stock_after)biz_production_material_stock_batch(in_qty=remaining_qty=output_qty)prep_in usage(change_type=in,增加 catalog stock_qty 与 batch remaining_qty)系统 SHALL 提供:
GET /production-material-preps — 分页列表(可按 configured_material_id、status、时间筛选)GET /production-material-preps/{id} — 详情含 prep_line 及子物料/领用快照POST /production-material-preps — 创建(draft)PUT /production-material-preps/{id} — 更新 draftPOST /production-material-preps/{id}/complete — 确认配制POST /production-material-preps/{id}/cancel — 取消 draft变动记录 Tab SHALL 展示 source_type 为 prep_consume、prep_in 的流水;prep_consume 行 SHALL 可下钻到 parent 领用记录与配制单号。