Qeasy Cloud
Get Started

Purchase Order Sync: Querying from Kingdee Cloud and Writing to the Middle Layer

· 许创贵· Integration Solutions· 10 views· 4 min read

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)TypeMeaningTarget field in middle layer
FBillNostringDocument number (business key)Document number
FSourceBillNostringSource document numberSource document number
FBillTypeID_FNumberstringDocument type code (CGDD01_SYS, etc.)Document type
FBusinessTypestringBusiness typeBusiness type
FIDstringHeader internal IDHeader internal ID
FPOOrderEntry_FEntryIdstringEntry line internal IDLine 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:

  1. Source node (Kingdee Cloud): use the built-in Kingdee.Cloud adapter. Pick executeBillQuery as the API, POST as the method, and QUERY as the effect. Enable autoFillResponse and buildModel so the platform generates the field model automatically from the response structure, saving manual table building. Set FBillNo as the document number, FPOOrderEntry_FEntryId as the entry line ID, and FID as the header ID. Keep idCheck off — this is the initial full-pull scenario.
  2. 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:

  1. Full initialization: on the first run, set idCheck to 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.
  2. 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 at 23 2 * * * (02:23 daily), leaving a 20-minute window so the source finishes before the target consumes, avoiding concurrent-write conflicts.
  3. 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 executeBillQuery and 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

  1. Document type code passed through as a business field. Kingdee's FBillTypeID_FNumber is 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.
  2. idCheck mistakenly enabled during the full phase. If idCheck is 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.
  3. 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.
  4. Missing filter on executeBillQuery. Kingdee's interface requires at least one filter; typically FBillNo plus 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.
  5. 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-oa-e9http-kingdee-cloud-5216-n4a69a6da-9e72e32f

Comments