fix: use API workdays and final delivery date in bot replies
This commit is contained in:
@@ -93,12 +93,10 @@ Do not use temporary curl, WebFetch, or any API method outside the controlled sc
|
||||
|
||||
## Output Selection
|
||||
|
||||
- Prefer numeric `data.交期汇总.AM516总交期`; if it is absent, fall back to numeric `data.交期汇总.总交期`. Treat this value as the original natural-day lead time `N`.
|
||||
- Convert `N` with `(q, r) = divmod(N, 7)`: `r = 0` gives `q × 5`; `1 ≤ r ≤ 4` gives `q × 5 + MAX(r - 1, 0)`; `5 ≤ r ≤ 6` gives `q × 5 + r - 2`. The result is workday lead time `W`.
|
||||
- Starting from the local query date, exclude the query date itself and count forward `W` workdays using the configured China statutory calendar. Statutory holidays are not workdays, ordinary Saturdays and Sundays are not workdays, and official makeup Saturdays or Sundays are workdays.
|
||||
- The configured 2026 calendar follows `国办发明电〔2025〕7号`. If counting reaches a year whose official calendar is not configured, do not silently estimate a delivery date; mark that calendar year as pending.
|
||||
- Display the calculated delivery date together with both `N` and `W`, for example `2026-10-09(原始31个自然日,折算22个工作日)`.
|
||||
- Use `data.交期汇总.AM516预测交期` only as a fallback when the API does not return a usable whole-number natural-day lead time, and explicitly mark that no conversion was performed.
|
||||
- Read the workday count directly from `data.交期汇总.AM516工作日交期` and the corresponding final delivery date from `data.交期汇总.AM516最终交货日期`.
|
||||
- Require a nonnegative whole-number workday count (including zero) and a valid `YYYY-MM-DD` date. Both must be returned by the API; missing or invalid values make the lead-time result unavailable.
|
||||
- Display `8个工作日,最终交货日期:2026-10-08` consistently in the overall judgment, candidate details, and newly appended records. Rank the fastest candidate by the API workday count.
|
||||
- Do not convert natural days, recalculate dates from the local query date, or fall back to the old `AM516预测交期` field. `AM516总交期` and `总交期` remain natural-day reference fields and are not shown in the reply.
|
||||
|
||||
## Candidate Batch Rule
|
||||
|
||||
@@ -163,13 +161,13 @@ Use this field order for a successful Feishu report:
|
||||
总体判断:
|
||||
- 现货候选:{fully covered candidate or none}
|
||||
- 最快候选型号:{fastest candidate}
|
||||
- 最快候选交期:{calculated delivery date, original natural days, and converted workdays}
|
||||
- 最快候选交期:{API workdays}个工作日,最终交货日期:{API final delivery date}
|
||||
- 是否完全覆盖数量:{yes / no / unavailable}
|
||||
- 主导因素:{main factor}
|
||||
|
||||
1. {model}({candidate type and reducer brand})
|
||||
- 数量:{quantity}台
|
||||
- AM516预测交期:{calculated delivery date}(原始{N}个自然日,折算{W}个工作日)
|
||||
- AM516预测交期:{API workdays}个工作日,最终交货日期:{API final delivery date}
|
||||
- 可用库存/覆盖情况:{summary-level inventory and coverage only}
|
||||
- 主导因素:{main factor}
|
||||
- 推荐理由:{rule-based recommendation reason}
|
||||
|
||||
Reference in New Issue
Block a user