Merge branch 'Release/Spec_KitMan_08'
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
|
||||
@if (showKitDetail)
|
||||
{
|
||||
<MP_TAB3.Components.ProdKIT.KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></MP_TAB3.Components.ProdKIT.KitDetailModal>
|
||||
}
|
||||
<div class="col-12 my-1">
|
||||
<div class="card">
|
||||
<div class="card-header @cssDetailOdl d-flex justify-content-between">
|
||||
@@ -82,12 +85,21 @@
|
||||
Articolo:
|
||||
</div>
|
||||
<div class="px-0 text-end fw-bold">
|
||||
|
||||
@if (CurrOdl != null && !showPOdlData)
|
||||
{
|
||||
@if (CheckIsKit(CurrOdl.CodArticolo))
|
||||
{
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(CurrOdl.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
@CurrOdl.DescArticolo
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (CheckIsKit(CurrPodl.CodArticolo))
|
||||
{
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(CurrPodl.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
@CurrPodl.DescArticolo
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace MP_TAB3.Components
|
||||
|
||||
[Parameter]
|
||||
public bool InAttr { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public bool ShowClose { get; set; } = true;
|
||||
|
||||
@@ -45,10 +46,48 @@ namespace MP_TAB3.Components
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio
|
||||
/// </summary>
|
||||
/// <param name="CodArticolo"></param>
|
||||
/// <returns></returns>
|
||||
protected bool CheckIsKit(string CodArticolo)
|
||||
{
|
||||
bool answ = false;
|
||||
if (ListArtKit != null && ListArtKit.Count > 0)
|
||||
{
|
||||
answ = ListArtKit.Count(x => x.CodArticolo == CodArticolo) > 0;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected void KitToggleDetail(string? selCodArt)
|
||||
{
|
||||
CodArtParent = selCodArt ?? "";
|
||||
if (!string.IsNullOrEmpty(CodArtParent))
|
||||
{
|
||||
ListKitTemplate = TDService.TemplateKitFilt(CodArtParent, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
ListKitTemplate = null;
|
||||
}
|
||||
showKitDetail = !showKitDetail;
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
// carico elenco KIT
|
||||
ListArtKit = TDService.ArticoliGetByTipo("KIT", "*");
|
||||
}
|
||||
|
||||
protected async Task ToggleOdlDetail()
|
||||
{
|
||||
await EC_ToggleOdlDetail.InvokeAsync(true);
|
||||
@@ -61,6 +100,21 @@ namespace MP_TAB3.Components
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string CodArtParent = "";
|
||||
|
||||
/// <summary>
|
||||
/// Elenco articoli tipo KIT
|
||||
/// </summary>
|
||||
private List<AnagArticoliModel>? ListArtKit;
|
||||
|
||||
private List<TemplateKitModel>? ListKitTemplate = null;
|
||||
|
||||
private bool showKitDetail = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string baseLang
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<dialog class="modal fade show" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" aria-modal="true" role="dialog">
|
||||
<div class="modal-dialog shadow shadow-lg">
|
||||
<div class="modal-content p-2">
|
||||
<div class="modal-title d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
<h4>Dettaglio KIT <b>@CodArtParent</b></h4>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<button class="btn btn-outline-dark" @onclick="() => ReqClose()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body px-1">
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalKitCount == 0)
|
||||
{
|
||||
<div class="alert alert-warning text-center display-4">
|
||||
Nessun record trovato
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><i class="fa-solid fa-sitemap"></i> Cod Kit (Parent)</th>
|
||||
<th><i class="fa-solid fa-file"></i> Articolo (Child)</th>
|
||||
<th class="text-end"><i class="fa-solid fa-hashtag"></i> Art/Kit Qty</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@record.CodArtParent
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArtChild
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<div>@record.Qty</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public string CodArtParent { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_Close { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
public List<TemplateKitModel>? ListRecords { get; set; } = null;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
// base.OnParametersSet();
|
||||
totalKitCount = ListRecords != null ? ListRecords.Count() : 0;
|
||||
}
|
||||
private int totalKitCount = 0;
|
||||
|
||||
protected async void ReqClose()
|
||||
{
|
||||
await EC_Close.InvokeAsync(true);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2504.1617</Version>
|
||||
<Version>6.16.2505.1208</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2504.1617</h4>
|
||||
<h4>Versione: 6.16.2505.1208</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2504.1617
|
||||
6.16.2505.1208
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2504.1617</version>
|
||||
<version>6.16.2505.1208</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -60,11 +60,11 @@
|
||||
},
|
||||
"MailKitMailSettings": {
|
||||
"DisplayName": "MAPO EgalWare Email BOT",
|
||||
"From": "steamwarebot@outlook.it",
|
||||
"Host": "smtp-mail.outlook.com",
|
||||
"Password": "siamoInViaNazionale93!",
|
||||
"From": "services@steamware.net",
|
||||
"Host": "smtp.gmail.com",
|
||||
"Password": "rzdwvdhvyxtbrzoq",
|
||||
"Port": 587,
|
||||
"UserName": "steamwarebot@outlook.it",
|
||||
"UserName": "services@steamware.net",
|
||||
"UseSSL": false,
|
||||
"UseStartTls": true
|
||||
},
|
||||
|
||||
@@ -176,6 +176,28 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restitusice elenco articoli dato tipo (es KIT)
|
||||
/// </summary>
|
||||
/// <param name="tipo"></param>
|
||||
/// <param name="azienda"></param>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagArticoliModel> ArticoliGetByTipo(string tipo, string azienda = "*")
|
||||
{
|
||||
List<AnagArticoliModel> dbResult = new List<AnagArticoliModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.AsNoTracking()
|
||||
.Where(x => x.Tipo.ToUpper() == tipo.ToUpper() && (azienda == "*" || x.Azienda.ToUpper() == azienda.ToUpper()))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia necessario inserire un cambio di stato impianto in modalità batch
|
||||
/// </summary>
|
||||
@@ -2281,6 +2303,26 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco template KIT da ricerca
|
||||
/// </summary>
|
||||
/// <param name="KitCode"></param>
|
||||
/// <param name="codChild"></param>
|
||||
/// <returns></returns>
|
||||
public List<TemplateKitModel> TemplateKitFilt(string KitCode, string codChild)
|
||||
{
|
||||
List<TemplateKitModel> dbResult = new List<TemplateKitModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetTempKit
|
||||
.Where(x => (string.IsNullOrEmpty(KitCode) && string.IsNullOrEmpty(codChild)) || (x.CodArtParent.Contains(KitCode) && !string.IsNullOrEmpty(KitCode)) || (x.CodArtChild.Contains(codChild) && !string.IsNullOrEmpty(codChild)))
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco turni macchina (all)
|
||||
/// </summary>
|
||||
|
||||
@@ -21,6 +21,7 @@ using System.Threading.Tasks;
|
||||
using MongoDB.Driver.Core.Operations;
|
||||
using MP.Data.Controllers;
|
||||
using DnsClient.Protocol;
|
||||
using MP.AppAuth.Controllers;
|
||||
|
||||
namespace MP.Data.Services
|
||||
{
|
||||
@@ -366,6 +367,44 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restitusice elenco articoli dato tipo (es KIT)
|
||||
/// </summary>
|
||||
/// <param name="tipo"></param>
|
||||
/// <param name="azienda"></param>
|
||||
/// <returns></returns>
|
||||
public List<AnagArticoliModel> ArticoliGetByTipo(string tipo, string azienda = "*")
|
||||
{
|
||||
List<AnagArticoliModel>? result = new List<AnagArticoliModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string sKey = string.IsNullOrEmpty(tipo) ? "ALL" : tipo;
|
||||
string currKey = $"{Utils.redisArtList}:{azienda}:Tipo:{sKey}";
|
||||
// cerco in redis dato valore sel idxMaccSel...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<AnagArticoliModel>>($"{rawData}");
|
||||
readType = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbTabController.ArticoliGetByTipo(tipo, azienda);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<AnagArticoliModel>();
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"ArticoliGetByTipo | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco ultimi commenti
|
||||
/// </summary>
|
||||
@@ -3441,6 +3480,42 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Template KIT da ricerca
|
||||
/// </summary>
|
||||
/// <param name="codParent"></param>
|
||||
/// <param name="codChild"></param>
|
||||
/// <returns></returns>
|
||||
public List<TemplateKitModel> TemplateKitFilt(string codParent, string codChild)
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<TemplateKitModel>? result = new List<TemplateKitModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{Utils.redisKitTempl}:{codParent}:{codChild}";
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<TemplateKitModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbTabController.TemplateKitFilt(codParent, codChild);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, LongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<TemplateKitModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"TemplateKitFilt | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turno macchina
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
@if (ListRecords == null)
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
@@ -10,6 +9,10 @@ else if (totalCount == 0)
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
@if (showKitDetail)
|
||||
{
|
||||
<MP.SPEC.Components.ProdKit.KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></MP.SPEC.Components.ProdKit.KitDetailModal>
|
||||
}
|
||||
@if (currRecord != null && !showStats && isCurrOdl)
|
||||
{
|
||||
<div class="col-6 col-lg-8">
|
||||
@@ -102,7 +105,13 @@ else
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
<div>
|
||||
@record.CodArticolo
|
||||
@if (CheckIsKit(record.CodArticolo))
|
||||
{
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(record.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="small textConsensed text-secondary">@record.DescArticolo</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -182,6 +182,7 @@ namespace MP.SPEC.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
ListArtKit = MDService.ArticoliGetByTipo("KIT", "*");
|
||||
string SPEC_PODL_gest = await MDService.ConfigTryGetAsync("SPEC_PODL_gest");
|
||||
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
|
||||
{
|
||||
@@ -368,5 +369,42 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio
|
||||
/// </summary>
|
||||
/// <param name="CodArticolo"></param>
|
||||
/// <returns></returns>
|
||||
protected bool CheckIsKit(string CodArticolo)
|
||||
{
|
||||
bool answ = false;
|
||||
if (ListArtKit != null && ListArtKit.Count > 0)
|
||||
{
|
||||
answ = ListArtKit.Count(x => x.CodArticolo == CodArticolo) > 0;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
protected void KitToggleDetail(string? selCodArt)
|
||||
{
|
||||
CodArtParent = selCodArt ?? "";
|
||||
if (!string.IsNullOrEmpty(CodArtParent))
|
||||
{
|
||||
ListKitTemplate = MDService.TemplateKitFilt(CodArtParent, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
ListKitTemplate = null;
|
||||
}
|
||||
showKitDetail = !showKitDetail;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco articoli tipo KIT
|
||||
/// </summary>
|
||||
private List<AnagArticoliModel>? ListArtKit;
|
||||
|
||||
private List<TemplateKitModel>? ListKitTemplate = null;
|
||||
private bool showKitDetail = false;
|
||||
private string CodArtParent = "";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Components.ProdKit
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@if (ListRecords == null || isLoading)
|
||||
@@ -16,7 +15,7 @@ else
|
||||
<div class="@mainCss">
|
||||
@if (showKitDetail)
|
||||
{
|
||||
<KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></KitDetailModal>
|
||||
<MP.SPEC.Components.ProdKit.KitDetailModal CodArtParent="@CodArtParent" ListRecords="@ListKitTemplate" EC_Close="() => KitToggleDetail(null)"></MP.SPEC.Components.ProdKit.KitDetailModal>
|
||||
}
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
@@ -118,7 +117,7 @@ else
|
||||
@record.CodArticolo
|
||||
@if (CheckIsKit(record.CodArticolo))
|
||||
{
|
||||
<button class="ms-2 btn btn-sm btn-info small" @onclick="() => KitToggleDetail(record.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
<button class="mx-1 btn btn-sm btn-outline-dark small" @onclick="() => KitToggleDetail(record.CodArticolo)" title="Mostra dettaglio"><i class="fa-solid fa-search"></i></button>
|
||||
}
|
||||
</div>
|
||||
<div class="small textConsensed text-secondary">@record.DescArticolo</div>
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = dbController.ArticoliGetByTipo(tipo);
|
||||
result = dbController.ArticoliGetByTipo(tipo, azienda);
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||
|
||||
Reference in New Issue
Block a user