Qeasy Cloud
Get Started

Authoritative Tutorial: Querying Jky Assembly/Disassembly Inbound Orders — Field Reference

· 卢剑航· Engineering Best Practices· 12 views· 4 min read

What Problem This Interface Solves

In Jky-to-Kingdee supply chain integration, assembly and disassembly operations generate inbound orders that must flow across systems. The erp.storage.goodsdocin.v2 endpoint, filtered by inouttype=107, precisely retrieves assembly/disassembly inbound orders and their line details (materials, batches, costs, taxes), providing the single source of truth for downstream Kingdee assembly/disassembly order synchronization.

Interface Capabilities Overview

  • Authentication: Jky OpenAPI signature auth using AppKey/AppSecret via Header or QueryString.
  • Request Structure: POST-style query with body parameters startDate, endDate, inouttype, pageIndex, pageSize, selelctFields, goodsDocNo.
  • Response Structure: JSON returning the main header plus the goodsDocDetailList array, with hasNext as pagination flag.
  • Pagination/Incremental Mode: Time-range based pagination, pageIndex starting at 0, default pageSize 100; the incremental cursor advances on {{LAST_SYNC_TIME}}.
  • Execution Cadence: Cron 1-59/5 6-23 * * *, every 5 minutes from 06:00 to 23:00 daily.

Typical Field Mappings

FieldTypeMeaningPractical Notes
recIdstringHeader primary keyUnique identifier, anchor for cross-system reconciliation
goodsdocNostringInbound order numberBusiness code used by external systems
billNostringRelated order numberLinks to assembly/disassembly order, key for Kingdee mapping
inouttypestringInbound typeHardcoded to 107 in this strategy
gmtCreatestringCreation timeBaseline timestamp for incremental sync
gmtModifiedstringLast modifiedCombine with red/finance status changes
redStatusstringRed-invoice status1 blue / 2 reversed / 9 reversing; recommend filtering
financeBillStatusstringFinance status1/11/21/25/31; affects cost and tax fields
warehouseCodestringWarehouse codeStable key for Kingdee warehouse mapping
companyCodestringOrganization codeRequired in multi-org scenarios
goodsDocDetailList.recIdstringLine primary keyUniqueness anchor for detail rows
goodsNostringMaterial codeKey for Kingdee material mapping
skuId / skuBarcodestringSKU ID / barcodeEssential for multi-SKU scenarios
batchNostringBatch numberBatch management and shelf-life traceability
quantitystringQuantityString type — must be converted to numeric
estPrice / estCost / estTaxstringEstimated price/cost/taxDistinct from transactional trans* fields
transHasTaxAmountstringTax-included amountAligns with Kingdee amount field

How to Configure on Qeasy

On the Qeasy Data Integration Platform, this interface is typically wrapped as the "Jky Inbound Order Query Adapter", with a pre-built request template and field mapper for erp.storage.goodsdocin.v2. In the strategy editor:

  1. Select source system "Jky" → interface "Inbound Order Query v2";
  2. Pin inouttype=107 in the request panel and bind startDate/endDate to Qeasy's built-in LAST_SYNC_TIME/CURRENT_TIME variables;
  3. Qeasy's field mapper automatically expands goodsDocDetailList as a nested header/detail structure and offers quick bindings such as "primary key → id" and "business code → number" on the mapping canvas;
  4. Because the Target is configured as a "no-op write" (a pure query strategy), no target write configuration is needed; the result dataset is consumed by downstream strategies (e.g., "Jky Assembly Order → Kingdee Assembly Order").

Cross-Scenario Best Practices

  1. Hardcode inbound type to 107: Across multiple customer projects, mistyped inouttype has caused data mixing with unrelated business documents.
  2. Prefer gmtCreate over gmtModified for incremental sync: A consistent finding is that gmtModified can roll back (e.g., on un-approval), causing missed records.
  3. Always declare detail fields in selelctFields: Without explicit fields, some responses omit goodsDocDetailList, breaking downstream reconciliation.
  4. pageSize=100 is the performance sweet spot: Below 50 wastes requests; above 100 risks throttling.
  5. Use both hasNext and pageIndex: Relying solely on hasNext misses the last full page.
  6. Filter redStatus=9: Without filtering, reversing orders create duplicate inbound postings in Kingdee.

Pitfalls and Resolutions

  • Pitfall 1: Misaligned incremental watermark. A retail client used gmtModified, but reversing writes caused timestamps to roll back, producing missed records. The fix is to standardize on gmtCreate, with a one-time full pull before switching to incremental.
  • Pitfall 2: Empty detail array. Another client omitted detail fields in selelctFields, so the API returned only the header. The fix is to explicitly include goodsDocDetailList.recId, goodsNo, quantity, etc.
  • Pitfall 3: String arithmetic on quantity. Because quantity is a string, 1+1 becomes 11. Enable Qeasy mapper's numeric conversion or call parseFloat in the script.
  • Pitfall 4: Wrong cost field. estCost is the estimated cost; transactional cost must come from transHasTaxAmount / transNoTaxAmount.
  • Pitfall 5: Cross-org warehouse collision. A multi-org client did not pass companyCode, so same-coded warehouses across organizations overwrote each other. Fix: always include the company dimension in request parameters.

When to Use

Suitable for private-deployment supply chain integrations where Jky assembly/disassembly inbound orders must synchronize into Kingdee. If only inventory ledger snapshots are needed, prefer the inventory snapshot interface to reduce bandwidth and reconciliation complexity.

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

Comments