refactor: gate LF candidates with current AR836 response
This commit is contained in:
1 parent
f1099c84dd
commit
127d88e84e
6 files changed
+112
-244
No files matched your search
@@ -48,9 +48,8 @@ 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;
|
||||
- generated LF candidates pass when finished-product available inventory covers demand, or when the readable AR836 shortage list contains no `20.30.*` reducer constraint after AR836's 95% yield, five-unit rounding and BOM calculation;
|
||||
- an LF candidate with insufficient finished-product inventory plus a `20.30.*` shortage, or with an unreadable shortage list, is absent from the report, fastest comparison, candidate counts and `不可用候选`;
|
||||
|
||||
## Sample 1B | API Workdays And Final Delivery Date
|
||||
|
||||
|
||||
@@ -1,59 +1,36 @@
|
||||
# 来福减速器存量清仓候选门禁
|
||||
# 来福减速器存量清仓候选门禁(AR836 当前接口版)
|
||||
|
||||
## 背景
|
||||
|
||||
来福减速器后续不再采购。使用来福减速器的候选整机只能依据当前整机现货和对应来福减速器实际可用库存推荐,不能用采购在途、待检、固定提前期或未来补货能力补足数量。
|
||||
来福减速器后续不再采购。使用来福减速器的生成候选,必须有整机可用库存或 AR836 根据本次排产需求核算后确认减速器不构成供应约束,不能只凭型号相似和预测交期推荐。
|
||||
|
||||
## AR836 接口字段
|
||||
## 当前使用的 AR836 字段
|
||||
|
||||
AM516 从 `data.库存信息` 读取以下精简字段:
|
||||
AM516 仅依赖现有接口已返回的:
|
||||
|
||||
- `现货数`:候选整机实际可用量。它不是 ERP 库存量,也不是未补扣销售订单占用的可用量。
|
||||
- `需排产数`:`max(需求数量 - 现货数, 0)`。
|
||||
- `对应来福减速器编码`:候选型号匹配的来福减速器物料编码。
|
||||
- `减速器实际可用量`:ERP 即时库存口径下可用于本次生产的数量。
|
||||
- `逾期待复核销售订单`:可选列表;订单超过要货日期 30 天但仍有待锁库/待预留数量时,包含销售订单编码、要货日期和逾期天数。
|
||||
- `data.库存信息.可用库存(扣除了待产数量)`:候选整机的当前可用库存口径。
|
||||
- `data.采购信息.缺料明细[]` 及其 `缺料物料`:物料编码以 `20.30.` 开头的记录视为减速器供应约束。
|
||||
|
||||
`现货数`由 AR836/ERP 侧计算:
|
||||
AR836 已在内部按下列口径把订单数量换算为排产和 BOM 需求:
|
||||
|
||||
```text
|
||||
整机实际可用量
|
||||
= max(
|
||||
ERP可用量(主单位)
|
||||
- 有效销售订单待锁库/待预留数量(换算为主单位), 0
|
||||
)
|
||||
成品缺口 = max(订单需求 - 净可用成品库存, 0)
|
||||
本次排产量 = ceil(成品缺口 / 95% / 5) × 5
|
||||
```
|
||||
|
||||
AM516 不要求接口返回、也不在报告展示以下中间字段:
|
||||
|
||||
- `ERP可用量(主单位)`
|
||||
- `待锁库待预留数量(主单位)`
|
||||
- `实际可用量`
|
||||
- `每台减速器用量`
|
||||
- `合计可覆盖整机数量`
|
||||
- `本次需求数量`
|
||||
- `是否满足推荐门槛`
|
||||
AR836 根据该排产量、BOM 用量、存量需求和当前供应判定减速器是否进入缺料明细。AM516 不重复实现 95% 合格率和 5 台取整。
|
||||
|
||||
## 推荐门禁
|
||||
|
||||
当前业务按每台关节模组使用一件对应减速器判断:
|
||||
|
||||
```text
|
||||
现货数 = 整机实际可用量
|
||||
需排产数 = max(需求数量 - 现货数, 0)
|
||||
|
||||
需排产数 = 0
|
||||
-> 整机现货已覆盖,可保留 LF 候选
|
||||
|
||||
需排产数 > 0 且 减速器实际可用量 >= 需排产数
|
||||
-> 整机现货与减速器库存合计覆盖,可保留 LF 候选
|
||||
|
||||
其他情况
|
||||
-> 剔除 LF 候选
|
||||
若 整机可用库存 >= 本次需求数量 -> 保留
|
||||
否则,若 缺料明细缺失或不可读 -> 保守剔除
|
||||
否则,若 缺料明细中存在 20.30.* 物料 -> 剔除
|
||||
否则 -> AR836 未发现减速器供应约束,保留
|
||||
```
|
||||
|
||||
以下情况同样剔除:字段缺失或不可读、`需排产数`与公式不一致、需要排产但无对应减速器编码。
|
||||
|
||||
被剔除的 LF 型号不出现在关节模组交期预估报告、不可用候选、最快交期比较、现货候选或候选统计中。原始输入型号仍作为基准展示,不按“生成候选”处理。
|
||||
|
||||
逾期销售订单只触发人工复核提醒,不自动释放库存;在 ERP 完成释放前,其待锁库/待预留数量仍由 AR836 扣除在`现货数`之外。
|
||||
## 当前接口的边界
|
||||
|
||||
减速器未进入缺料明细时,当前接口不返回匹配减速器编码和确切库存。本版也不具备销售订单待锁库/待预留的二次扣减、逾期 30 天订单提醒能力;这些需要 AR836 后续增加数据后才能严格实现。
|
||||
@@ -222,16 +222,16 @@ AI 输出中不得使用“已替代”“已承诺”“可直接交付”等
|
||||
|
||||
来福减速器后续不再采购,因此 `(Vx)` 来福候选不能只凭型号配置相似和预测交期进入报告。
|
||||
|
||||
对每个来福候选读取 AR836 返回的:
|
||||
对每个来福候选读取 AR836 当前返回的:
|
||||
|
||||
```text
|
||||
现货数 = 候选整机实际可用量
|
||||
需排产数 = max(本次需求数量 - 现货数, 0)
|
||||
data.库存信息.可用库存(扣除了待产数量)
|
||||
data.采购信息.缺料明细[].缺料物料
|
||||
```
|
||||
|
||||
- `需排产数 = 0`:整机现货覆盖本次需求,可保留候选。
|
||||
- `需排产数 > 0`:对应来福减速器实际可用量必须大于等于需排产数,才可保留候选。
|
||||
- 整机现货与减速器库存合计不足,或库存字段缺失、无匹配减速器、数量口径矛盾:剔除候选。
|
||||
- 整机可用库存覆盖需求:保留候选。
|
||||
- 整机库存不足,且缺料明细中出现 `20.30.*` 减速器物料:剔除候选。
|
||||
- 整机库存不足,但 AR836 按 95% 合格率、5 台取整及 BOM 用量核算后未返回减速器供应约束:保留候选。
|
||||
- 缺料明细缺失或不可读:保守剔除。
|
||||
- 被剔除型号不进入交期报告、最快交期比较或不可用候选清单。
|
||||
- 采购在途、待检、固定提前期和未来采购不得作为放行依据。
|
||||
- 超过要货日期30天且仍有待锁库/待预留数量的销售订单只提示人工复核,不自动释放现货。
|
||||
- 当前接口无法在减速器不缺料时单独展示匹配编码和确切库存,也无法实现销售订单待锁库/待预留二次扣减及逾期 30 天提醒。
|
||||
@@ -133,14 +133,12 @@ Do not use temporary curl, WebFetch, or any API method outside the controlled sc
|
||||
## LF Reducer Stock Gate
|
||||
|
||||
- Apply this gate only to generated LF candidates, identified by `(Vx)`.
|
||||
- Read `现货数`、`需排产数`、`对应来福减速器编码`、`减速器实际可用量` from `data.库存信息`.
|
||||
- `现货数` means the finished product's actual available quantity after AR836 has deducted valid sales-order quantities waiting for locking/reservation.
|
||||
- Require `需排产数 = max(原始需求数量 - 现货数, 0)`.
|
||||
- If `需排产数 = 0`, the finished-product stock covers demand and the candidate passes without reducer replenishment.
|
||||
- Otherwise require a matched LF reducer code and `减速器实际可用量 >= 需排产数`.
|
||||
- Missing, invalid, inconsistent or insufficient fields reject the LF candidate. Purchasing in transit, inspection stock, fixed lead time and future replenishment must not rescue it.
|
||||
- Show `现货数` and `需排产数` for retained results. Show the matched LF reducer code and actual available quantity for retained LF candidates that need production.
|
||||
- If `逾期待复核销售订单` is returned, show its sales-order code and request human review. Never release stock automatically.
|
||||
- Read `data.库存信息.可用库存(扣除了待产数量)` and `data.采购信息.缺料明细` from the current AR836 response.
|
||||
- AR836 owns the 95% yield, five-unit rounding and BOM-demand calculation. AM516 must not reproduce a different quantity formula.
|
||||
- If finished-product available inventory covers the original demand, retain the candidate.
|
||||
- Otherwise reject when the shortage list is missing/unreadable or contains any material code beginning `20.30.`; retain when the readable list contains no such reducer constraint.
|
||||
- Rejected LF candidates are omitted from the report, fastest comparison, candidate counts and `不可用候选`.
|
||||
- Do not claim that the current response proves the matched reducer code or exact reducer stock when no reducer shortage record is returned.
|
||||
- The original input model remains the baseline; this generated-candidate gate does not hide the user's original model.
|
||||
|
||||
## Unavailable Result Reasons
|
||||
@@ -211,7 +209,7 @@ Use this field order for a successful Feishu report:
|
||||
1. {model}({candidate type and reducer brand})
|
||||
- 需求数量:{input quantity}台
|
||||
- AM516预测交期:{API workdays}个工作日,最终交货日期:{API final delivery date}
|
||||
- 现货/排产情况:现货数{actual available finished goods}台;需排产数{remaining production quantity}台
|
||||
- 可用库存/覆盖情况:整机可用库存{AR836 available inventory}台({coverage statement})
|
||||
- 主导因素:{main factor}
|
||||
- 推荐理由:{rule-based recommendation reason}
|
||||
- 差异项:{field changes formatted as `字段 原值→新值`; join multiple changes with `;`, for example `编码器 HS→HM;品牌 DZ→LF`}
|
||||
|
||||