Aggiunta metodo GetCurrOdlStart x IOC
This commit is contained in:
@@ -147,6 +147,38 @@ namespace MP.IOC.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce data-ora inizio dell'odl correntemente in lavorazione sulla macchina...
|
||||
/// es: http://url_site/MP/IO/IOB/getCurrOdlStart/SIMUL_03
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getCurrOdlStart/{id}")]
|
||||
public async Task<IActionResult> GetCurrOdlStart(string id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id)) return BadRequest("Missing ID");
|
||||
|
||||
// Multi: gestione carattere "|" trasformato in "#"
|
||||
id = id.Replace("|", "#");
|
||||
|
||||
DateTime answ = new DateTime(DateTime.Now.Year - 1, 12, 31);
|
||||
// chiamo metodo redis/db...
|
||||
try
|
||||
{
|
||||
var odlData = await DService.OdlCurrByMaccAsync(id);
|
||||
if (odlData != null && odlData.DataInizio.HasValue)
|
||||
{
|
||||
answ = odlData.DataInizio.Value;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in recupero getCurrOdlStart{Environment.NewLine}{exc}");
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, "NO");
|
||||
}
|
||||
return Ok(answ.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera TASK richiesto x macchina:
|
||||
/// GET: IOB/getOptPar/SIMUL_03
|
||||
|
||||
Reference in New Issue
Block a user