OrderBridge:用 AI 半天做一个工具OrderBridge: Building a Tool in Half a Day with AI
从电话手写到全自动化 · 内部分享 · Jack Deng · IT 部门 · 2026
From Phone & Handwriting to Full Automation · Internal Knowledge-Share · Jack Deng · IT Dept. · 2026
一、背景与项目目的1. Background & Purpose
客户电话下订单,员工接听并手写记录 SKU、数量、客户名,再手动录入 NetSuite ERP。
Customers placed orders over the phone. Staff answered, wrote down SKUs, quantities, and customer names by hand, then manually entered everything into NetSuite ERP.
客户填写标准化 Excel 订单表(Form1 / Form2)发回,系统自动生成 NetSuite 可直接导入的 CSV 文件。
Customers fill in a standardized Excel order form (Form 1 or Form 2) and email it back. The system automatically produces a CSV ready to import directly into NetSuite.
把收订单 → 录订单的全流程压缩到「拖入文件 + 选择客户 + 一键导出」,操作人员无需懂技术。
Compress the entire order-receipt-to-entry workflow into three steps — drop file, select customer, export — with no technical knowledge required from the operator.
二、解决的痛点2. Pain Points Solved
| 旧流程痛点Old Process Pain Point | 说明Description |
|---|---|
| 📞 客户电话报货📞 Phone-in orders | 员工手写听错、写错、漏记 |
| 🔍 逐行查 NetSuite Item ID🔍 Manual Item ID lookup | 耗时,815 个 SKU 难以记忆 |
| 📊 手动整理 Tariff 分区逻辑📊 Manual Tariff zone sorting | 规则复杂,容易出错 |
| ⌨️ 重新录入 ERP⌨️ Re-entering data into ERP | 重复劳动,效率低 |
三、实现方法:三层架构3. How It Works: Three-Layer Architecture
- 815 个 SKU 本地参考 CSV(含料件分类、Tariff Code)
- 815-SKU local reference CSV (with item category and Tariff Code)
- NetSuite 实时数据:通过 SuiteQL REST API + OAuth 1.0 认证查询
- Live NetSuite data: queried via SuiteQL REST API with OAuth 1.0 authentication
- 读取 Excel 订单(第 6 行为表头,提取 SKU + 数量)
- Read Excel order (row 6 = header; extract SKU + quantity)
- 本地匹配分类和 Tariff Code
- Match category and Tariff Code from local reference
- 批量查询 NetSuite Item ID
- Batch-query NetSuite Item IDs
- 自动分区排序:有 Tariff 的料件进「上区」,无 Tariff 进「下区」,GSCO SKU 优先置顶
- Auto-sort into zones: items with Tariff Code → upper zone; without → lower zone; GSCO SKUs pinned to top
- 自动插入 Subtotal + Tariff Surcharge 行
- Auto-insert Subtotal and Tariff Surcharge rows
- 🖱️ 拖拽 .xlsx 或点击浏览
- 🖱️ Drag-and-drop .xlsx or click to browse
- 🔍 输入客户名实时搜索 NetSuite 客户
- 🔍 Type a customer name to search NetSuite customers in real time
- 🎨 预览表格(颜色区分上下区,标红未匹配 SKU)
- 🎨 Preview table with color-coded zones; unmatched SKUs highlighted in red
- 📤 一键导出 CSV,含自动生成 External ID
- 📤 One-click CSV export with auto-generated External ID
- 📦 打包为单文件 .exe,无需安装 Python
- 📦 Packaged as a single-file .exe — no Python installation needed
四、版本迭代(半天完成两个版本)4. Version History (Half a Day, Two Versions)
上午 — 核心功能跑通Morning — Core pipeline working
Excel 读取 → NetSuite 查询 → CSV 导出;基础 GUI,支持文件浏览和客户选择
Excel read → NetSuite query → CSV export. Basic GUI with file browse and customer selector.
下午 — 体验升级Afternoon — UX upgrades
拖拽文件支持(tkinterdnd2);预览表格颜色标记(上/下区、映射状态);字体调节(A−/A+);未匹配 SKU 警告;打包为独立 .exe
Drag-and-drop support (tkinterdnd2); color-coded preview table (upper/lower zone, mapping status); font-size buttons (A−/A+); unmatched-SKU warning dialog; packaged as standalone .exe
⏱ 总耗时:约半天Total time: ~half a workday
五、成果对比:流程前后5. Results: Before vs. After
| ⚠️ 旧流程(人工)Old Process (Manual) | ✅ 新流程(OrderBridge)New Process (OrderBridge) | |
|---|---|---|
| 步骤 1Step 1 | 客户致电,员工接听并手写记录 SKU、数量、客户名Customer calls in; staff answers phone and hand-writes SKU, quantity, and customer name | 客户填写标准化 Excel 订单表后发回邮件Customer fills in the standard Excel order form and emails it back |
| 步骤 2Step 2 | 人工逐行查阅 NetSuite,确认 815 个 SKU 对应的 Item IDStaff manually looks up each Item ID in NetSuite across 815 SKUs | 从邮件下载 Excel,拖入 OrderBridge 窗口Download Excel from email, drag & drop it into the OrderBridge window |
| 步骤 3Step 3 | 手动整理 Tariff 分区逻辑,查分类规则Manually sort Tariff zone logic and check category rules | 搜索并选择客户,点击「生成 CSV」Search & select the customer, then click "Generate CSV" |
| 步骤 4Step 4 | 逐行录入 NetSuite ERP,核对后提交 Sales OrderEnter every line into NetSuite ERP, verify, and submit the Sales Order | 直接将 CSV 导入 NetSuite,完成Import the CSV directly into NetSuite — done |
| ⏱ | 几十分钟(且易出错)Tens of minutes (and error-prone) | 约 3 分钟 ✨~3 minutes ✨ |
六、AI 的帮助:角色分工6. How We Used AI: Division of Labor
👤 人做的Human
- ✅描述业务需求和业务规则Defined business needs and rules
- ✅提供 Excel 样本和字段说明Provided Excel samples and field descriptions
- ✅测试运行,反馈 bugRan tests and reported bugs
- ✅说明 NetSuite API 认证方式Explained the NetSuite API auth method
- ✅说"要能拖拽"、"要打包 exe"Said "make it drag-and-drop" and "package as .exe"
🤖 AI 做的AI
- ⚡设计模块结构、编写全部代码Designed module architecture, wrote all code
- ⚡解析文件格式,写出读取逻辑Parsed file format, built the read logic
- ⚡定位问题,修改代码Diagnosed issues and patched the code
- ⚡实现 OAuth1 + SuiteQLImplemented OAuth1 + SuiteQL
- ⚡选库、集成、配置 PyInstallerSelected libraries, integrated, configured PyInstaller
七、掌握 AI 管理:BRACE 框架7. Mastering AI: The BRACE Framework
要像管理专业实习生一样管理 AI。初学者常犯的错误是把 AI 当搜索引擎用。BRACE 框架通过五个维度规范指令,大幅提升输出质量。
Manage AI like a highly capable but very literal intern. A common beginner mistake is treating AI like a search engine. The BRACE framework structures prompts across five dimensions and dramatically improves output quality.
提示词对比示例Prompt Comparison Example
八、人的思想对结果的影响8. The Human Element: How Thinking Shapes the Outcome
🧠 业务规则必须由人来定义 — AI 不知道 GSCO 要优先、Tariff Surcharge Item ID 是 12316,这些只有人能提供。
🧠 Business rules must come from humans — AI did not know that GSCO SKUs go first, or that the Tariff Surcharge Item ID is 12316. Only we could provide that.
👤 对用户是谁的判断影响 UI 设计 — 因为操作人员不是程序员,才有了拖拽、中文提示、颜色预览。
👤 Who the user is shapes the UI — Because the operator is not a developer, we got drag-and-drop, color previews, and clear status indicators.
🧪 测试要覆盖真实场景 — "路径含空格的文件"这种边界情况,只有真实测试才能发现。
🧪 Tests must cover real scenarios — Edge cases like "file path contains a space" only surface through real-world testing.
🛑 适时踩刹车 — AI 会建议加配置热重载、单元测试框架;这个体量「够用就好」。
🛑 Know when to stop — AI suggested adding hot-reload config and a full unit-test framework. At this scale, "good enough" is the right call.
九、实战小 Tips9. Quick Tips
- 先说数据格式,再说功能Describe your data format first, then the feature — 文件结构说清楚,AI 基本不会猜错。A clear file structure leaves no room for AI to guess wrong.
- 把完整报错直接贴给 AIPaste the full error message directly — 不用自己先分析,AI 通常能直接定位。No need to analyze it yourself; AI will usually pinpoint it.
- 一次改一个问题Change one thing at a time — 多个需求堆一起容易改乱。Stacking multiple requests leads to tangled edits.
- 让 AI 解释它做了什么Ask AI to explain what it just did — 有助于下次表述更准确。This builds your vocabulary for the next prompt.
- 打包 exe 要单独处理资源路径Handle resource paths specially when packaging an .exe —
resource_path()是 PyInstaller 常见坑。resource_path()is a classic PyInstaller gotcha. - 不需要会写代码,但需要会读代码You don't need to write code, but you need to read it — 能看懂才能判断 AI 的实现是否正确。Being able to review AI output is what keeps you in control.
VWD AI Guide v3.9 | VWD | 2026 | IT Department