Qeasy Cloud
Get Started

Practical Guide: Syncing Subordinate Departments from Weaver to Kingdee

· 尹春锐· Integration Solutions· 28 views· 3 min read
SQL ServerKingdee Cloud基础资料同步泛微 OA供应链集成轻易云私有化部署

What This Strategy Solves (Scenario and Value)

In one group, Weaver is used for workflow approval while Kingdee Cosmic is used for the supply chain. Subordinate departments (subsidiaries, branch offices, secondary units) are created in Weaver, but Kingdee either has no record or relies on manual entry by finance, leading to failures in reimbursement, budgeting, and purchase requests. We use the Qeasy Data Integration Platform to handle this, and once this single strategy runs smoothly, the organizational structure on both sides only needs "adjustments" instead of "manual entry."

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

The source side is the department view of Weaver stored in SQL Server, and the target side is the master data in Kingdee Cosmic. The integration flow runs through Qeasy, responsible for code mapping, status conversion, and default values for nulls.

Business MeaningWeaver Source Field (Typical)Qeasy Middle LayerKingdee Cosmic Target Field
Department CodedeptCodeUnified code, uppercase, trimmedFNumber
Department NamedeptNameTruncated to 60 charsFName
Parent Department CodeparentDeptCodeResolved and parsed, root if emptyFParentId
ManagermanagerLeft blank, filled by employee strategyFManager
Active StatusisActive1/0 → Yes/NoFUseOrgId (related enable)

Centralized code mapping management is a pattern repeatedly validated across many Qeasy customers: when switching systems or账套, only one mapping table needs to be updated, leaving the main flow untouched.

How to Configure in Qeasy

  1. Create an integration flow: Choose SQL Server as the source database and Kingdee Cosmic API (Org Structure - Department) as the target.
  2. Source extraction: Use a direct SQL connection and only pull records where deptCode IS NOT NULL, filtering out logically deleted temporary nodes in Weaver.
  3. Field mapping: In Qeasy's mapping canvas, drag source fields on the left and select Kingdee target fields on the right. For FParentId, use the "lookup parent department ID by code" resolution function to avoid foreign key errors caused by creating child departments before parent ones.
  4. Save as department sync solution: Suggested name "Subordinate Department Weaver=>Kingdee", reusable across environments.
  5. Runtime parameters: 200 records per page, 3 retries on failure, and failure alerts pushed to the integration owner.

Implementation Steps (Phased Scheduling)

  • Phase 1: Full initialization. In customer projects, we usually trigger this manually to run a full sync first and verify data consistency between the two sides. This step immediately reveals historical gaps ("exists in Weaver but missing in Kingdee") and helps with cleanup.
  • Phase 2: Set the incremental starting point. Mark the incremental cursor as lastUpdateTime in Qeasy, and after full sync completes, switch to incremental mode and only pull changed rows. A common pitfall here is when the source table lacks a reliable update timestamp; the safe approach is to add a trigger or use Change Tracking.
  • Phase 3: Scheduling frequency. Master data does not change frequently, so we typically configure it to run every 15 minutes. Qeasy supports a dual-track of incremental and full sync: incremental runs normally, and a lightweight full sync is added daily in the early morning as a safety net to catch missed records.

Pitfall Recap

  1. Parent department written before child department. Kingdee Cosmic's FParentId is required and must reference an existing record. If child departments are created before parent ones, everything fails. Qeasy's topological sort can solve this by sorting by hierarchy before mapping, and it is enabled by default.
  2. Code whitespace and case sensitivity. D001 in Weaver and D001 in Kingdee count as two separate records, breaking duplicate checks. We recommend unifying in the middle layer with UPPER(LTRIM(RTRIM(col))).
  3. Different semantics for "active" status. Weaver's "enabled" means workflow-enabled, while Kingdee's "enabled" means organization-enabled. Direct sync results in "department exists but unusable." The safe approach is to add a status mapping table in the middle layer, defaulting "enabled" to "Yes" and "disabled" to "No", with manual confirmation by the business side.

Applicable and Non-Applicable Scenarios

This is suitable for mid-sized groups with a relatively stable organizational structure where monthly adjustments are in the double digits, especially customers already using Weaver for OA and Kingdee for ERP. It is not suitable for large organizations where departments are created and deleted daily, nor for bidirectional sync (where both sides can edit) — the latter should be upgraded to a solution with conflict resolution rather than a one-way push.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-sql-server-kingdee-cloud-1831-ne82766e8-1aac5e9c

Comments