bozza sel macchine
This commit is contained in:
@@ -1,10 +1,26 @@
|
||||
@if (false)
|
||||
@if (isMulti)
|
||||
{
|
||||
<h3>MachSel</h3>
|
||||
<asp:DropDownList runat="server" ID="ddlSubMacc" DataSourceID="ods" CssClass="form-control" DataTextField="CodMaccArticolo" DataValueField="IdxMacchina" AutoPostBack="True" OnSelectedIndexChanged="ddlSubMacc_SelectedIndexChanged" OnDataBound="ddlSubMacc_DataBound"></asp:DropDownList>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="basic-addon1">Macchina</span>
|
||||
<select class="form-select form-select-sm" @bind="@IdxMaccSel">
|
||||
<option disabled>--- Selezionare impianto ---</option>
|
||||
@if (ListMacchineAll == null)
|
||||
{
|
||||
<option value="" disabled>No record found</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in ListMacchineAll)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
@* <asp:DropDownList runat="server" ID="ddlSubMacc" DataSourceID="ods" CssClass="form-control" DataTextField="CodMaccArticolo" DataValueField="IdxMacchina" AutoPostBack="True" OnSelectedIndexChanged="ddlSubMacc_SelectedIndexChanged" OnDataBound="ddlSubMacc_DataBound"></asp:DropDownList>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getMulti" TypeName="MapoDb.DS_applicazioneTableAdapters.MSFDTableAdapter" FilterExpression="idxMacchina LIKE '%#%'">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="IdxMacchina" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</asp:ObjectDataSource> *@
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
{
|
||||
@@ -8,10 +10,25 @@ namespace MP_TAB_SERV.Components
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public MappaStatoExpl? RecMSE { get; set; } = null;
|
||||
public EventCallback<string> E_MachSel { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> E_MachSel { get; set; }
|
||||
public MappaStatoExpl? RecMSE { get; set; } = null;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string IdxMaccSel { get; set; } = "";
|
||||
|
||||
protected Dictionary<string, string>? ListMacchineAll { get; set; } = null;
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService MServ { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -19,9 +36,21 @@ namespace MP_TAB_SERV.Components
|
||||
if (RecMSE != null)
|
||||
{
|
||||
await E_MachSel.InvokeAsync(RecMSE?.IdxMacchina);
|
||||
// verifico se la macchina sia configurata tra le MSFD...
|
||||
if (MServ.DictMacchMulti.ContainsKey(RecMSE?.IdxMacchina))
|
||||
{
|
||||
isMulti = MServ.DictMacchMulti[RecMSE?.IdxMacchina] == 1;
|
||||
}
|
||||
ListMacchineAll = MServ.DictMacchine;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool isMulti = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,6 @@ namespace MP_TAB_SERV.Components
|
||||
await Task.Delay(1);
|
||||
// effettua conferma con conf da DB del tipo (giorni / turni / periodo
|
||||
bool fatto = effettuaConfermaProd();
|
||||
|
||||
// refresh tabella dati tablet...
|
||||
TabDServ.RicalcMse(IdxMaccSel, 0);
|
||||
// mostro output
|
||||
|
||||
@@ -68,7 +68,10 @@ namespace MP_TAB_SERV.Components
|
||||
protected bool ListArtDisabled { get => string.IsNullOrEmpty(SearchVal) || SearchVal.Length < SearchMinChar; }
|
||||
protected Dictionary<string, string>? ListArticoli { get; set; } = null;
|
||||
protected Dictionary<string, string> ListArticoliAll { get; set; } = new Dictionary<string, string>();
|
||||
protected Dictionary<string, string> ListMacchineAll { get => MServ.DictMacchine; set => MServ.DictMacchine = value; }
|
||||
protected Dictionary<string, string> ListMacchineAll {
|
||||
get => MServ.DictMacchine;
|
||||
set => MServ.DictMacchine = value;
|
||||
}
|
||||
|
||||
protected int Num2Displ
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2310.417</Version>
|
||||
<Version>6.16.2310.419</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2310.417</h4>
|
||||
<h4>Versione: 6.16.2310.419</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.417
|
||||
6.16.2310.419
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.417</version>
|
||||
<version>6.16.2310.419</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>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
@implements IDisposable
|
||||
@inject NavigationManager NavMan
|
||||
@inject ListSelectDataSrv MDataService
|
||||
@inject TabDataService TDataService
|
||||
@inject SharedMemService MStor
|
||||
@inject MessageService MServ
|
||||
|
||||
@@ -92,6 +93,10 @@
|
||||
// fix config...
|
||||
var allConf = await MDataService.ConfigGetAll();
|
||||
MStor.SetConfig(allConf);
|
||||
|
||||
// fix MSFD...
|
||||
var allMSFD = await TDataService.VMSFDGetAll();
|
||||
MStor.SetMsfd(allMSFD);
|
||||
}
|
||||
CurrLevel = MStor.PageLevel(NavMan.Uri);
|
||||
// recupero menù
|
||||
|
||||
@@ -360,6 +360,7 @@ namespace MP.Data.Controllers
|
||||
/// <summary>
|
||||
/// Vista v_MSFD CALCOALTA x singola macchina (da stored) - singolo record
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
public List<VMSFDModel> VMSFDGetByMacc(string idxMacc)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,9 @@ using System.Collections.Generic;
|
||||
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
public partial class VMSFDModel
|
||||
{
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
@@ -25,6 +25,17 @@ namespace MP.Data.Services
|
||||
/// </summary>
|
||||
public Dictionary<string, string> DictMacchine { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario macchine con info multi(bool)
|
||||
/// </summary>
|
||||
public Dictionary<string, int> DictMacchMulti { get; set; } = new Dictionary<string, int>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// List configurazione attiva da tab DB
|
||||
/// </summary>
|
||||
public List<VMSFDModel> ListMSFD { get; set; } = new List<VMSFDModel>();
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario Menu
|
||||
/// </summary>
|
||||
@@ -85,6 +96,14 @@ namespace MP.Data.Services
|
||||
Log.Info("SharedMemService | SetConfig executed!");
|
||||
}
|
||||
|
||||
public void SetMsfd(List<VMSFDModel> newList)
|
||||
{
|
||||
ListMSFD = newList ?? new List<VMSFDModel>();
|
||||
// salvo dizionario
|
||||
DictMacchMulti = ListMSFD.ToDictionary(x => x.IdxMacchina, x => x.Multi);
|
||||
Log.Info("SharedMemService | SetMsfd executed!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua setup memorie menu recuperando dati dal DB + popolando dizionario x livelli
|
||||
/// </summary>
|
||||
|
||||
@@ -31,9 +31,11 @@ namespace MP.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
dbController = new Controllers.MpTabController(configuration);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
dbTabController = new Controllers.MpTabController(configuration);
|
||||
sb.AppendLine($"TabDataService | MpTabController OK");
|
||||
dbIocController = new Controllers.MpIocController(configuration);
|
||||
sb.AppendLine($"TabDataService | MpIocController OK");
|
||||
Log.Info(sb.ToString());
|
||||
}
|
||||
}
|
||||
@@ -42,7 +44,8 @@ namespace MP.Data.Services
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public static Controllers.MpTabController dbController { get; set; } = null!;
|
||||
public static Controllers.MpIocController dbIocController { get; set; } = null!;
|
||||
public static Controllers.MpTabController dbTabController { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -67,7 +70,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.AnagEventiGetAll();
|
||||
result = dbTabController.AnagEventiGetAll();
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
@@ -95,7 +98,7 @@ namespace MP.Data.Services
|
||||
public bool ConfermaProdMacchina(string idxMacchina, int modoConfProd, int numPzConfermati, int numPzScarto, DateTime DataOraApp, int MatrOpr)
|
||||
{
|
||||
bool answ = false;
|
||||
answ = dbController.ConfermaProdMacchina(idxMacchina, modoConfProd, numPzConfermati, numPzScarto, DataOraApp, MatrOpr);
|
||||
answ = dbTabController.ConfermaProdMacchina(idxMacchina, modoConfProd, numPzConfermati, numPzScarto, DataOraApp, MatrOpr);
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -116,7 +119,7 @@ namespace MP.Data.Services
|
||||
public bool ConfermaProdMacchinaFull(string idxMacchina, int modoConfProd, int numPzConfermati, int numPzLasciati, int numPzScarto, DateTime DataOraApp, int MatrOpr)
|
||||
{
|
||||
bool answ = false;
|
||||
answ = dbController.ConfermaProdMacchinaFull(idxMacchina, modoConfProd, numPzConfermati, numPzLasciati, numPzScarto, DataOraApp, MatrOpr);
|
||||
answ = dbTabController.ConfermaProdMacchinaFull(idxMacchina, modoConfProd, numPzConfermati, numPzLasciati, numPzScarto, DataOraApp, MatrOpr);
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -140,7 +143,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.ConfigGetAll());
|
||||
result = await Task.FromResult(dbTabController.ConfigGetAll());
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
@@ -157,7 +160,7 @@ namespace MP.Data.Services
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
dbTabController.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -169,7 +172,7 @@ namespace MP.Data.Services
|
||||
public bool RicalcMse(string idxMacchina, int maxAgeSec)
|
||||
{
|
||||
bool answ = false;
|
||||
answ = dbController.RicalcMse(idxMacchina, maxAgeSec);
|
||||
answ = dbTabController.RicalcMse(idxMacchina, maxAgeSec);
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -196,7 +199,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.STAR_byGrpOdl(codGruppo, idxODL);
|
||||
result = dbTabController.STAR_byGrpOdl(codGruppo, idxODL);
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
@@ -234,7 +237,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.STAR_byGrpOdlLbl(codGruppo, label, idxODL);
|
||||
result = dbTabController.STAR_byGrpOdlLbl(codGruppo, label, idxODL);
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
@@ -271,7 +274,7 @@ namespace MP.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.StatoProdMacchina(idxMacchina, dtReq);
|
||||
result = dbTabController.StatoProdMacchina(idxMacchina, dtReq);
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraFastCache);
|
||||
@@ -285,6 +288,77 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Intera vista v_MSFD
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VMSFDModel>> VMSFDGetAll()
|
||||
{
|
||||
// setup parametri costanti
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<VMSFDModel> result = new List<VMSFDModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:MSFD:ALL";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<VMSFDModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbIocController.VMSFDGetAll();
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<VMSFDModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"VMSFDGetAll | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vista v_MSFD CALCOALTA x singola macchina (da stored) - singolo record
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VMSFDModel>> VMSFDGetByMacc(string idxMacc)
|
||||
{
|
||||
// setup parametri costanti
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<VMSFDModel>? result = new List<VMSFDModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:MSFD:MACCH:{idxMacc}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<VMSFDModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbIocController.VMSFDGetByMacc(idxMacc);
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraFastCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<VMSFDModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"VMSFDGetByMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
Reference in New Issue
Block a user