This commit is contained in:
Samuele Locatelli
2023-10-05 19:38:29 +02:00
8 changed files with 163 additions and 71 deletions
+3 -5
View File
@@ -1,5 +1,3 @@
<h3>IobInfoMan</h3>
@code {
}
@infosIob.IP
@infosIob.iType
@infosIob.name
@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DTO;
using MP.Data.Services;
namespace MP_TAB_SERV.Components
{
public partial class IobInfoMan
{
[Parameter]
public string idxMacch { get; set; } = "";
[Inject]
protected TabDataService TabSrv { get; set; } = null!;
protected IobInfoDTO infosIob { get; set; } = new IobInfoDTO();
protected override async Task OnInitializedAsync()
{
infosIob = await TabSrv.IobInfo(idxMacch);
}
}
}
+68 -60
View File
@@ -91,79 +91,87 @@ else
}
else
{
<div class="card mapBlock shadow @RecMSE.Semaforo p-0 m-0">
<div class="m-1 bg-black">
<div class="card-img-overlay p-0 d-flex flex-row-reverse align-items-start rCTop">
<div class="labelTopDx px-2 w-100">
<div class="row">
<div class="col-3 text-start">
Art
<div class="d-flex justify-content-between">
<div class="card mapBlock shadow @RecMSE.Semaforo p-0 m-0 col-10">
<div class="m-1 bg-black">
@*<div class="card-img-overlay p-0 d-flex flex-row-reverse align-items-start rCTop">
<div class="labelTopDx px-2 w-100">
<div class="row">
<div class="col-3 text-start">
Art
</div>
<div class="col-9 text-end fw-bold">
@RecMSE.CodArticolo
</div>
</div>
<div class="row small">
<div class="col-6 text-start">
@($"PODL{RecMSE.IdxPOdl:00000000}")
</div>
<div class="col-6 text-end">
@($"ODL{RecMSE.IdxOdl:00000000}")
</div>
</div>
</div>
</div>*@
<div class="card bg-black text-light p-0 rCBot">
<div class="row justify-content-center mx-0">
<div class="col-12 px-1">
<h4 class="text-start mb-0 fw-bold">
@RecMSE.Nome
</h4>
</div>
<div class="col-9 text-end fw-bold">
@RecMSE.CodArticolo
</div>
</div>
<div class="row small">
<div class="col-6 text-start">
@($"PODL{RecMSE.IdxPOdl:00000000}")
</div>
<div class="col-6 text-end">
@($"ODL{RecMSE.IdxOdl:00000000}")
</div>
</div>
</div>
</div>
<div class="card bg-black text-light p-0 rCBot">
<div class="row justify-content-center mx-0">
<div class="col-12 px-1">
<h4 class="text-start mb-0 fw-bold">
@RecMSE.Nome
</h4>
</div>
<div class="col-12 p-1 @RecMSE.Semaforo">
<div class="d-flex justify-content-between">
<div class="p-0 mr-auto">
<b>@RecMSE.DescrizioneStato</b>
</div>
<div class="p-0">
@(formatDurata(RecMSE.Durata))
<div class="col-12 p-1 @RecMSE.Semaforo">
<div class="d-flex justify-content-between">
<div class="p-0 mr-auto">
<b>@RecMSE.DescrizioneStato</b>
</div>
<div class="p-0">
@(formatDurata(RecMSE.Durata))
</div>
</div>
</div>
</div>
<div class="col-12 p-0 text-nowrap" style="font-size: 1.2em; line-height: 1.0em;">
<div class="row px-1 fw-bold" style="font-size:0.85em;">
<div class="col pe-0">
<small class="text-success">Confermati</small>
<div class="col-12 p-0 text-nowrap" style="font-size: 1.2em; line-height: 1.0em;">
<div class="row px-1 fw-bold" style="font-size:0.85em;">
<div class="col pe-0">
<small class="text-success">Confermati</small>
</div>
<div class="col text-center px-0">
<small class="text-warning">Prodotti</small>
</div>
<div class="col text-end ps-0">
<small class="text-light">Ordinati</small>
</div>
</div>
<div class="col text-center px-0">
<small class="text-warning">Prodotti</small>
<div class="row px-1">
<div class="col pe-0 text-success">
@($"{RecMSE.PezziConf:N0}")
</div>
<div class="col text-center text-warning px-0">
@($"{RecMSE.PezziProd:N0}")
</div>
<div class="col text-end ps-0">
@($"{RecMSE.NumPezzi:N0}")
</div>
</div>
<div class="col text-end ps-0">
<small class="text-light">Ordinati</small>
</div>
</div>
<div class="row px-1">
<div class="col pe-0 text-success">
@($"{RecMSE.PezziConf:N0}")
</div>
<div class="col text-center text-warning px-0">
@($"{RecMSE.PezziProd:N0}")
</div>
<div class="col text-end ps-0">
@($"{RecMSE.NumPezzi:N0}")
</div>
</div>
<div class="row">
<div class="col m-1">
<ProdAdvDispl CountData="@CurrCount"></ProdAdvDispl>
<div class="row">
<div class="col m-1">
<ProdAdvDispl CountData="@CurrCount"></ProdAdvDispl>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-2 d-flex flex-wrap align-items-center justify-content-center p-1">
<button class="w-100 h-100 btn btn-secondary">
<i class="fa-solid fa-file-pdf" style="font-size: 4vw"></i>
</button>
</div>
</div>
}
}
+19 -5
View File
@@ -1,5 +1,19 @@
<h3>TechSheetDetail</h3>
@code {
}
<div class="card mt-2">
<div class="card-header fs-4 bg-info fw-bold">
Scheda Tecnica
</div>
<div class="card-body d-flex justify-content-between flex-wrap">
<div class="col-6 p-1">
<button class="w-100 btn btn-light shadow p-3">Dati Articolo</button>
</div>
<div class="col-6 p-1">
<button class="w-100 btn btn-light shadow p-3">Materiali</button>
</div>
<div class="col-6 p-1">
<button class="w-100 btn btn-light shadow p-3">Attrezzatura</button>
</div>
<div class="col-6 p-1">
<button class="w-100 btn btn-light shadow p-3">Imballi</button>
</div>
</div>
</div>
@@ -0,0 +1,6 @@
namespace MP_TAB_SERV.Components
{
public partial class TechSheetDetail
{
}
}
+1 -1
View File
@@ -9,5 +9,5 @@ else
<div>
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
</div>
<AlarmsMan></AlarmsMan>
<IobInfoMan idxMacch="@IdxMacc"></IobInfoMan>
}
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DTO
{
public class IobInfoDTO
{
public string name { get; set; } = "ND";
public string IP { get; set; } = "::1";
public string iType { get; set; } = "Win";
}
}
+28
View File
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Configuration;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using Newtonsoft.Json;
using NLog;
using StackExchange.Redis;
@@ -157,6 +158,32 @@ namespace MP.Data.Services
return result;
}
public async Task<IobInfoDTO> IobInfo(string IdxMacchina)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
IobInfoDTO? result = new IobInfoDTO();
// cerco in redis...
string currKey = $"{moonProRedisBaseKey}:{IdxMacchina}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<IobInfoDTO>($"{rawData}");
source = "REDIS";
}
if (result == null)
{
result = new IobInfoDTO();
}
sw.Stop();
Log.Debug($"IobInfo | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
public void Dispose()
{
// Clear database controller
@@ -414,6 +441,7 @@ namespace MP.Data.Services
private static Logger Log = LogManager.GetCurrentClassLogger();
private string redisBaseKey = "MP:TAB:Cache";
private string moonProRedisBaseKey = "MoonPro:SQL2016DEV:MoonPro:hM2IOB";
#endregion Private Fields
}