diff --git a/app/service/systems/stockout_order.js b/app/service/systems/stockout_order.js index 9f349da..9d15204 100644 --- a/app/service/systems/stockout_order.js +++ b/app/service/systems/stockout_order.js @@ -209,7 +209,10 @@ class StockoutOrderService extends MainService { orderLineNo: line.orderLineNo, ownerCode: line.ownerCode, itemCode: line.itemCode, - itemId: line.itemId, + // item_id 统一写入实际匹配到的 StockStore 主键 id(纯数字), + // 避免调用方把「编码+名称」等非数字值放进 itemId 时写入 BIGINT 列 + // 触发 MySQL 严格模式报错(与 entry_order 建单口径一致) + itemId: wmsStock.id, itemName: line.itemName, planQty, inventoryType: line.inventoryType, diff --git a/methods/changes/qimen.json b/methods/changes/qimen.json index 57221a2..3831ca9 100644 --- a/methods/changes/qimen.json +++ b/methods/changes/qimen.json @@ -1,4 +1,20 @@ [ + { + "version": "2026.10.08-qimen-stockout-item-id-normalize", + "date": "2026-10-08", + "type": "updated", + "module": "stockout", + "summary": "qimen stockout.create 明细 item_id 落库口径修正:统一写入实际匹配到的 StockStore 数字主键 id,修复调用方把「编码+名称」拼接串放进 itemId(同时 itemCode 可精确匹配)时写入 BIGINT 列触发 MySQL 严格模式 1366(Incorrect integer value for column item_id)导致建单失败的问题;与 entryorder.create 建单口径对齐。", + "methods": [ + "stockout.create" + ], + "notes": [ + "app/service/systems/stockout_order.js#create 校验循环 items.push:itemId 由 line.itemId 改为 wmsStock.id(StockStore 主键,纯数字);itemCode/itemName 仍落报文原值,stockId 仍为 wmsStock.stock_id", + "回传影响:stockout 确认回传(order_async.js buildStockoutConfirmDataInternal)itemId 改为 StockStore 主键 id,符合奇门 itemId=「仓储系统商品ID」语义,与入库单确认回传口径一致", + "生产案例:2026-10-08 10:09 奇门 stockout.create(app_key=23204092)报 Incorrect integer value: LB006小光兔灵感五色眼影盘#01情懒落日 for column item_id,调用方 itemId/itemCode/itemName 三字段均为拼接串,系统按 itemCode 匹配到 StockStore(stock_id=162580)但落库仍用报文原值", + "验证:test/temp_test_stockout_itemid_normalize.js(非数字 itemId + itemCode 降级匹配 → 建单成功且 item_id=StockStore 主键;数字主键回归通过),5/5 PASS" + ] + }, { "version": "2026.09.12-qimen-order-cancel-rk-entry-order-support", "date": "2026-09-12", diff --git a/methods/qimen.json b/methods/qimen.json index ea7ec7e..9420321 100644 --- a/methods/qimen.json +++ b/methods/qimen.json @@ -1,8 +1,8 @@ { "module": "qimen", "description": "奇门接口标准入口,method 对应 qimenMethods 异步方法,全部使用 POST 请求,参数包含 query 与 XML body(request 节点)", - "version": "0.3.10", - "updatedAt": "2026-09-12", + "version": "0.3.11", + "updatedAt": "2026-10-08", "headers": [], "methods": { "groups": [ @@ -1375,7 +1375,12 @@ "description": "出库单号" } ], - "errors": [] + "errors": [], + "notes": [ + "明细行商品匹配二级策略:itemId 主键直查(货主一致)> itemCode 精确匹配(warehouse_id + store_id + app_key 维度)", + "item_id 统一写入实际匹配到的 StockStore 数字主键 id(wms_stock_store.id),避免非数字值(如「编码+名称」拼接串)写入 BIGINT 列触发 MySQL 严格模式报错(Incorrect integer value for column item_id)", + "item_code / item_name / plan_qty / inventory_type 落报文原值,stock_id 落系统解析值" + ] }, { "method": "stockout.query",