feat(pda): validate live inventory before batch submit

This commit is contained in:
2026-08-11 18:46:04 +08:00
parent f83a0c47c1
commit 41e83bf15f
3 changed files with 24 additions and 7 deletions
+4 -1
View File
@@ -59,6 +59,7 @@ test('PDA cabinet picking adapter claims online and submits one atomic batch', (
assert.match(source, /\/first-leg\/pda-loading\/tasks\?/)
assert.match(source, /tasks\/\$\{encodeURIComponent\(taskId\)\}\/claim/)
assert.match(source, /tasks\/\$\{encodeURIComponent\(task\.taskId\)\}\/batch/)
assert.match(source, /tasks\/\$\{encodeURIComponent\(taskId\)\}\/inventory-snapshot\?warehouseId=/)
assert.match(source, /submitContainerPickingBatch/)
assert.match(source, /stableIdempotencyKey/)
assert.match(source, /Math\.imul\(hash, 16777619\)/)
@@ -66,7 +67,9 @@ test('PDA cabinet picking adapter claims online and submits one atomic batch', (
assert.match(page, /claimContainerPickingTask\(/)
assert.match(page, /submitContainerPickingBatch\(/)
assert.match(page, /任务版本已变化,请刷新后重试/)
assert.match(source, /data: \{ warehouseId, containerNo: task\.containerNo, expectedVersion, items \}/)
assert.match(source, /data: \{ warehouseId, containerNo: task\.containerNo, expectedVersion, inventorySnapshotToken, items \}/)
assert.match(page, /await getPickingInventorySnapshot\([\s\S]*await submitContainerPickingBatch/)
assert.match(page, /库存已变化,请刷新后重试/)
assert.doesNotMatch(source.match(/export async function submitContainerPickingBatch[\s\S]*?\n\}/)?.[0] || '', /for \(/)
assert.match(page, /version: Number\(item\.version \|\| 0\)/)
assert.match(page, /refreshTask/)