Integrate ZTO site module and add debug/single-site mode

- Add site_zto.py: ZTO expected-arrival data download with menu
  navigation, export polling, and Excel merge
- Wire ZTO into main_router: site URL, login detection, menu items
  [5]/[6], and a global offline Left Anti-Join compare entry [9]
- Read config.yaml debug flags to launch only the target site for
  focused debugging; guard each site init and route handler behind
  site-loaded checks via is_site_ready()
- Expand config.example.yaml with documented debug, baishi, and zto
  config keys

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-06-20 12:46:46 +08:00
parent 7f8d81af21
commit 9375b6efd6
3 changed files with 535 additions and 88 deletions

View File

@@ -1,4 +1,37 @@
# config.example.yaml
# 复制本文件为 config.yaml 并填入真实凭据后使用
# ============================================================================
# 复制本文件为 config.yaml 并填入真实凭据后使用:
# cp config.example.yaml config.yaml
#
# 说明:
# - config.yaml 已被 .gitignore 忽略,不会提交到仓库,可安全存放凭据。
# - 所有配置项均设有默认值,未填写时会自动回退到默认行为,不会报错。
# ============================================================================
# ----------------------------------------------------------------------------
# 调试模式:用于单网点联调,仅挂载并启动指定网点,其余网点不加载。
# ----------------------------------------------------------------------------
debug:
# 是否启用调试模式true=仅启动 target_site 一个网点false=全量启动所有网点)。
enabled: false
# 调试模式下要单独启动的网点名称。
# 仅在 enabled: true 时生效。可选值:顺心 / 百世 / 中通。
# 留空或不匹配时将回退为全量模式。
target_site: ""
# ----------------------------------------------------------------------------
# 百世快运 (https://v5.800best.com)
# ----------------------------------------------------------------------------
baishi:
# 应到未到数据导出时需要填写的“登录密码”。
# 留空会导致导出授权校验失败,无法下载数据。
password: "YOUR_PASSWORD_HERE"
# ----------------------------------------------------------------------------
# 中通快运 (https://ws.zto56.com/)
# ----------------------------------------------------------------------------
zto:
# 应到货物数据的查询时间范围(单位:天,向前回溯 N 天至今天)。
# 建议保持 1。设置过大且超出日历视窗时会自动降级为仅查询当天。
query_days: 1