Qeasy Cloud
Get Started

Kingdee Cloud Exchange Rate Pull Strategy: End-to-End Landing in MySQL via Qeasy

· 冯潇· Integration Solutions· 12 views· 4 min read
MySQLKingdee Cloud汇率同步供应链集成轻易云私有化部署

What This Strategy Solves

Exchange rates are the pricing foundation for supply chain documents. A certain manufacturing enterprise runs its finance core on Kingdee Cloud in a private deployment, while downstream BI, reconciliation, and customs modules all run on MySQL. Letting multiple downstream systems query Kingdee directly for exchange rates is unstable and hard to audit. We use the Qeasy data integration platform to build an "exchange rate pull" strategy: every early morning, exchange rate master data from Kingdee Cloud is incrementally synchronized into a MySQL staging table, so all downstream systems read from a single staging table and reports, reconciliations, and customs declarations share one consistent rate basis.

Data Flow and Field Mapping

The data flow is Kingdee Cloud (source) → Qeasy integration platform (middle layer) → MySQL (target). The source side queries rate documents through the Kingdee WebAPI executeBillQuery, while the target side writes into the basic_kingdee_rate table via an INSERT statement.

Key field mapping:

Business meaningSource field (Kingdee Cloud)Target field (MySQL)Notes
Entity primary keyFRateIDFRateIDIdempotent dedup basis
Document statusFDocumentStatusFDocumentStatusA audited / B created
Forbid statusFForbidStatusFForbidStatusA forbidden / B normal
Using organizationFUseOrgId.fnumberFUseOrgIdBase data code
Source currencyFCyForID.fnumberFCyForIDISO currency code
Target currencyFCyToID.fnumberFCyToIDISO currency code
Effective dateFBegDateFBegDateInclusive
Expiry dateFEndDateFEndDateInclusive
Rate typeFRATETYPEIDFRATETYPEIDBase data
Direct rateFExchangeRateFExchangeRateHigh-precision decimal
Reverse rateFReverseExRateFReverseExRateHigh-precision decimal

How to Configure in Qeasy

Open the corresponding integration project in the Qeasy data integration platform and add a strategy named "kingdee_exchange_rate_pull".

Source configuration: select the Kingdee Cloud connector, API executeBillQuery, method POST, enable idCheck and autoFillResponse, document primary key FRateID, document number id. Add the required filter fields (FRateID, FDocumentStatus, FForbidStatus, FUseOrgId.fnumber, FCyForID.fnumber, FCyToID.fnumber, FBegDate, FEndDate, FRATETYPEID, FExchangeRate, FReverseExRate) into the request list, and set filter conditions by FUseOrgId, currency pair, and rate type.

Target configuration: select the MySQL connector, API execute, method POST, and write main_sql as an INSERT statement on basic_kingdee_rate. The field order must match the source one-to-one, with named placeholders such as :FRateID, :FCyForID that Qeasy binds automatically.

Platform-level landing convention: Qeasy customers often centralize code mapping inside the platform. For base-data fields like using organization, currency, and rate type, a .fnumber → code conversion is done once in the platform, and the target table stores only the final value, so subsequent report joins do not need to JOIN Kingdee again.

Implementation Steps

Phase one: incremental starting point. The source side performs an initial historical full load by FRateID, and once it lands in MySQL, record max(modifydate) as the initial cursor. In Qeasy this is typically handled by a separate one-off "full trigger" task so it does not pollute the daily schedule.

Phase two: daily schedule. Set the source crontab to 3 2 * * * (02:03 AM) and the target crontab to 23 2 * * * (02:23 AM). The two timestamps are offset by 20 minutes to leave room for source extraction, network transfer, and target landing; the target will not read dirty data while the source is still running.

Phase three: frequency and fault tolerance. Exchange rate master data does not change frequently, so a daily schedule is enough. It is recommended in Qeasy to enable "3 retries on failure + alert to enterprise WeChat". Use FRateID as the primary key in MySQL, and write with INSERT ... ON DUPLICATE KEY UPDATE so even a source full replay does not produce dirty rows.

Phase four: validation. After each batch runs, run a sampling SQL: compare MySQL and Kingdee Cloud on the current period's rate row count, currency pair coverage, and decimal precision differences. If differences exceed the threshold, trigger manual review.

Pitfall Review

  1. The currency field is base data, not a plain string. The source FCyForID.fnumber must carry the .fnumber suffix, otherwise what comes back is an internal JSON code and the target write becomes unreadable.
  2. Decimal precision for direct and reverse rates. Use DECIMAL(20,8) in the MySQL table. If source precision at the 0.00000001 level is truncated, monthly customs conversion will be off by a few cents.
  3. Effective / expiry dates form a closed interval. On the Kingdee side, the same currency pair under the same rate type has closed-interval date coverage. Do not casually add FBegDate >= today filtering in Qeasy, otherwise historical rates will be dropped and customs historical documents will not find the rate of that day.
  4. Multiple organization versions. A currency pair may have different rates under different using organizations, so data must be landed by FUseOrgId and cannot simply be deduplicated by currency pair.
  5. The "incremental + full double track" approach is the safe way. A common Qeasy customer pattern is: run incremental daily, and run a full overlay plus cursor reset at the start of each month or whenever a new rate type is added. This prevents a single incremental run from bringing down long-expired old rates as "latest".

Applicable and Non-applicable Scenarios

Applicable: Kingdee Cloud is the master source of exchange rates, and downstream systems such as BI, customs, and reconciliation need stable data access; enterprises with low rate change frequency and a need for unified rate basis. Not applicable: scenarios requiring real-time per-transaction rates (such as FX trading systems); and situations where source rates are delivered in real time by external interfaces (central bank / third party) and do not pass through Kingdee. In that scenario, the pull should be done directly against the external interface rather than going through Kingdee and syncing again.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mysql-kingdee-cloud-2246-kingdee-be51c365

Comments