Commit Graph

67 Commits

Author SHA1 Message Date
Misaka
5d13c13f40 Close Shunxin tabs after each stage via shared _close_tab helper
- Add _close_tab(page, tab_name) for closing Ant Design Tabs by label
- Close 运单列表 / 车辆点到 in the expected-arrival flow after export
  submission, and 数据导出 after download/merge
- Close 卸车扫描记录 and 数据导出 likewise in the actual-arrival flow
- Renumber step comments

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 21:47:05 +08:00
Misaka
a67b64f8f8 Auto-login Yunda and switch router to ready-guard polling
- Add yunda_login: probe the login page, fill credentials from
  config.yaml (yunda.username/password), submit; no-op if already
  logged in
- main_router: register per-site READY_SELECTORS and replace the
  blocking input() with a ready-guard poll loop; invoke Yunda
  auto-login up front; simplify site-init cleanup
- site_yunda: drop the custom frame probes in favor of native
  frame_locator("section iframe")
- Skip handover rows already marked 已绑定; abort the export harvest
  when no tasks were submitted
- Fix NameError from undefined username/password fallback

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 21:33:09 +08:00
Misaka
e8b789e906 Add anti-collapse menu nav and fix multi-tab Strict Mode leakage
- Rewrite yunda_smart_menu_click to check each parent submenu's
  is-opened state before clicking (skip if already open), using XPath
  parent-child isolation to avoid collapsing accordion menus
- Scope the expected/actual-arrival loading mask, #sum panel, and
  empty-record hint to #tab-1 and add .first to fix Playwright Strict
  Mode (5 elements found) leaks across multiple open tabs
- Move _yunda_poll_and_download_tasks above yunda_actual_download for
  definition order

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 19:22:01 +08:00
Misaka
604d1822e4 Implement Yunda actual-arrival download and harden query loading
- Implement yunda_actual_download via the 报表管理 -> 扫描记录查询
  menu: set date range, switch scan type to 到件, then reuse the
  shared poll/download/merge engine
- Add a three-stage query buffer (yield, wait for the Bootstrap Table
  loading mask, settle) before the data/empty verdict to avoid stale
  DOM reads in the expected-arrival flow
- Trim the offline-export retry state machine's verbose logs
- Fix a typo (研编 -> 研判) and drop the 待开发 tag on menu [7]

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 18:59:49 +08:00
Misaka
194fbc7cda Integrate Yunda site module and rewire router menu numbering
- Add site_yunda.py: Yunda expected-arrival download (进站交接单查询)
  with Layui date-range setup, row double-click export, a retry state
  machine for the offline-export dialog, and a shared poll/download/
  merge engine; actual-arrival is a placeholder
- Wire Yunda into main_router: site URL, login detection, menu items,
  and read yunda.query_days from config.yaml
- Rework the hub menu: drop the standalone Shunxin local-compare entry,
  renumber modules (百世 3, 中通 4/5, 韵达 6/7), keep global compare [9]
- Streamline site-init cleanup and log wording

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 18:20:46 +08:00
Misaka
eb9bbe9b70 Harden ZTO export flows and close site tabs after each stage
- Poll #inEwbCount until it updates before reading the result, then
  branch on zero-count (confirm empty-data area vs missing flag)
- Wait for real grid rows to render in the expected-arrival flow
- Close the active site tab (进站交接单查询 / 到件扫描监控 / 导出任务管理)
  after each stage completes to reset the page state
- Tighten export-task time-match window from 60s to 20s
- Trim verbose log messages and stale comments

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 15:24:48 +08:00
Misaka
358b8327b9 Implement ZTO actual-arrival download and extract shared poll engine
- Implement zto_actual_download via the 到件扫描监控 menu with 子单
  number-type filter, reusing the common download flow
- Extract the export-task poll/verify/download/merge steps into
  _zto_poll_and_download_tasks so both ZTO flows share it
- Tighten task time-match window from 120s to 60s and add a
  refresh-and-recheck loop when expected tasks are missing or pending
- Drop unused _ensure_menu_expanded helper
- Update menu [6] label since actual-arrival is now implemented

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-20 13:48:28 +08:00
Misaka
9375b6efd6 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>
2026-06-20 12:46:46 +08:00
Misaka_Company
7f8d81af21 Add zero-count validation for Baishi undelivered data extraction 2026-06-17 15:27:51 +08:00
Misaka_Company
7cae24fae3 Add PyYAML dependency to fix missing yaml module 2026-06-17 15:11:03 +08:00
Misaka
b127ef6165 Fix Baishi scan-query selector ambiguity and add password guard
- Scope the 扫描综合查询 click to .nav-level2-wrapper to avoid collision with the right-side tab of the same name
- Warn when config.yaml has no baishi.password before attempting export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-16 22:32:10 +08:00
Misaka
5c3225388e Add multi-round popup cleanup engine for Baishi site initialization
- Loop up to 5 rounds to dismiss 阅读完毕 / 配置检查 / 通知提示 / 广告 popups until the page is clean
- Revert undelivered-data docstring to dynamic-prefix wording

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-16 22:20:07 +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
497fd11674 Add per-site file prefix for undelivered-data comparison
- task_process_undelivered_data now accepts site_name (default 顺心)
  and reads/writes {site}-{应到/实到/应到未到}货物数据.xlsx
- Menu option 5 prompts for site name before running reconciliation
- Update 顺心 site outputs to 顺心-应到/实到货物数据.xlsx naming
- Remove redundant inline comments in site_shunxin.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-15 22:09:12 +08:00
Misaka
411a2487fc Refactor monolithic script into multi-site module architecture
- Introduce main_router.py as multi-site controller with interactive menu
- Extract 顺心 site logic into site_shunxin.py (expected & actual download)
- Add site_baishi.py stub for upcoming 百世 integration
- Add global 应到未到 data reconciliation via Left Anti-Join on 运单号

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-15 22:02:51 +08:00
Misaka
b0c82bc23d Update selectors and query flow in expected/actual goods tasks
- Use regex-based locator to match 已发/已到 status options robustly
- Switch to role-based selectors for 查询 button and 任务标题 column
- Trigger additional 查询 after entering 数据导出 page to refresh list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-15 21:29:06 +08:00
Misaka_Company
e5205760a0 Initial commit: InboundVerify automation scripts for logistics data processing 2026-06-15 18:18:51 +08:00