Completato fix SPEC, ok x MON, altri da verificare/sistemare
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>8.16.2606.119</Version>
|
||||
<Version>8.16.2606.311</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 8.16.2606.119</h4>
|
||||
<h4>Versione: 8.16.2606.311</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.119
|
||||
8.16.2606.311
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.119</version>
|
||||
<version>8.16.2606.311</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>
|
||||
|
||||
@@ -12,16 +12,23 @@ namespace MP.AppAuth.Controllers
|
||||
{
|
||||
public class AppAuthController
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public AppAuthController(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
|
||||
Log.Info("Avviata classe AppAuthController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
@@ -189,8 +196,6 @@ namespace MP.AppAuth.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x gestione Update
|
||||
/// </summary>
|
||||
@@ -225,12 +230,5 @@ namespace MP.AppAuth.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,16 @@ namespace MP.AppAuth.Controllers
|
||||
{
|
||||
public class AppUserController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private bool _disposed = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public AppUserController(IConfiguration configuration)
|
||||
@@ -19,7 +29,7 @@ namespace MP.AppAuth.Controllers
|
||||
Log.Info("Avviata classe AppUserController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
@@ -42,18 +52,28 @@ namespace MP.AppAuth.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
#region Protected Methods
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposed)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// Free managed resources here
|
||||
}
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Fields
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,19 +10,15 @@ namespace MP.AppAuth.Controllers
|
||||
{
|
||||
public class MPController : IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static MPController dbController;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
private bool _disposed = false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
@@ -32,7 +28,7 @@ namespace MP.AppAuth.Controllers
|
||||
Log.Info("Avviata classe MpController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
@@ -271,15 +267,6 @@ namespace MP.AppAuth.Controllers
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (dbController != null)
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x ListValues
|
||||
/// </summary>
|
||||
@@ -380,5 +367,27 @@ namespace MP.AppAuth.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposed)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// Free managed resources here
|
||||
}
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.AppAuth
|
||||
{
|
||||
public static class DataServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Aggiunta repository/servizi specifici per IOC
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddAuthLandDataLayer(this IServiceCollection services)
|
||||
{
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,6 @@ namespace MP.AppAuth.Services
|
||||
// diritti (cablato)
|
||||
public const string RoleSuperAdmin = "MoonPro_SuperAdmin";
|
||||
|
||||
public static AppAuthController dbController;
|
||||
public static MPController MpDbController;
|
||||
public static AppUserController userController;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Private Fields
|
||||
@@ -37,15 +33,15 @@ namespace MP.AppAuth.Services
|
||||
|
||||
private const string rKeyPermUser = $"{redisBaseAddr}:PERM_USER";
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
private static ILogger<AppAuthService> _logger;
|
||||
private readonly ILogger<AppAuthService> _logger;
|
||||
|
||||
private static JsonSerializerSettings? JSSettings;
|
||||
private readonly JsonSerializerSettings? JSSettings;
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static string Modulo = "";
|
||||
private string Modulo = "";
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga IN SECONDI
|
||||
@@ -60,23 +56,27 @@ namespace MP.AppAuth.Services
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
private IConnectionMultiplexer redisConn;
|
||||
private readonly IConnectionMultiplexer redisConn;
|
||||
|
||||
//ISubscriber sub = redis.GetSubscriber();
|
||||
/// <summary>
|
||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
||||
/// </summary>
|
||||
private StackExchange.Redis.IDatabase redisDb = null!;
|
||||
private readonly StackExchange.Redis.IDatabase redisDb;
|
||||
|
||||
private Random rnd = new Random();
|
||||
private readonly Random rnd = new Random();
|
||||
|
||||
private Dictionary<string, string> Vocabolario = new Dictionary<string, string>();
|
||||
|
||||
private readonly AppAuthController _appAuthController;
|
||||
private readonly MPController _mpController;
|
||||
private readonly AppUserController _appUserController;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public AppAuthService(IConfiguration configuration, ILogger<AppAuthService> logger, IConnectionMultiplexer redisConnMult)
|
||||
public AppAuthService(IConfiguration configuration, ILogger<AppAuthService> logger, IConnectionMultiplexer redisConnMult, AppAuthController appAuthController, MPController mpController, AppUserController appUserController)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
@@ -103,9 +103,9 @@ namespace MP.AppAuth.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
dbController = new AppAuthController(configuration);
|
||||
MpDbController = new MPController(configuration);
|
||||
userController = new AppUserController(configuration);
|
||||
_appAuthController = appAuthController;
|
||||
_mpController = mpController;
|
||||
_appUserController = appUserController;
|
||||
_logger.LogInformation("DbController OK");
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ namespace MP.AppAuth.Services
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string CodApp { get; set; } = "";
|
||||
private string CodApp { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
|
||||
@@ -153,7 +153,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaCausaliScarto> dbResult = new List<AnagraficaCausaliScarto>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagCauSca();
|
||||
dbResult = _mpController.AnagCauSca();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagCauSca: {ts.TotalMilliseconds} ms");
|
||||
@@ -169,7 +169,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagClassiTempo> dbResult = new List<AnagClassiTempo>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagClassiTempo();
|
||||
dbResult = _mpController.AnagClassiTempo();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagClassiTempo: {ts.TotalMilliseconds} ms");
|
||||
@@ -185,7 +185,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaEventi> dbResult = new List<AnagraficaEventi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagEventi();
|
||||
dbResult = _mpController.AnagEventi();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagEventi: {ts.TotalMilliseconds} ms");
|
||||
@@ -201,7 +201,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaGruppi> dbResult = new List<AnagraficaGruppi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagGruppiGetAll();
|
||||
dbResult = _appAuthController.AnagGruppiGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagGruppiAll: {ts.TotalMilliseconds} ms");
|
||||
@@ -213,7 +213,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaGruppi> dbResult = new List<AnagraficaGruppi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagGruppiFilt(codTipo);
|
||||
dbResult = _appAuthController.AnagGruppiFilt(codTipo);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagGruppiFilt: {ts.TotalMilliseconds} ms");
|
||||
@@ -229,7 +229,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaIngressi> dbResult = new List<AnagraficaIngressi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagIngressi();
|
||||
dbResult = _mpController.AnagIngressi();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagIngressi: {ts.TotalMilliseconds} ms");
|
||||
@@ -241,7 +241,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.AnagKeyValuesUpsert(currRec);
|
||||
answ = _mpController.AnagKeyValuesUpsert(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"AnagKeyValAdd | Aggiunto rec | NomeVar: {currRec.NomeVar} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -253,7 +253,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.AnagKeyValuesDelete(NomeVar);
|
||||
answ = _mpController.AnagKeyValuesDelete(NomeVar);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"AnagKeyValDelete | Effettuata cancellazione | NomeVar: {NomeVar} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -265,7 +265,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagKeyValueModel> dbResult = new List<AnagKeyValueModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagKeyValuesGetAll();
|
||||
dbResult = _mpController.AnagKeyValuesGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagKeyValList: {ts.TotalMilliseconds} ms");
|
||||
@@ -277,7 +277,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.AnagKeyValuesUpsert(currRec);
|
||||
answ = _mpController.AnagKeyValuesUpsert(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"AnagKeyValUpd | Effettuata modifica | NomeVar: {currRec.NomeVar} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -293,7 +293,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaMicroStati> dbResult = new List<AnagraficaMicroStati>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagMicroStati();
|
||||
dbResult = _mpController.AnagMicroStati();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagMicroStati: {ts.TotalMilliseconds} ms");
|
||||
@@ -305,7 +305,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaOperatori> dbResult = new List<AnagraficaOperatori>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var rawData = dbController
|
||||
var rawData = _appAuthController
|
||||
.AnagOpByGruppoGetFilt(codGruppo, searchVal);
|
||||
dbResult = rawData
|
||||
.GroupBy(user => user.MatrOpr)
|
||||
@@ -322,7 +322,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaOperatori> dbResult = new List<AnagraficaOperatori>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagOpGetAll(searchVal);
|
||||
dbResult = _appAuthController.AnagOpGetAll(searchVal);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagOperList: {ts.TotalMilliseconds} ms");
|
||||
@@ -338,7 +338,7 @@ namespace MP.AppAuth.Services
|
||||
List<AnagraficaStati> dbResult = new List<AnagraficaStati>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.AnagStati();
|
||||
dbResult = _mpController.AnagStati();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagStati: {ts.TotalMilliseconds} ms");
|
||||
@@ -350,7 +350,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.ConfigUpsert(currRec);
|
||||
answ = _mpController.ConfigUpsert(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"ConfigAdd | Aggiunto rec | Chiave: {currRec.Chiave} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -362,7 +362,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.ConfigDelete(Chiave);
|
||||
answ = _mpController.ConfigDelete(Chiave);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"ConfigDelete | Effettuata cancellazione | Chiave: {Chiave} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -374,7 +374,7 @@ namespace MP.AppAuth.Services
|
||||
List<ConfigModel> dbResult = new List<ConfigModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.ConfigGetAll();
|
||||
dbResult = _mpController.ConfigGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per ConfigList: {ts.TotalMilliseconds} ms");
|
||||
@@ -386,7 +386,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.ConfigUpsert(currRec);
|
||||
answ = _mpController.ConfigUpsert(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"ConfigUpd | Effettuata modifica | Chiave: {currRec.Chiave} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -415,7 +415,7 @@ namespace MP.AppAuth.Services
|
||||
else
|
||||
{
|
||||
// recupero diritti utente
|
||||
dbResult = userController.DirittiUtente(UserName, Modulo);
|
||||
dbResult = _appUserController.DirittiUtente(UserName, Modulo);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
@@ -430,11 +430,8 @@ namespace MP.AppAuth.Services
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
if (MpDbController != null)
|
||||
{
|
||||
MpDbController.Dispose();
|
||||
}
|
||||
// Clear database controllers
|
||||
_mpController?.Dispose();
|
||||
}
|
||||
|
||||
public async Task FlushRedisCache()
|
||||
@@ -455,7 +452,7 @@ namespace MP.AppAuth.Services
|
||||
List<ListValues> dbResult = new List<ListValues>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.ListValues();
|
||||
dbResult = _mpController.ListValues();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per ListValues: {ts.TotalMilliseconds} ms");
|
||||
@@ -484,7 +481,7 @@ namespace MP.AppAuth.Services
|
||||
else
|
||||
{
|
||||
// recupero diritti utente
|
||||
dbResult = MpDbController.MacchineGetAll();
|
||||
dbResult = _mpController.MacchineGetAll();
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
redisDb.StringSet(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
@@ -526,7 +523,7 @@ namespace MP.AppAuth.Services
|
||||
else
|
||||
{
|
||||
// recupero diritti utente
|
||||
var userRightList = userController.DirittiUtente(UserName, Modulo);
|
||||
var userRightList = _appUserController.DirittiUtente(UserName, Modulo);
|
||||
// proietto come funzioni...
|
||||
var ListFunc = userRightList.Select(x => x.Funzione).ToList();
|
||||
// trasformo i permessi utente
|
||||
@@ -534,7 +531,7 @@ namespace MP.AppAuth.Services
|
||||
{
|
||||
ListFunc = new List<string>();
|
||||
}
|
||||
dbResult = dbController.PermessiGetByFunc(ListFunc);
|
||||
dbResult = _appAuthController.PermessiGetByFunc(ListFunc);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
@@ -565,7 +562,7 @@ namespace MP.AppAuth.Services
|
||||
List<UpdMan> dbResult = new List<UpdMan>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.UpdManGetAll();
|
||||
dbResult = _appAuthController.UpdManGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per UpdManList: {ts.TotalMilliseconds} ms");
|
||||
@@ -577,7 +574,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.VocabolarioUpsert(currRec);
|
||||
answ = _mpController.VocabolarioUpsert(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"VocabolarioAdd | Aggiunto rec | lingua: {currRec.Lingua} | lemma: {currRec.Lemma} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -589,7 +586,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.VocabolarioDelete(currRec);
|
||||
answ = _mpController.VocabolarioDelete(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"VocabolarioDelete | Effettuata cancellazione | lingua: {currRec.Lingua} | lemma: {currRec.Lemma} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -601,7 +598,7 @@ namespace MP.AppAuth.Services
|
||||
List<VocabolarioModel> dbResult = new List<VocabolarioModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = MpDbController.VocabolarioGetAll();
|
||||
dbResult = _mpController.VocabolarioGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per VocabolarioList: {ts.TotalMilliseconds} ms");
|
||||
@@ -613,7 +610,7 @@ namespace MP.AppAuth.Services
|
||||
bool answ = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
answ = MpDbController.VocabolarioUpsert(currRec);
|
||||
answ = _mpController.VocabolarioUpsert(currRec);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"VocabolarioUpd | Effettuata modifica | lingua: {currRec.Lingua} | lemma: {currRec.Lemma} | durata: {ts.TotalMilliseconds} ms");
|
||||
@@ -641,7 +638,7 @@ namespace MP.AppAuth.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
Vocabolario = dbController
|
||||
Vocabolario = _appAuthController
|
||||
.VocabolarioGetAll()
|
||||
.ToDictionary(x => $"{x.Lingua}#{x.Lemma}", x => x.Traduzione);
|
||||
rawData = JsonConvert.SerializeObject(Vocabolario);
|
||||
@@ -665,10 +662,10 @@ namespace MP.AppAuth.Services
|
||||
{
|
||||
bool answ = false;
|
||||
var masterEndpoint = redisConn.GetEndPoints()
|
||||
.Where(ep => redisConn.GetServer(ep).IsConnected && !redisConn.GetServer(ep).IsReplica)
|
||||
.FirstOrDefault();
|
||||
.Where(ep => redisConn.GetServer(ep).IsConnected && !redisConn.GetServer(ep).IsReplica)
|
||||
.FirstOrDefault();
|
||||
|
||||
// sepattern è "*" elimino intero DB...
|
||||
// se pattern è "*" elimino intero DB...
|
||||
if (masterEndpoint != null && (pat2Flush.Equals(new RedisValue("*")) || pat2Flush == RedisValue.Null))
|
||||
{
|
||||
redisConn.GetServer(masterEndpoint).FlushDatabase(database: redisDb.Database);
|
||||
@@ -699,4 +696,4 @@ namespace MP.AppAuth.Services
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
_configuration = configuration;
|
||||
string connStr = _configuration.GetConnectionString("MP.Land");
|
||||
if(string.IsNullOrEmpty(connStr))
|
||||
if (string.IsNullOrEmpty(connStr))
|
||||
{
|
||||
connStr = _configuration.GetConnectionString("MP.Data");
|
||||
}
|
||||
@@ -143,7 +143,8 @@ namespace MP.Data.Controllers
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_configuration = null;
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -262,11 +263,28 @@ namespace MP.Data.Controllers
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposed)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// Free managed resources here
|
||||
}
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private DbContextOptions<MoonProContext> options;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly DbContextOptions<MoonProContext> options;
|
||||
private bool _disposed = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
using DnsClient.Protocol;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DbModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using static MP.Core.Objects.Enums;
|
||||
|
||||
namespace MP.Data.Controllers
|
||||
{
|
||||
@@ -19,6 +15,10 @@ namespace MP.Data.Controllers
|
||||
public MpVocController(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
string connStr = _configuration.GetConnectionString("MP.Voc");
|
||||
options = new DbContextOptionsBuilder<MoonPro_VocContext>()
|
||||
.UseSqlServer(connStr)
|
||||
.Options;
|
||||
Log.Info("Avviata classe MpVocController");
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace MP.Data.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
private DbContextOptions<MoonPro_VocContext> options;
|
||||
/// <summary>
|
||||
/// Elenco da tabella Config
|
||||
/// </summary>
|
||||
@@ -33,15 +34,12 @@ namespace MP.Data.Controllers
|
||||
public List<ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<ConfigModel> dbResult = new List<ConfigModel>();
|
||||
using (var dbCtx = new MoonPro_VocContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
using var dbCtx = new MoonPro_VocContext(options);
|
||||
return dbCtx
|
||||
.DbSetConfig
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -55,15 +53,12 @@ namespace MP.Data.Controllers
|
||||
public List<LingueModel> LingueGetAll()
|
||||
{
|
||||
List<LingueModel> dbResult = new List<LingueModel>();
|
||||
using (var dbCtx = new MoonPro_VocContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetLilngue
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Lingua)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
using var dbCtx = new MoonPro_VocContext(options);
|
||||
return dbCtx
|
||||
.DbSetLilngue
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Lingua)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -73,15 +68,12 @@ namespace MP.Data.Controllers
|
||||
public List<VocabolarioModel> VocabolarioGetAll()
|
||||
{
|
||||
List<VocabolarioModel> dbResult = new List<VocabolarioModel>();
|
||||
using (var dbCtx = new MoonPro_VocContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetVocabolario
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Lemma)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
using var dbCtx = new MoonPro_VocContext(options);
|
||||
return dbCtx
|
||||
.DbSetVocabolario
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Lemma)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using MP.AppAuth.Controllers;
|
||||
using MP.AppAuth.Services;
|
||||
using MP.Data.Controllers;
|
||||
using MP.Data.Repository.Anag;
|
||||
@@ -49,6 +50,33 @@ namespace MP.Data
|
||||
return services;
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiunta repository/servizi specifici per LAND
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddLandDataLayer(this IServiceCollection services)
|
||||
{
|
||||
|
||||
services.TryAddSingleton<IMpLandRepository, MpLandRepository>();
|
||||
services.TryAddSingleton<SyncService>();
|
||||
services.TryAddSingleton<TabDataService>();
|
||||
services.TryAddSingleton<LandDataService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiunta repository/servizi specifici per MON
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddMonDataLayer(this IServiceCollection services)
|
||||
{
|
||||
|
||||
services.TryAddSingleton<IMpMonRepository, MpMonRepository>();
|
||||
services.TryAddSingleton<MonDataFeeder>();
|
||||
return services;
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiunta repository/servizi specifici per SPEC
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
@@ -56,10 +84,8 @@ namespace MP.Data
|
||||
public static IServiceCollection AddSpecDataLayer(this IServiceCollection services)
|
||||
{
|
||||
// ---------- Start Repository ----------
|
||||
// Singleton
|
||||
services.TryAddSingleton<IAnagRepository, AnagRepository>();
|
||||
services.TryAddScoped<IAnagRepository, AnagRepository>();
|
||||
|
||||
// Scoped
|
||||
services.TryAddScoped<IProductionRepository, ProductionRepository>();
|
||||
services.TryAddScoped<IDossierRepository, DossierRepository>();
|
||||
services.TryAddScoped<IFluxLogRepository, FluxLogRepository>();
|
||||
@@ -67,35 +93,26 @@ namespace MP.Data
|
||||
services.TryAddScoped<IMpMonRepository, MpMonRepository>();
|
||||
services.TryAddScoped<IMpVocRepository, MpVocRepository>();
|
||||
services.TryAddScoped<IMpLandRepository, MpLandRepository>();
|
||||
|
||||
|
||||
// ---------- End Repository ----------
|
||||
|
||||
|
||||
// ---------- Start Servizi ----------
|
||||
|
||||
// Singleton
|
||||
|
||||
//services.TryAddSingleton<MpDataService>();
|
||||
|
||||
// Scoped
|
||||
|
||||
// ---------- End Servizi ----------
|
||||
|
||||
|
||||
// ---------- Start Altro ----------
|
||||
// Singleton
|
||||
services.TryAddSingleton<AppAuthService>();
|
||||
services.TryAddScoped<AppAuthController>();
|
||||
services.TryAddScoped<MPController>();
|
||||
services.TryAddScoped<AppUserController>();
|
||||
services.TryAddScoped<AppAuthService>();
|
||||
services.TryAddScoped<OrderDataSrv>();
|
||||
services.TryAddScoped<ListSelectDataSrv>();
|
||||
services.TryAddSingleton<SharedMemService>();
|
||||
services.TryAddSingleton<TabDataService>();
|
||||
services.TryAddSingleton<TabDataFeeder>();
|
||||
|
||||
// Scoped
|
||||
services.TryAddScoped<TabDataFeeder>();
|
||||
services.AddScoped<ISessionStorageService, SessionStorageService>();
|
||||
services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||
|
||||
// ---------- End Altro ----------
|
||||
|
||||
return services;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -16,6 +17,7 @@ namespace MP.Data.DbModels
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int AlarmLogId { get; set; } = 0;
|
||||
public DateTime DtRif { get; set; } = DateTime.Now;
|
||||
[Precision(18, 6)]
|
||||
public decimal Duration { get; set; } = 0;
|
||||
public string MachineId { get; set; } = "";
|
||||
public string MemAddress { get; set; } = "";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MP.Data.DbModels
|
||||
{
|
||||
@@ -6,6 +7,7 @@ namespace MP.Data.DbModels
|
||||
{
|
||||
[Key]
|
||||
public string DbName { get; set; } = "";
|
||||
[Precision(18, 6)]
|
||||
public decimal DbSizeMb { get; set; } = 0;
|
||||
public int NumTables { get; set; } = 0;
|
||||
public string BigTable { get; set; } = "";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -35,11 +36,13 @@ namespace MP.Data.DbModels
|
||||
/// <summary>
|
||||
/// Tempo Ciclo std
|
||||
/// </summary>
|
||||
[Precision(18, 6)]
|
||||
public decimal TCiclo { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Minuti prodotti (da TC e pz prod
|
||||
/// </summary>
|
||||
[Precision(18, 6)]
|
||||
public decimal MinProd { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
@@ -50,7 +53,7 @@ namespace MP.Data.DbModels
|
||||
[NotMapped]
|
||||
public bool IsWork
|
||||
{
|
||||
get => IdxTipoEv == 1;
|
||||
get => IdxTipoEv == 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -19,7 +20,9 @@ namespace MP.Data.DbModels
|
||||
public string CodArticolo { get; set; } = "";
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; }
|
||||
[Precision(18, 6)]
|
||||
public decimal Tcassegnato { get; set; }
|
||||
[Precision(18, 6)]
|
||||
public decimal TCRichAttr { get; set; }
|
||||
public DateTime? DataInizio { get; set; }
|
||||
public DateTime? DataFine { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -21,6 +22,7 @@ namespace MP.Data.DbModels
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; }
|
||||
[Precision(18, 6)]
|
||||
public decimal Tcassegnato { get; set; }
|
||||
public DateTime? DataInizio { get; set; }
|
||||
public DateTime? DataFine { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -28,6 +29,7 @@ namespace MP.Data.DbModels
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; } = 1;
|
||||
[Precision(18, 6)]
|
||||
public decimal Tcassegnato { get; set; } = 1;
|
||||
public DateTime? DueDate { get; set; }
|
||||
public int Priorita { get; set; } = 1;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -29,6 +30,7 @@ namespace MP.Data.DbModels
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; } = 1;
|
||||
[Precision(18, 6)]
|
||||
public decimal Tcassegnato { get; set; } = 1;
|
||||
public DateTime? DueDate { get; set; }
|
||||
public int Priorita { get; set; } = 1;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
@@ -24,6 +25,7 @@ namespace MP.Data.DbModels
|
||||
/// <summary>
|
||||
/// Score Cicli Associati
|
||||
/// </summary>
|
||||
[Precision(18, 6)]
|
||||
public decimal ChildScore { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// Score complessivo
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using MP.Data.DbModels;
|
||||
using NLog;
|
||||
|
||||
@@ -17,16 +14,16 @@ namespace MP.Data
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private IConfiguration _configuration;
|
||||
//private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MoonPro_VocContext(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
//public MoonPro_VocContext(IConfiguration configuration)
|
||||
//{
|
||||
// _configuration = configuration;
|
||||
//}
|
||||
|
||||
public MoonPro_VocContext(DbContextOptions<MoonPro_VocContext> options) : base(options)
|
||||
{
|
||||
@@ -52,11 +49,16 @@ namespace MP.Data
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
//if (!optionsBuilder.IsConfigured)
|
||||
//{
|
||||
// string connString = _configuration.GetConnectionString("MP.Voc");
|
||||
|
||||
// optionsBuilder.UseSqlServer(connString);
|
||||
//}
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("MP.Voc");
|
||||
|
||||
optionsBuilder.UseSqlServer(connString);
|
||||
// fallback si spera non necessario
|
||||
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace MP.Data.Services
|
||||
/// </summary>
|
||||
protected static readonly ActivitySource ActivitySource = new ActivitySource("MP.IOC");
|
||||
|
||||
protected static IConfiguration _configuration = null!;
|
||||
protected IConfiguration _configuration = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione operazioni tracing generiche
|
||||
|
||||
@@ -40,12 +40,6 @@ namespace MP.Data.Services
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public static MpLandController dbController { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.INVE</RootNamespace>
|
||||
<Version>8.16.2606.119</Version>
|
||||
<Version>8.16.2606.311</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOINVE </i>
|
||||
<h4>Versione: 8.16.2606.119</h4>
|
||||
<h4>Versione: 8.16.2606.311</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.119
|
||||
8.16.2606.311
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.119</version>
|
||||
<version>8.16.2606.311</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>8.16.2606.119</Version>
|
||||
<Version>8.16.2606.311</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MP-IOC </i>
|
||||
<h4>Versione: 8.16.2606.119</h4>
|
||||
<h4>Versione: 8.16.2606.311</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.119
|
||||
8.16.2606.311
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.119</version>
|
||||
<version>8.16.2606.311</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>8.16.2606.0119</Version>
|
||||
<Version>8.16.2606.0312</Version>
|
||||
<Configurations>Debug;Release;Debug_LiManDebug</Configurations>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo Tablet MAPO - DotNet6</i>
|
||||
<h4>Versione: 8.16.2606.0119</h4>
|
||||
<h4>Versione: 8.16.2606.0312</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.0119
|
||||
8.16.2606.0312
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.0119</version>
|
||||
<version>8.16.2606.0312</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
+18
-10
@@ -2,25 +2,21 @@ using Blazored.LocalStorage;
|
||||
using Blazored.SessionStorage;
|
||||
using Microsoft.AspNetCore.Authentication.Negotiate;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using MP.AppAuth.Services;
|
||||
using MP.Data.Services;
|
||||
using MP.Data;
|
||||
using MP.Land.Data;
|
||||
using MP.TaskMan.Services;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Land
|
||||
{
|
||||
@@ -138,12 +134,24 @@ namespace MP.Land
|
||||
services.AddServerSideBlazor();
|
||||
|
||||
services.AddSingleton<IConfiguration>(Configuration);
|
||||
|
||||
// aggiungo il costruttore x i vari DbContextFactory
|
||||
var connStr = Configuration.GetConnectionString("MP.Land")
|
||||
?? throw new InvalidOperationException("ConnString 'MP.Land' mancante.");
|
||||
services.AddDbContextFactory<MoonProContext>(options =>
|
||||
options.UseSqlServer(connStr)
|
||||
.EnableSensitiveDataLogging(false) // true solo in Sviluppo
|
||||
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning)));
|
||||
|
||||
//init servizi specifici LAND
|
||||
//services.AddAuthLandDataLayer();
|
||||
services.AddLandDataLayer();
|
||||
services.AddSingleton<LicenseService>();
|
||||
services.AddSingleton<SyncService>();
|
||||
services.AddSingleton<RestCallService>();
|
||||
services.AddSingleton<TaskService>();
|
||||
services.AddSingleton<TabDataService>();
|
||||
services.AddSingleton<LandDataService>();
|
||||
//services.AddSingleton<SyncService>();
|
||||
//services.AddSingleton<TabDataService>();
|
||||
//services.AddSingleton<LandDataService>();
|
||||
|
||||
services.AddScoped<AppAuthService>();
|
||||
services.AddScoped<LMessageService>();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.MON</RootNamespace>
|
||||
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
|
||||
<Version>8.16.2606.119</Version>
|
||||
<Version>8.16.2606.312</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+15
-1
@@ -1,3 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using MP.Data;
|
||||
using MP.Data.Services;
|
||||
using MP.MON.Components;
|
||||
using NLog;
|
||||
@@ -26,10 +29,21 @@ string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"))
|
||||
// avvio oggetto shared x redis...
|
||||
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
|
||||
// aggiungo il costruttore x i vari DbContextFactory
|
||||
var connStr = builder.Configuration.GetConnectionString("MP.Mon")
|
||||
?? throw new InvalidOperationException("ConnString 'MP.Mon' mancante.");
|
||||
builder.Services.AddDbContextFactory<MoonProContext>(options =>
|
||||
options.UseSqlServer(connStr)
|
||||
.EnableSensitiveDataLogging(false) // true solo in Sviluppo
|
||||
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning)));
|
||||
|
||||
// Add services to the container.
|
||||
logger.Info("Setup Services");
|
||||
|
||||
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
|
||||
builder.Services.AddSingleton<MonDataFeeder>();
|
||||
// Init centralizzato Repository/Servizi da MP.Data Services
|
||||
builder.Services.AddMonDataLayer();
|
||||
|
||||
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 8.16.2606.119</h4>
|
||||
<h4>Versione: 8.16.2606.312</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.119
|
||||
8.16.2606.312
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.119</version>
|
||||
<version>8.16.2606.312</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.MON.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
|
||||
}
|
||||
},
|
||||
"NLog": {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>MP.Prog</RootNamespace>
|
||||
<Version>8.16.2606.0119</Version>
|
||||
<Version>8.16.2606.0310</Version>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 8.16.2606.0119</h4>
|
||||
<h4>Versione: 8.16.2606.0310</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.0119
|
||||
8.16.2606.0310
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.0119</version>
|
||||
<version>8.16.2606.0310</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>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.RIOC</RootNamespace>
|
||||
<Version>8.16.2606.119</Version>
|
||||
<Version>8.16.2606.311</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MP-RIOC </i>
|
||||
<h4>Versione: 8.16.2606.119</h4>
|
||||
<h4>Versione: 8.16.2606.311</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.119
|
||||
8.16.2606.311
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.119</version>
|
||||
<version>8.16.2606.311</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/MP.RIOC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Yarp": "Debug",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
@@ -31,10 +31,27 @@ namespace MP.SPEC.Data
|
||||
private readonly IFluxLogRepository _fluxLogRepository;
|
||||
private readonly IProductionRepository _productionRepository;
|
||||
|
||||
public MpDataService(IConfiguration configuration, IFusionCache cache, IAnagRepository anagRepository, ISystemRepository systemRepository, IDossierRepository dossierRepository, IFluxLogRepository fluxLogRepository, IProductionRepository productionRepository)
|
||||
public MpDataService(IConnectionMultiplexer connMPlex, IConfiguration configuration, IFusionCache cache, IAnagRepository anagRepository, ISystemRepository systemRepository, IDossierRepository dossierRepository, IFluxLogRepository fluxLogRepository, IProductionRepository productionRepository)
|
||||
{
|
||||
// salvataggio oggetti
|
||||
_configuration = configuration;
|
||||
redisConn = connMPlex;
|
||||
redisDb = redisConn.GetDatabase();
|
||||
|
||||
#if false
|
||||
// setup compoenti REDIS
|
||||
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis") ?? "localhost:6379");
|
||||
redisConnAdmin = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("RedisAdmin") ?? "localhost:6379");
|
||||
redisDb = redisConn.GetDatabase();
|
||||
#endif
|
||||
// leggo cache lungo/cordo periodo
|
||||
int.TryParse(_configuration.GetValue<string>("ServerConf:redisShortTimeCache"), out redisShortTimeCache);
|
||||
int.TryParse(_configuration.GetValue<string>("ServerConf:redisLongTimeCache"), out redisLongTimeCache);
|
||||
|
||||
// setup MsgPipe
|
||||
BroadastMsgPipe = new MessagePipe(redisConn, Constants.BROADCAST_M_PIPE);
|
||||
Log.Info("MpDataService | Redis OK");
|
||||
|
||||
_cache = cache;
|
||||
_anagRepository = anagRepository;
|
||||
_systemRepository = systemRepository;
|
||||
@@ -524,7 +541,7 @@ namespace MP.SPEC.Data
|
||||
{
|
||||
// Clear database controller
|
||||
mongoController.Dispose();
|
||||
redisConn.Dispose();
|
||||
//redisConn.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2009,7 +2026,7 @@ namespace MP.SPEC.Data
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
private ConnectionMultiplexer redisConn = null!;
|
||||
private IConnectionMultiplexer redisConn = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS modalità admin (ex flux dati)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>8.16.2606.119</Version>
|
||||
<Version>8.16.2606.311</Version>
|
||||
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
+10
-5
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using MP.Data;
|
||||
using MP.SPEC.Components;
|
||||
@@ -159,19 +160,23 @@ builder.Services.AddFusionCache()
|
||||
// Metodi principali x accesso dati
|
||||
var connStr = builder.Configuration.GetConnectionString("MP.Data")
|
||||
?? throw new InvalidOperationException("ConnString 'MP.Data' mancante.");
|
||||
// aggiungo il costruttore x i DbContextFactory
|
||||
// aggiungo il costruttore x i vari DbContextFactory
|
||||
builder.Services.AddDbContextFactory<MoonProContext>(options =>
|
||||
options.UseSqlServer(connStr)
|
||||
.EnableSensitiveDataLogging(false) // true solo in Sviluppo
|
||||
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning)));
|
||||
builder.Services.AddDbContextFactory<MoonPro_VocContext>(options =>
|
||||
options.UseSqlServer(connStr)
|
||||
.EnableSensitiveDataLogging(false) // true solo in Sviluppo
|
||||
.ConfigureWarnings(w => w.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning)));
|
||||
|
||||
// MP.Data Services Utils - Statistiche DB
|
||||
builder.Services.AddSpecDataLayer();
|
||||
|
||||
// altri servizi
|
||||
builder.Services.AddSingleton<MpDataService>();
|
||||
builder.Services.AddSingleton<IOApiService>();
|
||||
builder.Services.AddScoped<MsgServiceSpec>();
|
||||
// servizi del progetto SPEC
|
||||
builder.Services.TryAddScoped<MpDataService>();
|
||||
builder.Services.TryAddSingleton<IOApiService>();
|
||||
builder.Services.TryAddScoped<MsgServiceSpec>();
|
||||
|
||||
#if false
|
||||
builder.Services.AddSingleton<AppAuthService>();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 8.16.2606.119</h4>
|
||||
<h4>Versione: 8.16.2606.311</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.119
|
||||
8.16.2606.311
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.119</version>
|
||||
<version>8.16.2606.311</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>
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
|
||||
"ZiggyCreatures.Caching.Fusion": "Warning"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>MP.Stats</RootNamespace>
|
||||
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
||||
<Version>8.16.2606.0119</Version>
|
||||
<Version>8.16.2606.0311</Version>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 8.16.2606.0119</h4>
|
||||
<h4>Versione: 8.16.2606.0311</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
8.16.2606.0119
|
||||
8.16.2606.0311
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>8.16.2606.0119</version>
|
||||
<version>8.16.2606.0311</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>
|
||||
|
||||
Reference in New Issue
Block a user