diff --git a/MP-TAB-SERV/Components/IobInfoMan.razor b/MP-TAB-SERV/Components/IobInfoMan.razor index 0ca74e68..190064bc 100644 --- a/MP-TAB-SERV/Components/IobInfoMan.razor +++ b/MP-TAB-SERV/Components/IobInfoMan.razor @@ -1,5 +1,3 @@ -

IobInfoMan

- -@code { - -} +@infosIob.IP +@infosIob.iType +@infosIob.name \ No newline at end of file diff --git a/MP-TAB-SERV/Components/IobInfoMan.razor.cs b/MP-TAB-SERV/Components/IobInfoMan.razor.cs index e69de29b..663f2789 100644 --- a/MP-TAB-SERV/Components/IobInfoMan.razor.cs +++ b/MP-TAB-SERV/Components/IobInfoMan.razor.cs @@ -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); + } + + } +} \ No newline at end of file diff --git a/MP-TAB-SERV/Components/MachineBlock.razor b/MP-TAB-SERV/Components/MachineBlock.razor index 5ff8d645..234a5247 100644 --- a/MP-TAB-SERV/Components/MachineBlock.razor +++ b/MP-TAB-SERV/Components/MachineBlock.razor @@ -91,79 +91,87 @@ else } else { -
-
-
-
-
-
- Art +
+
+
+ @*
+
+
+
+ Art +
+
+ @RecMSE.CodArticolo +
+
+
+
+ @($"PODL{RecMSE.IdxPOdl:00000000}") +
+
+ @($"ODL{RecMSE.IdxOdl:00000000}") +
+
+
+
*@ +
+
+
+

+ @RecMSE.Nome +

-
- @RecMSE.CodArticolo -
-
-
-
- @($"PODL{RecMSE.IdxPOdl:00000000}") -
-
- @($"ODL{RecMSE.IdxOdl:00000000}") -
-
-
-
-
-
-
-

- @RecMSE.Nome -

-
-
-
-
- @RecMSE.DescrizioneStato -
-
- @(formatDurata(RecMSE.Durata)) +
+
+
+ @RecMSE.DescrizioneStato +
+
+ @(formatDurata(RecMSE.Durata)) +
-
-
-
-
- Confermati +
+
+
+ Confermati +
+
+ Prodotti +
+
+ Ordinati +
-
- Prodotti +
+
+ @($"{RecMSE.PezziConf:N0}") +
+
+ @($"{RecMSE.PezziProd:N0}") +
+
+ @($"{RecMSE.NumPezzi:N0}") +
-
- Ordinati -
-
-
-
- @($"{RecMSE.PezziConf:N0}") -
-
- @($"{RecMSE.PezziProd:N0}") -
-
- @($"{RecMSE.NumPezzi:N0}") -
-
-
-
- +
+
+ +
+
+ +
} } + diff --git a/MP-TAB-SERV/Components/TechSheetDetail.razor b/MP-TAB-SERV/Components/TechSheetDetail.razor index 95a73d89..f654734d 100644 --- a/MP-TAB-SERV/Components/TechSheetDetail.razor +++ b/MP-TAB-SERV/Components/TechSheetDetail.razor @@ -1,5 +1,19 @@ -

TechSheetDetail

- -@code { - -} +
+
+ Scheda Tecnica +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/MP-TAB-SERV/Components/TechSheetDetail.razor.cs b/MP-TAB-SERV/Components/TechSheetDetail.razor.cs new file mode 100644 index 00000000..885b880d --- /dev/null +++ b/MP-TAB-SERV/Components/TechSheetDetail.razor.cs @@ -0,0 +1,6 @@ +namespace MP_TAB_SERV.Components +{ + public partial class TechSheetDetail + { + } +} \ No newline at end of file diff --git a/MP-TAB-SERV/Pages/IobInfo.razor b/MP-TAB-SERV/Pages/IobInfo.razor index 2050c2f2..dcf4d33a 100644 --- a/MP-TAB-SERV/Pages/IobInfo.razor +++ b/MP-TAB-SERV/Pages/IobInfo.razor @@ -9,5 +9,5 @@ else
- + } diff --git a/MP.Data/DTO/IobInfoDTO.cs b/MP.Data/DTO/IobInfoDTO.cs new file mode 100644 index 00000000..a0fd39ec --- /dev/null +++ b/MP.Data/DTO/IobInfoDTO.cs @@ -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"; + } +} diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs index 75e34186..2e0a3dc4 100644 --- a/MP.Data/Services/TabDataService.cs +++ b/MP.Data/Services/TabDataService.cs @@ -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 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($"{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 }