Vendor Master Organization Mapping Sync: From Kingdee Cloud to MySQL Middle Layer
What This Strategy Solves
In multi-org, multi-ledger manufacturing or retail enterprises, vendors in the ERP (Kingdee Cloud) are often assigned to multiple organizations simultaneously, while downstream systems such as MES, SRM, and WMS need to query vendors by organization. In one real project, the customer needed to periodically land vendor master data and "per-organization IDs" from Kingdee Cloud into a MySQL middle layer so that downstream systems could filter by organization. We delivered this on the Qeasy Data Integration Platform: the source pulls vendors via Kingdee's executeBillQuery, and the target writes to MySQL through a generic WebAPI.
Data Flow and Field Mapping
Data flow: Kingdee Cloud (source) → Qeasy → MySQL (target).
| Kingdee Cloud Field | Meaning | Recommended MySQL Column |
|---|---|---|
FSupplierId | Vendor primary key | vendor_id (primary key, unique index) |
FNumber | Vendor code | vendor_code |
FName | Vendor name | vendor_name |
FCreateOrgId.FNumber | Creating-org code | create_org_code |
FUseOrgId.FNumber | Using-org code | use_org_code |
FDocumentStatus | Document status | doc_status |
In Kingdee, the "organization ID" is a typical multi-value field — one vendor can be effective under multiple using organizations at the same time. When landing it into MySQL, you have two choices: a wide table (one row with multiple use_org_1/use_org_2/... columns) or a long table (one row per org relationship). We recommend the long table — it scales better and is easier to integrate with SRM and WMS later.
How to Configure on Qeasy
Source-side configuration:
- Choose
Kingdee Cloudas the data source, APIexecuteBillQuery, method POST, primary keyFSupplierId, code fieldFNumber, enableidCheck. - Explicitly list
FUseOrgId.FNumberandFCreateOrgId.FNumberin therequestfields. Don't rely on "auto-fill response" — that's a classic way for org fields to be silently dropped. - For incremental starting point, use
FSupplierIdplusFModifyDate. If the response doesn't include a timestamp, fall back to full pull plus code deduplication.
Target-side configuration:
- Choose
MySQLas the data source, API modeWebAPI execute, method POST. The source's id and number are both set to"0"on Qeasy, because we write via SQL rather than Kingdee'sSave/Submit. - In Qeasy's "script node", write a single SQL statement:
INSERT INTO vendor_org_map (...) VALUES (...) ON DUPLICATE KEY UPDATE .... Centralizing the code mapping in one place is a common pattern among Qeasy customers — later field changes only touch the script, not the main flow.
Implementation Steps
We break this strategy into three rollout phases:
- Incremental starting point. First run a full pull keyed on
FSupplierIdto initialize vendor master data into the MySQL long table. After that, use "the maximum ID of the last successful sync" as the watermark, pulling only newly added or updated vendors. - Full-volume trigger. Run a weekly full-volume reconciliation in the early morning, comparing vendor counts on the Kingdee side with valid records on the MySQL side. Alert when the difference exceeds a threshold. Full-volume is a safety net, not a replacement for incremental.
- Scheduling frequency. The source-side cron is set to
*/10 * * * *, pulling every 10 minutes; the target-side MySQL write is event-driven and does not need its own cron. This "high-frequency incremental + low-frequency full-volume" dual-track pattern is widely used by Qeasy customers and is very stable.
Lessons Learned
- Organization fields get dropped. Kingdee's
FUseOrgId.FNumberis a nested object and won't appear in the response by default. It must be explicitly written into therequestarray; otherwise every synced vendor ends up with no organization. - Primary-key conflicts. If the same vendor has multiple using organizations in Kingdee, you cannot use
FSupplierIdalone as the primary key when landing to the MySQL long table — combinevendor_code + use_org_code, otherwise the unique index will repeatedly reject rows. - Scattered code mappings. Early on, we put field mappings in each strategy's "field mapping" UI. Later we centralized them in a single script node — a common pattern among Qeasy customers. One change takes effect everywhere.
- Status-field semantics.
FDocumentStatusin Kingdee is a document-level status; don't confuse it with "is the vendor enabled". When landing into MySQL, split it into a separatedoc_statusandis_active. - Don't copy the target-side cron literally. In the source material the target-side cron is
1 1 1 1 1(a placeholder). In real projects, the MySQL write is event-driven and doesn't need a cron; filling in a wrong value can cause delayed or duplicate writes.
When to Use and When Not to
Use it for: multi-org group enterprises where vendors need to be distributed to MES/SRM/WMS by organization, and any project that needs vendor master data governance. Don't use it for: vendors used only in a single organization and a single system, or scenarios with strict real-time requirements (< 10 seconds) — those should go through a message queue, not scheduled polling.