Qeasy Cloud
Get Started

Inventory Overage Sync in Practice: From JikuCloud to Kingdee Cloud Galaxy

· 吕修远· Integration Solutions· 28 views· 4 min read

What This Strategy Solves

An overage document (盘盈单) is generated when physical inventory exceeds book inventory after a stocktake. Its core purpose is to write the WMS-side stocktake result back to the finance/ERP inventory organization so that book and physical stock stay aligned. In one real project, a retail enterprise used a WMS for daily inbound/outbound and stocktaking, while the ERP handled inventory organization and financial accounting. Because overage documents were not flowing between the two systems, the books and physical stock stayed out of sync at month-end. We used the Qeasy data integration platform to push overage documents from the source system to the target system in an incremental, traceable, and replayable way.

Data Flow and Field Mapping

The overall flow is: source system (WMS, stocktake query API) → middle layer (Qeasy) → target system (Kingdee.Cloud, overage document write API). The middle layer handles time-windowed pagination, field renaming, code mapping, and idempotency control.

Key field mapping:

Business meaningSource field (stocktake query)Target field (overage doc)Notes
Document numberstocktakeIdFBillNoPass through
Document type—FBillTypeIDFixed value PY01_SYS
Inventory org—FStockOrgIdFixed value 101, tenant-configurable
Owner type—FOwnerTypeIdHeadBD_OwnerOrg
Owner—FOwnerIdHeadSame as inventory org
DateStocktake timeFDateMapped from source
Warehouse codewarehouseCodeFStockId (body)Centralized code mapping
Barcode/SKUskuBarcodeFMaterialId (body)Material code mapping

The source is a query API with pagination and start/end stocktake timestamps; the target is an execute-type batch save API with a clear header-body structure. A common pattern is "header and body in stages": land header fields first, then the body detail rows.

How to Configure on Qeasy

On the Qeasy integration platform, this strategy is a standard "source query → target execute" chain.

Configuration usually focuses on these points:

  1. Source data source: Select the WMS connector, API wms.stocktake.get, method POST. In the request body, express startPdDate with the variable {{DAYS_AGO_3|datetime}} for a rolling window; set pageSize to 20 and use a loop variable for pageIndex.
  2. Target data source: Select the Kingdee.Cloud connector, choose the overage document batch save API, hard-code FBillTypeID as PY01_SYS, and route organization-type fields via tenant-level constants.
  3. Code mapping: Maintain warehouse and material code mappings centrally in Qeasy's code-mapping module rather than scattering them across strategies. Both source warehouseCode and skuBarcode go through mapping tables to look up target codes. This is one of the common patterns Qeasy customers use.
  4. Idempotency and replay: Use the source stocktakeId as the idempotency key. The platform layer deduplicates so failures can be replayed without producing duplicate documents.
  5. Separate variables from constants: Dates, organizations, and document types are relatively stable; put them in tenant constants. Business fields go in request body variables. Switching organizations later only requires changing one place.

Implementation Steps

Phased scheduling is the safe approach. A common Qeasy customer pattern is "full and incremental in parallel":

  • Incremental start point: On first go-live, set the source startPdDate to the business start date and run a one-time historical full load to backfill existing overage documents. At the same time, record the maximum stocktakeId or maximum stocktake timestamp as the incremental start point.
  • Full load trigger: After historical data is backfilled, switch the strategy to incremental mode and only push new or status-changed overage documents going forward.
  • Scheduling frequency: Use 20 3 * * * for the source strategy (triggered at 03:20, off-peak) and 55 3 * * * for the target strategy (triggered at 03:55). The 30+ minute gap leaves time for the source to paginate and clean data, and avoids both sides contending for database connections at the same time.
  • Phased rollout: First run a head and a tail document end-to-end in a test tenant; then open up full volume. During the first week after go-live, manually reconcile document numbers, quantities, and amounts daily; once stable, drop to weekly spot checks.

Pitfall Recap

  1. Stocktake time window misaligned: A typical mistake is using calendar-day start/end, which causes stocktake tasks that span midnight to be missed. The safe approach is to use the source stocktake creation or completion time as the window boundary, plus a 1–2 minute buffer.
  2. Code mappings scattered across strategies: Changing a warehouse code once means editing it across a dozen strategies, which is easy to miss. Centralizing them in Qeasy's code-mapping module lets a single edit take effect globally.
  3. Header and body stuffed into one request body: The target's batch save API is sensitive to header-body structure, and a wrong field order will fail the whole document. The safe approach is to land header fields first, then body rows in batches, and retry failed rows individually.
  4. No idempotency key designed: A failed first run, when re-run, produces duplicate overage documents in the target system—only caught during financial reconciliation. This is a common pitfall. Always set an idempotency key at the strategy layer and deduplicate on the platform side.
  5. Organization constants hard-coded: When different organizations go live, FStockOrgId, FOwnerIdHead, and similar values need to change with the tenant. Keep them as tenant-level variables so adding or switching organizations later only requires changing one place.

Applicable and Non-Applicable Scenarios

Applicable: scenarios where WMS handles execution and ERP handles accounting, where overage/loss inventory adjustment documents need to be synced daily, and where the organization models on both sides are basically aligned. Not applicable: scenarios where the stocktake process is fully closed-loop inside the ERP, where the source lacks a stable stocktake timestamp field, or where the unit-of-measure and inventory-organization models differ so much between the two systems that secondary development is required. In those cases, align the models first before attempting sync.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-p2ea595-kingdee-cloud-9948-copy-0cb5c081

Comments