diff --git a/MP-TAB3/Components/FixOdl.razor.cs b/MP-TAB3/Components/FixOdl.razor.cs index 4e42017b..246b506c 100644 --- a/MP-TAB3/Components/FixOdl.razor.cs +++ b/MP-TAB3/Components/FixOdl.razor.cs @@ -37,8 +37,8 @@ namespace MP_TAB3.Components get => showFixOdl ? "fa-chevron-up" : "fa-chevron-down"; } - protected List ListComplete { get; set; } = new List(); - protected List ListPaged { get; set; } = new List(); + protected List ListComplete { get; set; } = new List(); + protected List ListPaged { get; set; } = new List(); [Inject] protected MessageService MServ { get; set; } = null!; diff --git a/MP-TAB3/Components/MachineSelOdl.razor.cs b/MP-TAB3/Components/MachineSelOdl.razor.cs index 6d92ec57..0dc5e4a6 100644 --- a/MP-TAB3/Components/MachineSelOdl.razor.cs +++ b/MP-TAB3/Components/MachineSelOdl.razor.cs @@ -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 ListODL { get; set; } = new(); protected int NumRec diff --git a/MP-TAB3/Components/ProdConfMan.razor b/MP-TAB3/Components/ProdConfMan.razor index a93678d9..43e9bd1b 100644 --- a/MP-TAB3/Components/ProdConfMan.razor +++ b/MP-TAB3/Components/ProdConfMan.razor @@ -17,7 +17,7 @@ @if (useOdl) { - + } else { @@ -27,52 +27,11 @@
- @* - - - - - - - - @if (ShowRilav) - { - - } - - - - - @foreach (var item in ListPaged) - { - var actOdl = ActiveOdl(item.DataTo); - - - - - - - - @if (ShowRilav) - { - - } - - - } - -
DataOraODL/CommArticolo# Pz Conf# Pz Scarto# Pz RilavOperatore
-
@($"{item.DataOraConf:yyyy-MM-dd}")
-
@($"{item.DataOraConf:ddd, HH:mm:ss}")
-
-
@($"ODL{actOdl.IdxOdl:00000000}")
-
@item.CommessaEsterna
-
@actOdl.CodArticolo@item.PezziConf@item.PezziScar@item.PezziDaRilav@OperDto(item.MatrApp)
*@ - + @if (ShowRilav) { @@ -87,27 +46,26 @@ var actOdl = ActiveOdl(item.DataTo); - - @* *@ @if (ShowRilav) { - + } } diff --git a/MP-TAB3/Components/ProdConfMan.razor.cs b/MP-TAB3/Components/ProdConfMan.razor.cs index 932688c6..5238d0cd 100644 --- a/MP-TAB3/Components/ProdConfMan.razor.cs +++ b/MP-TAB3/Components/ProdConfMan.razor.cs @@ -22,11 +22,39 @@ namespace MP_TAB3.Components [Parameter] public MappaStatoExplModel? RecMSE { get; set; } = null; - [Parameter] - public bool ShowRilav { get; set; } = false; - #endregion Public Properties + /// + /// Init da valori configurazione + /// + 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); + } + + /// + /// Indica se mostrare rilavorati in conferma produzione + /// + private bool ShowRilav = false; + + /// + /// Indica se partire da ultimo ODL x definire ultimo periodo... + /// + private bool ShowLastOdl = false; + + /// + /// Indica se mostrare descrizione articolo su 3° riga + /// + private bool ShowArtDescr = false; + + /// + /// Indica se mostrare CodExt (commessa) su 3° riga + /// + private bool ShowExtCode = false; + #region Public Methods public void Dispose() @@ -62,6 +90,7 @@ namespace MP_TAB3.Components protected override async Task OnInitializedAsync() { await Task.Delay(1); + InitConfig(); await ReloadBaseList(); if (RecMSE != null) { @@ -75,7 +104,7 @@ namespace MP_TAB3.Components IdxMaccSel = idxMSel; } } - setupPeriodo(); + await setupPeriodo(); await ReloadData(); } } @@ -163,7 +192,7 @@ namespace MP_TAB3.Components private bool isProcessing = false; - private List ListaOdl = new List(); + private List ListaOdl = new List(); private List ListaOper = new List(); @@ -248,20 +277,20 @@ namespace MP_TAB3.Components #region Private Methods - private ODLModel ActiveOdl(DateTime dtRif) + private ODLExpModel ActiveOdl(DateTime dtRif) { var recOdl = ListaOdl .Where(x => x.DataInizio <= dtRif && (x.DataFine >= dtRif || x.DataFine == null)) .FirstOrDefault(); - return recOdl ?? new ODLModel(); + return recOdl ?? new ODLExpModel(); } - private ODLModel GetOdl(int idxOdl) + private ODLExpModel GetOdl(int idxOdl) { var recOdl = ListaOdl .Where(x => x.IdxOdl == idxOdl) .FirstOrDefault(); - return recOdl ?? new ODLModel(); + return recOdl ?? new ODLExpModel(); } private string OperDto(int matr) @@ -305,7 +334,7 @@ namespace MP_TAB3.Components DictOpr.Add(matr, answ); } return (MarkupString)answ; - } + } #endif /// @@ -327,7 +356,7 @@ namespace MP_TAB3.Components await Task.Delay(1); if (!string.IsNullOrEmpty(IdxMaccSel)) { - ListaOdl = await TabDServ.OdlListByMaccPeriodo(IdxMaccSel, CurrPeriodo.Inizio, CurrPeriodo.Fine); + 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 @@ -336,13 +365,35 @@ namespace MP_TAB3.Components isProcessing = false; } - private void setupPeriodo() + private async Task setupPeriodo() { - DateTime fine = DateTime.Today.AddDays(1); - DateTime inizio = fine.AddDays(-7); - CurrPeriodo = new Periodo(inizio, fine); + 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 } } \ No newline at end of file diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index 6da0ba3a..55e3a07e 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2507.2417 + 6.16.2507.2814 enable MP_TAB3 diff --git a/MP-TAB3/Pages/ProdConf.razor.cs b/MP-TAB3/Pages/ProdConf.razor.cs index e2dfaf87..266c027b 100644 --- a/MP-TAB3/Pages/ProdConf.razor.cs +++ b/MP-TAB3/Pages/ProdConf.razor.cs @@ -1,3 +1,7 @@ + +using Microsoft.AspNetCore.Components; +using MP.Data.Services; + namespace MP_TAB3.Pages { public partial class ProdConf @@ -17,6 +21,7 @@ namespace MP_TAB3.Pages await ReloadData(); } + protected void SetMacc(string selIdxMacc) { IdxMaccSubSel = selIdxMacc; diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index b4229754..5380e47a 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2507.2417

+

Versione: 6.16.2507.2814


Note di rilascio:
  • diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt index 83372e5b..3fdea622 100644 --- a/MP-TAB3/Resources/VersNum.txt +++ b/MP-TAB3/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2507.2417 +6.16.2507.2814 diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml index e701ed03..4d01499a 100644 --- a/MP-TAB3/Resources/manifest.xml +++ b/MP-TAB3/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2507.2417 + 6.16.2507.2814 https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html false diff --git a/MP.Data/Controllers/MpTabController.cs b/MP.Data/Controllers/MpTabController.cs index e2188dd4..3624e8e2 100644 --- a/MP.Data/Controllers/MpTabController.cs +++ b/MP.Data/Controllers/MpTabController.cs @@ -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 /// /// /// - public List OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) + public List OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) { - List dbResult = new List(); + List dbResult = new List(); 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(); diff --git a/MP.Data/Services/MessageService.cs b/MP.Data/Services/MessageService.cs index 78353e0c..eb231f55 100644 --- a/MP.Data/Services/MessageService.cs +++ b/MP.Data/Services/MessageService.cs @@ -1,11 +1,7 @@ using Blazored.LocalStorage; using Blazored.SessionStorage; using EgwCoreLib.Utils; -using Microsoft.AspNetCore.Components; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; using Microsoft.Extensions.Configuration; -using MP.AppAuth.Services; -using MP.Data.Controllers; using MP.Data.DbModels; using MP.Data.DTO; using Newtonsoft.Json; diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs index e144f6a1..54c445b5 100644 --- a/MP.Data/Services/TabDataService.cs +++ b/MP.Data/Services/TabDataService.cs @@ -1981,23 +1981,23 @@ namespace MP.Data.Services /// /// /// - public async Task> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) + public async Task> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) { string source = "DB"; Stopwatch sw = new Stopwatch(); sw.Start(); - List? result = new List(); + List? result = new List(); // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:{dtStart:yyyyMMdd-HHmmss}:{dtEnd:yyyyMMdd-HHmmss}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); source = "REDIS"; } else { - result = await Task.FromResult(dbTabController.OdlListByMaccPeriodo(idxMacchina, dtStart, dtEnd)); + result = dbTabController.OdlListByMaccPeriodo(idxMacchina, dtStart, dtEnd); // riordino result = result.OrderByDescending(x => x.DataInizio).ToList(); // serializzo e salvo... @@ -2006,7 +2006,7 @@ namespace MP.Data.Services } if (result == null) { - result = new List(); + result = new List(); } sw.Stop(); Log.Debug($"OdlListByMaccPeriodo | {source} | {sw.Elapsed.TotalMilliseconds}ms");
Art/ODL# Pz Conf# Pz Buoni # Pz Scarto
-
- Art: @actOdl.CodArticolo -
-
- ODL: @($"ODL{actOdl.IdxOdl:000000000}") -
+
Art: @actOdl.CodArticolo
+
ODL: @($"ODL{actOdl.IdxOdl:000000000}")
+ @if (ShowExtCode) + { +
@item.CommessaEsterna
+ }
-
@($"ODL{actOdl.IdxOdl:00000000}")
-
@item.CommessaEsterna
-
@item.PezziConf @item.PezziScar@item.PezziDaRilav@item.PezziDaRilav
@($"{item.DataOraConf:ddd yyyy-MM-dd HH:mm:ss}")
@OperDto(item.MatrApp)
+ @if (ShowArtDescr) + { +
@actOdl.DescArticolo
+ }