Qeasy Cloud
Get Started

Field Manual and Practical Tutorial for the "Outsourced Order Details (Product)" Interface of Do1QQ

· 许创贵· Engineering Best Practices· 25 views· 4 min read
小满OKKICRM道一云·七巧接口字段手册委外订单表单查询轻易云集成Incremental Sync

What Problem Does This Interface Solve

In manufacturing and outsourced processing scenarios, business systems need to align "outsourced order product details" with CRM or downstream ERP. This interface is used to paginate and query the product line items of outsourced processing orders from the Do1QQ form application within a time window. Its typical purpose is to provide a detailed data source for the CRM and Do1QQ integration of a retail/manufacturing enterprise, supporting cost accounting, production scheduling, and order traceability.

Interface Capability Overview

  • Authentication: Standard application-level authentication of the Do1QQ open platform. When integrating, configure applicationId as the target application identity.
  • Request structure: GET /plus/cgi-bin/open/applications/{applicationId}/forms/{formModelId}, with required parameters applicationId and formModelId, optional startTime/endTime for incremental windows, orderField defaults to createDate, isAsc defaults to false (descending), page/pageSize default to 1/50, and joinFormModelIds for join queries.
  • Response structure: JSON, with business data located in data.list. Each record is uniquely identified by extend.id (32 characters). Form custom fields are uniformly stored within the extend object.
  • Pagination/Incremental mode: Page-based pagination sorted by createDate, combined with millisecond timestamps {{LAST_SYNC_TIME}}000 and {{CURRENT_TIME}}000 for incremental fetching. The typical schedule is */4 8-23 * * *, meaning a round every 4 minutes from 8:00 to 23:00.
  • Strategy type: Pure query (Target configured as "write no-op"), without writing to any target system.

Typical Field Mapping

Field NameTypeMeaningPractical Notes
extend.idstringForm data instance primary key, 32 charactersUsually mapped as {{extend.id}} in metadata, used for cross-table association and deduplication
委外编号stringOutsourced order business codeThe main line for establishing one-to-many associations with the outsourcing master order
产品编号stringProduct unique codePrioritize this for alignment with product master data
产品名称stringProduct name or material reference IDIn real scenarios, this is often a reference ID and requires secondary parsing
产品名称2stringMaterial standard nameObtained via _mongoQuery by querying content.extend.id = {{产品名称}} against the material table; not directly returned by the API
销售订单stringAssociated sales order referenceUsed for cross-business-domain concatenation
委外下单stringOutsourced order association identifierUsed as a status/classification field in some projects
备注stringBusiness remarksLength varies; needs to be trimmed as required
尺寸/规格/颜色stringProduct specification dimensionsFree text; strong validation is not recommended
配件包装要求stringPackaging descriptionWeakly structured; suitable for display only
成本单价stringUnit costString type; must be converted to number before calculation
模费stringMold fee (yuan)Same as above; avoid direct addition/subtraction on strings
生产数量stringOutsourced processing quantityString numerical value; pay attention to null and zero values during aggregation
extendobjectForm extended dataDynamic field container; new columns naturally fall here

How to Configure on Qeasy

On the Qeasy data integration platform, this interface is usually encapsulated by a "Form Query Adapter". After entering applicationId and formModelId, the platform automatically generates a request template. The data.list in the response will be expanded into a standardized row structure, and dynamic fields within extend will be automatically exposed to the field mapper without manually writing the schema.

Regarding incremental fetching, the "Time Window Component" of Qeasy will splice {{LAST_SYNC_TIME}}000/{{CURRENT_TIME}}000 into startTime/endTime, and fetch in descending order by createDate. Pagination parameters page/pageSize are also driven by the platform looping with pageSize=50 until an empty list is returned or the upper limit is hit.

Since the Target of this strategy is "write no-op", only the source end Source and schedule need to be configured on the Qeasy canvas, without attaching a target Adapter. However, the result can still be delivered to Qeasy's data service for secondary consumption by other outsourced order synchronization strategies as a detail data source.

Cross-Project Practical Key Points

  1. Product names need secondary parsing: Real responses are often reference IDs. Be sure to configure _mongoQuery to look up the material table to fill in the standard name, otherwise dirty data with "ID as name" will be pushed downstream.
  2. Numeric fields are all strings: Cost unit price, mold fee, and production quantity are all returned as strings. They must be explicitly converted to numbers before aggregation or reconciliation, and placeholders such as empty strings and "-" need to be handled.
  3. extend.id is the unique anchor: Deduplication, idempotency, and associated updates all rely on it. Any downstream write scenario should pass it through as the business primary key.
  4. Incremental timestamps must align to milliseconds: The Do1QQ interface requires 13-digit millisecond timestamps. Suffixing with 000 in Qeasy is a safe practice. If the suffix is missed, data may be empty or duplicated.
  5. Be cautious with descending order + pagination combination: When createDate is in descending order, new data appears on the first page. Be sure to deduplicate using extend.id to avoid duplicate entries in the same window.
  6. Avoid strong validation on free-text fields: Fields such as size, specification, color, and accessory packaging requirements have a wide variety of values. Display-style mapping is sufficient, as validation will cause a large number of false positives.

Pitfall Review

  • Pitfall 1: Using product name directly as the name——In one integration, the product name was pushed to the CRM as the display name, resulting in all IDs downstream. The safe approach here is to configure the reverse lookup chain of 产品名称2 to ensure that the business side sees the material standard name.
  • Pitfall 2: String addition of numeric fields——The cost unit price was concatenated with "+" for summation, resulting in concatenated strings like "12.0010.00". Be sure to force toNumber in the mapper and provide fallback for null values.
  • Pitfall 3: Incremental window misses data across days——startTime used yyyy-MM-dd instead of a millisecond timestamp, causing the batch of data around 23:xx at night to be missed. Switch to millisecond timestamps combined with a 4-minute polling cycle to fix it.
  • Pitfall 4: Target misconfiguration causing empty writes——Forgetting that this is a QUERY_ONLY strategy, an Adapter was also attached to the Target, causing scheduling errors. Keeping Target as "write no-op" is the most stable choice.
  • Pitfall 5: New fields in extend not exposed——After the form was upgraded, downstream fields were missing. The field mapper of Qeasy dynamically senses the extend container; you only need to refresh it once in the mapping panel to see new columns.

When to Choose This Interface

It is suitable for scenarios that require "incrementally pulling outsourced processing order product details by time window, with no database writes", such as outsourced order comparison on the CRM side, cost reverse lookup, and pre-preparation for production scheduling. It is not suitable for scenarios that require strong real-time bidirectional writing or complex aggregation and drill-down; for such scenarios, it is recommended to switch to dedicated synchronization strategies.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-057-ok-59b0

Comments