Qeasy Cloud
Get Started

Querying Goods from Wangdiantong: A Practical Guide to Pulling Product Records from the CRM Side

· 何金辉· Integration Solutions· 6 views· 4 min read

What This Strategy Solves

In projects where CRM and ERP/WMS collaborate, the product master is the foundation for orders, inventory, and shipping. In one of our real projects, sales placed orders in the CRM, but warehouse fulfillment depended on Wangdiantong's product codes and specifications. Once the encoding rules diverged, everything stalled.

The core purpose of the "Querying Goods from Wangdiantong" strategy is to look up product master data on demand from the CRM side, using Wangdiantong's goods_id / goods_no as the canonical encoding, so the two systems don't drift after each maintaining their own SKU records. It is essentially a read-only, paginated query strategy, while the write side is a "no-op write"—all product data only lands in the Qeasy data integration platform's intermediate layer, to be referenced by other write strategies (sales orders, real-time inventory, etc.) by code.

Data Flow and Field Mapping

The data flow is: Wangdiantong Flagship Edition (source) → Qeasy Integration Platform (intermediate layer) → Xiaoman OKKICRM consumer (target is a no-op).

The source invokes goods.Goods.queryWithSpec (POST). The key request structure consists of pager (pagination parameters) and params (business parameters). The response uses goods_id as the internal ID and goods_no as the business number, and returns specification details (queryWithSpec literally means query with specifications).

The intermediate layer is responsible for receiving and standardizing three groups of key fields:

DimensionSource (Wangdiantong) FieldIntermediate Unified FieldNotes
Business keygoods_noprod_codeCross-strategy unified code
Internal keygoods_idprod_idUsed by subsequent write strategies
Name/specgoods_name + spec detailsprod_name / spec_textSpec needs to be assembled in the intermediate layer

The target metadata.api is "no-op write", effect: EXECUTE, with idCheck: true. This means this strategy does not write directly to the target system, but only pulls data into the Qeasy platform's interior, for other write strategies to reference—this is the typical pattern of a "pull-type prerequisite strategy".

How to Configure on Qeasy

When configuring on the Qeasy data integration platform, we recommend landing it according to the following points:

  1. Register the source platform: Select the Wangdiantong Flagship Edition driver, pick the API goods.Goods.queryWithSpec, method POST, and expose the pager parameter as a visual field to control how many records are pulled per page.
  2. Configure the target platform: A no-op write doesn't need field mapping, but keep idCheck: true so the platform validates the primary key at the scheduling entry, preventing downstream strategies from referencing empty values.
  3. Centralize code mapping: Maintain a "Wangdiantong product → CRM product" mapping table in Qeasy's code-mapping module, and have all write strategies reference it uniformly. New SKUs are then maintained in one place, avoiding drift between an "order strategy mapping" and an "inventory strategy mapping".
  4. Phased header/body rollout: Product master data is header-level. Bring it online before body-level strategies like sales orders and real-time inventory; otherwise the downstream write strategies will fail because they can't find the canonical codes.

Implementation Steps

We split this strategy into a three-phase schedule. The pitfalls we hit are recapped in the next section.

  • Full trigger (first go-live): Manually trigger a full pull, paginated in ascending goods_no order, written into the intermediate layer. The source schedule is recommended for off-peak early morning (the material gives 47 3 * * *, i.e. 03:47), to avoid the downstream order-writing window.
  • Incremental starting point: Use "the last successful pull time" as the starting point and request only products with update_time > last_time. The Qeasy scheduler automatically persists the previous timestamp, so you don't need to write persistence into a script.
  • Schedule frequency: Stagger at least one hour from the target no-op write's 23 2 * * * (02:23), so that by the time downstream write strategies run, this round's products are stable. A typical combination is "source pulls at 03:47 → target no-op validates at 02:23 → downstream business strategies start at 04:30".

Pitfall Recap

  1. A typical mistake is using goods_name as the join key. In one implementation, the customer tried to save effort by treating the product name as the primary key; three months later the same item was renamed, the numbers on both sides stopped matching, and stocktaking fell apart. The safe approach is to consistently use goods_no as the business key and goods_id as the internal key.
  2. The specs returned by queryWithSpec are a nested structure. Many engineers dump the whole thing into one field, and downstream JSON parsing fails. We recommend explicitly expanding the spec array in Qeasy's field mapping and landing it into a dedicated spec_text field.
  3. Don't omit autoFillResponse: true. Skipping it makes response fields invisible in the Qeasy platform; during debugging it looks like the API returned nothing, but it's actually that the metadata wasn't declared.
  4. Always set an upper bound on pagination. When Wangdiantong returns too many records per page, Qeasy slows down. Keep each page between 200 and 500, and combine it with source-side rate limiting.
  5. The target no-op is not "doing nothing". With idCheck: true, the primary key is validated; if the source pull returns nothing and we proceed straight into this strategy, it gets blocked at the entry point. Don't disable this safeguard.

When It Applies and When It Doesn't

Applies: Projects where CRM and ERP/WMS need unified product master data, where subsequent write strategies (orders, inventory) depend on product codes, and where you don't want to maintain SKUs bidirectionally. Doesn't apply: Scenarios where product master is owned exclusively by one side, where the source system doesn't support spec-returning queries like queryWithSpec, or where the business volume is so small that an intermediate mapping layer isn't worth it.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-okkicrm-wdt-7404-n76c15b11-fd100a31

Comments