Compare commits

..

7 Commits

Author SHA1 Message Date
Samuele Locatelli 67f0f74fbe Merge branch 'Release/UpdateGestSelect' 2022-10-18 10:11:16 +02:00
Samuele Locatelli d00b4bbb8b Refresh 2022-10-18 10:09:01 +02:00
Samuele Locatelli dd63bb292d Merge remote-tracking branch 'origin/develop' into develop 2022-10-18 09:56:05 +02:00
zaccaria.majid 57bc790074 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-18 09:55:37 +02:00
zaccaria.majid 41a00ffa45 fix 2 variabili x statRecord e currRecord 2022-10-18 09:55:29 +02:00
Samuele Locatelli 633b5dda6e Fix cache recupero ODL correnti (3 sec redis) 2022-10-18 09:51:43 +02:00
Samuele Locatelli 5d6bef0fc8 Merge tag 'UpdateGestOdlPodl' into develop
Update gestione ODL/PODL
2022-10-18 09:26:34 +02:00
12 changed files with 140 additions and 64 deletions
+27 -27
View File
@@ -110,7 +110,7 @@ else
<b>@record.DurataMinuti</b>
</div>
<div>
<button class="btn btn-sm btn-primary py-0" type="button" @onclick="() => selectRecord(record)" data-bs-toggle="modal" data-bs-target="#myModal" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
<button class="btn btn-sm btn-primary py-0" type="button" @onclick="() => selectStatRecord(record)" data-bs-toggle="modal" data-bs-target="#myModal" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
</div>
<!-- Modal -->
</td>
@@ -122,26 +122,26 @@ else
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header bg-primary col-12">
@if (currRecord != null)
@if (statRecord != null)
{
<div class="col-3">
<b class="modal-title fs-1" id="staticBackdropLabel"><b>ODL @currRecord.IdxOdl</b></b>
<b class="modal-title fs-1" id="staticBackdropLabel"><b>ODL @statRecord.IdxOdl</b></b>
</div>
<div class="col-6 fs-5">
<b>@currRecord.CodArticolo</b>
<div class="small textConsensed text-light">@currRecord.ArticoloNav.DescArticolo</div>
<b>@statRecord.CodArticolo</b>
<div class="small textConsensed text-light">@statRecord.ArticoloNav.DescArticolo</div>
</div>
<div class="col-2 fs-5">
<b>@currRecord.IdxMacchina</b>
<div class="small textConsensed text-light">@currRecord.MachineNav.Descrizione</div>
<b>@statRecord.IdxMacchina</b>
<div class="small textConsensed text-light">@statRecord.MachineNav.Descrizione</div>
</div>
}
<div class="col-1 text-end">
<button type="button" class="btn btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="TriggerDotNetInstanceMethod"></button>
<button type="button" class="btn btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
</div>
<div class="modal-body col-12">
@if (currRecord != null && showStats)
@if (statRecord != null && showStats)
{
<div class="d-flex justify-content-between">
<div class="col-8">
@@ -150,23 +150,23 @@ else
<tbody>
<tr>
<td style="width: 270px">
<div class="small textConsensed"><b>N° pezzi:</b> @currRecord.NumPezzi</div>
<div class="small textConsensed"><b>T. Ciclo:</b> @currRecord.Tcassegnato.ToString("N3")</div>
<div class="small textConsensed"><b>N° pezzi:</b> @statRecord.NumPezzi</div>
<div class="small textConsensed"><b>T. Ciclo:</b> @statRecord.Tcassegnato.ToString("N3")</div>
</td>
<td style="width: 300px">
<div class="small d-flex justify-content-between">
<div>
<div><b>@($"{@currRecord.DataInizio:yyyy/MM/dd}")</b></div>
<div>@($"{@currRecord.DataInizio:ddd HH:mm:ss}")</div>
<div><b>@($"{@statRecord.DataInizio:yyyy/MM/dd}")</b></div>
<div>@($"{@statRecord.DataInizio:ddd HH:mm:ss}")</div>
</div>
<div class="p-0">
<i class="fa-solid fa-angles-right"></i>
</div>
<div>
@if (@currRecord.DataFine != null)
@if (@statRecord.DataFine != null)
{
<div><b>@($"{@currRecord.DataFine:yyyy/MM/dd}")</b></div>
<div>@($"{@currRecord.DataFine:ddd HH:mm:ss}")</div>
<div><b>@($"{@statRecord.DataFine:yyyy/MM/dd}")</b></div>
<div>@($"{@statRecord.DataFine:ddd HH:mm:ss}")</div>
}
else
{
@@ -192,12 +192,12 @@ else
<tr>
<td>
<div>
@tradFase(currRecord.KeyRichiesta)
@tradFase(statRecord.KeyRichiesta)
</div>
@if (currRecord.Note != "")
@if (statRecord.Note != "")
{
<div class="small textConsensed text-secondary badge text-bg-light border border-secondary rounded">
<b class="text-dark"></b> <span class="text-wrap text-start"> @currRecord.Note </span>
<b class="text-dark"></b> <span class="text-wrap text-start"> @statRecord.Note </span>
</div>
}
</td>
@@ -206,25 +206,25 @@ else
</table>
</div>
<div>
@if (currRecord != null)
@if (statRecord != null)
{
@if (ListOdlStats != null)
{
@foreach (var statRecord in ListOdlStats)
@foreach (var stat in ListOdlStats)
{
<div class="p-1">
<div class="d-flex justify-content-between">
<div class="text-uppercase">
@statRecord.Descrizione
@stat.Descrizione
</div>
<div>
<b>@(formDurata(statRecord.TotDurata))</b>
<b>@(formDurata(stat.TotDurata))</b>
</div>
</div>
<div class="progress">
<div class="progress-bar @colorChanger(@statRecord.Css)" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(statRecord.TotDurata),0)%; background-color:@statRecord.Css;" aria-valuemax="100">@($"{calcolaPerc(statRecord.TotDurata):N1}%")</div>
<div class="progress-bar @colorChanger(@stat.Css)" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(stat.TotDurata),0)%; background-color:@stat.Css;" aria-valuemax="100">@($"{calcolaPerc(stat.TotDurata):N1}%")</div>
</div>
</div>
@@ -234,14 +234,14 @@ else
</div>
</div>
<div class="col-4 dcContainer">
@if (currRecord != null && ListOdlStats != null)
@if (statRecord != null && ListOdlStats != null)
{
<div class="dcBox">
<ODLPlot SelectedOdl="@currRecord.IdxOdl"></ODLPlot>
<ODLPlot SelectedOdl="@statRecord.IdxOdl"></ODLPlot>
</div>
<div class="dcBox dcOverlay d-flex">
<div class="align-self-center text-center w-100">
<b class="fs-3">@currRecord.DurataMinuti</b>
<b class="fs-3">@statRecord.DurataMinuti</b>
</div>
</div>
}
+26 -6
View File
@@ -48,19 +48,19 @@ namespace MP.SPEC.Components
//oggetto contenente le funzioni del code behind che sono jsInvokable
private DotNetObjectReference<ListODL>? objRef;
#if true //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLOCK BOTTONE
#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE
[JSInvokable]
public void setHelper()
{
objRef = DotNetObjectReference.Create(this);
}
[JSInvokable]
public void svuotaRecord()
{
currRecord = null;
}
[JSInvokable]
public void setHelper()
{
objRef = DotNetObjectReference.Create(this);
}
public async Task TriggerDotNetInstanceMethod()
{
await JSRuntime.InvokeVoidAsync("recordDeselect", objRef);
@@ -71,6 +71,8 @@ namespace MP.SPEC.Components
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
@@ -165,6 +167,22 @@ namespace MP.SPEC.Components
ListOdlStats = null;
}
}
protected async Task selectStatRecord(ODLModel? currRec)
{
showStats = true;
await Task.Delay(1);
statRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
}
else
{
showStats = false;
ListOdlStats = null;
}
}
protected async Task selRecord(ODLModel? currRec)
{
@@ -187,6 +205,8 @@ namespace MP.SPEC.Components
private ODLModel? currRecord = null;
private ODLModel? statRecord = null;
private List<StatODLModel>? ListOdlStats;
private List<ODLModel>? ListRecords;
+1 -1
View File
@@ -61,7 +61,7 @@ namespace MP.SPEC.Components
{
Data.Add(record.TotDurata);
Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min");
colors.Add(record.Css);
colors.Add($"{record.Css}");
}
await Task.Delay(1);
isLoading = false;
+29 -2
View File
@@ -671,8 +671,34 @@ namespace MP.SPEC.Data
/// <returns></returns>
public ODLModel OdlGetCurrentByMacc(string idxMacchina)
{
// cache REDIS...
var dbResult = dbController.OdlGetCurrentByMacc(idxMacchina);
ODLModel dbResult = new ODLModel();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisOdlCurrByMac}:{idxMacchina}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
dbResult = JsonConvert.DeserializeObject<ODLModel>($"{rawData}");
readType = "REDIS";
}
else
{
dbResult = dbController.OdlGetCurrentByMacc(idxMacchina);
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(dbResult);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
}
if (dbResult == null)
{
dbResult = new ODLModel();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"OdlGetCurrentByMacc | Read from {readType}: {ts.TotalMilliseconds}ms");
return dbResult;
}
@@ -834,6 +860,7 @@ namespace MP.SPEC.Data
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1809</Version>
<Version>6.16.2210.1810</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1809</h4>
<h4>Versione: 6.16.2210.1810</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1809
6.16.2210.1810
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1809</version>
<version>6.16.2210.1810</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+19
View File
@@ -326,4 +326,23 @@ a,
min-width: 8rem;
min-height: 4rem;
}
}
/* Colori!*/
blue {
color: purple;
background-color: purple;
}
.dc_yellow {
color: yellow;
background-color: yellow;
}
.dc_gray {
color: gray;
}
.dc_red {
color: red;
}
.dc_green {
color: green;
background-color: green;
}
+21
View File
@@ -375,4 +375,25 @@ a, .btn-link {
min-width: @blSCut * 8;
min-height: @blSCut * 4;
}
}
/* Colori!*/
blue {
color: purple;
background-color: purple;
}
.dc_yellow {
color: yellow;
background-color: yellow;
}
.dc_gray {
color: gray;
}
.dc_red {
color: red;
}
.dc_green {
color: green;
background-color: green;
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+12 -23
View File
@@ -1,15 +1,4 @@
//window.recordDeselect = (dotNetHelper) => {
// var myModalEl = document.getElementById('myModal')
// myModalEl.addEventListener('hidden.bs.modal', function (event) {
// // do something...
// //dotNetHelper.invokeMethodAsync('TriggerDotNetInstanceMethod');
// return dotNetHelper.invokeMethodAsync('svuotaRecord');
// console.log("fatto");
// });
//};
//TENTATIVO POPOLAMENTO HELPER PER POTER INVOCARE IL METODO DOPO
////TENTATIVO POPOLAMENTO HELPER PER POTER INVOCARE IL METODO DOPO
//let helper;
//window.setHelper = (dotNetHelper) => {
@@ -18,15 +7,15 @@
// return dotNetHelper.invokeMethodAsync('setHelper');
//}
//BECCA QUANDO LA MODALE VIENE CHIUSA ED ESEGUE
document.addEventListener('click', function (e) {
if (e.target.id === 'myModal') {
console.log('chiuso');
////BECCA QUANDO LA MODALE VIENE CHIUSA ED ESEGUE
//document.addEventListener('click', function (e) {
// if (e.target.id === 'myModal') {
// console.log('chiuso');
return helper.invokeMethodAsync('svuotaRecord');
console.log("fatto");
} else {
console.log('aperto');
}
e.stopPropagation();
}, false);
// //return helper.invokeMethodAsync('svuotaRecord');
// console.log("fatto");
// } else {
// console.log('aperto');
// }
// e.stopPropagation();
//}, false);