Aggiungi pausa picking list nel barcode

This commit is contained in:
2026-07-03 10:13:49 +02:00
parent 29687c8094
commit 7ecc906d59
4 changed files with 238 additions and 25 deletions

View File

@@ -72,6 +72,20 @@ LEFT JOIN dbo.Celle AS c
WHERE g.BarcodePallet = :pallet;
"""
SQL_OPEN_LOCATIONS_BY_PALLET = """
SELECT
g.BarcodePallet,
g.IDCella,
RTRIM(c.Corsia) AS Corsia,
RTRIM(CAST(c.Colonna AS varchar(32))) AS Colonna,
RTRIM(CAST(c.Fila AS varchar(32))) AS Fila
FROM dbo.XMag_GiacenzaPallet AS g
LEFT JOIN dbo.Celle AS c
ON c.ID = g.IDCella
WHERE g.BarcodePallet = :pallet
ORDER BY g.IDCella;
"""
SQL_RESOLVE_PHYSICAL_CELL = """
DECLARE @raw int = TRY_CONVERT(int, :destination);
DECLARE @cell_id int =
@@ -184,6 +198,12 @@ class BarcodeRepository:
rows = _rows_to_dicts(res)
return rows[0] if rows else None
async def fetch_open_locations_by_pallet(self, pallet: str) -> list[dict[str, Any]]:
"""Return all positive stock locations currently open for a pallet."""
res = await self.db_client.query_json(SQL_OPEN_LOCATIONS_BY_PALLET, {"pallet": str(pallet or "").strip()})
return _rows_to_dicts(res)
async def resolve_physical_cell(self, destination: str) -> DestinationCell | None:
"""Accept either an internal cell ID or the scanned legacy cell barcode."""