Qeasy Cloud
Get Started

Kingdee Miscellaneous Inbound to MES Inspection Sign-off: Inventory Sync Strategy Tutorial

· 系统管理员· Integration Solutions· 20 views· 4 min read
四化智造MES(API)Kingdee CloudInventory SyncMES轻易云送检签收私有化部署

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 MeaningSource Field (Kingdee STK_MISCELLANEOUS)Target Field (MES creatQmsInspectTaskDto)Mapping Notes
Document NumberFBillNoinspectNoDirect mapping; serves as inspection number
Entry Row IDFEntity_FEntryIDKey for idempotency control
MaterialFMATERIALIDmaterialUuidRequires master data mapping
WarehouseFSTOCKIDreceiveInvDetailUuidWarehouse ID passed through
QuantityFQtyinspectNumConvert to int
UnitFUnitIDweightUnitNameTarget expects unit name; may need lookup
DepartmentFDEPTIDdeptNameSame as above; may need lookup
SupplierFSUPPLIERIDsupplierUuidRequires master data mapping
Company CodecompanyCodeConstant value

How to Configure on Qeasy

We use Qeasy Data Integration Platform to host the entire pipeline. Configuration typically falls into three parts:

  1. Source dataset: Pick Kingdee Cloud's executeBillQuery (POST). Tick material ID, warehouse ID, document number, etc. Use the incremental filter FApproveDate>='{{LAST_SYNC_TIME|datetime}}' and add FDocumentStatus='C' to sync only approved documents.
  2. Target API: Pick the MES creatQmsInspectTaskDto WebAPI (POST). Company code is a constant; other fields reference source variables.
  3. 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_TIME to 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

  1. Unit/department IDs vs names mismatch: Kingdee's FUnitID and FDEPTID get 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 _findCollection in Qeasy to look up unit/department names from Kingdee's master tables, or make MES accept ID input.
  2. Direct material UUID fails MES lookup: Passing Kingdee's FMATERIALID directly 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 _findCollection for lookup.
  3. Incremental window misses cross-hour approvals: With FApproveDate>='...', if the schedule fires exactly on the hour, documents approved at 21:59 may be missed. Move LAST_SYNC_TIME back 5–10 minutes, or switch to finer-grained triggers.
  4. Draft documents get pushed: Without FDocumentStatus filtering, Kingdee's drafts/temp saves also flow through, giving inspectors meaningless tasks. Always add FDocumentStatus='C' in the FilterString.
  5. 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mes-api-kingdee-cloud-4233-mes-0026671f

Comments