feat: add LF reducer stock coverage gate

This commit is contained in:
ZE-TH5-AR516 committed 2026-11-27 11:07:48 +08:00
1 parent a017c4b48c
commit f1099c84dd
6 files changed
+391 -19

No files matched your search

@@ -48,6 +48,9 @@ Expected:
- each future appended candidate row records the same query-completion time in `YYYY-MM-DD HH:mm:ss +0800` form (with the actual local UTC offset), without rewriting or backfilling historical records;
- record-table columns follow this order: 序号、记录时间、型号、推荐类型、差异项、API状态、AM516预测交期、可用库存、主导因素;
- unavailable candidates remain in their original rule order and are recorded as `❌ 不可用` with unavailable result fields shown as `—`; lack of a result does not itself establish that the model does not exist;
- generated LF candidates pass only when `现货数` and matching LF reducer actual availability cover the original demand; an LF candidate with insufficient combined coverage, missing stock fields, no matched reducer or an inconsistent `需排产数` is absent from the report, fastest comparison, candidate counts and `不可用候选`;
- retained results display `现货数` and `需排产数`; retained LF candidates needing production also display the matched reducer code and reducer actual available quantity;
- overdue unreserved sales orders returned by the API display the sales-order code and a human-review reminder without automatically releasing inventory;
## Sample 1B | API Workdays And Final Delivery Date
@@ -0,0 +1,59 @@
# 来福减速器存量清仓候选门禁
## 背景
来福减速器后续不再采购。使用来福减速器的候选整机只能依据当前整机现货和对应来福减速器实际可用库存推荐,不能用采购在途、待检、固定提前期或未来补货能力补足数量。
## AR836 接口字段
AM516 从 `data.库存信息` 读取以下精简字段:
- `现货数`:候选整机实际可用量。它不是 ERP 库存量,也不是未补扣销售订单占用的可用量。
- `需排产数`:`max(需求数量 - 现货数, 0)`。
- `对应来福减速器编码`:候选型号匹配的来福减速器物料编码。
- `减速器实际可用量`:ERP 即时库存口径下可用于本次生产的数量。
- `逾期待复核销售订单`:可选列表;订单超过要货日期 30 天但仍有待锁库/待预留数量时,包含销售订单编码、要货日期和逾期天数。
`现货数`由 AR836/ERP 侧计算:
```text
整机实际可用量
= max(
ERP可用量(主单位)
- 有效销售订单待锁库/待预留数量(换算为主单位), 0
)
```
AM516 不要求接口返回、也不在报告展示以下中间字段:
- `ERP可用量(主单位)`
- `待锁库待预留数量(主单位)`
- `实际可用量`
- `每台减速器用量`
- `合计可覆盖整机数量`
- `本次需求数量`
- `是否满足推荐门槛`
## 推荐门禁
当前业务按每台关节模组使用一件对应减速器判断:
```text
现货数 = 整机实际可用量
需排产数 = max(需求数量 - 现货数, 0)
需排产数 = 0
-> 整机现货已覆盖,可保留 LF 候选
需排产数 > 0 且 减速器实际可用量 >= 需排产数
-> 整机现货与减速器库存合计覆盖,可保留 LF 候选
其他情况
-> 剔除 LF 候选
```
以下情况同样剔除:字段缺失或不可读、`需排产数`与公式不一致、需要排产但无对应减速器编码。
被剔除的 LF 型号不出现在关节模组交期预估报告、不可用候选、最快交期比较、现货候选或候选统计中。原始输入型号仍作为基准展示,不按“生成候选”处理。
逾期销售订单只触发人工复核提醒,不自动释放库存;在 ERP 完成释放前,其待锁库/待预留数量仍由 AR836 扣除在`现货数`之外。
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.