[GRAMM] Vario
This commit is contained in:
@@ -34,8 +34,8 @@ namespace ISG___Biolevante__L1_.Core.Model
|
||||
|
||||
public int VelocitaNominale { get; set; }
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
public int ContatoreParziale { get; set; }
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
public string DescrizioneOrdineInCorso { get; set; }
|
||||
public string LottoOrdineInCorso { get; set; }
|
||||
public DateTime? ScadenzaOrdineInCorso { get; set; }
|
||||
|
||||
@@ -54,11 +54,11 @@ namespace ISG___Biolevante.Core.Model
|
||||
|
||||
|
||||
[ModbusAddress(1605, 2)]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
|
||||
|
||||
[ModbusAddress(1671, 2)]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ namespace ISG___Biolevante.Core.Model
|
||||
|
||||
|
||||
[ModbusAddress(105, 2)]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
|
||||
[ModbusAddress(171, 2)]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,11 +54,11 @@ namespace ISG___Biolevante.Core.Model
|
||||
|
||||
|
||||
[ModbusAddress(855, 2)]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
|
||||
[ModbusAddress(921, 2)]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ namespace ISG___Biolevante.Core.Model
|
||||
|
||||
|
||||
[ModbusAddress(1105, 2)]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
|
||||
[ModbusAddress(1171, 2)]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace ISG___Biolevante.Core.Model
|
||||
public DateTime? ScadenzaOrdineProssimo { get; set; }
|
||||
|
||||
[ModbusAddress(1355, 2)]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[ModbusAddress(1421, 2)]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[ModbusAddress(1467, 1)]
|
||||
public ushort QtaCartoniPerStrato { get; set; }
|
||||
|
||||
@@ -46,9 +46,9 @@ namespace ISG___Biolevante.Core.Model
|
||||
public DateTime? ScadenzaOrdineProssimo { get; set; }
|
||||
|
||||
[ModbusAddress(355, 2)]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[ModbusAddress(421, 2)]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace ISG___Gramm__SILSE_.Core.Model.Machine
|
||||
public ProductionSpeedTimeUnitsEnum UnitaProduzioneSuTempo { get; set; } = ProductionSpeedTimeUnitsEnum.HOUR;
|
||||
public int VelocitaNominale { get; set; }
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
public int ContatoreParziale { get; set; }
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
public string DescrizioneOrdineInCorso { get; set; }
|
||||
public string LottoOrdineInCorso { get; set; }
|
||||
public DateTime? ScadenzaOrdineInCorso { get; set; }
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace ISG___Gramm__SL01_.Core.Model
|
||||
public ProductionSpeedTimeUnitsEnum UnitaProduzioneSuTempo { get; set; } = ProductionSpeedTimeUnitsEnum.HOUR;
|
||||
public int VelocitaNominale { get; set; }
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
public int ContatoreParziale { get; set; }
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - RAM - Linea Pasta Lunga LPL01 - OPC UA Client.Tags.Ltt.InCorso.Descrizione", true)]
|
||||
public string DescrizioneOrdineInCorso { get; set; }
|
||||
|
||||
@@ -1,24 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Integry_Smart_Gateway.Core.Alert;
|
||||
using Integry_Smart_Gateway.Core.Event;
|
||||
using Integry_Smart_Gateway.Core.ExternalCom;
|
||||
using Integry_Smart_Gateway.Core.Machine;
|
||||
using Integry_Smart_Gateway.Core.RestConsumer.Controller;
|
||||
using Integry_Smart_Gateway.Core.RestConsumer.Entity.Model.DTO;
|
||||
using ISG___Gramm__SL03_.Core.Model;
|
||||
|
||||
namespace ISG___Gramm__SL03_.Core.Events
|
||||
{
|
||||
public class ScaricoMateriaPrimaEvent : IExecutionEvent
|
||||
{
|
||||
private DateTime _lastExecutionDateTime = DateTime.Now;
|
||||
|
||||
private const long MIN_TIME_DELAY = 60;
|
||||
|
||||
|
||||
private readonly IAlertService _alertService;
|
||||
private readonly IMachineDataManagerService _machineDataManagerService;
|
||||
private readonly IWarehouseControllerService _warehouseControllerService;
|
||||
|
||||
private DateTime _lastExecutionDateTime = DateTime.Now;
|
||||
private double? _lastQtaCounterByLinea = null;
|
||||
private short[] _lastQtaCounterBySemoliera = null;
|
||||
|
||||
private const string SILOS_SEMOLA_COD_JFAS = "SILSE";
|
||||
private const int MIN_TIME_DELAY = 10;
|
||||
private const int MIN_QTA = 0;
|
||||
private const int MAX_QTA = 100;
|
||||
|
||||
private LineaPastaCortaModel _currentLineaPastaCortaModel;
|
||||
|
||||
public ScaricoMateriaPrimaEvent(IAlertService alertService, IWarehouseControllerService warehouseControllerService, IMachineDataManagerService machineDataManagerService)
|
||||
{
|
||||
_alertService = alertService;
|
||||
_warehouseControllerService = warehouseControllerService;
|
||||
_machineDataManagerService = machineDataManagerService;
|
||||
}
|
||||
|
||||
|
||||
public bool Check(IList<IExternalMachineComModel> prevExternalComModels, IList<IExternalMachineComModel> externalComModels)
|
||||
{
|
||||
return (DateTime.Now - _lastExecutionDateTime).TotalSeconds > MIN_TIME_DELAY;
|
||||
var lineaPastaCortaPrevModel = prevExternalComModels?.Single(x => x is LineaPastaCortaModel) as LineaPastaCortaModel;
|
||||
var lineaPastaCortaCurrentModel = externalComModels?.Single(x => x is LineaPastaCortaModel) as LineaPastaCortaModel;
|
||||
|
||||
if (lineaPastaCortaCurrentModel == null) return false;
|
||||
|
||||
_currentLineaPastaCortaModel = lineaPastaCortaCurrentModel;
|
||||
|
||||
_lastQtaCounterByLinea ??= lineaPastaCortaCurrentModel.ContatoreParziale;
|
||||
_lastQtaCounterBySemoliera ??= lineaPastaCortaCurrentModel.ScaricoLinea3QtaScar;
|
||||
|
||||
return ((DateTime.Now - _lastExecutionDateTime).TotalSeconds > MIN_TIME_DELAY || _currentLineaPastaCortaModel.ContatoreParziale - _lastQtaCounterByLinea >= MAX_QTA)
|
||||
&& _currentLineaPastaCortaModel.ContatoreParziale - _lastQtaCounterByLinea >= MIN_QTA;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
var qtaScaricoSemola_ByLinea = _currentLineaPastaCortaModel.ContatoreParziale - _lastQtaCounterByLinea;
|
||||
var qtaScaricoSemola_BySemoliera = (short[]) _currentLineaPastaCortaModel.ScaricoLinea3QtaScar.Clone();
|
||||
|
||||
|
||||
for (int i = 0; i < qtaScaricoSemola_BySemoliera.Length; i++)
|
||||
{
|
||||
qtaScaricoSemola_BySemoliera[i] = (short) (qtaScaricoSemola_BySemoliera[i] - _lastQtaCounterBySemoliera[i]);
|
||||
}
|
||||
|
||||
|
||||
int sumQtaBySemoliera = qtaScaricoSemola_BySemoliera.Sum(x => x);
|
||||
float[] percScaricoSemola_BySemoliera = new float[qtaScaricoSemola_BySemoliera.Length];
|
||||
float[] newQtaScaricoSemola_BySemoliera = new float[qtaScaricoSemola_BySemoliera.Length];
|
||||
|
||||
for (int i = 0; i < qtaScaricoSemola_BySemoliera.Length; i++)
|
||||
{
|
||||
percScaricoSemola_BySemoliera[i] = (float) (qtaScaricoSemola_BySemoliera[i] * 100) / sumQtaBySemoliera;
|
||||
newQtaScaricoSemola_BySemoliera[i] = ((float)qtaScaricoSemola_ByLinea / 100) * percScaricoSemola_BySemoliera[i];
|
||||
}
|
||||
|
||||
|
||||
//Retrieve colli in posizione silos
|
||||
IList<ScaricoMateriaPrimaDTO> scaricoMateriaPrimaDtos = new List<ScaricoMateriaPrimaDTO>();
|
||||
|
||||
for (int i = 0; i < newQtaScaricoSemola_BySemoliera.Length; i++)
|
||||
{
|
||||
if (newQtaScaricoSemola_BySemoliera[i] > 0)
|
||||
{
|
||||
scaricoMateriaPrimaDtos.Add(new ScaricoMateriaPrimaDTO()
|
||||
{
|
||||
posizione = $"{SILOS_SEMOLA_COD_JFAS}{i + 1:D2}",
|
||||
quantity = newQtaScaricoSemola_BySemoliera[i]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Scarico qta da collo
|
||||
var ordineInCorso = _machineDataManagerService.GetOrdineInCorso();
|
||||
_warehouseControllerService.ScaricaMateriaPrimaDaPosizione(ordineInCorso.codMdep, scaricoMateriaPrimaDtos);
|
||||
|
||||
|
||||
_lastExecutionDateTime = DateTime.Now;
|
||||
_lastQtaCounterByLinea = _currentLineaPastaCortaModel.ContatoreParziale;
|
||||
_lastQtaCounterBySemoliera = _currentLineaPastaCortaModel.ScaricoLinea3QtaScar;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,10 @@ namespace ISG___Gramm__SL03_.Core.Model
|
||||
public ProductionSpeedTimeUnitsEnum UnitaProduzioneSuTempo { get; set; } = ProductionSpeedTimeUnitsEnum.HOUR;
|
||||
public int VelocitaNominale { get; set; }
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
public int ContatoreParziale { get; set; }
|
||||
public int ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L3 - RAM - Linea Pasta Corta LPC04 - OPC UA Client.Tags.Ltt.InCorso.QtaTot_Semola")]
|
||||
public double ContatoreParziale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L3 - RAM - Linea Pasta Corta LPC04 - OPC UA Client.Tags.Ltt.InCorso.Descrizione")]
|
||||
public string DescrizioneOrdineInCorso { get; set; }
|
||||
@@ -40,6 +42,10 @@ namespace ISG___Gramm__SL03_.Core.Model
|
||||
|
||||
|
||||
|
||||
[OPCUAAddress("ns=2;s=Lamura - PLC Sfarinati - OMRON FINS.Tags.Scarico - Linea 3 - Qta scaricata")]
|
||||
public short[] ScaricoLinea3QtaScar { get; set; }
|
||||
|
||||
|
||||
[OPCUAAddress("ns=2;s=L3 - RAM - Linea Pasta Corta LPC04 - OPC UA Client.Tags.Ltt.Lotto da archiviare")]
|
||||
public bool LottoDaArchiviare { get; set; }
|
||||
|
||||
|
||||
@@ -14,4 +14,8 @@
|
||||
<ProjectReference Include="..\Integry Smart Gateway\Integry Smart Gateway.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Core\Model\REST\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace ISG___LaMonarca__L2_.Core.Model.L2
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L2 - Cosmapack - Pallettizzatore - Modbus TCP/IP.Tags.Contatore parziale")]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L2 - Cosmapack - Pallettizzatore - Modbus TCP/IP.Tags.Contatore totale")]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L2 - Cosmapack - Pallettizzatore - Modbus TCP/IP.Tags.ID Ricetta attiva")]
|
||||
public int RicettaAttuale { get; set; }
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace ISG___LaMonarca.Core.Model
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Confezionatrice - MODBUS TCP/IP.Tags.Contatore parziale")]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Confezionatrice - MODBUS TCP/IP.Tags.Contatore totale")]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Confezionatrice - MODBUS TCP/IP.Tags.ID Ricetta attiva")]
|
||||
public int RicettaAttuale { get; set; }
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace ISG___LaMonarca.Core.Model
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Mettialveare - MODBUS TCP/IP.Tags.Contatore parziale")]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Mettialveare - MODBUS TCP/IP.Tags.Contatore totale")]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Mettialveare - MODBUS TCP/IP.Tags.ID Ricetta attiva")]
|
||||
public int RicettaAttuale { get; set; }
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace ISG___LaMonarca.Core.Model
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Pallettizzatore - MODBUS TCP/IP.Tags.Contatore parziale")]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Pallettizzatore - MODBUS TCP/IP.Tags.Contatore totale")]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Cosmapack - Pallettizzatore - MODBUS TCP/IP.Tags.ID Ricetta attiva")]
|
||||
public int RicettaAttuale { get; set; }
|
||||
|
||||
@@ -24,10 +24,10 @@ namespace ISG___LaMonarca.Core.Model
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Sigmac - Tappatore - Siemens S7-1200/S7-1500.Tags.Contatore parziale")]
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Sigmac - Tappatore - Siemens S7-1200/S7-1500.Tags.Contatore totale")]
|
||||
public int ContatoreTotale { get; set; }
|
||||
public double ContatoreTotale { get; set; }
|
||||
|
||||
[OPCUAAddress("ns=2;s=L1 - Sigmac - Tappatore - Siemens S7-1200/S7-1500.Tags.Descrizione ordine in corso")]
|
||||
public string DescrizioneOrdineInCorso { get; set; }
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace Integry_Smart_Gateway.Core.ExternalCom
|
||||
ProductionSpeedTimeUnitsEnum UnitaProduzioneSuTempo { get; set; }
|
||||
int VelocitaNominale { get; set; }
|
||||
int VelocitaEffettiva { get; set; }
|
||||
int ContatoreParziale { get; set; }
|
||||
int ContatoreTotale { get; set; }
|
||||
double ContatoreParziale { get; set; }
|
||||
double ContatoreTotale { get; set; }
|
||||
string DescrizioneOrdineInCorso { get; set; }
|
||||
string LottoOrdineInCorso { get; set; }
|
||||
DateTime? ScadenzaOrdineInCorso { get; set; }
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Integry_Smart_Gateway.Core.ExternalCom.Protocols.Modbus
|
||||
return (short)values[0];
|
||||
}
|
||||
|
||||
if (type == typeof(uint) || type == typeof(int))
|
||||
if (type == typeof(uint) || type == typeof(int) || type == typeof(double))
|
||||
{
|
||||
string completeBinString = "";
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace Integry_Smart_Gateway.Core.Machine
|
||||
VelocitaMassima = _machineManagerService.GetMaxSpeed(x.Nome),
|
||||
VelocitaEffettiva = x.VelocitaEffettiva,
|
||||
VelocitaNominale = x.VelocitaNominale == 0 && x.VelocitaEffettiva > 0 ? (x.VelocitaEffettiva + (x.VelocitaEffettiva/100)*20) : x.VelocitaNominale,
|
||||
ContatoreParziale = x.ContatoreParziale,
|
||||
ContatoreParziale = (int) x.ContatoreParziale,
|
||||
OrdineInCorso = ordineInCorso,
|
||||
QtaDaProdurre = qtaDaProdurre,
|
||||
ExtraInfo = externalComManager?.GetExtraInfo()
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Integry_Smart_Gateway.Core.Machine.Model
|
||||
public int VelocitaMassima { get; set; }
|
||||
public int VelocitaNominale { get; set; }
|
||||
public int VelocitaEffettiva { get; set; }
|
||||
public int ContatoreParziale { get; set; }
|
||||
public double ContatoreParziale { get; set; }
|
||||
public int QtaDaProdurre { get; set; }
|
||||
public OrdineLavorazioneDTO OrdineInCorso { get; set; }
|
||||
public IList<ExternalComExtraInfoModel> ExtraInfo { get; set; }
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Integry_Smart_Gateway.Core.Alert.Model;
|
||||
using Integry_Smart_Gateway.Core.Orders.Model;
|
||||
using Integry_Smart_Gateway.Core.RestConsumer.Entity.Model.DTO;
|
||||
|
||||
namespace Integry_Smart_Gateway.Core.RestConsumer.Controller
|
||||
{
|
||||
@@ -16,5 +18,7 @@ namespace Integry_Smart_Gateway.Core.RestConsumer.Controller
|
||||
MtbColt CreateEmptyMtbColt(OrdineLavorazioneDTO ordineLavorazione);
|
||||
|
||||
void SaveCaratteristicaPartita<T>(string codMart, string partitaMag, string caratName, T value);
|
||||
|
||||
IList<AlertDTO> ScaricaMateriaPrimaDaPosizione(string codMdep, IList<ScaricoMateriaPrimaDTO> scaricoMateriaPrimaDtos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ using Integry_Smart_Gateway.Core.RestConsumer.Entity.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Integry_Smart_Gateway.Core.Alert.Model;
|
||||
using Integry_Smart_Gateway.Core.Logger;
|
||||
using Integry_Smart_Gateway.Core.Orders.Model;
|
||||
using Integry_Smart_Gateway.Core.RestConsumer.Entity.Model.DTO;
|
||||
using Integry_Smart_Gateway.Core.Settings;
|
||||
|
||||
namespace Integry_Smart_Gateway.Core.RestConsumer.Controller
|
||||
@@ -117,5 +119,51 @@ namespace Integry_Smart_Gateway.Core.RestConsumer.Controller
|
||||
_loggerService.LogError(ex, nameof(WarehouseControllerService));
|
||||
}
|
||||
}
|
||||
|
||||
public IList<AlertDTO> ScaricaMateriaPrimaDaPosizione(string codMdep, IList<ScaricoMateriaPrimaDTO> scaricoMateriaPrimaDtos)
|
||||
{
|
||||
IDictionary<string, object> queryParams = new Dictionary<string, object>();
|
||||
|
||||
queryParams.Add("codJfas", _settingsService.GetProductionConfig().CodJfas);
|
||||
queryParams.Add("codMdep", codMdep);
|
||||
|
||||
IList<AlertDTO> alerts = new List<AlertDTO>();
|
||||
|
||||
try
|
||||
{
|
||||
IList<dynamic> responses = _restConsumerService.Post<IList<dynamic>>("scaricoMateriaPrimaDaPosizione", queryParams, scaricoMateriaPrimaDtos).dto;
|
||||
|
||||
foreach (var response in responses)
|
||||
{
|
||||
AlertLevelEnum? level = null;
|
||||
|
||||
switch ((string) response.tipo)
|
||||
{
|
||||
case "INFO":
|
||||
level = AlertLevelEnum.INFO;
|
||||
break;
|
||||
case "WARNING":
|
||||
level = AlertLevelEnum.WARNING;
|
||||
break;
|
||||
case "ERROR":
|
||||
level = AlertLevelEnum.DANGER;
|
||||
break;
|
||||
}
|
||||
|
||||
alerts.Add(new AlertDTO()
|
||||
{
|
||||
AlertLevel = (AlertLevelEnum) level,
|
||||
Title = "Scarico materia prima",
|
||||
Message = response.message
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
_loggerService.LogError(ex, nameof(WarehouseControllerService));
|
||||
}
|
||||
|
||||
return alerts;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace Integry_Smart_Gateway.Core.RestConsumer.Entity.Model.DTO
|
||||
{
|
||||
public class ScaricoMateriaPrimaDTO
|
||||
{
|
||||
public string posizione { get; set; }
|
||||
public float quantity { get; set; }
|
||||
|
||||
public DateTime dataOrd { get; set; }
|
||||
public int numOrd { get; set; }
|
||||
public string gestioneOrd { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user