Qeasy Cloud
Get Started

Query Kingdee Employees Strategy in Practice: Pushing Employee Master Data Downstream Steadily with Qeasy

· 何金辉· Integration Solutions· 11 views· 4 min read
四化智造MES(API)Kingdee Cloud轻易云轻易云QeasyMES员工主数据基础资料同步

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 meaningSource field (King)Target side usageHandling recommendation
CodeFNumberPrimary key mapping, unique identifierRecommended as downstream primary key; no further processing
Primary keyFIDIn-system reconciliationRetain only in logs
NameFNameDisplay and fuzzy queryPass through as-is
MobileFMobileNotifications, shift leader contactRecommend desensitizing before distribution
EmailFEmailProcess messagesSame as above; recommend desensitizing
DepartmentFPostDeptDepartment affiliationAlign 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:

  1. Source platform access: Select the Kingdee Cloud Cosmos adapter, choose executeBillQuery for the API, with POST as the request method. Keep autoFillResponse enabled so that returned query fields are automatically populated into the response template.
  2. Filter conditions: Use FNumber as the query key field, paired with FID for idempotent deduplication; disable idCheck because this strategy queries on demand rather than saving documents.
  3. Middle layer processing: In Qeasy's field mapping node, run sensitive fields such as FMobile and FEmail through 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.
  4. 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.
  5. Dependency relationship: This strategy is usually recommended as the depends_on for 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

  1. The typical mistake is treating "query employees" as "save employees". The source is the executeBillQuery query 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.
  2. 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".
  3. 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.
  4. Department field not aligned with department master data strategy. The FPostDept in 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".
  5. 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mes-api-kingdee-cloud-9955-naff7db06-a03a3360

Comments