Fix eventi VSEB x fermate
This commit is contained in:
@@ -197,11 +197,11 @@ namespace MP_TAB_SERV.Components
|
||||
protected async Task SetMacc(string selIdxMacc)
|
||||
{
|
||||
isProcessing = true;
|
||||
await Task.Delay(100);
|
||||
await Task.Delay(10);
|
||||
IdxMaccSel = selIdxMacc;
|
||||
await doUpdate();
|
||||
isProcessing = false;
|
||||
await Task.Delay(100);
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2310.617</Version>
|
||||
<Version>6.16.2310.618</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace MP_TAB_SERV.Pages
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
protected List<AnagEventiModel> events2show { get; set; } = new List<AnagEventiModel>();
|
||||
protected List<vSelEventiBCodeModel> events2show { get; set; } = new List<vSelEventiBCodeModel>();
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2310.617</h4>
|
||||
<h4>Versione: 6.16.2310.618</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.617
|
||||
6.16.2310.618
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.617</version>
|
||||
<version>6.16.2310.618</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -13,4 +13,5 @@
|
||||
@using MP.Data.DatabaseModels
|
||||
@using MP.Data.DTO
|
||||
@using MP.Data.Services
|
||||
@using Newtonsoft.Json
|
||||
@using NLog
|
||||
|
||||
@@ -46,15 +46,15 @@ namespace MP.Data.Controllers
|
||||
/// Restituisce l'anagrafica EVENTI per intero
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagEventiModel> AnagEventiGetByMacc(string IdxMac)
|
||||
public List<vSelEventiBCodeModel> AnagEventiGetByMacc(string IdxMac)
|
||||
{
|
||||
List<AnagEventiModel> dbResult = new List<AnagEventiModel>();
|
||||
List<vSelEventiBCodeModel> dbResult = new List<vSelEventiBCodeModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacch = new SqlParameter("@idxMacchina", IdxMac);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagEventi
|
||||
.DbSetVSEB
|
||||
.FromSqlRaw("exec dbo.stp_vseb_getByIdxMacchinaFull @idxMacchina", IdxMacch)
|
||||
.AsNoTracking()
|
||||
.AsEnumerable()
|
||||
@@ -80,6 +80,90 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia necessario inserire un cambio di stato impianto in modalità batch
|
||||
/// </summary>
|
||||
/// <param name="tipoInput"></param>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
/// <param name="InizioStato"></param>
|
||||
/// <param name="IdxTipo"></param>
|
||||
/// <param name="CodArt"></param>
|
||||
/// <param name="Value"></param>
|
||||
/// <param name="MatrOpr"></param>
|
||||
/// <param name="pallet"></param>
|
||||
public void CheckCambiaStatoBatch(tipoInputEvento tipoInput, string IdxMacchina, DateTime InizioStato, int IdxTipo, string CodArt, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
List<TransizioneStatiModel> tabTransStati = new List<TransizioneStatiModel>();
|
||||
TransizioneStatiModel rigaTransStati = new TransizioneStatiModel();
|
||||
switch (tipoInput)
|
||||
{
|
||||
case tipoInputEvento.barcode:
|
||||
// effettuo cambio stato INDIPENDENTEMENTE da stato precedente
|
||||
try
|
||||
{
|
||||
tabTransStati = SMES_getUserForced(IdxMacchina, IdxTipo);
|
||||
if (tabTransStati != null)
|
||||
{
|
||||
if (tabTransStati.Count > 0)
|
||||
{
|
||||
rigaTransStati = tabTransStati.FirstOrDefault();
|
||||
// solo se cambia stato...
|
||||
if (rigaTransStati.IdxStato != rigaTransStati.next_IdxStato)
|
||||
{
|
||||
DDB_InsStatoBatch(IdxMacchina, InizioStato, rigaTransStati.next_IdxStato, CodArt, Value, MatrOpr, pallet);
|
||||
// aggiorno MSE
|
||||
RicalcMse(IdxMacchina, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Debug($"Non trovata riga per: BARCODE | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// non dovrebbe succedere... input utente da barcode dovrebbero TUTTI essere
|
||||
// inseriti in tab transizione con famiglia 1...
|
||||
Log.Error($"Eccezione controllo transizione stato x evento barcode: BARCODE | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
|
||||
case tipoInputEvento.hw:
|
||||
// verifico se ci sia necessità di cambio stato
|
||||
try
|
||||
{
|
||||
tabTransStati = SMES_getHwTransitions(IdxMacchina, IdxTipo);
|
||||
if (tabTransStati != null)
|
||||
{
|
||||
if (tabTransStati.Count > 0)
|
||||
{
|
||||
//rigaTransStati = tabTransStati[0];
|
||||
rigaTransStati = tabTransStati.FirstOrDefault();
|
||||
if (rigaTransStati != null)
|
||||
{
|
||||
// solo se cambia stato...
|
||||
if (rigaTransStati.IdxStato != rigaTransStati.next_IdxStato)
|
||||
{
|
||||
DDB_InsStatoBatch(IdxMacchina, InizioStato, rigaTransStati.next_IdxStato, CodArt, Value, MatrOpr, pallet);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Debug($"Non trovata riga per: HW | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// non trovo riga [0]... NON scrivo!
|
||||
Log.Error($"Errore controllo transizione stato x evento barcode: HW | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua conferma prod macchina dell'intero periodo da confermare (ultima conferma
|
||||
/// --> dtEvent)
|
||||
@@ -190,6 +274,29 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool DDB_InsStatoBatch(string idxMacchina, DateTime inizioStato, int idxStato, string codArt, string value, int matrOpr, string pallet)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var InizioStato = new SqlParameter("@InizioStato", inizioStato);
|
||||
var IdxStato = new SqlParameter("@IdxStato", idxStato);
|
||||
var CodArticolo = new SqlParameter("@CodArticolo", codArt);
|
||||
var Value = new SqlParameter("@Value", value);
|
||||
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||
var Pallet = new SqlParameter("@pallet", pallet);
|
||||
|
||||
var result = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("exec dbo.stp_DDB_InsStatoBatch @IdxMacchina, @InizioStato, @IdxStato, @CodArticolo, @Value, @MatrOpr, @pallet", IdxMacchina, InizioStato, IdxStato, CodArticolo, Value, MatrOpr, Pallet);
|
||||
|
||||
// indico eseguito!
|
||||
fatto = result > 0;
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_configuration = null;
|
||||
@@ -365,7 +472,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="idxTipo"></param>
|
||||
/// <returns></returns>
|
||||
public List<TransizioneStatiModel> SMES_getUserForced(string idxMacchina, int idxTipo)
|
||||
public List<TransizioneStatiModel> SMES_getHwTransitions(string idxMacchina, int idxTipo)
|
||||
{
|
||||
List<TransizioneStatiModel> dbResult = new List<TransizioneStatiModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -374,7 +481,7 @@ namespace MP.Data.Controllers
|
||||
var IdxTipo = new SqlParameter("@IdxTipo", idxTipo);
|
||||
dbResult = dbCtx
|
||||
.DbSetSMES
|
||||
.FromSqlRaw("exec dbo.stp_TS_getUserForcedTrans @IdxMacchina, @IdxTipo", IdxMacchina, IdxTipo)
|
||||
.FromSqlRaw("exec dbo.stp_TS_getByIdxMacchIdxTipoEv @IdxMacchina, @IdxTipo", IdxMacchina, IdxTipo)
|
||||
.AsNoTracking()
|
||||
.AsEnumerable()
|
||||
.ToList();
|
||||
@@ -387,7 +494,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="idxTipo"></param>
|
||||
/// <returns></returns>
|
||||
public List<TransizioneStatiModel> SMES_getHwTransitions(string idxMacchina, int idxTipo)
|
||||
public List<TransizioneStatiModel> SMES_getUserForced(string idxMacchina, int idxTipo)
|
||||
{
|
||||
List<TransizioneStatiModel> dbResult = new List<TransizioneStatiModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -396,7 +503,7 @@ namespace MP.Data.Controllers
|
||||
var IdxTipo = new SqlParameter("@IdxTipo", idxTipo);
|
||||
dbResult = dbCtx
|
||||
.DbSetSMES
|
||||
.FromSqlRaw("exec dbo.stp_TS_getByIdxMacchIdxTipoEv @IdxMacchina, @IdxTipo", IdxMacchina, IdxTipo)
|
||||
.FromSqlRaw("exec dbo.stp_TS_getUserForcedTrans @IdxMacchina, @IdxTipo", IdxMacchina, IdxTipo)
|
||||
.AsNoTracking()
|
||||
.AsEnumerable()
|
||||
.ToList();
|
||||
@@ -521,113 +628,6 @@ namespace MP.Data.Controllers
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
public bool DDB_InsStatoBatch(string idxMacchina, DateTime inizioStato, int idxStato, string codArt, string value, int matrOpr, string pallet)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var InizioStato = new SqlParameter("@InizioStato", inizioStato);
|
||||
var IdxStato = new SqlParameter("@IdxStato", idxStato);
|
||||
var CodArticolo = new SqlParameter("@CodArticolo", codArt);
|
||||
var Value = new SqlParameter("@Value", value);
|
||||
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||
var Pallet = new SqlParameter("@pallet", pallet);
|
||||
|
||||
var result = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("exec dbo.stp_DDB_InsStatoBatch @IdxMacchina, @InizioStato, @IdxStato, @CodArticolo, @Value, @MatrOpr, @pallet", IdxMacchina, InizioStato, IdxStato, CodArticolo, Value, MatrOpr, Pallet);
|
||||
|
||||
// indico eseguito!
|
||||
fatto = result > 0;
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia necessario inserire un cambio di stato impianto in modalità batch
|
||||
/// </summary>
|
||||
/// <param name="tipoInput"></param>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
/// <param name="InizioStato"></param>
|
||||
/// <param name="IdxTipo"></param>
|
||||
/// <param name="CodArt"></param>
|
||||
/// <param name="Value"></param>
|
||||
/// <param name="MatrOpr"></param>
|
||||
/// <param name="pallet"></param>
|
||||
public void CheckCambiaStatoBatch(tipoInputEvento tipoInput, string IdxMacchina, DateTime InizioStato, int IdxTipo, string CodArt, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
List<TransizioneStatiModel> tabTransStati = new List<TransizioneStatiModel>();
|
||||
TransizioneStatiModel rigaTransStati = new TransizioneStatiModel();
|
||||
switch (tipoInput)
|
||||
{
|
||||
case tipoInputEvento.barcode:
|
||||
// effettuo cambio stato INDIPENDENTEMENTE da stato precedente
|
||||
try
|
||||
{
|
||||
tabTransStati = SMES_getUserForced(IdxMacchina, IdxTipo);
|
||||
if (tabTransStati != null)
|
||||
{
|
||||
if (tabTransStati.Count > 0)
|
||||
{
|
||||
rigaTransStati = tabTransStati.FirstOrDefault();
|
||||
// solo se cambia stato...
|
||||
if (rigaTransStati.IdxStato != rigaTransStati.next_IdxStato)
|
||||
{
|
||||
DDB_InsStatoBatch(IdxMacchina, InizioStato, rigaTransStati.next_IdxStato, CodArt, Value, MatrOpr, pallet);
|
||||
// aggiorno MSE
|
||||
RicalcMse(IdxMacchina, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Debug($"Non trovata riga per: BARCODE | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// non dovrebbe succedere... input utente da barcode dovrebbero TUTTI essere
|
||||
// inseriti in tab transizione con famiglia 1...
|
||||
Log.Error($"Eccezione controllo transizione stato x evento barcode: BARCODE | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
|
||||
case tipoInputEvento.hw:
|
||||
// verifico se ci sia necessità di cambio stato
|
||||
try
|
||||
{
|
||||
tabTransStati = SMES_getHwTransitions(IdxMacchina, IdxTipo);
|
||||
if (tabTransStati != null)
|
||||
{
|
||||
if (tabTransStati.Count > 0)
|
||||
{
|
||||
//rigaTransStati = tabTransStati[0];
|
||||
rigaTransStati = tabTransStati.FirstOrDefault();
|
||||
if (rigaTransStati != null)
|
||||
{
|
||||
// solo se cambia stato...
|
||||
if (rigaTransStati.IdxStato != rigaTransStati.next_IdxStato)
|
||||
{
|
||||
DDB_InsStatoBatch(IdxMacchina, InizioStato, rigaTransStati.next_IdxStato, CodArt, Value, MatrOpr, pallet);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Debug($"Non trovata riga per: HW | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// non trovo riga [0]... NON scrivo!
|
||||
Log.Error($"Errore controllo transizione stato x evento barcode: HW | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
@@ -13,8 +13,12 @@ namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxTipo { get; set; } = 0;
|
||||
public string Label { get; set; } = "";
|
||||
public string Nome { get; set; } = "";
|
||||
public string TabAzione { get; set; } = "";
|
||||
public string Azione { get; set; } = "";
|
||||
public string KeyEvento { get; set; } = "";
|
||||
public bool EventoTablet { get; set; } = true;
|
||||
public string NoteEvento { get; set; } = "";
|
||||
public string CssClass { get; set; } = "";
|
||||
public string Icon { get; set; } = "";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public class vSelEventiBCodeModel
|
||||
{
|
||||
[Key]
|
||||
public int IdxTipo { get; set; } = 0;
|
||||
public string Label { get; set; } = "";
|
||||
public bool EventoTablet { get; set; } = true;
|
||||
public string CssClass { get; set; } = "";
|
||||
public string Icon { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -79,6 +79,9 @@ namespace MP.Data
|
||||
public virtual DbSet<ST_TemplateRows> DbSetStTemplateRows { get; set; }
|
||||
|
||||
|
||||
public virtual DbSet<vSelEventiBCodeModel> DbSetVSEB { get; set; }
|
||||
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -518,6 +521,14 @@ namespace MP.Data
|
||||
|
||||
});
|
||||
|
||||
|
||||
modelBuilder.Entity<vSelEventiBCodeModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdxTipo);
|
||||
|
||||
entity.ToView("v_selEventiBCode");
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:Art:{azienda}:{searchVal}:{numRecord}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagArticoli>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -139,7 +139,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:Menu:{tipoLink}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<LinkMenu>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -172,7 +173,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:Menu:ALL";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<LinkMenu>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -207,7 +209,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:Macc:{MatrOpr}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using Blazored.LocalStorage;
|
||||
using Blazored.SessionStorage;
|
||||
using MP.Data.DatabaseModels;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Services
|
||||
@@ -180,11 +180,10 @@ namespace MP.Data.Services
|
||||
public async Task<MappaStatoExpl> GetMachineMse(string idxMacchina)
|
||||
{
|
||||
MappaStatoExpl answ = new MappaStatoExpl();
|
||||
//answ = await localStorage.GetItemAsync<MappaStatoExpl>(machineMse(idxMacchina));
|
||||
string tryString = await localStorage.GetItemAsync<string>(machineMse(idxMacchina));
|
||||
if (tryString != "")
|
||||
{
|
||||
answ = JsonSerializer.Deserialize<MappaStatoExpl>(tryString);
|
||||
answ = JsonConvert.DeserializeObject<MappaStatoExpl>(tryString);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -331,7 +330,7 @@ namespace MP.Data.Services
|
||||
{
|
||||
foreach (var item in currListMSE)
|
||||
{
|
||||
string serVal = JsonSerializer.Serialize(item);
|
||||
string serVal = JsonConvert.SerializeObject(item);
|
||||
await localStorage.SetItemAsync(machineMse(item.IdxMacchina), serVal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:ODL:{IdxMacchina}:{CodArt}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ODLExpModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
|
||||
@@ -110,8 +110,8 @@ namespace MP.Data.Services
|
||||
stopWatch.Start();
|
||||
List<MappaStatoExpl>? result = new List<MappaStatoExpl>();
|
||||
// cerco in redis...
|
||||
RedisValue rawData = await redisDb.StringGetAsync(redisMseKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
RedisValue rawData = redisDb.StringGet(redisMseKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>($"{rawData}");
|
||||
stopWatch.Stop();
|
||||
|
||||
@@ -75,8 +75,6 @@ namespace MP.Data.Services
|
||||
public async Task<List<AnagEventiModel>> AnagEventiGetAll()
|
||||
{
|
||||
// setup parametri costanti
|
||||
DateTime startDate = new DateTime(2000, 1, 1);
|
||||
DateTime endDate = DateTime.Today.AddDays(1);
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
@@ -84,7 +82,7 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:AnagEventi:ALL";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagEventiModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -109,7 +107,7 @@ namespace MP.Data.Services
|
||||
/// Elenco EVENTI validi x macchina
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<AnagEventiModel>> AnagEventiGetByMacch(string IdxMacch)
|
||||
public async Task<List<vSelEventiBCodeModel>> AnagEventiGetByMacch(string IdxMacch)
|
||||
{
|
||||
// setup parametri costanti
|
||||
DateTime startDate = new DateTime(2000, 1, 1);
|
||||
@@ -117,13 +115,14 @@ namespace MP.Data.Services
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<AnagEventiModel>? result = new List<AnagEventiModel>();
|
||||
List<vSelEventiBCodeModel>? result = new List<vSelEventiBCodeModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:AnagEventi:{IdxMacch}";
|
||||
string currKey = $"{redisBaseKey}:VSEB:{IdxMacch}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagEventiModel>>($"{rawData}");
|
||||
result = JsonConvert.DeserializeObject<List<vSelEventiBCodeModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
@@ -135,7 +134,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<AnagEventiModel>();
|
||||
result = new List<vSelEventiBCodeModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"AnagEventiGetByMacch | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
@@ -158,7 +157,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:AnagStati";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagStatiModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -231,7 +231,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:Conf";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ConfigModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -258,8 +259,9 @@ namespace MP.Data.Services
|
||||
dbTabController.Dispose();
|
||||
dbIocController.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero info IOB x TAB (da info registrate IOB-WIN--> MP-IO)
|
||||
/// Recupero info IOB x TAB (da info registrate IOB-WIN--> MP-IO)
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
@@ -272,7 +274,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = redHash($"hM2IOB:{IdxMacchina}");
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<IOB_data>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -487,7 +490,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:START:{codGruppo}:{idxODL}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ST_ActRow>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -525,7 +529,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:START:{codGruppo}:{label}:{idxODL}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<ST_ActRow>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -561,7 +566,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:StatoMacc:{idxMacchina}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<StatoMacchineModel>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -598,7 +604,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:StatoProd:{idxMacchina}:{dtReq:HHmmss}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<StatoProdModel>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -633,7 +640,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:MSFD:ALL";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<VMSFDModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -669,7 +677,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:MSFD:MACCH:{idxMacc}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<VMSFDModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
@@ -705,7 +714,8 @@ namespace MP.Data.Services
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:MSFD:MULTI:{idxMacc}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<VMSFDModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
|
||||
Reference in New Issue
Block a user