SPEC:
- inizio pagina gest fluxLog e pareto eventi - ok visualizzazione ultimo mese
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -53,10 +54,10 @@ namespace MP.Data.Controllers
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagGruppi
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.CodGruppo)
|
||||
.ToList();
|
||||
.DbSetAnagGruppi
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.CodGruppo)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -81,6 +82,24 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagKeyValueModel> AnagKeyValGetAll()
|
||||
{
|
||||
List<AnagKeyValueModel> dbResult = new List<AnagKeyValueModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAKV
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.nomeVar)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori ammessi x Stati commessa (es Yacht Baglietto)
|
||||
/// </summary>
|
||||
@@ -737,7 +756,7 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in MacchineGetFilt{Environment.NewLine}{exc}");
|
||||
Log.Error($"Eccezione in MacchineByMatrOper{Environment.NewLine}{exc}");
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
@@ -1067,6 +1086,27 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ParetoFluxLogDTO> ParetoFluxLog(string idxMacchina, DateTime dtFrom, DateTime dtTo)
|
||||
{
|
||||
List<ParetoFluxLogDTO> dbResult = new List<ParetoFluxLogDTO>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetFluxLog
|
||||
.Where(x => (string.IsNullOrEmpty(idxMacchina) || x.IdxMacchina == idxMacchina) && (dtFrom <= x.dtEvento && x.dtEvento <= dtTo))
|
||||
.AsNoTracking()
|
||||
.GroupBy(x => x.CodFlux)
|
||||
.Select(g => new ParetoFluxLogDTO() { IdxMacchina = idxMacchina, CodFlux = g.Key, Qty = g.Count() })
|
||||
.OrderByDescending(x => x.Qty)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato prod macchina
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user