Qeasy Cloud
Get Started

Kingdee Cloud Operation Planning Query Interface Field Manual: Full-Link Practice from executeBillQuery to MySQL

· 吕修远· Engineering Best Practices· 44 views· 4 min read

What This Interface Solves

The Operation Planning query interface pulls process planning data from Kingdee Cloud (including production orders, operations, work centers, and qualified quantities) into MySQL on a modification-date incremental basis. It enables MES, planning dashboards, and sales reconciliation systems to perform traceability, statistics, and execution monitoring based on a unified process detail table. It is a critical link in the traceability chain of Sales Order → Production Order → Operation Plan.

Interface Capability Overview

  • Authentication: Kingdee Cloud WebAPI, typically using a third-party account with tenant authorization, with App ID and secret passed in request headers.
  • Request Endpoint: /k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.executeBillQuery.common.kdsvc.
  • Input Structure: Core parameters are FormId, FilterString, FieldKeys, OrderString, Top, StartRow, Limit.
  • Return Structure: JSON array, each record corresponding to one Operation Planning entry row.
  • Pagination/Incremental Mode: Pagination via Top + StartRow + Limit; incremental driven by FilterString like FModifyDate >= '{{DAYS_AGO_s10|datetime}}' and FSaleOrderNumber <> '', combined with a scheduled task (commonly */16 7-22 * * * in real scenarios, every 16 minutes during business hours).

Typical Field Mapping

Field NameTypeMeaningPractical Notes
FIDstringMaster table inner keyUnique within Kingdee; recommended as hash key for cross-system reconciliation
FSubEntity_FDetailIDstringEntry detail IDCorresponds to metadata id; unique at document level
FBillNostringOperation plan document numberCorresponds to metadata number; commonly used as business document number
FMONumberstringProduction order numberCombined with FMOEntrySeq locates the production order line
FMOEntrySeqstringProduction order line numberStored as string, watch leading zeros
FMOQtystringHeader quantityCarried in entry rows too, easy to double-count during capacity planning
FSaleOrderNumberstringDemand order numberOne of the key incremental filter fields
F_QOQG_Text2stringCustomer short nameCustom field, varies by tenant
FProductId_FNumber / FProductId_FNamestringProduct code / nameRecommend storing both for search and display
FProcessId_FNamestringOperation/process nameUsed for routing reconstruction
FOperDescriptionstringOperation descriptionMay contain special characters; watch encoding
FOperUnitId_FNamestringOperation unitpcs, kg, etc.
FProcessOrgId_FNumberstringProcessing organizationMust be stored for multi-org tenants
FWorkCenterId_FNumberstringWork center codePrimary dimension for scheduling/capacity analysis
FOperQtystringOperation quantityPlanned quantity, note difference from FMOQty
FQualifiedQtystringQualified quantityCompleted and inspected
FOperStatusstringOperation execution statusCommon: Not Started / In Progress / Completed
FAPPROVERID / FCREATEDATE / FApproveDatestringApprover / Create / Approve dateAudit fields for change tracking

How to Configure on QeasyCloud

  • Adapter Encapsulation: QeasyCloud Data Integration Platform has a built-in "Kingdee Cloud WebAPI" adapter. You can directly select the executeBillQuery action, set FormId = SFC_OperationPlanning, and skip writing HTTP clients and signing logic manually.
  • Field Mapper: Source metadata fields like FID/FBillNo and entry fields like FSubEntity_FDetailID are auto-parsed. The target MySQL table process_plan_detail can be bound via drag-and-drop in the mapper. Common concept mappings such as FProductId_FNumber → product_code and FProcessId_FName → process_name can reuse platform-built naming templates.
  • FilterString Template: QeasyCloud supports variable interpolation like {{DAYS_AGO_s10|datetime}}, turning "last 10 minutes of modifications" into a configurable parameter, then layering the business filter FSaleOrderNumber <> '' on top, so every tenant does not have to rewrite SQL.
  • Scheduling and Pagination: The adapter directly configures StartRow/Limit pagination and scheduling policies (the common */16 7-22 * * * pattern runs every 16 minutes during business hours), and automatically merges paginated results into the target database.

Cross-Strategy Practical Highlights

  • Always Combine Primary Keys: Only FBillNo + FSubEntity_FDetailID uniquely locks one row in Kingdee; using FBillNo alone will collide at the entry dimension.
  • End-to-End Traceability: FMONumber → FSaleOrderNumber must both land in MySQL, so downstream sales reconciliation and plan write-back do not need to query Kingdee again.
  • Store Quantities and Units Separately: FOperQty/FQualifiedQty/FMOQty are stored as strings to avoid front-end conversion; FOperUnitId_FName in its own column for unit-based aggregation.
  • Choose Incremental Fields Carefully: FModifyDate is more stable than FCREATEDATE and covers unapprove/modify scenarios; add document status filter when needed to reduce empty runs.
  • Dictionary Table for Status Fields: FOperStatus enumerations differ across tenants and versions. The stable practice is to maintain a mapping dictionary in QeasyCloud rather than hardcoding.
  • Work Center is the Primary Key for Capacity Analysis: Storing FWorkCenterId_FNumber + FProcessOrgId_FNumber combination as the fact-table primary key supports later OEE and bottleneck analysis.

Pitfall Review

  • Missing Entry Primary Key: Only using FID as primary key causes conflicts in MySQL; always include FSubEntity_FDetailID.
  • Quantity Fields Treated as Numbers for Aggregation: FMOQty repeats in entry rows, so direct SUM multiplies by N. Deduplicate or read from header before aggregating.
  • FilterString Time Window Drift: Building FModifyDate with local timezone easily misses records. Use UTC or Kingdee server timezone and keep a 2-5 minute overlap window.
  • Inconsistent Custom Field Names: Fields like F_QOQG_Text2 have different meanings across tenants (customer short name vs. remark). In QeasyCloud, add notes in the field mapper and allow manual overrides.
  • Status Enumeration Changes: After Kingdee version upgrades, FOperStatus gains new statuses; old downstream consumers crash without tolerance. Normalize enumerations in the QeasyCloud field mapper before landing.

When to Use

Use this interface when you need to sync Kingdee Cloud's Operation Planning data into your own data warehouse or MES at the entry granularity, while preserving the sales order traceability chain and work center dimensions. If you only need document-level summaries or real-time inventory snapshots, switch to Kingdee's instant inventory query or other aggregate interfaces.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-022-b6c8

Comments