7.4 KiB
联泰下单助手
Chrome MV3 unpacked extension for the LTJT ERP business-operation workflows.
What It Does
- Parses a raw Chinese order instruction or accepts the same structured JSON used by the local adapter.
- Opens the LTJT
orders_add.aspform inside the logged-in ERP page. - Resolves choice-backed fields from existing LTJT options.
- Runs the product template side effect through the page's own
Find_product(). - Rebuilds receivable rows from the supplied passenger counts and prices.
- Captures the page's own
SubmitInfoForm()branch withDoInfoJHblocked before network. - Allows live submit only after a passed preflight and captured submit hash. In the mock business-system flow, the background executor submits test orders automatically without opening the popup.
- Verifies the saved test order through
JH_OrderListby departure date and obvious test marker. - Returns the ERP order-entry frame to the independent-order list after verification, filtered by departure date and the obvious test marker.
- Keeps the extension popup as a minimal business-system connection status panel with an ERP-operation enable switch.
- Persists a server-issued
execution_idguard before starting. A duplicate page message, page refresh, bridge reinjection, or extension service-worker restart cannot execute the same task again. - Persists
write_startedbefore any real ERP write. Any crash or unknown result after that boundary becomes reconciliation-required and is never retried automatically.
Absorbed ERP Operation Rules
The extension now recognizes the handoff package's complete business-operation matrix instead of treating every non-create task as an invalid order:
team_order_create: the existing guarded browser path; live submit remains test-only.team_order_batch_create: recognizes the handoff rule that nativeDoInfoJHsis deferred and, for an explicitly marked test task, runs the verifiedteam_single-per-date fallback. It stops at the first incomplete date and never claims native batch execution.shared_plan_createandshared_child_order_create: for explicitly marked test tasks, resolve exact ERP choices, submit the native split-plan/child-order forms, and re-query the parent/list row. The current live adapter supports one date and one plan per date.order_update: preserves structuredset/delta/appendactions, can preview room/remark changes against a browser-read snapshot, and never broad-overwrites or saves from the preview.passenger_list_import: preserves attachment paths and traveler-upsert intent, checks that the task has an existing identifier, and keeps workbook parsing/import/count verification outside the page planner.confirmation_export: normalizes Xingyou/Liantai/JOB aliases, locates the order and correctddid/tid, fetches the Word-like source responses, and never re-saves an order during recovery. It reports source responses, not a local download or customer delivery.
The pure planning rules live in operation-plans.js. inpage.js contains the guarded split create, export-source, and read-only order/traveler probes. Business rules remain testable without opening Chrome or touching ERP.
Install Locally
-
Open Chrome and go to
chrome://extensions. -
Enable
Developer mode. -
Click
Load unpacked. -
Select this folder:
/Users/inmanx/Documents/lwltAPI/chrome-extension/ltjt-order-assistant -
Open or refresh the logged-in LTJT ERP page:
https://ltjt.yunzhi.run/System/Mainlt.asp. -
Click the extension icon and use the popup.
Safe Test Flow
- Paste the raw instruction or structured JSON.
- Click
解析/格式化. - Click
预检并拦截. - Review the report. A good preflight has:
status = raw_instruction_test_passedsubmit_intercept.status = submit_intercept_captured- no blockers
- Tick the confirmation checkbox.
- Click
确认真实保存. - Click
回查标记.
Mock Business-System Flow
The repository also contains a tiny mock business-system page:
/Users/inmanx/Documents/lwltAPI/mock-business-system
When opened through a local HTTP server, the page communicates with the extension through business-bridge.js.
For the production-hardened control plane, use the central server at its configured HTTPS origin. The page owns the administrator session and the extension remains a session-bound ERP adapter; chrome.storage.local is only a temporary execution cache. The production manifest must include the real business-system origin in its host_permissions and content_scripts.matches before packaging.
-
Reload the unpacked extension after any code change.
-
Start the mock business-system server:
cd /Users/inmanx/Documents/lwltAPI/mock-business-system node server.mjs -
Open the mock page at
http://127.0.0.1:8765/. -
Paste the raw business instruction into the single text box.
-
Configure
DEERFLOW_BASE_URLandDEERFLOW_OPEN_API_KEYin the mock business-system server environment before starting it. -
Click
解析并创建任务. -
The mock page creates a task card immediately.
-
The extension background executor automatically finds or opens the logged-in LTJT ERP tab, runs preflight, submits the obvious test order, and verifies the marker.
-
Track progress from the task card in the mock page. The popup remains available for manual debugging, but business users do not need to open it.
The mock page calls its local /api/parse endpoint. The server creates one independent Open Agent Session per task, streams the request to the published external Profile, and returns the standard operation JSON. The external Profile prompt and API policy are managed outside this repository; the browser never receives the external API key.
Current Guardrails
- Version
0.3.1only permits live submit fororder_nature = teston the team and split-create routes and requires a server-issued execution ID. - Reload the unpacked extension after upgrading. The business page refuses new ERP execution when the connected extension is older than
0.3.1. - Deleting a business task requests cancellation of its matching background task before removing the task card and stored bridge records. A browser/ERP action already in flight cannot be rolled back by deletion.
- A non-empty
data.test_markeris required. - The live submit uses the intercepted
DoInfoJHpayload hash as the approved hash. - If the actual submit payload hash differs at network-send time, the extension blocks the request.
- Split create has a live test-only adapter; export is read-only source fetch with
neverResave=true. - Order update and traveler import remain read-only at the business-system layer. Live ERP update requests returned HTTP 200 with an empty body and did not persist in the current account, so the extension fails closed instead of claiming success.
- The ERP native traveler paste routine can fill test rows, but its phone-column mapping is offset by earlier same-name controls; do not reuse it for production traveler data without a row-scoped import fix.
- Export recovery is
exportOnly/neverResave; an export failure cannot route back into create-order. - Traveler attachments stay as paths/metadata in the task; the extension does not silently open local workbooks or put traveler PII into audit output.
- The extension does not store account passwords or cookies.
Notes
This is a browser-session adapter, not an official LTJT API client. It depends on the logged-in ERP page, the existing page JavaScript, and the current form field names.