fix: use API workdays and final delivery date in bot replies
This commit is contained in:
@@ -40,17 +40,18 @@ Expected:
|
||||
- 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 `—`;
|
||||
|
||||
## Sample 1B | Natural Days To Workdays
|
||||
## Sample 1B | API Workdays And Final Delivery Date
|
||||
|
||||
Rules and expected results:
|
||||
|
||||
- treat `AM516总交期`, or numeric `总交期` when the AM516 field is absent, as the original natural-day lead time `N`;
|
||||
- convert `N` with the approved quotient-and-remainder rule, including `r = 4` as one rest day and `r = 0` as no remainder workday;
|
||||
- exclude the local query date itself, then count the converted workdays using the configured China statutory workday calendar;
|
||||
- statutory holidays are excluded and official makeup weekend workdays are included;
|
||||
- for a query date of `2026-09-02`, `31` natural days convert to `22` workdays and produce `2026-10-09`;
|
||||
- output `2026-10-09(原始31个自然日,折算22个工作日)` instead of adding a separate National Day exception;
|
||||
- when counting reaches an unconfigured calendar year, do not silently fall back to a Monday-Friday estimate.
|
||||
- read `data.交期汇总.AM516工作日交期` and `data.交期汇总.AM516最终交货日期` directly;
|
||||
- when the API returns `8` and `2026-10-08`, output `AM516预测交期:8个工作日,最终交货日期:2026-10-08`;
|
||||
- use the same workdays-and-date form in the fastest-candidate summary, initial and continuation candidate details, and newly appended record rows;
|
||||
- ignore natural-day totals and the old `AM516预测交期` field when selecting the displayed result; do not recalculate workdays or dates locally;
|
||||
- a valid API date in another calendar year remains usable without a local holiday calendar;
|
||||
- accept zero workdays; reject negative, fractional, boolean, or non-numeric workday values and invalid dates;
|
||||
- if either new field is missing or invalid, report the lead-time result as unavailable instead of falling back to old fields or estimating;
|
||||
- choose the fastest candidate using the API workday count, even when the natural-day totals would rank candidates differently.
|
||||
|
||||
## Sample 1A | Continue With Other Candidates
|
||||
|
||||
|
||||
Reference in New Issue
Block a user