Update pesante x gestione servizio x accesso IOC repo

This commit is contained in:
Samuele Locatelli
2026-04-30 17:58:55 +02:00
parent 7fe91d59d7
commit 523bf78d33
9 changed files with 1184 additions and 19 deletions
+15 -13
View File
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using MP.Core.DTO;
using MP.Core.Objects;
using MP.Data.DbModels;
using MP.Data.Services.IOC;
using MP.IOC.Data;
using Newtonsoft.Json;
using NLog;
@@ -16,17 +17,18 @@ namespace MP.IOC.Controllers
{
#region Public Constructors
public IOBController(IConfiguration configuration, MpDataService DataService)
public IOBController(IConfiguration configuration, MpDataService DataService, IIocService IService)
{
_configuration = configuration;
DService = DataService;
IOCService = IService;
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// <summary>
/// SALVA x macchina KVP parametro/valore:
/// GET: api/IOB/addOptPar/SIMUL_03?pName=PZREQ&pValue=1000
/// </summary> <param name="id"></param> <param name="pName"></param> <param name="pValue"></param>
@@ -327,15 +329,6 @@ namespace MP.IOC.Controllers
}
}
/// <summary>
/// Chiude ODL precedente ed avvia uno nuovo (duplicandolo e sitemando quantità RIMANENTE),
/// e CONFERMA produzione...
///
/// GET: IOB/forceSplitOdl/SIMUL_03
/// </summary>
/// <param name="id"></param>
/// <returns>Esito chiamata (OK/vuoto)</returns>
[HttpGet("forceSplitOdl/{id}")]
public async Task<IActionResult> ForceSplitOdl(string id)
{
@@ -358,6 +351,14 @@ namespace MP.IOC.Controllers
return Ok(answ);
}
/// <summary>
/// Chiude ODL precedente ed avvia uno nuovo (duplicandolo e sitemando quantità RIMANENTE),
/// e CONFERMA produzione...
///
/// GET: IOB/forceSplitOdl/SIMUL_03
/// </summary>
/// <param name="id"></param>
/// <returns>Esito chiamata (OK/vuoto)</returns>
/// <summary>
/// Recupera ArtNum dato CodXdl (per impianti che accettano solo INT in scrittura):
/// GET: IOB/getArtNum/SIMUL_03?CodXdl=ABC123
@@ -880,7 +881,8 @@ namespace MP.IOC.Controllers
DateTime dataOraEvento = DateTime.Now;
try
{
answ = await DService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt);
answ = await IOCService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt);
//answ = await DService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt);
return Ok(answ);
}
catch (Exception exc)
@@ -1447,8 +1449,8 @@ namespace MP.IOC.Controllers
#region Private Fields
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
private IIocService IOCService;
#endregion Private Fields