From 4a7b41dde7daf6fd96e763ff66e997876af0f17f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 13 Apr 2026 18:13:22 +0200 Subject: [PATCH] Aggiunta chiamata getCurrOdlQtaReq --- MP.IOC/Controllers/IOBController.cs | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/MP.IOC/Controllers/IOBController.cs b/MP.IOC/Controllers/IOBController.cs index 17791532..12214c94 100644 --- a/MP.IOC/Controllers/IOBController.cs +++ b/MP.IOC/Controllers/IOBController.cs @@ -171,6 +171,38 @@ namespace MP.IOC.Controllers } } + /// + /// Restituisce la quantità pezzi dell'odl correntemente in lavorazione sulla macchina... + /// GET: IOB/getCurrOdlQtaReq/SIMUL_01 + /// + /// + /// + [HttpGet("getCurrOdlQtaReq/{id}")] + public async Task GetCurrOdlQtaReq(string id) + { + if (string.IsNullOrEmpty(id)) return BadRequest("Missing ID"); + + // Multi: gestione carattere "|" trasformato in "#" + id = id.Replace("|", "#"); + + int answ = 0; + // chiamo metodo redis/db... + try + { + var odlData = await DService.OdlCurrByMaccAsync(id); + if (odlData != null && odlData.DataInizio.HasValue) + { + answ = odlData.NumPezzi; + } + } + catch (Exception exc) + { + Log.Error($"Eccezione in recupero GetCurrOdlQtaReq{Environment.NewLine}{exc}"); + return StatusCode(StatusCodes.Status500InternalServerError, "NO"); + } + return Ok(answ); + } + /// /// Restituisce data-ora inizio dell'odl correntemente in lavorazione sulla macchina... /// es: http://url_site/MP/IO/IOB/getCurrOdlStart/SIMUL_03