Qeasy Cloud
Get Started

Vendor Master Organization Mapping Sync: From Kingdee Cloud to MySQL Middle Layer

· 何海波· Integration Solutions· 26 views· 3 min read

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 FieldMeaningRecommended MySQL Column
FSupplierIdVendor primary keyvendor_id (primary key, unique index)
FNumberVendor codevendor_code
FNameVendor namevendor_name
FCreateOrgId.FNumberCreating-org codecreate_org_code
FUseOrgId.FNumberUsing-org codeuse_org_code
FDocumentStatusDocument statusdoc_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 Cloud as the data source, API executeBillQuery, method POST, primary key FSupplierId, code field FNumber, enable idCheck.
  • Explicitly list FUseOrgId.FNumber and FCreateOrgId.FNumber in the request fields. Don't rely on "auto-fill response" — that's a classic way for org fields to be silently dropped.
  • For incremental starting point, use FSupplierId plus FModifyDate. If the response doesn't include a timestamp, fall back to full pull plus code deduplication.

Target-side configuration:

  • Choose MySQL as the data source, API mode WebAPI execute, method POST. The source's id and number are both set to "0" on Qeasy, because we write via SQL rather than Kingdee's Save/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:

  1. Incremental starting point. First run a full pull keyed on FSupplierId to 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.
  2. 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.
  3. 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

  1. Organization fields get dropped. Kingdee's FUseOrgId.FNumber is a nested object and won't appear in the response by default. It must be explicitly written into the request array; otherwise every synced vendor ends up with no organization.
  2. Primary-key conflicts. If the same vendor has multiple using organizations in Kingdee, you cannot use FSupplierId alone as the primary key when landing to the MySQL long table — combine vendor_code + use_org_code, otherwise the unique index will repeatedly reject rows.
  3. 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.
  4. Status-field semantics. FDocumentStatus in Kingdee is a document-level status; don't confuse it with "is the vendor enabled". When landing into MySQL, split it into a separate doc_status and is_active.
  5. 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mysql-kingdee-cloud-2246-mom-id-2a42b63a

Comments