Query Kingdee Employees Strategy in Practice: Pushing Employee Master Data Downstream Steadily with Qeasy
What This Strategy Solves
For a manufacturing enterprise, employee master data has long been stored in Kingdee Cloud Cosmos' organizational structure, while the Sihua MES must retrieve this data when scheduling work, reporting, and attributing performance. The most common approach we take is to directly call King's executeBillQuery to pull employee profiles, land them in the middle platform, and then push them downstream to the MES. However, if the relationships between code, name, and department are not aligned, within three months the "employee number" in the downstream labor report will exhibit duplicates, empty values, or mismatched departments. The "Query Kingdee Employees" strategy is designed to address this kind of basic data distribution in a stable, loosely coupled manner.
Data Flow and Field Mapping
The data flow is clear:
Kingdee Cloud Cosmos (source) → Qeasy Data Integration Platform (middle layer) → downstream MES / business system (target)
The source side uses King's executeBillQuery query interface, while the target side is declared as a "write null operation" in the strategy configuration. This does not mean the data has nowhere to land; rather, it means this strategy only "queries employee profiles on demand and puts them into the middle platform's message channel," to be consumed by subsequent dependent strategies or message subscribers.
Key field mapping table (from metadata.request in 查询金蝶员工_source.json):
| Business meaning | Source field (King) | Target side usage | Handling recommendation |
|---|---|---|---|
| Code | FNumber | Primary key mapping, unique identifier | Recommended as downstream primary key; no further processing |
| Primary key | FID | In-system reconciliation | Retain only in logs |
| Name | FName | Display and fuzzy query | Pass through as-is |
| Mobile | FMobile | Notifications, shift leader contact | Recommend desensitizing before distribution |
| FEmail | Process messages | Same as above; recommend desensitizing | |
| Department | FPostDept | Department affiliation | Align with department master data strategy |
In actual projects, we've found that field mapping doesn't usually fail on the technical side, but on naming — the same "code" is called FNumber in King, EMPNO in MES, and employee_code in the middle platform. With three inconsistent names, troubleshooting becomes a mess. Qeasy's approach is to centrally manage field mappings in one place, with all strategies reusing the same code dictionary — change it once and it takes effect globally.
How to Configure on Qeasy
The source is Kingdee Cloud Cosmos, and the target is "write null operation", with Qeasy's strategy orchestration connecting them. Configuration points are as follows:
- Source platform access: Select the Kingdee Cloud Cosmos adapter, choose
executeBillQueryfor the API, with POST as the request method. KeepautoFillResponseenabled so that returned query fields are automatically populated into the response template. - Filter conditions: Use
FNumberas the query key field, paired withFIDfor idempotent deduplication; disableidCheckbecause this strategy queries on demand rather than saving documents. - Middle layer processing: In Qeasy's field mapping node, run sensitive fields such as
FMobileandFEmailthrough a script node for desensitization (e.g., masking the middle four digits of the mobile number). This step is done in the middle platform rather than the source — the source stays "as-is" and desensitization policies are centralized. - Target side: The strategy is declared as "write null operation", which essentially lets data enter the middle platform's message channel for downstream subscription and consumption. If the downstream is MES, it will typically be triggered as a dependency prerequisite by scheduling, reporting, and personnel qualification strategies.
- Dependency relationship: This strategy is usually recommended as the
depends_onfor downstream strategies like "personnel qualification sync" and "work order dispatch", ensuring that employee profiles are ready when they run.
Implementation Steps
We break down the rollout pace from an actual project into three phases:
Phase 1: Incremental Starting Point
When first going live, do not jump straight to full synchronization. Start with employees who have changed in the last 30 days as the incremental starting point, confirm that FNumber is unique, FName has no special characters, and departments match up. Run stably for three days before entering full synchronization.
Phase 2: Full Synchronization Trigger
Full synchronization is usually triggered during off-peak hours, such as 2-4 AM. The crontab field in the Qeasy strategy controls scheduling frequency; this strategy is set to * 7-22 * * * in the source configuration, meaning incremental runs every hour from 7 AM to 10 PM. Full synchronization is triggered by a separate one-time task so it doesn't compete with the incremental window.
Phase 3: Steady-State Scheduling
In steady state, adopt a "dual-track incremental and full synchronization" approach: incremental queries changes every 15 minutes or hourly, and full synchronization runs weekly as a fallback check. The two run in parallel without blocking each other — the incremental channel prioritizes timeliness, while the full synchronization channel catches drift.
Pitfall Review
- The typical mistake is treating "query employees" as "save employees". The source is the
executeBillQueryquery interface and the target is "write null operation". Many newcomers assume this strategy doesn't "persist data" and then add a save strategy, resulting in duplicate writes. The safe approach is: this strategy only produces data, and persistence is delegated to downstream strategies or message subscriptions. - Code field confusion. FNumber is the employee code in King, but it is often reused in MES as a work number or login account. Without explicit declaration, downstream systems may use FNumber as a login account, leading to the awkward situation of "departed employees still being able to log in".
- Wrong location for mobile and email desensitization. Desensitizing at the source causes all downstream strategies that depend on that field to receive desensitized values, which actually disrupts normal notifications; doing it at the middle platform layer means strategies that need original values can process them on their own.
- Department field not aligned with department master data strategy. The
FPostDeptin employee profiles must match the department ID dictionary produced by the "department sync" strategy; otherwise you end up with "employees attached to non-existent departments". - Missing dependency configuration. If downstream work order dispatch and reporting strategies do not explicitly depend on this strategy, the first run may not have employee profiles and produce "empty personnel".
Applicable and Non-Applicable Scenarios
Applicable: Steady-state distribution of employee profiles, department affiliations, and personnel qualifications from the middle platform, with downstream MES and HR subsystems consuming on demand. Not applicable: High-frequency bidirectional sync scenarios requiring real-time reverse writes back to King (e.g., MES reporting immediately updating King employee status). This strategy only does one-way query distribution; reverse sync requires a separate strategy.