Merge branch 'release/UpdateConfProd_01'

This commit is contained in:
Samuele E. Locatelli
2025-07-28 15:08:07 +02:00
123 changed files with 1447 additions and 896 deletions
+7 -1
View File
@@ -65,7 +65,13 @@ else
</tr>
}
</tbody>
<tfoot>
<tr>
<td>
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</td>
</tr>
</tfoot>
</table>
</div>
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
}
+7 -3
View File
@@ -123,11 +123,15 @@
</tr>
}
</tbody>
<tfoot>
<tr>
<td>
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="cad-footer">
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</div>
</div>
+49 -43
View File
@@ -6,7 +6,7 @@ using static EgwCoreLib.Utils.DtUtils;
namespace MP_TAB3.Components
{
public partial class ControlsMan
public partial class ControlsMan : IDisposable
{
#region Public Properties
@@ -23,6 +23,12 @@ namespace MP_TAB3.Components
#region Public Methods
public void Dispose()
{
ListComplete.Clear();
ListPaged.Clear();
}
/// <summary>
/// Aggiorno valori produzione alla data richiesta...
/// </summary>
@@ -33,7 +39,7 @@ namespace MP_TAB3.Components
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMaccSel))
{
ListComplete = await TabDServ.RegControlliFilt(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
ListComplete = await TabDServ.RegControlliFiltAsync(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
TotalCount = ListComplete.Count;
// esegue paginazione
UpdateTable();
@@ -78,8 +84,6 @@ namespace MP_TAB3.Components
#endregion Protected Properties
private bool isMulti = false;
#region Protected Methods
/// <summary>
@@ -125,44 +129,7 @@ namespace MP_TAB3.Components
await doUpdate();
}
}
/// <summary>
/// Macchina selezionata MAIN
/// </summary>
private string IdxMaccMain
{
get => RecMSE != null ? RecMSE.IdxMacchina : "";
}
/// <summary>
/// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina...
/// </summary>
private string idxMaccAltraTav
{
get
{
string answ = "";
if (RecMSE != null)
{
try
{
// verifico se SIA una tavola (ha char "#")
int iSharp = IdxMaccMain.IndexOf('#');
if (iSharp > 0)
{
// ora verifico SE ALTRA TAVOLA ha ODL...
string nomeTav = IdxMaccMain.Substring(iSharp);
string altraTav = nomeTav.Substring(0, nomeTav.Length - 1);
altraTav += nomeTav.EndsWith("1") ? "2" : "1";
// sistemo nome
answ = IdxMaccMain.Replace(nomeTav, altraTav);
}
}
catch
{ }
}
return answ;
}
}
protected async Task SaveKo()
{
isProcessing = true;
@@ -279,7 +246,7 @@ namespace MP_TAB3.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool isMulti = false;
private bool isProcessing = false;
private string noteKo = "";
@@ -302,9 +269,48 @@ namespace MP_TAB3.Components
private Periodo CurrPeriodo { get; set; } = new Periodo();
private string IdxMaccSel { get; set; } = "";
private string IdxMaccAltra { get; set; } = "";
/// <summary>
/// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina...
/// </summary>
private string idxMaccAltraTav
{
get
{
string answ = "";
if (RecMSE != null)
{
try
{
// verifico se SIA una tavola (ha char "#")
int iSharp = IdxMaccMain.IndexOf('#');
if (iSharp > 0)
{
// ora verifico SE ALTRA TAVOLA ha ODL...
string nomeTav = IdxMaccMain.Substring(iSharp);
string altraTav = nomeTav.Substring(0, nomeTav.Length - 1);
altraTav += nomeTav.EndsWith("1") ? "2" : "1";
// sistemo nome
answ = IdxMaccMain.Replace(nomeTav, altraTav);
}
}
catch
{ }
}
return answ;
}
}
/// <summary>
/// Macchina selezionata MAIN
/// </summary>
private string IdxMaccMain
{
get => RecMSE != null ? RecMSE.IdxMacchina : "";
}
private string IdxMaccSel { get; set; } = "";
private int IdxOdl { get; set; } = 0;
private string selMessage
+8 -4
View File
@@ -44,7 +44,7 @@
{
<tr>
<td>
<button class="btn btn-primary" @onclick="()=>SetEdit(item)"><i class="fa-solid fa-pen"></i></button>
<button class="btn btn-primary" @onclick="() => SetEdit(item)"><i class="fa-solid fa-pen"></i></button>
</td>
<td>
<i class="@item.CssClass" aria-hidden="true"></i>
@@ -64,11 +64,15 @@
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="6">
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div>
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</div>
</div>
+2 -2
View File
@@ -37,8 +37,8 @@ namespace MP_TAB3.Components
get => showFixOdl ? "fa-chevron-up" : "fa-chevron-down";
}
protected List<ODLModel> ListComplete { get; set; } = new List<ODLModel>();
protected List<ODLModel> ListPaged { get; set; } = new List<ODLModel>();
protected List<ODLExpModel> ListComplete { get; set; } = new List<ODLExpModel>();
protected List<ODLExpModel> ListPaged { get; set; } = new List<ODLExpModel>();
[Inject]
protected MessageService MServ { get; set; } = null!;
+45 -34
View File
@@ -222,45 +222,56 @@
</tr>
</thead>
<tbody>
@foreach (var item in ListDay)
@if (ListDay == null)
{
<tr>
<td>
@if (item.Imported == null)
{
<button class="btn btn-sm btn-primary" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pen"></i></button>
}
else
{
<button class="btn btn-sm btn-secondary disabled"><i class="fa-solid fa-pen"></i></button>
}
</td>
<td>@item.IdxMacchina</td>
<td>@(EvDescript(item.IdxTipoEv))</td>
<td>
<div>@item.CodArticolo</div>
@if (!string.IsNullOrEmpty(item.KeyRichiesta))
{
<small>@item.KeyRichiesta</small>
}
</td>
<td title="@($"{item.InizioStato:yyyy.MM.dd HH:mm:ss} --> {item.FineStato:yyyy.MM.dd HH:mm:ss}")">@($"{item.InizioStato:HH:mm}")</td>
<td class="text-end">@item.PzBuoni</td>
<td class="text-end">@($"{item.TCiclo:f2}")</td>
<td class="text-end">@($"{item.MinProd:f2}")</td>
<td class="text-end">
@if (item.Imported == null)
{
<button class="btn btn-sm btn-danger" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash-can"></i></button>
}
else
{
<button class="btn btn-sm btn-secondary disabled"><i class="fa-solid fa-trash-can"></i></button>
}
<td colspan="9">
<div class="alert alert-info fs-6">Nessun dato disponibile</div>
</td>
</tr>
}
else
{
foreach (var item in ListDay)
{
<tr>
<td>
@if (item.Imported == null)
{
<button class="btn btn-sm btn-primary" @onclick="() => DoEdit(item)"><i class="fa-solid fa-pen"></i></button>
}
else
{
<button class="btn btn-sm btn-secondary disabled"><i class="fa-solid fa-pen"></i></button>
}
</td>
<td>@item.IdxMacchina</td>
<td>@(EvDescript(item.IdxTipoEv))</td>
<td>
<div>@item.CodArticolo</div>
@if (!string.IsNullOrEmpty(item.KeyRichiesta))
{
<small>@item.KeyRichiesta</small>
}
</td>
<td title="@($"{item.InizioStato:yyyy.MM.dd HH:mm:ss} --> {item.FineStato:yyyy.MM.dd HH:mm:ss}")">@($"{item.InizioStato:HH:mm}")</td>
<td class="text-end">@item.PzBuoni</td>
<td class="text-end">@($"{item.TCiclo:f2}")</td>
<td class="text-end">@($"{item.MinProd:f2}")</td>
<td class="text-end">
@if (item.Imported == null)
{
<button class="btn btn-sm btn-danger" @onclick="() => DoDelete(item)"><i class="fa-solid fa-trash-can"></i></button>
}
else
{
<button class="btn btn-sm btn-secondary disabled"><i class="fa-solid fa-trash-can"></i></button>
}
</td>
</tr>
}
}
</tbody>
</table>
</div>
+10 -2
View File
@@ -70,6 +70,10 @@ namespace MP_TAB3.Components
public void Dispose()
{
innerCircleVals.Clear();
outerCircleVals.Clear();
datiProdAct = null;
LastRecMSE = null;
TabDServ.DataInvalidated -= TabDServ_DataInvalidated;
}
@@ -331,7 +335,7 @@ namespace MP_TAB3.Components
{
innerCircleVals.Add(new CircleGaugeMulti.CircSegm() { Color = "#CD1916", Value = datiProdAct.PzConfScarto });
}
if (CRecMSE.extraVal > 0)
if (CRecMSE != null && CRecMSE.extraVal > 0)
{
outerCircleVals.Add(new CircleGaugeMulti.CircSegm() { Color = "#1367FD", Value = CRecMSE.extraVal });
}
@@ -525,7 +529,11 @@ namespace MP_TAB3.Components
return true;
if (LastIdxMacchSub != IdxMacchSub)
return true;
if (!LastRecMSE.MostlyEquals(RecMSE))
if (LastRecMSE == null && RecMSE != null)
return true;
if (LastRecMSE != null && RecMSE == null)
return true;
if (LastRecMSE != null && !LastRecMSE.MostlyEquals(RecMSE))
return true;
return false;
+14 -11
View File
@@ -14,17 +14,8 @@ namespace MP_TAB3.Components
[Parameter]
public string IdxMacchina { get; set; } = "";
#endregion Public Properties
#region Protected Fields
protected bool isProcessing = false;
#endregion Protected Fields
#region Protected Properties
protected int IdxOdlSel
[Parameter]
public int IdxOdlSel
{
get => idxOdlSel;
set
@@ -37,6 +28,18 @@ namespace MP_TAB3.Components
}
}
#endregion Public Properties
#region Protected Fields
protected bool isProcessing = false;
#endregion Protected Fields
#region Protected Properties
protected List<vSelOdlModel> ListODL { get; set; } = new();
protected int NumRec
+84
View File
@@ -0,0 +1,84 @@
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<ShowProcessing Message="Caricamento" IsProcessing="@isProcessing"></ShowProcessing>
<div class="cardObj p-2 mt-2">
<div class="mb-1 fs-6">
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@UseOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl" IdxOdlSel="@idxOdlLast"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
</div>
<div class="bg-secondary p-1 mb-1">
<div class="row">
<div class="col-12">
<table class="table table-dark table-sm table-striped">
<thead>
<tr class="text-start1">
<th>Art/ODL</th>
<th class="text-end"># Pz Buoni</th>
<th class="text-end"># Pz Scarto</th>
@if (ShowRilav)
{
<th class="text-end"># Pz Rilav</th>
}
<th class="text-end">Operatore</th>
</tr>
</thead>
<tbody>
@foreach (var item in ListPaged)
{
var actOdl = ActiveOdl(item.DataTo);
<tr>
<td class="text-nowrap">
<div>Art: <b>@actOdl.CodArticolo</b></div>
<div>ODL: <b>@($"ODL{actOdl.IdxOdl:000000000}")</b></div>
@if (ShowExtCode)
{
<div class="px-1">@item.CommessaEsterna</div>
}
</td>
<td class="fs-4 fw-bold text-end">@item.PezziConf</td>
<td class="fs-4 fw-bold text-end">@item.PezziScar</td>
@if (ShowRilav)
{
<td class="fs-4 fw-bold text-end">@item.PezziDaRilav</td>
}
<td class="text-end">
<div>@($"{item.DataOraConf:ddd yyyy-MM-dd HH:mm:ss}")</div>
<div><b>@OperDto(item.MatrApp)</b> <i class="fa fa-user" aria-hidden="true"></i></div>
@if (ShowArtDescr)
{
<div class="px-0 ps-1 text-truncate" style="max-width: 20rem;" title="@actOdl.DescArticolo">@actOdl.DescArticolo</div>
}
</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="5">
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SetPage" numRecordChanged="SetNumRec"></EgwCoreLib.Razor.DataPager>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
+399
View File
@@ -0,0 +1,399 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DbModels;
using MP.Data.Services;
using NLog;
using static EgwCoreLib.Utils.DtUtils;
namespace MP_TAB3.Components
{
public partial class ProdConfMan : IDisposable
{
#region Public Properties
[Parameter]
public EventCallback<string> E_MachSel { get; set; }
[Parameter]
public EventCallback<bool> E_Updated { get; set; }
[Parameter]
public string IdxMacchSub { get; set; } = "";
[Parameter]
public MappaStatoExplModel? RecMSE { get; set; } = null;
#endregion Public Properties
/// <summary>
/// Init da valori configurazione
/// </summary>
private void InitConfig()
{
TabDServ.ConfigGetVal("TAB_confProdPeriodLastODL", ref ShowLastOdl);
TabDServ.ConfigGetVal("TAB_confProdShowRilav", ref ShowRilav);
TabDServ.ConfigGetVal("TAB_confProdShowArtDescr", ref ShowArtDescr);
TabDServ.ConfigGetVal("TAB_confProdShowExtCode", ref ShowExtCode);
}
/// <summary>
/// Indica se mostrare rilavorati in conferma produzione
/// </summary>
private bool ShowRilav = false;
/// <summary>
/// Indica se partire da ultimo ODL x definire ultimo periodo...
/// </summary>
private bool ShowLastOdl = false;
/// <summary>
/// Indica se mostrare descrizione articolo su 3° riga
/// </summary>
private bool ShowArtDescr = false;
/// <summary>
/// Indica se mostrare CodExt (commessa) su 3° riga
/// </summary>
private bool ShowExtCode = false;
#region Public Methods
public void Dispose()
{
ListComplete.Clear();
ListPaged.Clear();
ListaOdl.Clear();
ListaOper.Clear();
DictOpr.Clear();
}
#endregion Public Methods
#region Protected Properties
protected List<ElencoConfermeProdModel> ListComplete { get; set; } = new List<ElencoConfermeProdModel>();
protected List<ElencoConfermeProdModel> ListPaged { get; set; } = new List<ElencoConfermeProdModel>();
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
InitConfig();
await ReloadBaseList();
if (RecMSE != null)
{
IdxMaccSel = RecMSE.IdxMacchina;
isMulti = SMServ.DictMacchMulti[IdxMaccSel] == 1;
if (isMulti)
{
var idxMSel = MServ.UserPrefGet(IdxMaccSel);
if (!string.IsNullOrEmpty(idxMSel))
{
IdxMaccSel = idxMSel;
}
}
await setupPeriodo();
await ReloadData();
}
}
protected async Task SetMacc(string selIdxMacc)
{
isProcessing = true;
await Task.Delay(1);
IdxMaccSel = selIdxMacc;
await ReloadData();
await Task.Delay(1);
isProcessing = false;
await E_MachSel.InvokeAsync(selIdxMacc);
}
protected void SetNumRec(int newNum)
{
NumRecPage = newNum;
UpdateTable();
}
protected async Task SetOdl(int selIdxOdl)
{
isProcessing = true;
IdxOdl = selIdxOdl;
// se ho odl --> imposto periodo
if (IdxOdl > 0)
{
var recOdl = GetOdl(IdxOdl);
if (recOdl != null && recOdl.IdxOdl == IdxOdl)
{
DateTime fine = DateTime.Today.AddDays(1);
DateTime inizio = fine.AddDays(-7);
CurrPeriodo = new Periodo(recOdl.DataInizio ?? inizio, recOdl.DataFine ?? fine);
}
}
// altrimenti reset..
else
{
setupPeriodo();
}
await ReloadData();
isProcessing = false;
//await Task.Delay(1);
}
protected void SetPage(int newNum)
{
PageNum = newNum;
UpdateTable();
}
protected async Task SetPeriodo(Periodo newPeriodo)
{
CurrPeriodo = newPeriodo;
await ReloadData();
}
protected void UpdateTable()
{
// esegue paginazione
if (TotalCount > NumRecPage)
{
ListPaged = ListComplete
.OrderByDescending(x => x.DataTo)
.Skip((PageNum - 1) * NumRecPage)
.Take(NumRecPage)
.ToList();
}
else
{
ListPaged = ListComplete;
}
}
#endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private Dictionary<int, string> DictOpr = new Dictionary<int, string>();
private bool isMulti = false;
private bool isProcessing = false;
private List<ODLExpModel> ListaOdl = new List<ODLExpModel>();
private List<AnagOperatoriModel> ListaOper = new List<AnagOperatoriModel>();
private int NumRecPage = 10;
private int PageNum = 1;
private int TotalCount = 0;
private bool useOdl = false;
#endregion Private Fields
#region Private Properties
private Periodo CurrPeriodo { get; set; } = new Periodo();
private string IdxMaccAltra { get; set; } = "";
/// <summary>
/// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina...
/// </summary>
private string idxMaccAltraTav
{
get
{
string answ = "";
if (RecMSE != null)
{
try
{
// verifico se SIA una tavola (ha char "#")
int iSharp = IdxMaccMain.IndexOf('#');
if (iSharp > 0)
{
// ora verifico SE ALTRA TAVOLA ha ODL...
string nomeTav = IdxMaccMain.Substring(iSharp);
string altraTav = nomeTav.Substring(0, nomeTav.Length - 1);
altraTav += nomeTav.EndsWith("1") ? "2" : "1";
// sistemo nome
answ = IdxMaccMain.Replace(nomeTav, altraTav);
}
}
catch
{ }
}
return answ;
}
}
/// <summary>
/// Macchina selezionata MAIN
/// </summary>
private string IdxMaccMain
{
get => RecMSE != null ? RecMSE.IdxMacchina : "";
}
private string IdxMaccSel { get; set; } = "";
private int IdxOdl { get; set; } = 0;
private string selMessage
{
get => useOdl ? "Periodo da ODL" : "Periodo Libero";
}
private bool UseOdl
{
get => useOdl;
set
{
useOdl = value;
if (!value)
{
IdxOdl = 0;
}
}
}
#endregion Private Properties
#region Private Methods
private ODLExpModel ActiveOdl(DateTime dtRif)
{
var recOdl = ListaOdl
.Where(x => x.DataInizio <= dtRif && (x.DataFine >= dtRif || x.DataFine == null))
.FirstOrDefault();
return recOdl ?? new ODLExpModel();
}
private ODLExpModel GetOdl(int idxOdl)
{
var recOdl = ListaOdl
.Where(x => x.IdxOdl == idxOdl)
.FirstOrDefault();
return recOdl ?? new ODLExpModel();
}
private string OperDto(int matr)
{
string answ = $"[{matr}]";
// cerco in dizionario
if (DictOpr.ContainsKey(matr))
{
answ = DictOpr[matr];
}
else
{
// altrimenti cerco da lista e inserisco in dizionario
var recOpr = ListaOper.Where(x => x.MatrOpr == matr).FirstOrDefault();
if (recOpr != null)
{
answ = $"{recOpr.Cognome} {recOpr.Nome}";
}
DictOpr.Add(matr, answ);
}
return answ;
}
#if false
private MarkupString OperDto(int matr)
{
string answ = $"[{matr}]";
// cerco in dizionario
if (DictOpr.ContainsKey(matr))
{
answ = DictOpr[matr];
}
else
{
// altrimenti cerco da lista e inserisco in dizionario
var recOpr = ListaOper.Where(x => x.MatrOpr == matr).FirstOrDefault();
if (recOpr != null)
{
answ = $"{recOpr.Cognome} {recOpr.Nome}<sup>{matr}</sup>";
}
DictOpr.Add(matr, answ);
}
return (MarkupString)answ;
}
#endif
/// <summary>
/// Rileggo anagrafiche di base
/// </summary>
/// <returns></returns>
private async Task ReloadBaseList()
{
ListaOper = await TabDServ.ElencoOperatori();
}
/// <summary>
/// Aggiorno valori produzione alla data richiesta...
/// </summary>
/// <param name="newDate"></param>
private async Task ReloadData()
{
isProcessing = true;
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMaccSel))
{
ListaOdl = await TabDServ.OdlListByMaccPeriodo(IdxMaccSel, CurrPeriodo.Inizio.AddMonths(-1), CurrPeriodo.Fine);
ListComplete = await TabDServ.ElencoConfProdFiltAsync(IdxMaccSel, CurrPeriodo.Inizio, CurrPeriodo.Fine);
TotalCount = ListComplete.Count;
// esegue paginazione
UpdateTable();
}
isProcessing = false;
}
private async Task setupPeriodo()
{
bool doSet = true;
if (ShowLastOdl)
{
UseOdl = true;
var LastODL = await TabDServ.VSOdlGetLastByMacc(IdxMaccSel, 1);
if (LastODL != null)
{
var recOdl = LastODL.FirstOrDefault();
if (recOdl != null)
{
idxOdlLast = recOdl.value;
await SetOdl(idxOdlLast);
doSet = false;
}
}
}
// controllo di nuovo se impostare priodo
if (doSet)
{
DateTime fine = DateTime.Today.AddDays(1);
DateTime inizio = fine.AddDays(-7);
CurrPeriodo = new Periodo(inizio, fine);
}
}
private int idxOdlLast = 0;
#endregion Private Methods
}
}
+44 -36
View File
@@ -6,14 +6,8 @@ using NLog.Fluent;
namespace MP_TAB3.Components
{
public partial class ProdConfirm:IDisposable
public partial class ProdConfirm : IDisposable
{
public void Dispose()
{
confTimer.Elapsed -= ConfTimer_Elapsed;
}
#region Public Properties
/// <summary>
@@ -53,6 +47,16 @@ namespace MP_TAB3.Components
#endregion Public Properties
#region Public Methods
public void Dispose()
{
datiProdAct = null;
confTimer.Elapsed -= ConfTimer_Elapsed;
}
#endregion Public Methods
#region Protected Properties
protected string ConfBg
@@ -249,22 +253,6 @@ namespace MP_TAB3.Components
confTimer.Elapsed += ConfTimer_Elapsed;
}
/// <summary>
/// Timer visualizzazione esito conferma pezzi: deve nascondere...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
private void ConfTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
confTimer.Stop();
showConfirmResult = false;
// resetto
lastPzBuoni = 0;
lastPzRilav = 0;
lastPzScarto = 0;
}
protected override async Task OnParametersSetAsync()
{
lblOut = "";
@@ -340,11 +328,6 @@ namespace MP_TAB3.Components
confTimer.Start();
}
/// <summary>
/// Timer 3 sec x mostrare conferma
/// </summary>
private System.Timers.Timer confTimer = new System.Timers.Timer(3000);
protected void setConfirmBtn(bool newVal)
{
showConfirm = newVal;
@@ -385,20 +368,37 @@ namespace MP_TAB3.Components
private bool chkPzBuoniNeg = false;
private bool confDone = false;
private bool confRett = false;
/// <summary>
/// Timer 3 sec x mostrare conferma
/// </summary>
private System.Timers.Timer confTimer = new System.Timers.Timer(3000);
private bool enableMagPrint = false;
private bool enablePzProdLasciati = false;
private bool confDone = false;
private bool isMulti = false;
private bool isSlave = false;
private DateTime lastConfProd = DateTime.Now;
private int lastPzBuoni = 0;
private int lastPzRilav = 0;
private int lastPzScarto = 0;
private string lblOut = "";
private int modoConfProd = 0;
private bool showConfirmResult = false;
#endregion Private Fields
#region Private Properties
@@ -424,17 +424,25 @@ namespace MP_TAB3.Components
private bool showConfirm { get; set; } = true;
private bool showConfirmResult = false;
private int lastPzBuoni = 0;
private int lastPzRilav = 0;
private int lastPzScarto = 0;
private DateTime lastConfProd = DateTime.Now;
#endregion Private Properties
#region Private Methods
/// <summary>
/// Timer visualizzazione esito conferma pezzi: deve nascondere...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ConfTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{
confTimer.Stop();
showConfirmResult = false;
// resetto
lastPzBuoni = 0;
lastPzRilav = 0;
lastPzScarto = 0;
}
/// <summary>
/// Registra conferma produzione in modalita nuova (con rettifica pezzi lasciati) o legacy
/// (con anticipo periodo)
@@ -80,20 +80,31 @@
</tr>
</thead>
<tbody>
@foreach (var record in ListTK)
@if (ListTK == null)
{
<tr>
<td>
@record.CodArtParent
</td>
<td>
@record.CodArtChild
</td>
<td class="text-end">
<div>@record.Qty</div>
<td colspan="3">
<div class="alert alert-info fs-6">Nessun dato disponibile</div>
</td>
</tr>
}
else
{
foreach (var record in ListTK)
{
<tr>
<td>
@record.CodArtParent
</td>
<td>
@record.CodArtChild
</td>
<td class="text-end">
<div>@record.Qty</div>
</td>
</tr>
}
}
</tbody>
</table>
}
+9 -5
View File
@@ -84,13 +84,13 @@
<sub class="pe-1">&times;</sub>
@if (item.KitSplit)
{
<button class="btn btn-info" @onclick="()=>ShowKitDetail(item)" title="KIT esploso" style="max-width: 2.5rem;display: flex;justify-content: center;min-height: 2.375rem;align-items: center;">
<button class="btn btn-info" @onclick="() => ShowKitDetail(item)" title="KIT esploso" style="max-width: 2.5rem;display: flex;justify-content: center;min-height: 2.375rem;align-items: center;">
<i class="fa-solid fa-box-open"></i>
</button>
}
else
{
<button class="btn btn-secondary" @onclick="()=>ShowKitDetail(item)" title="KIT non esploso">
<button class="btn btn-secondary" @onclick="() => ShowKitDetail(item)" title="KIT non esploso">
<i class="fa-solid fa-box"></i>
</button>
}
@@ -136,11 +136,15 @@
}
}
</tbody>
<tfoot>
<tr>
<td>
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div>
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</div>
</div>
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2507.1117</Version>
<Version>6.16.2507.2814</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+8 -8
View File
@@ -2,14 +2,6 @@ namespace MP_TAB3.Pages
{
public partial class Controls
{
#region Private Fields
private string IdxMaccSubSel = "";
private bool IsLoading = false;
#endregion Private Fields
#region Protected Methods
protected async Task ForceReload()
@@ -31,5 +23,13 @@ namespace MP_TAB3.Pages
}
#endregion Protected Methods
#region Private Fields
private string IdxMaccSubSel = "";
private bool IsLoading = false;
#endregion Private Fields
}
}
+14
View File
@@ -0,0 +1,14 @@
@page "/ProdConf"
@page "/prod-conf"
@inherits BasePage
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null || IsLoading)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
}
else
{
<CheckControls RecMSE="CurrMSE"></CheckControls>
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
<ProdConfMan RecMSE="CurrMSE" IdxMacchSub="@IdxMaccSubSel"></ProdConfMan>
}
+40
View File
@@ -0,0 +1,40 @@
using Microsoft.AspNetCore.Components;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class ProdConf
{
#region Protected Methods
protected async Task ForceReload()
{
IsLoading = true;
await Task.Delay(5);
IsLoading = false;
}
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
}
#endregion Protected Methods
#region Private Fields
private string IdxMaccSubSel = "";
private bool IsLoading = false;
#endregion Private Fields
}
}
+13 -11
View File
@@ -127,9 +127,11 @@ namespace MP_TAB3.Pages
public void Dispose()
{
ListMSE = null;
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
TDFeeder.blinkPipe.EA_NewMessage -= BlinkPipe_EA_NewMessage;
ListMSE = null;
ListMachineEnabled = null;
AllDataMSE = null;
GC.Collect();
}
@@ -316,20 +318,20 @@ namespace MP_TAB3.Pages
}
#endif
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly List<string> --> allarmi
if (!string.IsNullOrEmpty(currArgs.newMessage))
// conversione on-the-fly List<string> --> allarmi
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
try
{
try
List<MappaStatoExplModel>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExplModel>>(currArgs.newMessage);
if (dataList != null)
{
List<MappaStatoExplModel>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExplModel>>(currArgs.newMessage);
if (dataList != null)
{
InvokeAsync(() => SaveData(dataList));
}
InvokeAsync(() => SaveData(dataList));
}
catch
{ }
}
catch
{ }
}
InvokeAsync(() =>
{
StateHasChanged();
-1
View File
@@ -35,7 +35,6 @@ builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<TabDataFeeder>();
builder.Services.AddSingleton<StatusData>();
builder.Services.AddSingleton<ListSelectDataSrv>();
builder.Services.AddSingleton<OrderDataSrv>();
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2507.1117</h4>
<h4>Versione: 6.16.2507.2814</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2507.1117
6.16.2507.2814
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2507.1117</version>
<version>6.16.2507.2814</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -6
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -8
View File
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Core.DTO
namespace MP.Core.DTO
{
public class ManualStatusDTO
{
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.ComponentModel.DataAnnotations.Schema;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -6
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
namespace MP.Core.DTO
{
+2 -2
View File
@@ -635,7 +635,7 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redisConn
/// </summary>
/// <param name="idxMacchina">macchina</param>
/// <param name="maxSec">Num massimo secondi per recuperare dati correnti</param>
@@ -658,7 +658,7 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redisConn
/// </summary>
/// <param name="idxMacchina">macchina</param>
/// <param name="dtMin">Data min x selezione</param>
+30 -7
View File
@@ -406,10 +406,10 @@ namespace MP.Data.Controllers
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetConfig
.AsNoTracking()
.OrderBy(x => x.Chiave)
.ToList();
.DbSetConfig
.AsNoTracking()
.OrderBy(x => x.Chiave)
.ToList();
}
return dbResult;
}
@@ -1323,9 +1323,9 @@ namespace MP.Data.Controllers
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<ODLModel> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd)
public List<ODLExpModel> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd)
{
List<ODLModel> dbResult = new List<ODLModel>();
List<ODLExpModel> dbResult = new List<ODLExpModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
try
@@ -1334,7 +1334,7 @@ namespace MP.Data.Controllers
var DataFrom = new SqlParameter("@dataFrom", dtStart);
var DataTo = new SqlParameter("@dataTo", dtEnd);
dbResult = dbCtx
.DbSetODL
.DbSetODLExp
.FromSqlRaw("EXEC stp_ODL_getByMacchinaPeriodo @IdxMacchina, @dataFrom, @dataTo", IdxMacchina, DataFrom, DataTo)
.AsNoTracking()
.ToList();
@@ -1717,6 +1717,29 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Restituisce elenco RC filtrato
/// </summary>
/// <param name="idxMacchina"></param>
/// <param name="dataFrom"></param>
/// <param name="dataTo"></param>
/// <returns></returns>
public List<ElencoConfermeProdModel> ElencoConfProdFilt(string idxMacchina, DateTime dataFrom, DateTime dataTo)
{
List<ElencoConfermeProdModel> dbResult = new List<ElencoConfermeProdModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetElConfProd
.Where (x => x.IdxMacchina== idxMacchina && (dataFrom <= x.DataOraConf && x.DataOraConf <= dataTo))
.AsNoTracking()
.ToList();
}
return dbResult;
}
/// <summary>
/// Registra controllo
/// </summary>
-5
View File
@@ -1,11 +1,6 @@
using MP.Core.Objects;
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.DTO
{
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
+1 -6
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#nullable disable
// <Auto-Generated>
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
+1 -6
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DbModels
{
+1 -6
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
-4
View File
@@ -1,10 +1,6 @@
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;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
-4
View File
@@ -1,10 +1,6 @@
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;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
+1 -6
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DbModels
{
+1 -6
View File
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DbModels
{
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
-4
View File
@@ -1,10 +1,6 @@
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;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -0,0 +1,38 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DbModels
{
[Table("ElencoConfermeProd")]
public partial class ElencoConfermeProdModel
{
#region Public Properties
public DateTime DataOraConf { get; set; } = DateTime.Now;
[MaxLength(50), Column("idxMacchina")]
public string IdxMacchina { get; set; } = "";
public int MatrApp { get; set; } = 0;
[Column("dataFrom")]
public DateTime DataFrom { get; set; } = DateTime.Now;
[Column("dataTo")]
public DateTime DataTo { get; set; } = DateTime.Now;
[Column("pezziConf")]
public int PezziConf { get; set; } = 0;
[Column("pezziScar")]
public int PezziScar { get; set; } = 0;
[Column("pezziDaRilav")]
public int PezziDaRilav { get; set; } = 0;
[MaxLength(50)]
public string CommessaEsterna { get; set; } = "";
public int TipoConf { get; set; } = 1;
#endregion Public Properties
}
}
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-3
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
@@ -1,10 +1,6 @@
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;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DbModels
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DbModels
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
#nullable disable
-2
View File
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
#nullable disable
// <Auto-Generated>
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-2
View File
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
#nullable disable
// <Auto-Generated>
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-2
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
-4
View File
@@ -1,10 +1,6 @@
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;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
#nullable disable
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
-2
View File
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static MP.Core.Objects.Enums;
#nullable disable
// <Auto-Generated>
-3
View File
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using MP.Core.Objects;
using static MP.Core.Objects.Enums;
using static MP.TaskMan.Objects.Enums;
#nullable disable
+1 -6
View File
@@ -1,9 +1,4 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static MP.Core.Objects.Enums;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DbModels
+1 -7
View File
@@ -1,10 +1,4 @@
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;
using System.ComponentModel.DataAnnotations;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DbModels
{
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DbModels
{
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+1 -3
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
-4
View File
@@ -1,10 +1,6 @@
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;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -4
View File
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
#nullable disable
// <Auto-Generated>
+1 -7
View File
@@ -1,10 +1,4 @@
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;
using System.ComponentModel.DataAnnotations;
namespace MP.Data.DbModels
{
-2
View File
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
+36 -14
View File
@@ -3,18 +3,21 @@ using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Channels;
namespace MP.Data
{
public class MessagePipe
public class MessagePipe : IDisposable
{
#region Public Constructors
public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false)
{
_channel = channelName;
redis = redisConn;
redisDb = redis.GetDatabase();
rChannel = new RedisChannel(_channel, RedisChannel.PatternMode.Literal);
this.redisConn = redisConn;
redisDb = this.redisConn.GetDatabase();
redisSub = this.redisConn.GetSubscriber();
this.enableLog = enableLog;
// aggiungo sottoscrittore
setupSubscriber();
@@ -30,6 +33,12 @@ namespace MP.Data
#region Public Methods
public void Dispose()
{
redisDb = null;
redisSub = null;
}
/// <summary>
/// Invio messaggio sul canale + salvataggio in cache REDIS
/// </summary>
@@ -74,8 +83,15 @@ namespace MP.Data
public bool sendMessage(string newMess)
{
bool answ = false;
if (!string.IsNullOrEmpty(_channel))
{
#if false
ISubscriber sub = redis.GetSubscriber();
sub.Publish(_channel, newMess);
#endif
var numCli = redisSub.Publish(rChannel, newMess);
answ = numCli > 0;
}
return answ;
}
@@ -89,29 +105,35 @@ namespace MP.Data
#region Private Fields
/// <summary>
/// Nome Canale associato al gestore pipeline messaggi
/// </summary>
private string _channel = "";
private bool enableLog = false;
private Dictionary<string, int> numSent = new Dictionary<string, int>();
private IConnectionMultiplexer redis;
private IDatabase redisDb;
#endregion Private Fields
#region Private Properties
/// <summary>
/// Canale associato al gestore pipeline messaggi
/// Channel di comunicazione REDIS
/// </summary>
private string _channel { get; set; } = "";
private RedisChannel rChannel;
#endregion Private Properties
private IConnectionMultiplexer redisConn;
private IDatabase redisDb;
private ISubscriber redisSub;
#endregion Private Fields
#region Private Methods
private void setupSubscriber()
{
ISubscriber sub = redis.GetSubscriber();
//Subscribe to the channel named messages
#if false
// Subscribe to the channel named messages
ISubscriber sub = redisConn.GetSubscriber();
sub.Subscribe(_channel, (channel, message) =>
#endif
redisSub.Subscribe(rChannel, (channel, message) =>
{
if (enableLog)
{

Some files were not shown because too many files have changed in this diff Show More