Syncing Kingdee Cloud Cosmos Master Material Data to MES: A Practical Incremental Strategy with Qeasy
What This Strategy Solves
In a private deployment at a manufacturing enterprise, Kingdee Cloud Cosmos serves as the ERP for master data, while a discrete MES handles shop-floor execution. Material codes, names, specifications, base units, and inventory categories must flow from the ERP into the MES—otherwise shop-floor issuing, BOM maintenance, and line reporting all stall. We use the Qeasy data integration platform to carry this one-way sync. The goal is straightforward: keep MES material master data consistent with the ERP without disturbing production hours. We pick an incremental pattern—filtered by modification time, use organization, and material group—so each material change is pushed to MES within an hourly window.
Data Flow and Field Mapping
Data flows in one direction only: Kingdee Cloud Cosmos (source) → Qeasy intermediate layer → MES (target). The source calls executeBillQuery against the BD_MATERIAL form; the target writes /api/createMaterialInfo. The intermediate layer handles field mapping, incremental cursor (LAST_SYNC_TIME), and pagination.
Key field mapping:
| Target Field (MES) | Source Field (Kingdee) | Mapping Type | Notes |
|---|---|---|---|
| companyCode | Constant fdd8dc88 | CONSTANT | Company code, fixed |
| classifyNo | FMaterialGroup | DIRECT | Material category UUID |
| parentClassifyNo | FMaterialGroup | DIRECT | Top-level category, same as classifyNo |
| materialUuid | FMasterId | DIRECT | Master key used as MES material UUID |
| partNo | FNumber | DIRECT | Material code |
| gradeName | FName | DIRECT | Material name |
| spec | FSpecification | DIRECT | Specification |
| unitUuid | FBaseUnitId | DIRECT | Unit of measure UUID |
| purchaseUnitUuid | FBaseUnitId | DIRECT | Purchase unit UUID, same as unitUuid |
| erpClassifyCode | FCategoryID.FNumber | DIRECT | ERP inventory category code passthrough |
| quality / brand / picNo / picVersion / texturesType / density / coefficient | Constant "" | CONSTANT | Not maintained on MES side, empty string |
Note: both
classifyNoandparentClassifyNodirectly take the Kingdee material group ID. This means the material-group strategy must run first, otherwise the MES side will receive a category UUID that does not exist and the write will fail. Mark this dependency explicitly in the metadata.
Configuring in Qeasy
In the Qeasy strategy editor, four configuration points matter for this strategy:
- Source metadata: API
executeBillQuery, form IDBD_MATERIAL, pagination Limit 2000,TopRowCount=0(do not return total row count, to reduce source pressure), filterFUseOrgId.fnumber='100' and FModifyDate>='{{LAST_SYNC_TIME|dateTime}}' and FMaterialGroup.FNumber!='virtual'. - Target metadata: API
/api/createMaterialInfo, POST, write row by row (autoFillResponse=true,idCheck=true). - Field mapping: Configure DIRECT and CONSTANT entries per the table above. If MES unit UUIDs diverge from Kingdee IDs in the future, switch
unitUuidandpurchaseUnitUuidfrom DIRECT to COLLECTION and introduce a unit code mapping table. - Centralized coding mapping: A common pattern among Qeasy customers is to place all master-data coding mappings in a dedicated "coding hub" strategy set and reuse them via
_findCollectionacross strategies, rather than maintaining them per strategy. This strategy currently has no cross-strategy lookup, but leave room for it.
Implementation Steps
We recommend a three-phase rollout:
- Phase 1: material group first. Stabilize the "Kingdee material group → MES material category" strategy first. Confirm MES category UUIDs map one-to-one with Kingdee
FMaterialGroup. This is the prerequisite for the material master strategy. - Phase 2: trigger a one-time full sync. For go-live, set
LAST_SYNC_TIMEto a historical start point (for example, one year back) and trigger a manual full sync to flush historical materials into MES. This step exposes any missing mappings (empty spec, unreachable FCategoryID, and so on). Run outside production hours. - Phase 3: incremental steady state. Schedule
* 7-22 * * *, hourly during the 7:00–22:00 working window, avoiding the overnight MES maintenance window. After one week, observe whetherLAST_SYNC_TIMEadvances steadily and per-window row counts converge (ideally most windows return zero to a few dozen rows).
A typical Qeasy pattern, "incremental and full dual track", is to keep a separate full-sync strategy (manually triggered, low frequency) as a fallback while daily traffic runs on the incremental strategy; when issues arise, you can always re-flush.
Lessons Learned from the Field
- Pitfall one: running material before material group is synced.
classifyNodirectly takesFMaterialGroup; if the group strategy has not run, MES writes fail because the category UUID does not exist. The safe approach is to declaredepends_onin the metadata and let the scheduler trigger strategies serially. - Pitfall two: not excluding virtual materials. If the source filter omits
FMaterialGroup.FNumber!='virtual', MES receives a pile of virtual materials that exist in ERP only for auxiliary accounting and pollutes the MES master list. - Pitfall three: blindly passing through unit UUIDs. In this strategy, MES unit UUIDs happen to equal Kingdee
FBaseUnitId, so DIRECT works. But if MES uses a different auto-increment ID,unitUuidwill hold the wrong value—and it will not raise an error; subsequent business queries simply find nothing. The safe approach is to verify against the coding mapping table up front, switching to COLLECTION if needed. - Pitfall four: empty fields written as null. Fields such as
qualityandbrandare intentionally empty, but some target interfaces validate strictly and expect empty strings rather than null. We configure these as""constants in Qeasy to avoid HTTP 400 responses. - Pitfall five: ignoring unmapped fields. Fields like
FOldNumber,FForbidStatus, andFIsBatchManageare not currently written. Three months later, when business needs forbidden-status sync or batch management, you will revisit the mapping from scratch. The pragmatic move is to expose these fields on the source metadata even if the target does not yet map them, so future expansion does not require going back to Kingdee to add fields.
Where This Strategy Applies—and Where It Doesn't
Applies: one-way ERP-to-MES master material sync, where the source provides reliable modification timestamps, the target supports upsert by material UUID, and there is no requirement to write MES-side fields back to ERP.
Does not apply: scenarios that need bidirectional material change sync, scenarios that require MES to feed routing or BOM back into ERP, and legacy ERPs whose modification timestamps are unreliable (for example, batch imports). In those cases, switch to event-driven or full-comparison approaches instead of this incremental strategy.