Kingdee Miscellaneous Inbound to MES Inspection Sign-off: Inventory Sync Strategy Tutorial
What This Strategy Solves
In discrete manufacturing QA workflows, "inbound" and "inspection" often span two systems: the ERP side records the inbound document after approval, while the MES side must create an inspection task to trigger quality checks. This strategy pushes Kingdee Cloud miscellaneous inbound documents into the MES inspection sign-off endpoint, so inspectors see newly created pending tasks as soon as they log in—eliminating manual re-entry and missed records.
Data Flow and Field Mapping
Data flows from Kingdee Cloud to the MES, using a flat structure: each entry row in the Kingdee miscellaneous inbound document maps directly to one MES inspection task record.
Key field mapping table:
| Business Meaning | Source Field (Kingdee STK_MISCELLANEOUS) | Target Field (MES creatQmsInspectTaskDto) | Mapping Notes |
|---|---|---|---|
| Document Number | FBillNo | inspectNo | Direct mapping; serves as inspection number |
| Entry Row ID | FEntity_FEntryID | — | Key for idempotency control |
| Material | FMATERIALID | materialUuid | Requires master data mapping |
| Warehouse | FSTOCKID | receiveInvDetailUuid | Warehouse ID passed through |
| Quantity | FQty | inspectNum | Convert to int |
| Unit | FUnitID | weightUnitName | Target expects unit name; may need lookup |
| Department | FDEPTID | deptName | Same as above; may need lookup |
| Supplier | FSUPPLIERID | supplierUuid | Requires master data mapping |
| Company Code | — | companyCode | Constant value |
How to Configure on Qeasy
We use Qeasy Data Integration Platform to host the entire pipeline. Configuration typically falls into three parts:
- Source dataset: Pick Kingdee Cloud's
executeBillQuery(POST). Tick material ID, warehouse ID, document number, etc. Use the incremental filterFApproveDate>='{{LAST_SYNC_TIME|datetime}}'and addFDocumentStatus='C'to sync only approved documents. - Target API: Pick the MES
creatQmsInspectTaskDtoWebAPI (POST). Company code is a constant; other fields reference source variables. - Scheduling: Set cron to
* 7-22 * * *to cover daytime operations.
For the common encoding mapping challenge, Qeasy lets you maintain "Kingdee Material → MES Material" and "Kingdee Supplier → MES Supplier" in dedicated master data sync strategies, then use _findCollection or _mongoQuery to look up UUIDs here. This is one of the most common patterns among Qeasy customers—centralized encoding mapping management—avoiding duplicate mapping logic in every transactional strategy.
Implementation Steps
A phased rollout is recommended:
- Set the incremental starting point: For the first full run, set
LAST_SYNC_TIMEto a historical date (e.g., 7 days before go-live) to pull a batch of historical documents and verify the pipeline. Then switch to incremental by approval date. - Full sync and reconciliation: After the full run, spot-check in MES that inspectNo, inspectNum, and materialUuid align one-to-one with the Kingdee inbound document—confirming no duplicates and no missing rows.
- Schedule frequency: After stabilization, run hourly via
* 7-22 * * *. Stop outside working hours to reduce source DB pressure. For more real-time needs, add an event trigger on Qeasy as a complement.
The "incremental + full dual-track" approach is also common among Qeasy customers—incremental polling during the day, periodic full sync overnight or on weekends as a safety net.
Lessons Learned from the Field
- Unit/department IDs vs names mismatch: Kingdee's
FUnitIDandFDEPTIDget pushed as IDs, but if MES expects names (e.g., KG, "Procurement Dept"), the inspection task ends up with an empty unit and an ID string in the department field. The safe approach is to use_findCollectionin Qeasy to look up unit/department names from Kingdee's master tables, or make MES accept ID input. - Direct material UUID fails MES lookup: Passing Kingdee's
FMATERIALIDdirectly sometimes can't be resolved by certain MES versions—the inspection task is created successfully, but the material shows blank. Confirm the "Kingdee Material → MES Material" master data strategy is live first, then use_findCollectionfor lookup. - Incremental window misses cross-hour approvals: With
FApproveDate>='...', if the schedule fires exactly on the hour, documents approved at 21:59 may be missed. MoveLAST_SYNC_TIMEback 5–10 minutes, or switch to finer-grained triggers. - Draft documents get pushed: Without
FDocumentStatusfiltering, Kingdee's drafts/temp saves also flow through, giving inspectors meaningless tasks. Always addFDocumentStatus='C'in the FilterString. - purchaseOrderNo semantic misalignment: Stuffing FBillNo into purchaseOrderNo is a common shortcut, but miscellaneous inbound isn't always purchasing inbound—this can confuse MES business traceability. Leave the field empty and configure it separately after confirming the actual business scenario.
Applicable and Non-applicable Scenarios
Applicable: Manufacturers that already have an MES QA process, a standard "miscellaneous inbound" approval node in ERP, and a need to automatically trigger inspections. Not applicable: intermediate environments where material/supplier master data mapping isn't ready, MES versions that don't support idempotency by document number, and scenarios where batch, production date, or expiry date fields must be populated but aren't covered in the current mapping—those need field extension first.