修复:补齐测试批次恢复锁定

This commit is contained in:
焦龙言
2026-09-23 09:01:50 +08:00
parent f5df2150d8
commit 97b4dc8508
15 changed files with 212 additions and 16 deletions
@@ -112,6 +112,7 @@ class InventoryDao:
db: AsyncSession,
inventory: BizPalletInventory,
event: BizPalletEvent,
scope: TestBatchScope,
) -> BizPalletEvent:
"""在调用方持有库存行锁时,为托盘追加下一序号事件。"""
last_sequence = 0
@@ -121,6 +122,7 @@ class InventoryDao:
.where(
BizPalletEvent.event_id == inventory.last_event_id,
BizPalletEvent.pallet_id == inventory.pallet_id,
batch_scope_condition(BizPalletEvent.test_batch_id, scope),
)
.with_for_update()
)