[egg-ts-helper] create typings\app\extend\application.d.ts (2ms) [egg-ts-helper] create typings\app\controller\index.d.ts (2ms) [egg-ts-helper] create typings\app\model\index.d.ts (2ms) [egg-ts-helper] create typings\config\index.d.ts (13ms) [egg-ts-helper] create typings\config\plugin.d.ts (1ms) [egg-ts-helper] create typings\app\service\index.d.ts (3ms) [egg-ts-helper] create typings\app\index.d.ts (0ms) test/app/controller/system.storage.inventory.matchPutaway.test.js [SETUP] 测试商品: 测试加货主商品1(157008), 新商品(156968) [EXACT] 收货单 ID: 506 [EXACT] 明细 1: detailId=714, product=测试加货主商品1, qty=10 [EXACT] 明细 2: detailId=715, product=新商品, qty=5 [EXACT] 入库单 ID: 156, code: TEST-ENTRY-1775810833609 [EXACT] matchPutaway 响应: { "flag": "success", "code": 200, "message": "匹配入库完成", "data": { "matched_items": [ { "stock_warehouse_id": 156968, "item_code": "6902226191552", "inbound_quantity": 5, "rcv_available": 5, "entry_planned": 5 }, { "stock_warehouse_id": 157008, "item_code": "6902226191553", "inbound_quantity": 10, "rcv_available": 10, "entry_planned": 10 } ], "receiving_results": [ { "receiving_id": 506, "receiving_number": "R20553028", "storage_status": "all" } ], "entry_order_results": [ { "entry_order_id": 156, "entry_order_code": "TEST-ENTRY-1775810833609", "order_status": "COMPLETED", "source_type": "API", "callback_status": "SUCCESS", "callback_detail": { "success": true, "skipped": true } } ], "unmatched_products": [] }, "timestamp": 1775810834 } [EXACT] 收货单 storage_status: all [EXACT] 入库单 order_status: COMPLETED ✔ should match putaway when receiving equals entry order (exact match) (5187ms) [SURPLUS] 收货单 ID: 507 [SURPLUS] 明细 1: detailId=716, product=测试加货主商品1, rcvQty=20 [SURPLUS] 明细 2: detailId=717, product=新商品, rcvQty=15 [SURPLUS] 入库单 ID: 157, code: TEST-ENTRY-1775810838554 [SURPLUS] matchPutaway 响应: { "flag": "success", "code": 200, "message": "匹配入库完成", "data": { "matched_items": [ { "stock_warehouse_id": 156968, "item_code": "6902226191552", "inbound_quantity": 5, "rcv_available": 15, "entry_planned": 5 }, { "stock_warehouse_id": 157008, "item_code": "6902226191553", "inbound_quantity": 10, "rcv_available": 20, "entry_planned": 10 } ], "receiving_results": [ { "receiving_id": 507, "receiving_number": "R20553029", "storage_status": "partial" } ], "entry_order_results": [ { "entry_order_id": 157, "entry_order_code": "TEST-ENTRY-1775810838554", "order_status": "COMPLETED", "source_type": "API", "callback_status": "SUCCESS", "callback_detail": { "success": true, "skipped": true } } ], "unmatched_products": [] }, "timestamp": 1775810839 } [SURPLUS] 收货单 storage_status: partial [SURPLUS] 明细 716: stored=10, actual=20, status=partial [SURPLUS] 明细 717: stored=5, actual=15, status=partial [SURPLUS] 入库单 order_status: COMPLETED ✔ should handle receiving > entry order (partial match with surplus) (4469ms) [INSUF] 收货单 ID: 508 [INSUF] 明细 1: detailId=718, product=测试加货主商品1, rcvQty=5 [INSUF] 明细 2: detailId=719, product=新商品, rcvQty=3 [INSUF] 入库单 ID: 158, code: TEST-ENTRY-1775810842785 [INSUF] matchPutaway 响应: { "flag": "success", "code": 200, "message": "匹配入库完成", "data": { "matched_items": [ { "stock_warehouse_id": 156968, "item_code": "6902226191552", "inbound_quantity": 3, "rcv_available": 3, "entry_planned": 8 }, { "stock_warehouse_id": 157008, "item_code": "6902226191553", "inbound_quantity": 5, "rcv_available": 5, "entry_planned": 10 } ], "receiving_results": [ { "receiving_id": 508, "receiving_number": "R20553030", "storage_status": "all" } ], "entry_order_results": [ { "entry_order_id": 158, "entry_order_code": "TEST-ENTRY-1775810842785", "order_status": "PARTIAL_RECEIVED", "source_type": "API", "callback_status": null } ], "unmatched_products": [], "warnings": [ "stock_warehouse_id=156968: 收货可入库量(3) < 入库计划量(8),按收货量入库", "stock_warehouse_id=157008: 收货可入库量(5) < 入库计划量(10),按收货量入库", "入库单 TEST-ENTRY-1775810842785: 未全部入库完成(PARTIAL_RECEIVED),不触发回传,需手工操作或等待其他收货入库" ] }, "timestamp": 1775810843 } [INSUF] 收货单 storage_status: all [INSUF] 入库单 order_status: PARTIAL_RECEIVED [INSUF] warnings: [ 'stock_warehouse_id=156968: 收货可入库量(3) < 入库计划量(8),按收货量入库', 'stock_warehouse_id=157008: 收货可入库量(5) < 入库计划量(10),按收货量入库', '入库单 TEST-ENTRY-1775810842785: 未全部入库完成(PARTIAL_RECEIVED),不触发回传,需手工操作或等待其他收货入库' ] ✔ should handle receiving < entry order (insufficient receiving) (4181ms) [TEARDOWN] 数据库连接已关闭 3 passing (15s) [mochawesome] Report JSON saved to D:\wms\node_modules\.mochawesome-reports\mochawesome.json [mochawesome] Report HTML saved to D:\wms\node_modules\.mochawesome-reports\mochawesome.html