Merge branch 'Release/FixLancLicenseMsg02'

This commit is contained in:
Samuele Locatelli
2023-10-16 15:04:03 +02:00
30 changed files with 894 additions and 53 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
using global::Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MongoDB.Driver.Linq;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.Data.Services;
@@ -97,7 +98,9 @@ namespace MP_TAB_SERV.Components
if (RecMSE != null)
{
IdxMaccSel = RecMSE.IdxMacchina;
CurrPeriodo = new Periodo(PeriodSet.ThisWeek);
DateTime fine = DateTime.Today.AddDays(1);
DateTime inizio = fine.AddDays(-8);
CurrPeriodo = new Periodo(inizio, fine);
await doUpdate();
}
var rawDest = config.GetValue<string>("AlarmDest");
+21 -1
View File
@@ -1,5 +1,25 @@
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
<ShowProcessing Message="Caricamento" IsProcessing="@isProcessing"></ShowProcessing>
<div class="card">
<div class="card-header bg-dark">
+28 -15
View File
@@ -27,7 +27,7 @@ namespace MP_TAB_SERV.Components
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMaccSel))
{
ListComplete = await TabDServ.RegControlliFilt(IdxMaccSel, idxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
ListComplete = await TabDServ.RegControlliFilt(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
TotalCount = ListComplete.Count;
// esegue paginazione
UpdateTable();
@@ -38,18 +38,6 @@ namespace MP_TAB_SERV.Components
#endregion Public Methods
#region Protected Fields
protected int idxOdl = 0;
protected bool isProcessing = false;
protected string noteKo = "";
protected int NumRecPage = 10;
protected int PageNum = 1;
protected bool showNote = false;
protected int TotalCount = 0;
#endregion Protected Fields
#region Protected Properties
protected string ConfTitle
@@ -116,11 +104,21 @@ namespace MP_TAB_SERV.Components
protected async Task SetMacc(string selIdxMacc)
{
isProcessing = true;
await Task.Delay(10);
await Task.Delay(1);
IdxMaccSel = selIdxMacc;
await doUpdate();
isProcessing = false;
await Task.Delay(10);
await Task.Delay(1);
}
protected async Task SetOdl(int selIdxOdl)
{
isProcessing = true;
await Task.Delay(1);
IdxOdl = selIdxOdl;
await doUpdate();
isProcessing = false;
await Task.Delay(1);
}
protected async Task SetPeriodo(Periodo newPeriodo)
@@ -162,15 +160,30 @@ namespace MP_TAB_SERV.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool isProcessing = false;
private string noteKo = "";
private int NumRecPage = 10;
private int PageNum = 1;
private bool showInsert = false;
private bool showNote = false;
private int TotalCount = 0;
private bool useOdl = false;
#endregion Private Fields
#region Private Properties
private Periodo CurrPeriodo { get; set; } = new Periodo();
private string IdxMaccSel { get; set; } = "";
private int IdxOdl { get; set; } = 0;
private string selMessage
{
get => useOdl ? "Periodo da ODL" : "Periodo Libero";
}
#endregion Private Properties
}
}
@@ -0,0 +1,29 @@
<div class="row">
<div class="col-8 pe-0">
<div class="input-group">
<span class="input-group-text">Commessa / ODL</span>
<select class="form-select form-select-sm" @bind="@IdxOdlSel">
<option value="0">--- MOSTRA TUTTI ---</option>
@if (ListODL == null)
{
<option value="" disabled>No record found</option>
}
else
{
@foreach (var item in ListODL)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
<div class="col-4 ps-0">
<div class="input-group">
<span class="input-group-text"># ODL</span>
<input class="form-control text-end" @bind="@NumRec" />
</div>
</div>
</div>
@@ -0,0 +1,92 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB_SERV.Components
{
public partial class MachineSelOdl
{
#region Public Properties
[Parameter]
public EventCallback<int> E_OdlSel { get; set; }
[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
{
get => idxOdlSel;
set
{
if (idxOdlSel != value)
{
idxOdlSel = value;
E_OdlSel.InvokeAsync(value).ConfigureAwait(false);
}
}
}
protected List<vSelOdlModel> ListODL { get; set; } = new();
protected int NumRec
{
get => numRec;
set
{
if (numRec != value)
{
numRec = value;
var pUpd = Task.Run(async () =>
{
await ReloadData();
});
pUpd.Wait();
}
}
}
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnParametersSetAsync()
{
await ReloadData();
}
protected async Task ReloadData()
{
isProcessing = true;
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMacchina))
{
ListODL = await TabDServ.VSOdlGetLastByMacc(IdxMacchina, NumRec);
}
isProcessing = false;
await Task.Delay(1);
}
#endregion Protected Methods
#region Private Properties
private int idxOdlSel { get; set; } = 0;
private int numRec { get; set; } = 10;
#endregion Private Properties
}
}
+2 -3
View File
@@ -1,8 +1,7 @@
<h2>Piano Produzione - PODL</h2>
<div class="row">
<div class="col-6">
<h2>Piano Produzione - PODL</h2>
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
</div>
<div class="col-6">
+41
View File
@@ -0,0 +1,41 @@
<div class="card">
<div class="card-header p-0">
<div class="row">
<div class="col-12">
<button class="btn btn-lg bg-info w-100" @onclick="ToggleCtrl">
<i class="fa-solid fa-bug"></i>
&nbsp;
<span class="fs-4 fw-bold">@Title</span>
</button>
</div>
</div>
</div>
@if (ShowDetail)
{
<div class="card-body p-1 bg-dark text-light">
<div class="row">
<div class="col-6">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">Data Ora</span>
<input type="datetime-local" class="form-control" id="floatDate" @bind="@DateSel">
</div>
</div>
<div class="col-6">
<button class="btn btn-warning w-100 align-middle" @onclick="doCancel"><i class="fa-solid fa-ban"></i> Annulla</button>
</div>
<div class="col-12 my-1">
<div class="form-floating">
<textarea type="text" class="form-control" id="floatingComm" style="height: 6rem;" @bind="@UserComment"></textarea>
<label for="floatingComm">Commento</label>
</div>
</div>
<div class="col-12">
@if (CanSave)
{
<button class="btn btn-success w-100" @onclick="doSave"><i class="fa-solid fa-plus"></i> Salva</button>
}
</div>
</div>
</div>
}
</div>
+242
View File
@@ -0,0 +1,242 @@
using global::System;
using global::System.Collections.Generic;
using global::System.Linq;
using global::System.Threading.Tasks;
using global::Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP_TAB_SERV;
using MP_TAB_SERV.Shared;
using MP_TAB_SERV.Components;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.Data.Services;
using Newtonsoft.Json;
using NLog;
namespace MP_TAB_SERV.Components
{
public partial class ScrapEditor
{
#region Public Properties
[Parameter]
public bool CanSave { get; set; } = false;
[Parameter]
public EventCallback<string> E_CommRec { get; set; }
[Parameter]
public EventCallback<DateTime> E_DateSel { get; set; }
[Parameter]
public EventCallback<bool> E_Updated { get; set; }
[Parameter]
public MappaStatoExpl? RecMSE { get; set; } = null;
protected string Title
{
get => ShowDetail? "Nascondi Registrazione Scarti": "Mostra Registrazione Scarti";
}
[Parameter]
public EventListModel? CurrRecord
{
set
{
if (value != null)
{
DateSel = value.InizioStato ?? DateTime.Now;
UserComment = value.Value;
ShowDetail = false;
}
}
}
#endregion Public Properties
#region Protected Properties
protected DateTime DateSel
{
get => dateSel.Round(TimeSpan.FromSeconds(1));
set
{
if (dateSel != value)
{
dateSel = value;
E_DateSel.InvokeAsync(value).ConfigureAwait(false);
}
}
}
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
[Inject]
protected TabDataService TabServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected void doCancel()
{
DoReset();
}
/// <summary>
/// Forza salvataggio impostando data-ora
/// </summary>
/// <param name="dtRif"></param>
/// <returns></returns>
public async Task ForceSave(DateTime dtRif)
{
DateSel = dtRif;
// ora salvo
await doSave();
}
protected async Task doSave()
{
// registro evento
EventListModel newRec = new EventListModel()
{
IdxMacchina = IdxMacc,
InizioStato = DateSel,
IdxTipo = idxTipoCommento,
CodArticolo = CodArt,
Value = UserComment,
MatrOpr = MatrOpr,
pallet = "-"
};
// elimino vecchio se c'è...
await TabServ.EvListDelete(IdxMacc, DateSel, idxTipoCommento);
// inserisco
await TabServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.commento);
// reset
DoReset();
//ToggleCtrl();
await E_Updated.InvokeAsync(true);
}
protected override void OnInitialized()
{
idxTipoCommento = SMServ.GetConfInt("idxTipoCommento");
dltMinRealtime = SMServ.GetConfInt("dltMinRealtime");
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
// verifico SE ci sia una data da usare...
bool hasDtRif = await MServ.SessHasVal(MessageService.KeyCommDtRif);
if (hasDtRif)
{
await Task.Delay(1);
ShowDetail = false;
UserComment = await MServ.CommentoValGet(true);
DateSel = await MServ.CommentoDtRifGet(true);
await InvokeAsync(StateHasChanged);
}
}
protected int dltMinRealtime = 1;
/// <summary>
/// Determina se insert sia Realtime o batch con DataOra (in base a diff tra DataOra
/// selezionata e realtime, se superiore ad X minuti NON realtime)
/// </summary>
protected bool insRealtime
{
get
{
bool answ = true;
try
{
if (Math.Abs(DateSel.Subtract(DateTime.Now).TotalMinutes) > dltMinRealtime)
{
answ = false;
}
}
catch
{ }
return answ;
}
}
protected void ToggleCtrl()
{
ShowDetail = !ShowDetail;
if (ShowDetail)
{
DateSel = DateTime.Now;
}
}
#endregion Protected Methods
#region Private Fields
private int idxTipoCommento = 0;
#endregion Private Fields
#region Private Properties
private string CodArt
{
get => RecMSE != null ? RecMSE.CodArticolo : "";
}
private DateTime dateSel { get; set; } = DateTime.Now;
private string IdxMacc
{
get => RecMSE != null ? RecMSE.IdxMacchina : "";
}
private int MatrOpr
{
get => MServ.MatrOpr;
}
private bool ShowDetail { get; set; } = true;
private string userComment { get; set; } = "";
private string UserComment
{
get => userComment.Trim();
set
{
if (userComment != value)
{
userComment = value;
E_CommRec.InvokeAsync(value).ConfigureAwait(false);
}
}
}
#endregion Private Properties
#region Private Methods
private void DoReset()
{
UserComment = "";
DateSel = DateTime.Now;
ShowDetail = true;
}
#endregion Private Methods
}
}
+122 -2
View File
@@ -1,5 +1,125 @@
<h3>ScrapMan</h3>
<ScrapEditor CanSave="true" RecMSE="@RecMSE" E_Updated="doUpdate"></ScrapEditor>
@code {
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
<ShowProcessing Message="Caricamento" IsProcessing="@isProcessing"></ShowProcessing>
<div class="card">
<div class="card-header bg-dark">
<button class="btn btn-primary btn-lg text-light w-100" @onclick="ToggleBtn">
<i class="fa fa-wrench"></i> @ConfTitle
</button>
@if (showInsert)
{
@if (showNote)
{
<div class="row">
<div class="col-12">
<div class="">
@* </div>
<div class="form-floating"> *@
<label class="form-label text-light">Note controllo NON superato (opzionali)</label>
<textarea class="form-control" @bind="@noteKo" style="height: 6rem;"></textarea>
</div>
</div>
<div class="col-12">
<button class="btn btn-danger btn-lg w-100" @onclick="SaveKo">Conferma controllo KO</button>
</div>
</div>
}
else
{
<div class="row my-2">
<div class="col-6">
<button class="btn btn-success w-100" @onclick="SaveOk">OK</button>
</div>
<div class="col-6">
<button class="btn btn-danger w-100" @onclick="ShowKo">KO</button>
</div>
</div>
}
}
</div>
<div class="card-body bg-secondary p-1">
<div class="row">
<div class="col-12">
<table class="table table-dark table-sm table-striped">
<thead>
<tr class="text-start1">
<th>
Elenco Controlli
</th>
</tr>
</thead>
<tbody>
@foreach (var item in ListPaged)
{
<tr>
<td>
<div class="row">
<div class="col-5 small">
<div>
Art: <b>@item.CodArticolo</b>
</div>
<div>
ODL: <b>@($"ODL{item.IdxOdl:000000000}")</b>
</div>
</div>
<div class="col-2 px-0 text-center">
@if (item.EsitoOk)
{
<i runat="server" class="fa fa-check-circle fs-1 text-success" aria-hidden="true"></i>
}
else
{
<i runat="server" class="fa fa-ban fs-1 text-danger" aria-hidden="true"></i>
}
</div>
<div class="col-5 text-end small">
<div class="text-truncate">
@($"{item.DataOra:ddd dd.MM.yy HH:mm:ss}") <i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
<div class="text-truncate">
<b>@item.Operatore</b>
<i class="fa fa-user" aria-hidden="true"></i>
</div>
</div>
<div class="col-12 small">
@if (!string.IsNullOrEmpty(item.Note))
{
<div class="text-warning">@item.Note</div>
}
</div>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
<div class="cad-footer">
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</div>
</div>
+189
View File
@@ -0,0 +1,189 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
using static EgwCoreLib.Utils.DtUtils;
namespace MP_TAB_SERV.Components
{
public partial class ScrapMan
{
#region Public Properties
[Parameter]
public MappaStatoExpl? RecMSE { get; set; } = null;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Aggiorno valori produzione alla data richiesta...
/// </summary>
/// <param name="newDate"></param>
public async Task doUpdate()
{
isProcessing = true;
await Task.Delay(1);
if (!string.IsNullOrEmpty(IdxMaccSel))
{
ListComplete = await TabDServ.RegControlliFilt(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false);
TotalCount = ListComplete.Count;
// esegue paginazione
UpdateTable();
}
isProcessing = false;
await Task.Delay(1);
}
#endregion Public Methods
#region Protected Properties
protected string ConfTitle
{
get => showInsert ? "Nascondi Controllo" : "Registra Controllo";
}
protected List<RegistroControlliModel> ListComplete { get; set; } = new List<RegistroControlliModel>();
protected List<RegistroControlliModel> ListPaged { get; set; } = new List<RegistroControlliModel>();
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
if (RecMSE != null)
{
IdxMaccSel = RecMSE.IdxMacchina;
CurrPeriodo = new Periodo(PeriodSet.ThisWeek);
await doUpdate();
}
}
protected async Task SaveKo()
{
isProcessing = true;
await TabDServ.RegControlliInsert(IdxMaccSel, MServ.MatrOpr, false, noteKo, DateTime.Now);
showInsert = false;
showNote = false;
await doUpdate();
isProcessing = false;
}
protected void SaveNumRec(int newNum)
{
NumRecPage = newNum;
UpdateTable();
}
protected async Task SaveOk()
{
isProcessing = true;
await TabDServ.RegControlliInsert(IdxMaccSel, MServ.MatrOpr, true, noteKo, DateTime.Now);
showInsert = false;
showNote = false;
await doUpdate();
isProcessing = false;
}
protected void SavePage(int newNum)
{
PageNum = newNum;
UpdateTable();
}
protected async Task SetMacc(string selIdxMacc)
{
isProcessing = true;
await Task.Delay(1);
IdxMaccSel = selIdxMacc;
await doUpdate();
isProcessing = false;
await Task.Delay(1);
}
protected async Task SetOdl(int selIdxOdl)
{
isProcessing = true;
await Task.Delay(1);
IdxOdl = selIdxOdl;
await doUpdate();
isProcessing = false;
await Task.Delay(1);
}
protected async Task SetPeriodo(Periodo newPeriodo)
{
CurrPeriodo = newPeriodo;
await doUpdate();
}
protected void ShowKo()
{
showNote = true;
}
protected void ToggleBtn()
{
showInsert = !showInsert;
if (showInsert)
{
noteKo = "";
showNote = false;
}
}
protected void UpdateTable()
{
// esegue paginazione
if (TotalCount > NumRecPage)
{
ListPaged = ListComplete.Skip((PageNum - 1) * NumRecPage).Take(NumRecPage).ToList();
}
else
{
ListPaged = ListComplete;
}
}
#endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool isProcessing = false;
private string noteKo = "";
private int NumRecPage = 10;
private int PageNum = 1;
private bool showInsert = false;
private bool showNote = false;
private int TotalCount = 0;
private bool useOdl = false;
#endregion Private Fields
#region Private Properties
private Periodo CurrPeriodo { get; set; } = new Periodo();
private string IdxMaccSel { get; set; } = "";
private int IdxOdl { get; set; } = 0;
private string selMessage
{
get => useOdl ? "Periodo da ODL" : "Periodo Libero";
}
#endregion Private Properties
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2310.1318</Version>
<Version>6.16.2310.1614</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB_SERV</RootNamespace>
</PropertyGroup>
+1 -3
View File
@@ -6,8 +6,6 @@
}
else
{
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<DeclarMan></DeclarMan>
}
+1 -3
View File
@@ -6,9 +6,7 @@
}
else
{
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<ProdStat RecMSE="CurrMSE"></ProdStat>
<PrintMag RecMSE="CurrMSE"></PrintMag>
<ProdConfirm RecMSE="CurrMSE" E_newVal="RefreshMBlock"></ProdConfirm>
+1 -3
View File
@@ -6,9 +6,7 @@
}
else
{
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<NotesMan RecMSE="CurrMSE"></NotesMan>
}
+1 -3
View File
@@ -6,8 +6,6 @@
}
else
{
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<ProdPlanMan RecMSE="CurrMSE"></ProdPlanMan>
}
+2 -4
View File
@@ -6,8 +6,6 @@
}
else
{
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<ProdStopMan></ProdStopMan>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<ScrapMan RecMSE="CurrMSE"></ScrapMan>
}
+4
View File
@@ -9,12 +9,16 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="description" content="MP TAB" />
<meta name="author" content="EgalWare" />
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="lib/font-awesome/css/all.min.css" />
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/font.min.css" />
<link rel="stylesheet" href="css/site.css" />
@* <link rel="shortcut icon" href="images/favicon.ico" /> *@
<link type="image/x-icon" href="images/favicon.ico" rel="shortcut icon" />
<link href="MP-TAB-SERV.styles.css" rel="stylesheet" />
<component type="typeof(HeadOutlet)" render-mode="Server" />
@* <component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" /> *@
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2310.1318</h4>
<h4>Versione: 6.16.2310.1614</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2310.1318
6.16.2310.1614
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2310.1318</version>
<version>6.16.2310.1614</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+23
View File
@@ -1042,6 +1042,29 @@ namespace MP.Data.Controllers
return answ;
}
/// <summary>
/// Elenco ultimi ODL x macchina
/// </summary>
/// <param name="idxMacchina">Macchina</param>
/// <param name="numRec"></param>
/// <returns></returns>
public List<vSelOdlModel> VSOdlGetLastByMacc(string idxMacchina, int numRec)
{
List<vSelOdlModel> dbResult = new List<vSelOdlModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
var NumRec = new SqlParameter("@numRec", numRec);
dbResult = dbCtx
.DbSetVSODL
.FromSqlRaw("EXEC stp_vsODL_getLastByMacc @IdxMacchina, @numRec", IdxMacc, NumRec)
.AsNoTracking()
.ToList();
}
return dbResult;
}
#endregion Public Methods
#region Private Fields
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class vSelOdlModel
{
[Key]
public int value { get; set; } = 0;
public string label { get; set; } = "";
public DateTime conditio { get; set; } = DateTime.Now;
}
}
+10 -2
View File
@@ -84,12 +84,14 @@ namespace MP.Data
public virtual DbSet<ST_Template> DbSetStTemplate { get; set; }
public virtual DbSet<ST_TemplateRows> DbSetStTemplateRows { get; set; }
public virtual DbSet<vSelEventiBCodeModel> DbSetVSEB { get; set; }
public virtual DbSet<CommentiModel> DbSetCommenti { get; set; }
public virtual DbSet<FermiNonQualModel> DbSetFNQ { get; set; }
public virtual DbSet<vSelEventiBCodeModel> DbSetVSEB { get; set; }
public virtual DbSet<vSelOdlModel> DbSetVSODL { get; set; }
#endregion Public Properties
#region Private Methods
@@ -544,6 +546,12 @@ namespace MP.Data
{
entity.HasKey(e => new { e.IdxMacchina, e.InizioStato });
});
modelBuilder.Entity<vSelOdlModel>(entity =>
{
//entity.HasKey(e => e.value);
entity.ToView("v_selODL");
});
OnModelCreatingPartial(modelBuilder);
}
+36
View File
@@ -1163,6 +1163,42 @@ namespace MP.Data.Services
return result;
}
/// <summary>
/// Elenco ultimi ODL x macchina
/// </summary>
/// <param name="idxMacchina">Macchina</param>
/// <param name="numRec"></param>
/// <returns></returns>
public async Task<List<vSelOdlModel>> VSOdlGetLastByMacc(string idxMacchina, int numRec)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<vSelOdlModel>? result = new List<vSelOdlModel>();
// cerco in redis...
string currKey = $"{redisBaseKey}:VSODL:{idxMacchina}:{numRec}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<vSelOdlModel>>($"{rawData}");
source = "REDIS";
}
else
{
result = await Task.FromResult(dbTabController.VSOdlGetLastByMacc(idxMacchina, numRec));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
result = new List<vSelOdlModel>();
}
sw.Stop();
Log.Debug($"VSOdlGetLastByMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
#endregion Public Methods
#region Protected Fields
+13 -3
View File
@@ -34,10 +34,20 @@ else // disegno box cliccabile e licenza ASSISTENZA mancante
{
<div class="card">
<div class="card-header">
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="btn btn-outline-info btn-block" title="Apri">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
@if (hasLic())
{
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="btn btn-outline-info btn-block" title="Apri">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
<h3 class="mb-0">@CurrItem.AppName&nbsp;</h3>
</a>
</a>
}
else
{
<button class="btn btn-outline-secondary btn-block" title="Manca Licenza" disabled>
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
<h3 class="mb-0">@CurrItem.AppName</h3>
</button>
}
</div>
<div class="card-body">
<div class="row text-muted">
+5 -2
View File
@@ -46,7 +46,6 @@ namespace MP.Land.Components
protected bool authOk()
{
//return false;
bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey);
if (allOk)
{
@@ -56,7 +55,11 @@ namespace MP.Land.Components
MService.YearAuth = true;
}
}
return allOk;
}
protected bool hasLic()
{
bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey);
return allOk;
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.16.2310.1610</Version>
<Version>6.16.2310.1615</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.16.2310.1610</h4>
<h4>Versione: 6.16.2310.1615</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2310.1610
6.16.2310.1615
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2310.1610</version>
<version>6.16.2310.1615</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>