修复:限定幂等键精确业务域
This commit is contained in:
@@ -513,10 +513,17 @@ class InboundService:
|
||||
) -> CrudResponseModel:
|
||||
try:
|
||||
warehouse_ids = await cls._warehouse_scope(query_db, current_user)
|
||||
current = await OperationDao.get_inbound_by_id(
|
||||
query_db,
|
||||
inbound_id,
|
||||
warehouse_ids=warehouse_ids,
|
||||
)
|
||||
if current is None:
|
||||
cls._raise_inbound_not_accessible(current_user)
|
||||
recovered = await OperationDao.get_inbound_by_confirm_idempotency_key(
|
||||
query_db,
|
||||
idempotency_key,
|
||||
warehouse_ids=warehouse_ids,
|
||||
warehouse_ids=[current.warehouse_id],
|
||||
)
|
||||
if recovered is None:
|
||||
raise ServiceException(message='确认入库失败,幂等冲突')
|
||||
@@ -575,7 +582,7 @@ class InboundService:
|
||||
existing = await OperationDao.get_inbound_by_confirm_idempotency_key(
|
||||
query_db,
|
||||
idempotency_key,
|
||||
warehouse_ids=warehouse_ids,
|
||||
warehouse_ids=[inbound.warehouse_id],
|
||||
)
|
||||
if existing is not None:
|
||||
await AccessService.assert_warehouse_access(
|
||||
|
||||
Reference in New Issue
Block a user