Aggiunta opzioni da config x visualizzaione conf pezzi + update su IIS01

This commit is contained in:
Samuele E. Locatelli
2025-07-28 15:07:02 +02:00
parent 8e36976860
commit 2fcbe4c158
12 changed files with 116 additions and 103 deletions
+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!;
+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
+13 -55
View File
@@ -17,7 +17,7 @@
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl" IdxOdlSel="@idxOdlLast"></MachineSelOdl>
}
else
{
@@ -27,52 +27,11 @@
<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>DataOra</th>
<th>ODL/Comm</th>
<th>Articolo</th>
<th class="text-end"># Pz Conf</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>@($"{item.DataOraConf:yyyy-MM-dd}")</div>
<div>@($"{item.DataOraConf:ddd, HH:mm:ss}")</div>
</td>
<td class="text-nowrap">
<div>@($"ODL{actOdl.IdxOdl:00000000}")</div>
<div>@item.CommessaEsterna</div>
</td>
<td class="fs-4 fw-bold">@actOdl.CodArticolo</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="text-end">@item.PezziDaRilav</td>
}
<td class="text-end">@OperDto(item.MatrApp)</td>
</tr>
}
</tbody>
</table> *@
<table class="table table-dark table-sm table-striped">
<thead>
<tr class="text-start1">
<th>Art/ODL</th>
<th class="text-end"># Pz Conf</th>
<th class="text-end"># Pz Buoni</th>
<th class="text-end"># Pz Scarto</th>
@if (ShowRilav)
{
@@ -87,27 +46,26 @@
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>
<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="text-nowrap">
<div>@($"ODL{actOdl.IdxOdl:00000000}")</div>
<div>@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="text-end">@item.PezziDaRilav</td>
<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>
}
+66 -15
View File
@@ -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
/// <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()
@@ -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<ODLModel> ListaOdl = new List<ODLModel>();
private List<ODLExpModel> ListaOdl = new List<ODLExpModel>();
private List<AnagOperatoriModel> ListaOper = new List<AnagOperatoriModel>();
@@ -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
/// <summary>
@@ -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
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2507.2417</Version>
<Version>6.16.2507.2814</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+5
View File
@@ -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;
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2507.2417</h4>
<h4>Versione: 6.16.2507.2814</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2507.2417
6.16.2507.2814
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2507.2417</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>
+7 -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();
-4
View File
@@ -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;
+5 -5
View File
@@ -1981,23 +1981,23 @@ namespace MP.Data.Services
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public async Task<List<ODLModel>> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd)
public async Task<List<ODLExpModel>> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<ODLModel>? result = new List<ODLModel>();
List<ODLExpModel>? result = new List<ODLExpModel>();
// 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<List<ODLModel>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<ODLExpModel>>($"{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<ODLModel>();
result = new List<ODLExpModel>();
}
sw.Stop();
Log.Debug($"OdlListByMaccPeriodo | {source} | {sw.Elapsed.TotalMilliseconds}ms");