feat: convert AM516 lead times to workdays

This commit is contained in:
ar51
2026-09-03 17:34:42 +08:00
parent fa8aee91b9
commit c7c5c3259c
6 changed files with 332 additions and 27 deletions

View File

@@ -14,6 +14,7 @@ Expected:
- model parses successfully;
- quantity is accepted;
- the bot immediately replies with `👀` after the valid trigger is accepted and before the API query starts;
- the controlled script uses the macOS system trust store and keeps TLS verification enabled;
- no temporary TLS-bypass parameter is required for the normal happy path;
- API script runs;
@@ -39,6 +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
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.
## Sample 1A | Continue With Other Candidates
Preconditions:
@@ -59,6 +72,7 @@ is not required.
Expected:
- the bot immediately replies with `👀` after the continuation and active-context gates pass;
- the bot reuses the active model and quantity only for that same sender and chat;
- the bot queries candidate positions 5-8 in the unchanged rule order;
- the original model and candidate positions 1-4 are not queried or displayed again;
@@ -83,6 +97,7 @@ eRob110H160I-FHM-18ET[V6]
Expected:
- bot stays silent;
- no acknowledgement emoji is sent;
- no API call is made;
- no record is appended.