After-Sales Reship Order Sync Strategy: From Banniu Reconciliation to MySQL with Goods Code Correction
What This Strategy Solves
In the after-sales chain of a retail enterprise, the customer-service work-order system (here, Banniu as an example) continuously produces "reship/reissue orders" — the merchant agrees to send a replacement item to the consumer, and the work order records the goods, quantity, and reason. However, the goods codes on the work-order side follow customer-service conventions; if they flow directly into the back-end SRM database (MySQL in this example), they will not align with purchasing and inventory standards, and within three months the numbers on both sides will diverge.
This strategy pulls the reship orders back as header + detail, performs code and field mapping, writes them stably to the business detail tables, and corrects erroneous goods codes before insertion.
Data Flow and Field Mapping
The overall flow is reconciliation system (Banniu, GET task.list, QUERY) → Qeasy middle layer → business database (MySQL, POST executeReturn, EXECUTE).
Key field comparison (only error-prone fields are listed; the full set follows the platform configuration):
| Business meaning | Reconciliation-side field | Middle-layer handling | MySQL target field (main / extend table) |
|---|---|---|---|
| Bill number | bill_no | Pass-through | supplier_after_sale_send.bill_no |
| Solution | solution | Pass-through | supplier_after_sale_send.solution |
| Responsible party | responsible_party / _detail | Pass-through | supplier_after_sale_send.responsible_party |
| Online trade no. | online_trade_no | Pass-through | supplier_after_sale_send.online_trade_no |
| Goods code | goods_no | Centrally managed code mapping, failures routed to exception queue | supplier_after_sale_send_detail.goods_no |
| Goods name | goods_name | Fallback filled from mapping table | supplier_after_sale_send_detail.goods_name |
| Barcode | bar_code | Pass-through | supplier_after_sale_send_detail.bar_code |
| Specification | spec_name | Pass-through | supplier_after_sale_send_detail.spec_name |
| Reship quantity | send_quantity | Numeric validation, non-positive discarded | supplier_after_sale_send_detail.send_quantity |
| Cost | cost / financial_cost | Numeric validation | supplier_after_sale_send_detail.cost |
The header writes to supplier_after_sale_send, and the detail writes to supplier_after_sale_send_detail. The two SQL segments are tied into one transaction through lastInsertId.
How to Configure on Qeasy
In one real project, we used the Qeasy data integration platform to carry this link. The typical configuration points are as follows.
- Source platform: Choose the reconciliation system; interface
task.list(GET). Pagination parameters:page_size=50,page_numincrements via expression, and the time window usesstar_modifiedas the incremental cursor. - Target platform: Choose the MySQL data source; interface
executeReturn(POST). SetbuildModel=true, so the platform constructs the request body from the SQL template. - Execution SQL: Split into
main_sql(main-table INSERT) andextend_sql_1(1:1 extend-table INSERT). The extend table receives multiple goods-detail rows via theextend_params_1array. - Code mapping: Maintain the "reconciliation-side goods code → SRM goods code" mapping table in Qeasy's Mapping Center, managed centrally rather than hard-coded in each strategy. This is one of the common patterns used by Qeasy customers.
- Failure handling: Records with unmapped codes, overlong fields, or invalid numbers go to the platform's exception queue and are reprocessed manually, rather than aborting the entire batch.
Implementation Steps
The cadence of after-sales reship orders is not very dense, so we use the "incremental as the main flow, full load as fallback" dual-track approach — another common pattern among Qeasy customers.
- Establish incremental starting point: For the first run, take all records after the last 7 days of
star_modifiedas the starting point, avoiding one-shot backfills that overwhelm the target database. - Configure full-load trigger: Keep a one-time full-load task that runs manually only after "code mapping rules change" or "target table structure changes"; it does not run daily.
- Daily scheduling: Set CRON to
*/30 8-23 * * *, pulling every 30 minutes during business hours and pausing overnight, aligning with the customer-service shift rhythm. - Two-phase header/detail writing: First insert the main table to obtain
lastInsertId, then batch-insert the extend table. If either stage fails, roll back the main table to avoid orphan records. - Monitoring and reconciliation: Monitor success rate and latency on the platform side; the business side samples 5 records daily to compare
bill_no, and immediately investigates the exception queue on any anomaly.
Pitfall Review
- Pitfall 1: "Fix afterwards" for erroneous goods codes. Customer-service entries in
goods_nooften carry suffixes or typos; passing them through directly produces invalid keys in the target table. The robust approach is to look up the mapping center before insertion, and route misses to the exception queue rather than write first and clean later. - Pitfall 2: Reversed header/detail order.
extend_sql_1depends on the main table'slastInsertId; the main table must commit first. - Pitfall 3: Unthrottled full-load tasks. Pulling tens of thousands of records at once exhausts the MySQL connection pool and drags down subsequent incremental runs.
- Pitfall 4:
send_quantityof 0 or negative written as-is, skewing downstream cost aggregation. This is a common crash point; the robust approach is to add numeric validation in the middle layer. - Pitfall 5: Running every 30 minutes overnight as well. With very few records generated after hours, this wastes API quota; restricting to the
8-23window is more economical.
Applicable and Non-Applicable Scenarios
Applicable: After-sales reship / reissue / exchange orders that need to flow from a reconciliation-side representation into SRM, ERP, or data-warehouse detail tables, with code or standard-conversion requirements.
Not applicable: Second-level real-time inventory linkage (use a message queue instead); and scenarios where the target database is itself on the reconciliation side and does not need a separate copy.