更新登录页及优化相关功能
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import or_, select
|
||||
from sqlalchemy.exc import MultipleResultsFound
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from exceptions.exception import ServiceException
|
||||
from module_business.domain.test_batch_scope import TestBatchScope, batch_scope_condition
|
||||
from module_business.entity.do.master_do import BizPallet
|
||||
from module_business.entity.do.operation_do import BizPalletEvent, BizPalletInventory
|
||||
@@ -57,13 +59,18 @@ class InventoryDao:
|
||||
qr_token: str,
|
||||
scope: TestBatchScope,
|
||||
) -> BizPallet | None:
|
||||
"""兼容印刷托盘号;调用方仍须复核仓库/现场权限,写入使用规范二维码。"""
|
||||
identifier = qr_token.strip()
|
||||
result = await db.execute(
|
||||
select(BizPallet).where(
|
||||
BizPallet.qr_token == qr_token,
|
||||
or_(BizPallet.qr_token == identifier, BizPallet.pallet_code == identifier),
|
||||
batch_scope_condition(BizPallet.test_batch_id, scope),
|
||||
)
|
||||
)
|
||||
return result.scalar_one_or_none()
|
||||
try:
|
||||
return result.scalar_one_or_none()
|
||||
except MultipleResultsFound:
|
||||
raise ServiceException(message='托盘号与二维码标识存在歧义,请联系管理员核对后重试') from None
|
||||
|
||||
@classmethod
|
||||
async def get_pallets_by_ids(
|
||||
|
||||
Reference in New Issue
Block a user