Misaka
|
ed6d403451
|
韵达音频授权提示弹窗清理(含重试重载后)+ 服务模式读取 debug 配置
- site_yunda:抽 dismiss_audio_prompt 助手(点「确定」);yunda_reset 重载主页后调用(解决重试重载后弹窗复现)
- runtime:_dismiss_initial_popups 韵达分支改用 dismiss_audio_prompt;launch_and_prepare 自己读 config.yaml 的 debug 段(服务模式也生效,之前仅 main_router 传参)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-18 10:54:10 +08:00 |
|
Misaka
|
6d45a9f5e5
|
站点配置(百世密码/韵达账密/安能路径)从 config.yaml 移至 state.db
- state_store:加 site_settings(site,key,value) 表 + get_setting/set_setting/get_site_settings
- runtime:seed_legacy_config 启动一次性从 config.yaml 灌入(已存在不覆盖);安能 app_path 改读 state_store
- site_baishi:导出密码改读 get_setting("百世","password")
- site_yunda:登录账密改读 get_setting("韵达",...)
- server:/config PUT 接受 settings;新增 GET /config/{site}/settings(不进 5s 轮询)
debug 仍保留在 config.yaml;站点配置现由前端配置弹窗管理(state.db 为准)。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-18 08:37:15 +08:00 |
|
Misaka
|
96e7018146
|
定时下载(APScheduler) + 跑比对纯离线 + 偏移拆 expected/actual + 报告下载
定时下载:
- state_store:site_config 加 schedule_enabled/schedule_time(旧库迁移)+ set_schedule/get_all_config
- server:APScheduler BackgroundScheduler,启动按配置注册各站 cron job、改配置重排;job 投 undelivered 任务到队列(错过跳过);/config 扩展 schedule
- runtime:("__compare__","compare") 改纯离线 expected_undelivered.main()(不下载)
- requirements:加 apscheduler
偏移拆分 + 报告下载:
- state_store:date_offset 拆 expected_offset/actual_offset(迁移)+ get_offset(site,kind)/set_offset(site,kind,n)
- 4 站 actual impl 改读 actual 偏移(expected 走默认 kind)
- server:/config 用 expected_offset/actual_offset;新增 GET /report(服务 output/应到未到数据.xlsx)
- paths:加 OUTPUT_DIR
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-18 08:11:18 +08:00 |
|
Misaka
|
82c80fc859
|
未到数据按站独立 + 百世并入汇总 + 全量跑比对(失败容错)
- state_store:site_status 加 undelivered_ready 字段(旧库 ALTER 迁移);init_db 提早到启动最前(server lifespan + launch_and_prepare 第0步),避免 /api/status 早于迁移报错
- expected_undelivered:重构为 process(name)/process_baishi/write_site_file/build_full_report;build_summary 支持百世(仅未到件、无基数,不计入合计/图表)与失败容错(未成功站保留行无数据)
- runtime:4 站 ("站","undelivered") = 下应到+实到 → 比对写 <站>-未到数据.xlsx;("__compare__","compare") 改 run_all(顺序跑5站、记成功清单 → build_full_report,未登录/失败跳过);DATA_FILENAMES 加 undelivered、心跳探测之;_site_undelivered_handler 用 is not False 与 dispatch 一致
- site_shunxin:shunxin_expected/actual_download 改为 return with_retry 结果(修复返回 None 致调用方误判失败、以及 with_retry 失败被当成功的潜在 bug)
- server:lifespan 启动时 init_db
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-17 23:19:21 +08:00 |
|
Misaka
|
26a94999dc
|
按站点指定下载日期偏移(0=今天…30)+ 修复启动陈旧登录态
偏移量功能(前端/API 可配,服务端持久化、多用户共享):
- state_store:新增 site_config 表 + get_offset / set_offset(0..30 钳制) / get_all_offsets
- server:新增 GET/PUT /config(百世锁定当天,不可配置)
- 顺心/中通/韵达/安能(各 expected+actual):日期逻辑由 query_days 范围改为读 offset
算单日 target=今天-offset,起止同日;百世仍走当日
- config.example.yaml:query_days 标记为已废弃
修复启动时显示上一会话陈旧登录态:
- state_store:新增 reset_login_states(登录态会话级,启动重置为 unknown;数据态会话无关、保留)
- runtime.launch_and_prepare:启动时对各站重置登录态,心跳就绪后重新探测写真实值
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-17 21:27:52 +08:00 |
|
Misaka
|
66bd8af421
|
阶段1:服务化骨架(FastAPI + Playwright worker + 任务队列)
- 新增 runtime.py:抽离共享核心 launch_and_prepare / dispatch_task / run_heartbeat /
probe_* / launch_anneng / RuntimeContext,常量 SITES_CONFIG 等;main_router 复用
- 新增 server.py:FastAPI(主线程)+ Playwright worker(独立线程)+ 任务队列;
API:POST/GET /tasks、GET /status、GET /data/{file}(防路径穿越)
- state_store:加 task_history 表 + create/update/get/list 接口
- 5 站点 with_retry 改为返回 True/False,供 dispatch_task 判成败
- main_router:重写为复用 runtime 的交互模式(行为不变)
- requirements:加 fastapi、uvicorn
- CLAUDE.md:补充运行模式与共享核心架构说明
线程模型:主线程 FastAPI 不碰 Playwright,worker 线程独占 page,经 Queue + SQLite 通信。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-17 00:04:39 +08:00 |
|