Purchase Order Sync: Querying from Kingdee Cloud and Writing to the Middle Layer
What this strategy solves
In supply-chain integration, purchase orders are among the most frequent and sensitive master data flowing between an ERP and an OA system. In one real project, a manufacturer needed dozens of purchase orders moved every day between Kingdee Cloud and a third-party OA: buyers raised requests in OA, after approval the data flowed back to ERP, and once ERP finalized the order it had to return to OA for contract archiving and printing. Manual export-import is slow and error-prone. We used the Qeasy Data Integration Platform to own this strategy: query purchase orders precisely on the source side, then write them to the target side on a schedule so both systems agree on every document.
Data flow and field mapping
The flow is unidirectional: Kingdee Cloud → Qeasy middle layer → OA-side target.
| Source field (Kingdee Cloud) | Type | Meaning | Target field in middle layer |
|---|---|---|---|
| FBillNo | string | Document number (business key) | Document number |
| FSourceBillNo | string | Source document number | Source document number |
| FBillTypeID_FNumber | string | Document type code (CGDD01_SYS, etc.) | Document type |
| FBusinessType | string | Business type | Business type |
| FID | string | Header internal ID | Header internal ID |
| FPOOrderEntry_FEntryId | string | Entry line internal ID | Line internal ID |
On the source side we use Kingdee's executeBillQuery interface (POST, type QUERY) with the document number as a required filter. On the target side, the Qeasy platform defines a WebAPI "write-empty-operation" node as the middle-layer landing point; downstream strategies then deliver the data to the OA material application.
How to configure it on Qeasy
In the Qeasy platform, this strategy is split into two nodes:
- Source node (Kingdee Cloud): use the built-in Kingdee.Cloud adapter. Pick
executeBillQueryas the API, POST as the method, and QUERY as the effect. EnableautoFillResponseandbuildModelso the platform generates the field model automatically from the response structure, saving manual table building. SetFBillNoas the document number,FPOOrderEntry_FEntryIdas the entry line ID, andFIDas the header ID. KeepidCheckoff — this is the initial full-pull scenario. - Target node (Qeasy middle layer): platform code
datahub, API "write-empty-operation", effect EXECUTE. The request body is empty; it acts as a placeholder write node that triggers downstream strategies. This is a typical "land first, distribute later" two-step architecture.
For field mapping, we recommend maintaining a single code-mapping table in the Qeasy mapping layer, translating Kingdee's FBillTypeID_FNumber (system codes such as CGDD01_SYS) into business semantics that the OA side understands. This is one of the most common patterns Qeasy customers adopt: keeping code mappings centralized rather than scattered across strategies.
Implementation steps
We usually split the rollout into three phases:
- Full initialization: on the first run, set
idCheckto false on the source side and do a full pull filtered by document type or date range, landing all historical orders in the middle layer. Schedule this for off-peak hours so it does not pressure the Kingdee interface. - Incremental start: after the full pull is complete, switch to incremental mode. Use the Kingdee document modification time as the incremental cursor, pulling only new or changed orders each round. Configure the source-side cron at
3 2 * * *(02:03 daily) and the target-side write at23 2 * * *(02:23 daily), leaving a 20-minute window so the source finishes before the target consumes, avoiding concurrent-write conflicts. - Scheduling frequency: a daily run is sufficient for normal operations. If the order volume is high or near-real-time is required, the source-side cron can be tightened to every 4 hours, but watch the concurrency limit on Kingdee's
executeBillQueryand configure throttling on the Qeasy side.
A safe pattern we recommend: run header and body in two phases. First run a strategy that pulls only the header fields, verify that document number, type, supplier and other key fields are stable, then enable the full-field strategy with line entries. This is another common Qeasy customer pattern that greatly reduces the cost of a failed first attempt.
Lessons learned from the field
- Document type code passed through as a business field. Kingdee's
FBillTypeID_FNumberis a system preset code (CGDD01_SYS); if you write it directly to the OA side without mapping, the front-end display will look ugly. Always translate semantics in the Qeasy mapping layer. idCheckmistakenly enabled during the full phase. IfidCheckis on during the first full pull while the middle layer is empty, it will produce many false "duplicate" judgments or task failures. We recommend: keep it off in the full phase, enable it in the incremental phase.- Source and target cron collide. When both run at the same time, you can get "data not yet written when the downstream tries to read it". We kept a 20-minute offset (source 02:03, target 02:23) after several incidents — it has held up ever since.
- Missing filter on
executeBillQuery. Kingdee's interface requires at least one filter; typicallyFBillNoplus document type. If you only pass document type without a date range, the returned dataset will be huge, so configure pagination and timeouts on the Qeasy side. - Internal domain and certificates in private deployment. The source call to Kingdee Cloud goes through an internal address; when Qeasy is deployed on the customer site, pay attention to proxy egress and certificate trust, otherwise you may hit silent TLS handshake failures with no obvious error in the task log.
Where this fits — and where it does not
Fit: scenarios where Kingdee Cloud is the ERP backbone and purchase orders need to be synced to OA or other peripheral systems for approval, archiving, or printing; private deployments with daily order volume in the low hundreds and freshness needs at the hour level.
Not fit: sub-second real-time high-frequency order scenarios (use Kingdee's push interface rather than polling); or two-way sync with complex conflict-merge logic — this strategy covers only unidirectional query and middle-layer landing.