Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop
This commit is contained in:
@@ -19,25 +19,49 @@
|
||||
<div class="col-12">
|
||||
Slave machine man
|
||||
</div>
|
||||
<div class="col-12">
|
||||
Check articolo in revisione
|
||||
</div>
|
||||
@if (cancelSetupEnabled)
|
||||
{
|
||||
<div class="col-12 col-sm-12 col-md-6 p-2">
|
||||
<button class="btn btn-lg btn-danger w-100">Annulla Setup ODL <i class="fa-solid fa-ban me-1"></i></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<div class="d-flex justify-content-between flex-wrap">
|
||||
<div class="col-12 col-sm-12 col-md-6 p-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group input-group-lg">
|
||||
<input type="text" class="form-control w-25" placeholder="Cerca" aria-label="Cerca">
|
||||
<select class="form-select w-50">
|
||||
<option>Selezionare P.ODL</option>
|
||||
<option disabled>Selezionare P.ODL</option>
|
||||
@foreach (var item in ListODL)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
}
|
||||
</select>
|
||||
<div class="input-group-text w-25">
|
||||
<input class="form-check-input mt-0 me-1" id="chk_all" type="checkbox" value="">
|
||||
<label class="form-check-label" for="chk_all">
|
||||
<div class="input-group-text">
|
||||
<input class="form-check-input mt-0 me-1" id="chk_all" type="checkbox" @bind="ShowAll">
|
||||
<label class="form-check-label" for="" chk_all">
|
||||
Tutti
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-6 p-2">
|
||||
<button class="btn btn-lg btn-outline-warning w-100"><i class="fa-solid fa-star me-1"></i> Dettaglio ODL</button>
|
||||
<button class="btn btn-lg btn-outline-warning w-100" disabled="@isInAttr" @onclick="togOdlDetail"><i class="fa-solid fa-star me-1"></i> Dettaglio ODL</button>
|
||||
@if (podlOk)
|
||||
{
|
||||
<button class="btn btn-lg btn-primary w-100"><i class="fa-solid fa-check me-1"></i> INIZIO Attrezzaggio</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (showOdlDetail)
|
||||
{
|
||||
<p>...dettaglio ODL...</p>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<div class="d-flex justify-content-between flex-wrap">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using NLog;
|
||||
|
||||
namespace MP_TAB_SERV.Components
|
||||
{
|
||||
@@ -19,8 +20,42 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool forceCloseOdl = true;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce il codice IdxMacchina dell'impianto PARENT (se multi) altrimenti la stessa macchina...
|
||||
/// </summary>
|
||||
protected string idxMaccParent
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
// se è multi controllo
|
||||
if (isMulti)
|
||||
{
|
||||
// verifico se SIA una tavola (ha char "#")
|
||||
int iSharp = IdxMaccSel.IndexOf('#');
|
||||
if (iSharp > 0)
|
||||
{
|
||||
// sistemo nome
|
||||
answ = IdxMaccSel.Substring(0, iSharp);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<vSelOdlModel> ListODL { get; set; } = new();
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService MServ { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Verifica ODL OK (ovvero caricato x macchina...)
|
||||
/// </summary>
|
||||
@@ -29,9 +64,29 @@ namespace MP_TAB_SERV.Components
|
||||
get => (RecMSE != null && RecMSE.IdxOdl > 0);
|
||||
}
|
||||
|
||||
protected bool ShowAll
|
||||
{
|
||||
get => showAll;
|
||||
set
|
||||
{
|
||||
if (showAll != value)
|
||||
{
|
||||
showAll = value;
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await ReloadData();
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabDServ { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -48,15 +103,22 @@ namespace MP_TAB_SERV.Components
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
baseLang = SMServ.GetConf("baseLang");
|
||||
numDayOdl = SMServ.GetConfInt("numDaySelOdl");
|
||||
if (RecMSE != null)
|
||||
{
|
||||
IdxMaccSel = RecMSE.IdxMacchina;
|
||||
await ReloadData();
|
||||
}
|
||||
checkAll();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
checkAll();
|
||||
isMulti = MServ.DictMacchMulti[RecMSE?.IdxMacchina] == 1;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task SetMacc(string selIdxMacc)
|
||||
@@ -69,6 +131,11 @@ namespace MP_TAB_SERV.Components
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
protected void togOdlDetail()
|
||||
{
|
||||
showOdlDetail = !showOdlDetail;
|
||||
}
|
||||
|
||||
protected string Traduci(string lemma)
|
||||
{
|
||||
return SMServ.Traduci($"{baseLang}_{lemma}".ToUpper());
|
||||
@@ -79,20 +146,27 @@ namespace MP_TAB_SERV.Components
|
||||
#region Private Fields
|
||||
|
||||
private string baseLang = "IT";
|
||||
private bool cancelSetupEnabled = false;
|
||||
private string IdxMaccSel = "";
|
||||
private bool isInAttr = false;
|
||||
private bool isInProd = false;
|
||||
private bool isMulti = false;
|
||||
private bool isProcessing = false;
|
||||
|
||||
private int numDayOdl = 5;
|
||||
private bool podlOk = false;
|
||||
private bool showAll = false;
|
||||
private bool showOdlDetail = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string IdxMaccSel { get; set; } = "";
|
||||
|
||||
private int IdxOdl
|
||||
{
|
||||
get => RecMSE != null ? RecMSE.IdxOdl ?? 0 : 0;
|
||||
}
|
||||
|
||||
private bool isProcessing { get; set; } = false;
|
||||
|
||||
private string lblWarnBody
|
||||
{
|
||||
get => odlOk ? Traduci("ConfProdBeforeContinueBody") : Traduci("setOdlBeforeContinueBody");
|
||||
@@ -113,8 +187,6 @@ namespace MP_TAB_SERV.Components
|
||||
get => RecMSE != null ? RecMSE.PezziProd - RecMSE.PezziConf : 0;
|
||||
}
|
||||
|
||||
protected bool forceCloseOdl = true;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -166,6 +238,17 @@ namespace MP_TAB_SERV.Components
|
||||
mod_ODL1.isEnabled = !needConfProd;
|
||||
#endif
|
||||
}
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
Log.Trace("OdlMan.ReloadData");
|
||||
if (!string.IsNullOrEmpty(IdxMaccSel))
|
||||
{
|
||||
ListODL = await TabDServ.VSOdlGetUnused(idxMaccParent, ShowAll, numDayOdl);
|
||||
Log.Trace($"found {ListODL.Count} rec");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2311.315</Version>
|
||||
<Version>6.16.2310.3117</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2311.315</h4>
|
||||
<h4>Versione: 6.16.2310.3117</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2311.315
|
||||
6.16.2310.3117
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2311.315</version>
|
||||
<version>6.16.2310.3117</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>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"DisplayName": "MAPO EgalWare Email BOT",
|
||||
"From": "steamwarebot@outlook.it",
|
||||
"Host": "smtp-mail.outlook.com",
|
||||
"Password": "siamoInViaNazionale93",
|
||||
"Password": "siamoInViaNazionale93!",
|
||||
"Port": 587,
|
||||
"UserName": "steamwarebot@outlook.it",
|
||||
"UseSSL": false,
|
||||
|
||||
@@ -1349,6 +1349,30 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco prossimi ODL/PODL x macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="showAll"></param>
|
||||
/// <param name="numDayAdd"></param>
|
||||
/// <returns></returns>
|
||||
public List<vSelOdlModel> VSOdlGetUnused(string idxMacchina, bool showAll, int numDayAdd)
|
||||
{
|
||||
List<vSelOdlModel> dbResult = new List<vSelOdlModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var ShowAll = new SqlParameter("@showAll", showAll);
|
||||
var NumDayAdd = new SqlParameter("@numDayAdd", numDayAdd);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetVSODL
|
||||
.FromSqlRaw("EXEC stp_vsODL_getUnused @IdxMacchina, @showAll, @numDayAdd", IdxMacc, ShowAll, NumDayAdd)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -14,6 +14,6 @@ namespace MP.Data.DatabaseModels
|
||||
[Key]
|
||||
public int value { get; set; } = 0;
|
||||
public string label { get; set; } = "";
|
||||
public DateTime conditio { get; set; } = DateTime.Now;
|
||||
public DateTime? conditio { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1953,6 +1953,43 @@ namespace MP.Data.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco prossimi ODL/PODL x macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="showAll"></param>
|
||||
/// <param name="numDayAdd"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<vSelOdlModel>> VSOdlGetUnused(string idxMacchina, bool showAll, int numDayAdd)
|
||||
{
|
||||
string source = "DB";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
List<vSelOdlModel>? result = new List<vSelOdlModel>();
|
||||
// cerco in redis...
|
||||
string currKey = $"{redisBaseKey}:VSODL:{idxMacchina}:ALL_{showAll}:{numDayAdd}";
|
||||
RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
if (rawData.HasValue)
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<vSelOdlModel>>($"{rawData}");
|
||||
source = "REDIS";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbTabController.VSOdlGetUnused(idxMacchina, showAll, numDayAdd));
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<vSelOdlModel>();
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Debug($"VSOdlGetUnused | {source} | {sw.Elapsed.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
Reference in New Issue
Block a user