Misaka
3c32720985
feat(sites): auto-screenshot on final download failure for debugging
...
所有站点 with_retry 在最后一次重试失败、reset 之前自动截图,
保存到 logs/screenshots/。网页站点走 Playwright page.screenshot(),
安能走 CDP Page.captureScreenshot。截图失败绝不阻塞任务流程。
- paths.py: 新增 SCREENSHOT_DIR (BASE_DIR/logs/screenshots/)
- runtime.py: 新增 capture_error_screenshot() 工具函数
- .gitignore: 新增 logs/ 忽略规则
Co-Authored-By: Claude <noreply@anthropic.com >
2026-08-02 11:18:21 +08:00
Misaka
a5ceb42ac1
阶段0:登录态心跳 + 状态持久化(重构地基)
...
- 新增 state_store.py:SQLite 状态存储(site_status 表:登录态/数据态/时间戳),
UPSERT 保留字段,重启不丢
- paths.py:加 STATE_DB_PATH(state/state.db)
- main_router:提取 probe_site_login / probe_data_file;菜单循环改为
input 后台线程 + 主线程心跳轮询(满足 Playwright sync 线程安全);
每 30s 探测各站登录态 + 数据文件写库,登录态变化时提示;新增菜单 [12] 站点状态盘
- .gitignore:忽略 state/
为后续 FastAPI 化与 Web 前端提供状态地基。
Co-Authored-By: Claude <noreply@anthropic.com >
2026-07-16 22:44:15 +08:00
Misaka
d05848ee36
Ignore .playwright-cli/ artifacts directory
...
Co-Authored-By: Claude <noreply@anthropic.com >
2026-07-06 21:26:12 +08:00
Misaka
d55c460c2d
Integrate expected-vs-actual (应到未到) comparison into main_router
...
- 应到未到比对.py -> expected_undelivered.py(英文名);main() 的 sys.exit 改为
return,使其可被 main_router 安全调用而不杀进程。
- main_router.py:菜单 [9] 改为调用 expected_undelivered.main()——全站点自动比对,
输出 output/应到未到数据.xlsx(汇总报表 + 中通/顺心/韵达/安能 各站明细);移除被
取代的旧 task_process_undelivered_data 及其专属 import pandas。
- .gitignore:忽略 output/(比对输出目录)。
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-21 23:39:36 +08:00
Misaka
9d3d3cbb78
Add Anneng (Electron) site: expected-data download + main_router integration
...
安能站点第一阶段:把应到数据(运单信息)下载流程接入主路由。
- site_anneng.py:用页面级 CDP 驱动「安能全网门户」Electron 应用(Playwright
connect_over_cdp 被 Electron 浏览器域 CDP 拦截,故走页面级)。完整应到流程:
菜单导航 → 进站交接单查询 → 设日期查询(“带小数点的 0”为加载完成判据)
→ 逐条交接单双击进运单信息并核对单号 → 导出(选中字段+→箭头转移全部列)
→ 关闭查询 tab → 导出下载页轮询 → 免对话框下载(x-auth+TGC 直连 GET)
→ 合并为 安能-应到货物数据.xlsx。CDP 端口可配;anneng_ready() 供路由就绪轮询。
- main_router.py:以调试模式启动安能(动态空闲端口,避免端口冲突),经 CDP
判断首页就绪,菜单加 [10] 应到下载,退出时关闭应用;网页站点逻辑不变。
- config.example.yaml:补充 anneng.query_days 与 anneng.app_path 说明。
- docs/安能门户CDP连接指南.md:连接方案、独立 webContents/tab 处理、免对话框下载。
- .gitignore:忽略 Archive/(早期探查脚本归档)。
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-21 19:38:44 +08:00
Misaka
ec1a9d9fbc
Implement Baishi undelivered-data extraction and restructure menu by site
...
- Replace Baishi placeholders with full download flow (scan-rate query, export modal, password auth via config.yaml)
- Reorganize router menu into 顺心 / 百世 modules; move undelivered-data compare into 顺心 flow
- Add config.example.yaml and ignore config.yaml to keep credentials out of VCS
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-06-16 21:58:02 +08:00
Misaka_Company
e5205760a0
Initial commit: InboundVerify automation scripts for logistics data processing
2026-06-15 18:18:51 +08:00