feat: add record time to delivery prediction records

This commit is contained in:
TH5-AR51
2026-07-23 08:52:38 +08:00
parent f824eb214e
commit 0aaedb8b66
3 changed files with 14 additions and 3 deletions

View File

@@ -573,6 +573,7 @@ def render_record(
generation_time: datetime,
) -> str:
all_count = len(candidates) + len(unavailable)
record_time = generation_time.strftime("%Y-%m-%d %H:%M:%S %z")
lines = [
f"\n## {generation_time:%Y-%m-%d %H:%M:%S %z} | {request.model} | {request.quantity}",
"",
@@ -589,8 +590,8 @@ def render_record(
"",
f"### 候选型号清单及 API 结果(共{all_count}项)",
"",
"| 序号 | 型号 | 推荐类型 | 差异项 | API状态 | AM516预测交期 | 可用库存 | 主导因素 |",
"|---:|---|---|---|---|---|---:|---|",
"| 序号 | 记录时间 | 型号 | 推荐类型 | 差异项 | API状态 | AM516预测交期 | 可用库存 | 主导因素 |",
"|---:|---|---|---|---|---|---|---:|---|",
]
record_rows = [
(candidate["record_order"], True, candidate) for candidate in candidates
@@ -605,6 +606,7 @@ def render_record(
api_status = "✅ 现货" if details.get("full_coverage") is True else "✅ 返回"
row = [
record_order,
record_time,
candidate["model"],
candidate["type"],
candidate["difference"],
@@ -616,6 +618,7 @@ def render_record(
else:
row = [
record_order,
record_time,
candidate["model"],
candidate["type"],
candidate["difference"],