Qeasy Cloud
Get Started

Practical Guide to Syncing Outsourced Miscellaneous Stock-In Documents to Kingdee Cloud Galaxy

· 尹春锐· Integration Solutions· 22 views· 5 min read
WDTKingdee Cloud供应链集成Inventory Sync业务单据轻易云委外入库

What This Strategy Solves

When outsourced processing is completed, finished products or semi-finished products generate miscellaneous stock-in documents. In one real project, relying on manual entry into the financial system caused missed documents, incorrect material mapping, and delayed inventory. We used the Qeasy Data Integration Platform to synchronize documents whose source business type is order_type=12 to a standard miscellaneous stock-in document in the target system. This approach requires no custom script and is suitable for foundational integration with stable header and line structures.

Data Flow and Field Mapping (Source → Integration Layer → Target)

The flow is: source stock-in query interface → Qeasy filtering, transformation, and idempotency processing → target miscellaneous stock-in save interface. The source primary key stockin_id is used for duplicate prevention, while business number stockin_no is mapped to the document number. The source header and the details_list line array together form the target document.

Business MeaningSource FieldTarget FieldProcessing Rule
Document primary keystockin_idIntegration validation keyUsed for incremental tracking and duplicate checks
Stock-in numberstockin_noFBillNoDirect mapping with target-side uniqueness check
Stock-in datestockin_timeFDateNormalize to the target date format
Document typeConstantFBillTypeIDFixed to the standard miscellaneous stock-in type
Inventory organizationConstantFStockOrgIdPopulate according to target master data
DepartmentConstantFDEPTIDPopulate according to target master data
SupplierConstantFSUPPLIERIDKeep empty
RemarkremarkFNOTEPass through and normalize empty values
Line collectiondetails_listFEntityIterate the array and create one line per element
Material codespec_no first, otherwise goods_noFMaterialIdApply a unified material-code mapping
Stock-in quantitygoods_count or numFQtyConvert to target numeric precision
Pre-tax unit priceprice or cost_priceFPriceApply target amount precision
Warehouse codewarehouse_noFStockIdApply the warehouse-code mapping
Batch numberbatch_noFLotRequired when batch management is enabled
Unit of measureunit_nameFUnitIDMatch the target unit master data

A common Qeasy customer pattern is centralized management of code mappings. Material and warehouse mappings are maintained centrally so that the target receives verified standard codes. A phased header-and-body rollout is also effective: send the header and quantities first, then add price, batch, and unit fields later.

How to Configure It in Qeasy

First, create the source query connection and configure the stock-in query interface, POST method, and response model. Set the business type filter to order_type=12. Use the previous synchronization time through the current time as the incremental window. Prefer a completed status when supported. If the interface cannot return such a status, leave it empty and add business validation in the integration layer.

Second, create the field mapping. The target form is the standard miscellaneous stock-in document. Map the number, date, type, inventory organization, department, supplier, and remark to the header. Bind the FEntity collection to details_list. No custom script is required; declarative mappings, defaults, and conditional expressions are sufficient.

Third, configure target-save controls. Enable validation of master-data fields and automatically submit and approve the document after saving. Before saving, check whether the inventory organization, department, material, warehouse, and unit of measure exist. Also check whether the same source primary key has already been created successfully.

Fourth, define exception handling. Missing materials, empty quantities, invalid dates, or missing target codes should not produce partial documents. Route them to a retry or exception queue. Use backoff for timeouts and rate limits, but send validation errors to manual handling so they are not retried indefinitely.

Implementation Steps

Phase 1: Establish the baseline. Confirm the scope of outsourced stock-in processing, the target document type, inventory organization, department, and the warehouses, materials, and units involved. Do not use fixed organization codes directly; first verify that they exist in the target master data.

Phase 2: Set the incremental start point. Start from a clearly identified completed business point that has not been synchronized, then backfill a small amount of historical data before and after that point. Qeasy records the synchronization watermark and uses stockin_id for idempotency. A common failure is relying only on the document number. Adjustments to a number or retries can still cause duplicates, so the primary key and business number should both be used.

Phase 3: Trigger and validate full synchronization. Full backfill must process only order_type=12. Validate the header, at least one valid line, and all required master data document by document. After saving, compare the target document number, line count, total quantity, and approval status. Switch to incremental synchronization only after stable operation.

Phase 4: Set the schedule. The source can query every fifteen minutes, while the target executes every eighteen minutes to stagger peak traffic and process accumulated data. Determine the actual frequency on site through business timeliness requirements and load testing rather than copying a fixed schedule blindly.

Phase 5: Observe after launch. A common dual-track pattern is incremental plus full synchronization: scheduled incremental runs provide timeliness, while low-peak full scans recover missed records. The full run must use a separate execution marker and must not write the same time window concurrently with the incremental run; otherwise duplicates or rollback ordering may occur.

Lessons Learned

  1. Business-type filtering fails. A typical mistake is querying only by warehouse or another condition and omitting order_type=12, causing ordinary miscellaneous stock-ins to be included. Enforce the business type in both the query condition and the integration validation.
  2. Fixed master data is not verified. Document type, inventory organization, and department codes appear to be constants, but they may not exist after migration. Verify them in the target master data and include them in the pre-launch checklist.
  3. Fallback is missing for alternative line fields. If only one of spec_no and goods_no is selected, a missing field creates an empty material. Set the priority, format validation, and exception reason in the integration layer.
  4. Quantity and amount precision differ. Passing quantity, price, and amount values unchanged can lead to rejection because of decimal differences. Convert them according to target precision and validate amount relationships.
  5. Retries create duplicates. If a timeout causes an immediate resubmission, the first save may already have succeeded. Before retrying, query by source primary key and determine whether the document was actually created.

Suitable and Unsuitable Scenarios

This solution is suitable when outsourced processing is stable, the miscellaneous stock-in document has a clear header-line structure, and the target system receives inventory through a miscellaneous stock-in document. It is not suitable when outsourced stock-in requires a separate business type, complex source-document association, reverse settlement, or line-by-line cost recalculation. In those cases, extend the target model and lookup logic before implementation.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-kingdee-cloud-2585-n7b95d503-11d8866c

Comments