Merge branch 'Release/ModDbFluxData_01'

This commit is contained in:
Samuele Locatelli
2025-02-10 12:18:16 +01:00
22 changed files with 183 additions and 50 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2412.2310</Version>
<Version>6.16.2502.1011</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2412.2310</h4>
<h4>Versione: 6.16.2502.1011</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2412.2310
6.16.2502.1011
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2412.2310</version>
<version>6.16.2502.1011</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 -1
View File
@@ -130,7 +130,7 @@ namespace MP.Data.Controllers
public List<FluxLog> FluxLogGetLastFilt(DateTime DtMax, DateTime DtMin, string IdxMacchina, string CodFlux, int MaxRec)
{
List<FluxLog> dbResult = new List<FluxLog>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = dbCtx
.DbSetFluxLog
+17 -17
View File
@@ -128,14 +128,14 @@ namespace MP.Data.Controllers
public List<string> ArticleWithDossier()
{
List<string> dbResult = new List<string>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = dbCtx
.DbSetDossiers
.AsNoTracking()
.Select(i => i.CodArticolo)
.Distinct()
.ToList();
.DbSetDossiers
.AsNoTracking()
.Select(i => i.CodArticolo)
.Distinct()
.ToList();
}
return dbResult;
}
@@ -347,7 +347,7 @@ namespace MP.Data.Controllers
public async Task<bool> DossiersDeleteRecord(DossierModel currRec)
{
bool answ = false;
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
try
{
@@ -381,7 +381,7 @@ namespace MP.Data.Controllers
public List<DossierModel> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
{
List<DossierModel> dbResult = new List<DossierModel>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = dbCtx
.DbSetDossiers
@@ -404,7 +404,7 @@ namespace MP.Data.Controllers
public async Task<bool> DossiersInsert(DossierModel newRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
try
{
@@ -431,7 +431,7 @@ namespace MP.Data.Controllers
public bool DossiersTakeParamsSnapshot(string idxMacchina, int maxSec, DateTime dtRif)
{
bool answ = false;
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
var pMaxSec = new SqlParameter("@MaxSec", maxSec);
@@ -454,7 +454,7 @@ namespace MP.Data.Controllers
public bool DossiersTakeParamsSnapshotLast(string idxMacchina, DateTime dtMin, DateTime dtMax)
{
bool answ = false;
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
var pDtMin = new SqlParameter("@DtMin", dtMin);
@@ -476,7 +476,7 @@ namespace MP.Data.Controllers
public async Task<bool> DossiersUpdateValore(DossierModel editRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
try
{
@@ -593,7 +593,7 @@ namespace MP.Data.Controllers
DateTime dtCursEnd = dtCursStart.Add(step);
bool setCompleted = false;
// dbContext x ogni singolo flusso
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
// opzionalmente timeout comandi a 2 minuti... NON usato x ora e da testare
//dbCtx.Database.SetCommandTimeout(TimeSpan.FromMinutes(2));
@@ -699,7 +699,7 @@ namespace MP.Data.Controllers
public List<FluxLog> FluxLogGetLastFilt(DateTime DtMax, DateTime DtMin, string IdxMacchina, string CodFlux, int MaxRec)
{
List<FluxLog> dbResult = new List<FluxLog>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = dbCtx
.DbSetFluxLog
@@ -719,7 +719,7 @@ namespace MP.Data.Controllers
public List<ParetoFluxLogDTO> FluxLogPareto(string idxMacchina, DateTime dtFrom, DateTime dtTo)
{
List<ParetoFluxLogDTO> dbResult = new List<ParetoFluxLogDTO>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = dbCtx
.DbSetFluxLog
@@ -1017,7 +1017,7 @@ namespace MP.Data.Controllers
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
{
List<string> dbResult = new List<string>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = await dbCtx
.DbSetFluxLog
@@ -1275,7 +1275,7 @@ namespace MP.Data.Controllers
public List<string> ParametriGetFilt(string IdxMacchina)
{
List<string> dbResult = new List<string>();
using (var dbCtx = new MoonProContext(_configuration))
using (var dbCtx = new MoonPro_FluxContext(_configuration))
{
dbResult = dbCtx
.DbSetFluxLog
-12
View File
@@ -55,8 +55,6 @@ namespace MP.Data
public virtual DbSet<ODLExpModel> DbSetODLExp { get; set; }
public virtual DbSet<PODLExpModel> DbSetPODLExp { get; set; }
public virtual DbSet<PODLModel> DbSetPODL { get; set; }
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
public virtual DbSet<DossierModel> DbSetDossiers { get; set; }
public virtual DbSet<StatODLModel> DbSetStatOdl { get; set; }
public virtual DbSet<PzProdModel> DbSetPzProd { get; set; }
public virtual DbSet<EventListModel> DbSetEvList { get; set; }
@@ -96,7 +94,6 @@ namespace MP.Data
public virtual DbSet<vSelEventiBCodeModel> DbSetVSEB { get; set; }
public virtual DbSet<vSelOdlModel> DbSetVSODL { get; set; }
public virtual DbSet<vSelCauScartoModel> DbSetVSCS { get; set; }
public virtual DbSet<ParetoFluxLogDTO> DbSetParetoFluxLog { get; set; }
#endregion Public Properties
@@ -344,11 +341,6 @@ namespace MP.Data
{
entity.HasKey(e => new { e.TableName, e.FieldName, e.value });
});
modelBuilder.Entity<FluxLog>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.dtEvento, e.CodFlux });
});
modelBuilder.Entity<EventListModel>(entity =>
@@ -576,10 +568,6 @@ namespace MP.Data
{
entity.ToView("v_DD_exp");
});
modelBuilder.Entity<ParetoFluxLogDTO>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.CodFlux });
});
OnModelCreatingPartial(modelBuilder);
}
+146
View File
@@ -0,0 +1,146 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using NLog;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data
{
public partial class MoonPro_FluxContext : DbContext
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private IConfiguration _configuration;
#endregion Private Fields
#region Public Constructors
/// <summary>
/// Indispensabile x prima generazione migrations EFCore
/// </summary>
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
public MoonPro_FluxContext()
{
}
public MoonPro_FluxContext(IConfiguration configuration)
{
_configuration = configuration;
}
public MoonPro_FluxContext(DbContextOptions<MoonPro_FluxContext> options) : base(options)
{
}
#endregion Public Constructors
#region Public Properties
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
public virtual DbSet<DossierModel> DbSetDossiers { get; set; }
public virtual DbSet<ParetoFluxLogDTO> DbSetParetoFluxLog { get; set; }
#endregion Public Properties
#region Private Methods
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
#endregion Private Methods
#region Protected Methods
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
string connString = _configuration.GetConnectionString("MP.Flux");
if (!string.IsNullOrEmpty(connString))
{
optionsBuilder.UseSqlServer(connString);
}
else
{
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_FluxData;Trusted_Connection=True;");
}
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
modelBuilder.Entity<AnagArticoli>(entity =>
{
entity.HasKey(e => e.CodArticolo);
entity.ToView("AnagArticoli");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DescArticolo)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.Disegno)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tipo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Azienda)
.IsRequired()
.HasMaxLength(50);
});
modelBuilder.Entity<Macchine>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
entity.ToView("Macchine");
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.IdxMacchina)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Nome).HasMaxLength(50);
});
modelBuilder.Entity<FluxLog>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.dtEvento, e.CodFlux });
});
modelBuilder.Entity<ParetoFluxLogDTO>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.CodFlux });
});
OnModelCreatingPartial(modelBuilder);
}
#endregion Protected Methods
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ namespace MP.Data.Objects
#region Public Enums
/// <summary>
/// Intervallo dati (es per definizione quanti dati FluxLog tenere x intervallo
/// Intervallo dati (es per definizione quanti dati FluxLog tenere x intervallo)
/// </summary>
public enum DataInterval
{
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Prog</RootNamespace>
<Version>6.16.2410.3112</Version>
<Version>6.16.2502.1011</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.16.2410.3112</h4>
<h4>Versione: 6.16.2502.1011</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2410.3112
6.16.2502.1011
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2410.3112</version>
<version>6.16.2502.1011</version>
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2501.3111</Version>
<Version>6.16.2502.1011</Version>
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2501.3111</h4>
<h4>Versione: 6.16.2502.1011</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2501.3111
6.16.2502.1011
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2501.3111</version>
<version>6.16.2502.1011</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -2
View File
@@ -10,8 +10,6 @@
"baseFileDir": "${basedir}/logs/",
"layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}"
},
// "internalLogLevel": "Info",
// "internalLogFile": "c:\\temp\\internal-nlog.txt",
"extensions": [
{ "assembly": "NLog.Extensions.Logging" },
{ "assembly": "NLog.Web.AspNetCore" }
@@ -51,6 +49,7 @@
"AllowedHosts": "*",
"ConnectionStrings": {
"MP.Data": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
"MP.Flux": "Server=SQL2016DEV;Database=MoonPro_FluxData; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
"MP.Inve": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
"Redis": "localhost:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true",
"RedisAdmin": "localhost:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true",
+2 -2
View File
@@ -4,8 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Stats</RootNamespace>
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
<Version>6.16.2412.1915</Version>
<Version>6.16.2412.1915</Version>
<Version>6.16.2502.1011</Version>
<Version>6.16.2502.1011</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo statistiche MAPO</i>
<h4>Versione: 6.16.2412.1915</h4>
<h4>Versione: 6.16.2502.1011</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2412.1915
6.16.2502.1011
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2412.1915</version>
<version>6.16.2502.1011</version>
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>