ok pagina commenti
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
<div class="col-4 my-1 p-2">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-start" style="font-size: 1.8rem;">
|
||||
Fermo Generico
|
||||
<div class="card-body @fnqSemaforo">
|
||||
<div class="text-start fw-bold" style="font-size: 1.8rem;">
|
||||
@fnqName
|
||||
</div>
|
||||
<div class="text-end" style="font-size: 1.5rem;">
|
||||
NCC_1701E
|
||||
@fnqArticle
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
<div class="card-footer d-flex justify-content-between bg-dark text-light">
|
||||
<div>
|
||||
@*@($"{item.InizioStato:yyyy/MM/dd HH:mm:ss}")*@
|
||||
09.10.2023 00:30
|
||||
@($"{fnqDateTime:yyyy/MM/dd HH:mm:ss}")
|
||||
@*09.10.2023 00:30*@
|
||||
</div>
|
||||
<div>
|
||||
7h 30m
|
||||
@*7h 30m*@
|
||||
@(fnqDurMin)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,5 +24,19 @@
|
||||
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string fnqName { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public string fnqArticle { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public DateTime fnqDateTime { get; set; } = DateTime.Now;
|
||||
|
||||
[Parameter]
|
||||
public double fnqDurMin { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public string fnqSemaforo { get; set; } = "";
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,48 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-9">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="input-group my-1">
|
||||
<span class="input-group-text" id="basic-addon1">Ultimi gg</span>
|
||||
<select class="form-select" @bind="@NumGiorni">
|
||||
@for (int i = 1; i < 11; i++)
|
||||
{
|
||||
<option label="@i" value="@i"></option>
|
||||
|
||||
}
|
||||
<option label="15" value="15"></option>
|
||||
<option label="30" value="30"></option>
|
||||
<option label="60" value="60"></option>
|
||||
<option label="90" value="90"></option>
|
||||
<option label="180" value="180"></option>
|
||||
<option label="360" value="360"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="input-group my-1">
|
||||
<span class="input-group-text" id="basic-addon1">Durata min</span>
|
||||
<select class="form-select" @bind="@DurataMin">
|
||||
@for (int i = 1; i < 7; i++)
|
||||
{
|
||||
<option label="@(5*i)'" value="@(5*i)"></option>
|
||||
|
||||
}
|
||||
<option label="2h" value="120"></option>
|
||||
<option label="4h" value="240"></option>
|
||||
<option label="8h" value="480"></option>
|
||||
<option label="1gg" value="1440"></option>
|
||||
<option label="2gg" value="2880"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between flex-wrap">
|
||||
@for (int i = 0; i < 8; i++)
|
||||
@foreach (var item in RecordListFnq)
|
||||
{
|
||||
<LongStopList></LongStopList>
|
||||
<LongStopList fnqName="@item.Stato" fnqArticle="@item.CodArticolo" fnqDateTime="@item.InizioStato" fnqDurMin="@item.DurataMinuti" fnqSemaforo="@setSemaforo(item.Semaforo)"></LongStopList>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -19,17 +56,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
@if (RecordList == null)
|
||||
@if (RecordListComments == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
}
|
||||
else if (RecordList.Count == 0)
|
||||
else if (RecordListComments.Count == 0)
|
||||
{
|
||||
<div class="alert alert-warning">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in RecordList)
|
||||
foreach (var item in RecordListComments)
|
||||
{
|
||||
<div class="my-1 w-100">
|
||||
<div class="card text-white w-100" style="font-size: 1.5rem">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data.Services;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
@@ -23,13 +24,40 @@ namespace MP_TAB_SERV.Components
|
||||
if (numComm != value)
|
||||
{
|
||||
numComm = value;
|
||||
ReloadData().ConfigureAwait(false);
|
||||
ReloadComments().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
protected int NumGiorni
|
||||
{
|
||||
get => _numGiorni;
|
||||
set
|
||||
{
|
||||
if (_numGiorni != value)
|
||||
{
|
||||
_numGiorni = value;
|
||||
ReloadFnq().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
protected int DurataMin
|
||||
{
|
||||
get => _durataMin;
|
||||
set
|
||||
{
|
||||
if (_durataMin != value)
|
||||
{
|
||||
_durataMin = value;
|
||||
ReloadFnq().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
private int numComm { get; set; } = 10;
|
||||
private int _numGiorni { get; set; } = 3;
|
||||
private int _durataMin { get; set; } = 30;
|
||||
|
||||
protected List<CommentiModel> RecordList { get; set; } = new List<CommentiModel>();
|
||||
protected List<CommentiModel> RecordListComments { get; set; } = new List<CommentiModel>();
|
||||
protected List<FnqDTO> RecordListFnq { get; set; } = new List<FnqDTO>();
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabServ { get; set; } = null!;
|
||||
@@ -40,26 +68,49 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
await ReloadComments();
|
||||
await ReloadFnq();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ReloadData()
|
||||
private async Task ReloadComments()
|
||||
{
|
||||
RecordList = await TabServ.CommentiGetLastByMacc(RecMSE?.IdxMacchina, NumComm);
|
||||
RecordListComments = await TabServ.CommentiGetLastByMacc(RecMSE?.IdxMacchina, NumComm);
|
||||
}
|
||||
private async Task ReloadFnq()
|
||||
{
|
||||
RecordListFnq = await TabServ.FnqGetByFilt(RecMSE?.IdxMacchina, NumGiorni, DurataMin);
|
||||
}
|
||||
|
||||
private async Task DoUpdate(bool forceReload)
|
||||
{
|
||||
if (forceReload)
|
||||
{
|
||||
await ReloadData();
|
||||
await ReloadComments();
|
||||
}
|
||||
}
|
||||
|
||||
private string setSemaforo(string sem)
|
||||
{
|
||||
string answ = "";
|
||||
if(sem == "sBl")
|
||||
{
|
||||
answ = "bg-primary text-warning";
|
||||
}
|
||||
else if(sem == "sGr")
|
||||
{
|
||||
answ = "bg-secondary text-dark";
|
||||
}
|
||||
else if(sem == "sGi")
|
||||
{
|
||||
answ = "bg-warning text-dark";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2310.910</Version>
|
||||
<Version>6.16.2310.912</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2310.910</h4>
|
||||
<h4>Versione: 6.16.2310.912</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.910
|
||||
6.16.2310.912
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.910</version>
|
||||
<version>6.16.2310.912</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>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -355,6 +356,31 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera elenco ultime fermate non frequenti
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="numGg"></param>
|
||||
/// <param name="durataMin"></param>
|
||||
/// <returns></returns>
|
||||
public List<FnqDTO> FnqGetByFilt(string idxMacchina, int numGg, int durataMin)
|
||||
{
|
||||
List<FnqDTO> dbResult = new List<FnqDTO>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var NumGg = new SqlParameter("@gg", numGg);
|
||||
var DurataMin = new SqlParameter("@durataMin", durataMin);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetFnq
|
||||
.FromSqlRaw("exec dbo.stp_FNQ_getFilt @IdxMacchina, @gg, @durataMin", IdxMacchina, NumGg, DurataMin)
|
||||
.AsNoTracking()
|
||||
.AsEnumerable()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MP.Data.DTO
|
||||
{
|
||||
public class FnqDTO
|
||||
{
|
||||
[Key]
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
public DateTime InizioStato { get; set; } = DateTime.Now;
|
||||
public string Macchina { get; set; } = "";
|
||||
public int IdxStato { get; set; } = 0;
|
||||
public string Stato { get; set; } = "";
|
||||
public string Semaforo { get; set; } = "";
|
||||
public double DurataMinuti { get; set; } = 0;
|
||||
public string Value { get; set; } = "";
|
||||
public string CodArticolo { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
@@ -56,6 +57,7 @@ namespace MP.Data
|
||||
public virtual DbSet<PzProdModel> DbSetPzProd { get; set; }
|
||||
public virtual DbSet<EventListModel> DbSetEvList { get; set; }
|
||||
public virtual DbSet<DiarioDiBordoModel> DbSetDDB { get; set; }
|
||||
public virtual DbSet<FnqDTO> DbSetFnq { get; set; }
|
||||
public virtual DbSet<VocabolarioModel> DbSetVocabolario { get; set; }
|
||||
public virtual DbSet<AnagOperatoriModel> DbOperatori { get; set; }
|
||||
public virtual DbSet<Gruppi2OperModel> DbSetGrp2Oper { get; set; }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.Data.Objects;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
@@ -217,6 +218,45 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco ultime fermate non frequenti
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="numGg"></param>
|
||||
/// <param name="durataMin"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<FnqDTO>> FnqGetByFilt(string idxMacchina, int numGg, int durataMin)
|
||||
{
|
||||
// setup parametri costanti
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<FnqDTO> result = new List<FnqDTO>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:FNQ:{idxMacchina}:{numGg}:{durataMin}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
//if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<FnqDTO>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbTabController.FnqGetByFilt(idxMacchina, numGg, durataMin);
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, FastCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<FnqDTO>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"FnqGetByFilt | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua conferma prod macchina dell'intero periodo da confermare (ultima conferma
|
||||
/// --> dtEvent)
|
||||
|
||||
Reference in New Issue
Block a user