Merge branch 'Release/UpdateSpecEndTime'

This commit is contained in:
Samuele Locatelli
2023-12-11 17:12:36 +01:00
82 changed files with 2914 additions and 1113 deletions
+138 -92
View File
@@ -4,6 +4,8 @@ variables:
APP_NAME: 'MP.Stats'
SOL_NAME: 'MP-STATS'
# nota: cer creazione rules: https://docs.gitlab.com/ee/ci/jobs/job_control.html#common-if-clauses-for-rules
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
@@ -90,10 +92,16 @@ LAND:build:
variables:
APP_NAME: MP.Land
SOL_NAME: MP-LAND
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/LAND.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- echo $CI_COMMIT_BRANCH
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
PROG:build:
@@ -103,6 +111,11 @@ PROG:build:
variables:
APP_NAME: MP.Prog
SOL_NAME: MP-PROG
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/PROG.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -116,6 +129,11 @@ STAT:build:
variables:
APP_NAME: MP.Stats
SOL_NAME: MP-STATS
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/STAT.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -129,6 +147,11 @@ MON:build:
variables:
APP_NAME: MP.Mon
SOL_NAME: MP-MON
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/MON.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -142,6 +165,11 @@ SPEC:build:
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/SPEC.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -155,6 +183,11 @@ INVE:build:
variables:
APP_NAME: MP.INVE
SOL_NAME: MP-INVE
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/INVE.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -168,6 +201,11 @@ CONF:build:
variables:
APP_NAME: IobConf.UI
SOL_NAME: IobConf
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/CONF.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -181,6 +219,11 @@ IOC:build:
variables:
APP_NAME: MP.IOC
SOL_NAME: MP-IOC
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/IOC.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -194,6 +237,11 @@ TAB3:build:
variables:
APP_NAME: MP-TAB-SERV
SOL_NAME: MP-TAB3
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH =~ /^feature\/TAB.+/
when: always
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
@@ -212,8 +260,10 @@ LAND:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/LAND.+/
when: always
needs: ["LAND:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -229,8 +279,10 @@ PROG:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/PROG.+/
when: always
needs: ["PROG:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -246,8 +298,10 @@ STAT:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/STAT.+/
when: always
needs: ["STAT:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -263,8 +317,10 @@ MON:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/MON.+/
when: always
needs: ["MON:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -280,8 +336,10 @@ SPEC:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/SPEC.+/
when: always
needs: ["SPEC:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -297,8 +355,10 @@ INVE:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/INVE.+/
when: always
needs: ["INVE:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -314,8 +374,10 @@ CONF:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/CONF.+/
when: always
needs: ["CONF:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -331,8 +393,10 @@ IOC:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/IOC.+/
when: always
needs: ["IOC:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -348,8 +412,10 @@ TAB3:IIS01:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'develop'
- if: $CI_COMMIT_BRANCH =~ /^feature\/TAB.+/
when: always
needs: ["TAB3:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -366,8 +432,8 @@ LAND:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["LAND:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -384,8 +450,8 @@ PROG:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["PROG:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -402,8 +468,8 @@ STAT:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["STAT:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -420,8 +486,8 @@ MON:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["MON:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -438,8 +504,8 @@ SPEC:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["SPEC:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -456,8 +522,8 @@ INVE:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["INVE:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -474,8 +540,8 @@ CONF:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["CONF:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -492,8 +558,8 @@ IOC:IIS02:deploy:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
rules:
- if: $CI_COMMIT_BRANCH == 'master'
needs: ["IOC:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -512,9 +578,9 @@ LAND:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["LAND:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -534,9 +600,9 @@ PROG:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["PROG:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -556,9 +622,9 @@ STAT:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["STAT:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -578,9 +644,9 @@ MON:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["MON:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -600,9 +666,9 @@ SPEC:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["SPEC:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -622,9 +688,9 @@ INVE:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["INVE:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -644,7 +710,7 @@ INVE:installer:
# before_script:
# - *nuget-fix
# - dotnet restore "$env:SOL_NAME.sln"
# only:
# rules:
# - develop
# - master
# needs: ["CONF:build"]
@@ -666,9 +732,9 @@ IOC:installer:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'develop'
needs: ["IOC:build"]
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
@@ -689,10 +755,8 @@ LAND:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["LAND:build"]
artifacts:
paths:
@@ -712,12 +776,8 @@ PROG:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
#- feature/Deploy_CI_CD
# - master
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["PROG:build"]
artifacts:
paths:
@@ -737,12 +797,8 @@ STAT:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
#- feature/Deploy_CI_CD
# - master
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["STAT:build"]
artifacts:
paths:
@@ -762,10 +818,8 @@ MON:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["MON:build"]
artifacts:
paths:
@@ -785,10 +839,8 @@ SPEC:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["SPEC:build"]
artifacts:
paths:
@@ -808,10 +860,8 @@ INVE:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["INVE:build"]
artifacts:
paths:
@@ -831,10 +881,8 @@ CONF:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["CONF:build"]
artifacts:
paths:
@@ -854,10 +902,8 @@ IOC:release:
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
rules:
- if: $CI_COMMIT_TAG
needs: ["IOC:build"]
artifacts:
paths:
+33 -4
View File
@@ -1,9 +1,18 @@
using Microsoft.AspNetCore.Components;
using MP.Data.Services;
using NLog;
namespace MP_TAB_SERV.Components
{
public partial class CmpFooter : IDisposable
{
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
#region Public Methods
public void Dispose()
@@ -18,10 +27,16 @@ namespace MP_TAB_SERV.Components
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var diffOfTime = DateTime.Now - MsgServ.dtLastAction;
var pUpd = Task.Run(async () =>
{
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
if(diffOfTime.Minutes >= dtTimerScadenzaLogin)
{
NavMan.NavigateTo("logout");
}
//Log.Trace("CmpFooter Timer elapsed");
});
pUpd.Wait();
@@ -29,7 +44,7 @@ namespace MP_TAB_SERV.Components
public void StartTimer()
{
int tOutPeriod = 5000;
int tOutPeriod = dtTimerScadenzaLogin * 60000;
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
@@ -40,12 +55,26 @@ namespace MP_TAB_SERV.Components
#region Protected Methods
protected override void OnInitialized()
int dtTimerScadenzaLogin { get; set; } = 0;
protected override async Task OnInitializedAsync()
{
var rawVers = typeof(Program).Assembly.GetName().Version; ;
await Task.Delay(1);
var rawVers = typeof(Program).Assembly.GetName().Version;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
StartTimer();
//dtTimerScadenzaLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin");
//dtTimerScadenzaLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin");
//if (dtTimerScadenzaLogin > 0)
//{
// //StartTimer();
//}
}
//protected override void OnInitialized()
//{
//}
#endregion Protected Methods
+27
View File
@@ -0,0 +1,27 @@
<div class="top-row d-flex justify-content-between text-light">
<div class="col-4">
<span>
<button class="btn btn-sm @ResetClass" @onclick="() => ForceReload()" title="Update"><i class="fa-solid fa-rotate"></i></button>
@UserName
</span>
<sub>[@MatrOpr]</sub>
</div>
<div class="col-4 text-center d-flex justify-content-center">
<div class="text-decoration-none text-light" @onclick="()=>backToSM()">
<i class="fa-solid fa-house"></i> &nbsp;
MapoTAB2
&nbsp;
<img src="images/LogoSteamware.png" style="height: 1rem" />
</div>
</div>
<div class="col-4 text-end">
@if (!HideMenu)
{
<div class="row w-100 slideMen">
<div class="p-0">
<SlideMenu MenuItems="@CurrMenuItems"></SlideMenu>
</div>
</div>
}
</div>
</div>
+226
View File
@@ -0,0 +1,226 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.Data.Services;
using MP_TAB_SERV.Pages;
using Newtonsoft.Json;
using NLog;
using System.Diagnostics;
namespace MP_TAB_SERV.Components
{
public partial class CmpTop
{
#region Public Properties
[Parameter]
public List<LinkMenu> CurrMenuItems { get; set; } = new List<LinkMenu>();
#endregion Public Properties
#region Protected Fields
protected string ResetClass = "btn-primary";
#endregion Protected Fields
#region Protected Properties
protected string CurrOprTknLS { get; set; } = null!;
protected string LastOpenedPage { get; set; } = null!;
protected string CurrMacc { get; set; } = null!;
protected string CurrOprTknRedis { get; set; } = null!;
protected DateTime expDT { get; set; } = DateTime.Now;
protected bool HideMenu
{
get => NavMan.Uri.Contains("reg-new-device");
}
[Inject]
protected ListSelectDataSrv MDataService { get; set; } = null!;
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected SharedMemService MStor { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
[Inject]
protected TabDataService TDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task RefreshLogIn(string decodValue)
{
bool done = await MsgServ.DoLogIn(decodValue);
if (done)
{
if (!string.IsNullOrEmpty(LastOpenedPage) && !string.IsNullOrEmpty(CurrMacc))
{
NavMan.NavigateTo(LastOpenedPage);
}
else
{
NavMan.NavigateTo("status-map");
}
}
}
protected async Task ForceReload()
{
Stopwatch sw = new Stopwatch();
sw.Start();
Log.Info("Start ForceReload");
ResetClass = "btn-warning";
await InvokeAsync(StateHasChanged);
var currToken = await MsgServ.GetCurrOperDtoAsync();
var lastOpr = await MsgServ.GetLastMatrOprAsync();
// reset cache varie
await MsgServ.ClearLocalStor();
await MsgServ.ClearSessionStor();
await MDataService.FlushCache();
// salvo di nuovo opr
await MsgServ.SetLastMatrOprAsync(lastOpr);
await MsgServ.SetCurrOperDtoAsync(currToken);
// reload MStor
await ReloadMemStor();
// calcolo tempo esecuzione
sw.Stop();
int delta = 500 - (int)sw.ElapsedMilliseconds;
delta = delta > 0 ? delta : 50;
await Task.Delay(delta);
ResetClass = "btn-primary";
// await InvokeAsync(StateHasChanged);
Log.Info($"ForceReload completed in {sw.ElapsedMilliseconds}ms");
// ricarica pagina!
NavMan.NavigateTo("status-map");
}
protected async Task backToSM()
{
await Task.Delay(1);
if (!NavMan.Uri.Contains("reg-new-device"))
{
await MsgServ.IdxMaccSet("");
NavMan.NavigateTo("status-map");
}
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
int expDays = SMServ.GetConfInt("cookieDayExpire");
expDT = DateTime.Now.AddDays(expDays);
CurrOprTknLS = await MsgServ.GetCurrOperDtoAsync();
LastOpenedPage = await MsgServ.LastOpenedPageGet();
CurrMacc = await MsgServ.IdxMaccGet();
var decodedUrl = Uri.UnescapeDataString(CurrOprTknLS);
// verifico se non avessi dati operatore
//var diffOfTime = DateTime.Now - MsgServ.dtLastAction;
//if (diffOfTime.Minutes >= 1)
//{
// NavMan.NavigateTo("logout");
//}
//else
if (MsgServ.RigaOper == null)
{
await RefreshLogIn(decodedUrl);
}
CurrOprTknRedis = await TDService.OperatoreGetRedis(MatrOpr);
if (CurrOprTknRedis == "")
{
if (!NavMan.Uri.Contains("reg-new-device"))
{
NavMan.NavigateTo("reg-new-device", true);
}
}
else if (CurrOprTknRedis != "")
{
//if (!NavMan.Uri.Contains("status-map"))
//{
//}
//if (LastOpenedPage != "")
//{
// NavMan.NavigateTo(LastOpenedPage, true);
//}
}
}
protected async Task ReloadMemStor()
{
// in primis svuoto...
MStor.ClearCache();
// rileggo link
var allData = await MDataService.ListLinkAll();
MStor.SetupMenu(allData);
// fix config...
var allConf = await MDataService.ConfigGetAll();
MStor.SetConfig(allConf);
// fix MSFD...
var allMSFD = await TDService.VMSFDGetAll();
MStor.SetMsfd(allMSFD);
// fix slave
var macSlave = await TDService.Macchine2Slave();
MStor.SetM2S(macSlave);
// fix elenco eventi
var allEvents = await TDService.AnagEventiGetAll();
MStor.SetEventi(allEvents);
// fix elenco stati
var allStati = await TDService.AnaStatiGetAll();
MStor.SetStati(allStati);
// non da farsi globalmente // fix macchine var allMach = await
// MDataService.MacchineByMatrOper(0); MStor.DictMacchine = allMach.ToDictionary(x =>
// x.IdxMacchina, x => $"{x.IdxMacchina} | {x.Nome}");
// fix vocabolario
var allVoc = TDService.VocabolarioGetAll();
MStor.SetVocab(allVoc);
// resetto il tabDServ
await TDService.FlushCache();
// ricarica la config...
TDService.SetupConfig();
}
#endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Properties
private int MatrOpr
{
get => MsgServ.MatrOpr;
}
private string UserName
{
get => MsgServ.CognomeNome;
}
#endregion Private Properties
}
}
+37 -22
View File
@@ -1,31 +1,46 @@
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
<ShowProcessing Message="Caricamento" IsProcessing="@isProcessing"></ShowProcessing>
<div class="cardObj p-2 mt-2">
<div class="mb-1 fs-6">
<button class="btn btn-primary btn-lg text-light w-100" @onclick="ToggleBtn">
<i class="fa fa-wrench"></i> @ConfTitle
</button>
@if (enableControlli)
{
@if (RecMSE.IdxOdl > 0)
{
<button class="btn btn-primary btn-lg text-light w-100 mb-1" @onclick="ToggleBtn">
<i class="fa fa-wrench"></i> @ConfTitle
</button>
}
else
{
<div class="alert bg-danger text-light fw-bold">ODL non presente!</div>
}
}
else
{
<div class="alert bg-info text-dark fw-bold">Registrazione controlli disabilitata</div>
}
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
@if (showInsert)
{
@if (showNote)
@@ -53,16 +53,21 @@ namespace MP_TAB_SERV.Components
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected bool enableControlli { get; set; } = true;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
if (RecMSE != null)
{
enableControlli = SMServ.GetConfBool("enableControlli");
IdxMaccSel = RecMSE.IdxMacchina;
DateTime fine = DateTime.Today.AddDays(1);
DateTime inizio = fine.AddDays(-8);
+22 -20
View File
@@ -1,29 +1,31 @@
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
<ShowProcessing Message="Caricamento" IsProcessing="@isProcessing"></ShowProcessing>
<div class="cardObj p-2 mt-2">
<div class="">
<div class="mb-1">
<DeclarEditor RecMSE="@RecMSE" EditRec="CurrRec" E_Updated="doUpdate"></DeclarEditor>
</div>
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
}
<div class="p-1">
<div class="row">
<div class="col-12">
+28 -25
View File
@@ -6,6 +6,31 @@
<div class="col-12">
<h1>Riassegnazione ODL</h1>
</div>
<div class="col-12">
<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" @bind="IdxOdlSel">
@* <option disabled>Selezionare P.ODL</option> *@
@foreach (var item in ListSelODL)
{
<option value="@item.value">@item.label</option>
}
</select>
<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 mt-2">
@if (IdxOdlSel > 0)
{
<button class="btn btn-lg btn-warning w-100" @onclick="() => SetupOdl()"><i class="fa-solid fa-plus"></i> Imposta ODL</button>
}
</div>
<div class="col-12">
<h4>Ultimi ODL lavorati:</h4>
<table class="table table-dark table-sm table-striped">
@@ -35,7 +60,7 @@
<div class="px-1">
<i class="fa-solid fa-arrow-right"></i>
</div>
<div class="px-1">
<div class="px-1 fw-bold">
@($"{item.DataFine:yyyy.MM.dd HH:mm:ss}")
</div>
</div>
@@ -61,30 +86,8 @@
<EgwCoreLib.Razor.DataPager currPage="@PageNum" PageSize="@NumRecPage" totalCount="@TotalCount" numPageChanged="SavePage" numRecordChanged="SaveNumRec"></EgwCoreLib.Razor.DataPager>
</div>
<div class="col-8">
<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" @bind="IdxOdlSel">
@* <option disabled>Selezionare P.ODL</option> *@
@foreach (var item in ListSelODL)
{
<option value="@item.value">@item.label</option>
}
</select>
<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-4">
@if (IdxOdlSel > 0)
{
<button class="btn btn-lg btn-warning w-100" @onclick="() => SetupOdl()"><i class="fa-solid fa-plus"></i> Imposta ODL</button>
}
</div>
</div>
}
+12 -1
View File
@@ -51,7 +51,15 @@
<i class="fa-solid @chevronDir"></i>
</button>
</div>
}
}
else
{
<div class="col-2 d-flex align-items-center">
<button class="btn btn-sm btn-success text-light" @onclick="SelectFermo">
<i class="fa-solid fa-plus"></i>
</button>
</div>
}
</div>
</div>
<div class="w-100">
@@ -66,6 +74,9 @@
<button class="btn btn-sm btn-danger h-50" @onclick="()=>doDelete(note)"><i class="fa-solid fa-trash-can"></i></button>
</div>
}
<button class="btn btn-sm btn-success text-light w-100" @onclick="SelectFermo">
Riqualifica
</button>
</div>
}
</div>
+22 -10
View File
@@ -58,15 +58,19 @@ else
<div class="d-flex justify-content-around">
<div class="text-center text-success d-flex justify-content-between">
<div>
<i class="fa-regular fa-circle-check"></i>&nbsp; @($" {RecMSE.PezziConf:N0}") &nbsp;
<i class="fa-regular fa-circle-check"></i>&nbsp; @($" {RecMSE.PezziConf}") &nbsp;
</div>
<div class="text-danger">
+ &nbsp; @($" {0:N0}")
+ &nbsp;
@if (datiProdAct != null)
{
@($" {datiProdAct.PzConfScarto}")
}
</div>
</div>
<div class="text-center text-warning ">
<div>
<i class="fa-solid fa-layer-group"></i>&nbsp; @($" {RecMSE.PezziProd:N0}")
<i class="fa-solid fa-layer-group"></i>&nbsp; @($" {RecMSE.PezziProd}")
</div>
</div>
</div>
@@ -111,16 +115,20 @@ else
<div class="col-4"><i class="fa-regular fa-circle-check"></i></div>
<div class="col-8 d-flex justify-content-between">
<div>
@($"{RecMSE.PezziConf:N0}")
@($"{RecMSE.PezziConf}")
</div>
<div class="text-danger">
+ &nbsp; @($" {0:N0}")
+ &nbsp;
@if (datiProdAct != null)
{
@($" {datiProdAct.PzConfScarto}")
}
</div>
</div>
</div>
<div class="text-center text-warning d-flex justify-content-between">
<div class="col-4"><i class="fa-solid fa-layer-group"></i></div>
<div class="col-8">@($"{RecMSE.PezziProd:N0}")</div>
<div class="col-8">@($"{RecMSE.PezziProd}")</div>
</div>
<div class="text-center text-light d-flex justify-content-between">
<div class="col-4"><span>ART.</span></div>
@@ -153,20 +161,24 @@ else
<div class="col-4"><i class="fa-regular fa-circle-check"></i></div>
<div class="col-8 d-flex justify-content-between">
<div>
@($"{RecMSE.PezziConf:N0}")
@($"{RecMSE.PezziConf}")
</div>
<div class="text-danger">
+ &nbsp; @($" {0:N0}")
+ &nbsp;
@if (datiProdAct != null)
{
@($" {datiProdAct.PzConfScarto}")
}
</div>
</div>
</div>
<div class="text-end text-warning d-flex justify-content-between">
<div class="col-4"><i class="fa-solid fa-layer-group"></i></div>
<div class="col-8">@($"{RecMSE.PezziProd:N0}")</div>
<div class="col-8">@($"{RecMSE.PezziProd}")</div>
</div>
<div class="text-end text-primary d-flex justify-content-between">
<div class="col-4"><i class="fa-brands fa-stack-overflow"></i></div>
<div class="col-8">@($"{RecMSE.extraVal:N0}")</div>
<div class="col-8">@($"{RecMSE.extraVal}")</div>
</div>
</div>
</div>
+31 -10
View File
@@ -4,7 +4,6 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
using static Org.BouncyCastle.Math.EC.ECCurve;
namespace MP_TAB_SERV.Components
{
@@ -17,6 +16,11 @@ namespace MP_TAB_SERV.Components
[Parameter]
public bool FullMode { get; set; } = true;
[Parameter]
public int Height { get; set; } = 0;
[Parameter]
public string IdxMacchSub { get; set; } = "";
[Parameter]
public int keepAliveMin { get; set; } = 5;
@@ -30,9 +34,6 @@ namespace MP_TAB_SERV.Components
[Parameter]
public int Width { get; set; } = 0;
[Parameter]
public int Height { get; set; } = 0;
#endregion Public Properties
#region Public Methods
@@ -96,6 +97,9 @@ namespace MP_TAB_SERV.Components
#region Protected Properties
[Inject]
protected IConfiguration config { get; set; } = null!;
protected ProdAdvDispl.ProdCounter CurrCount
{
get
@@ -123,14 +127,13 @@ namespace MP_TAB_SERV.Components
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
[Inject]
protected IConfiguration config { get; set; } = null!;
protected override async Task OnAfterRenderAsync(bool firstRender)
{//await Task.Delay(500);
if (firstRender)
@@ -143,7 +146,7 @@ namespace MP_TAB_SERV.Components
//return base.OnAfterRenderAsync(firstRender);
}
protected override void OnInitialized()
protected override async Task OnInitializedAsync()
{
isLoading = true;
// se configurata uso cartella virtuale... altrimenti cartella processo
@@ -156,11 +159,28 @@ namespace MP_TAB_SERV.Components
{
imgBasePath = $"{Environment.CurrentDirectory}/images/";
}
}
protected override void OnParametersSet()
/// <summary>
/// Dati produzioen rilevati
/// </summary>
protected StatoProdModel? datiProdAct { get; set; } = null;
protected override async Task OnParametersSetAsync()
{
DateTime adesso = DateTime.Now;
isLoading = RecMSE == null;
// controllo SE avessi idxMacchSub --> rileggo!
if (RecMSE != null)
{
datiProdAct = await TabDServ.StatoProdMacchina(RecMSE.IdxMacchina, adesso);
}
if (!string.IsNullOrEmpty(IdxMacchSub) && RecMSE != null)
{
RecMSE = TabDServ.MseGetSub(RecMSE.IdxMacchina, IdxMacchSub, true);
}
setGaugeVals();
}
@@ -192,6 +212,7 @@ namespace MP_TAB_SERV.Components
{
// salvo idxMacch
await MServ.IdxMaccSet(RecMSE!.IdxMacchina);
await MServ.LastOpenedPageSet("machine-detail");
// navigo!
NavMan.NavigateTo($"machine-detail");
}
+2 -12
View File
@@ -1,15 +1,5 @@
<div class="row mt-2">
@if (ShowBtn)
{
<div class="col-12">
<button class="btn btn-lg bg-info w-100" @onclick="ToggleCtrl">
<i class="fa-solid fa-star"></i>
&nbsp;
<span class="fs-5 fw-bold">@Title</span>
</button>
</div>
}
else
@if (!ShowBtn)
{
<div class="col-6">
<div class="input-group">
@@ -18,7 +8,7 @@
</div>
</div>
<div class="col-6">
<button class="btn btn-warning w-100 align-middle" @onclick="doCancel"><i class="fa-solid fa-ban"></i> Annulla</button>
<button class="btn btn-warning w-100 align-middle" @onclick="()=>doCancel()"><i class="fa-solid fa-ban"></i> Annulla</button>
</div>
<div class="col-12 my-1">
<div class="form-floating">
+9 -2
View File
@@ -30,6 +30,8 @@ namespace MP_TAB_SERV.Components
[Parameter]
public bool CanSave { get; set; } = false;
[Parameter]
public EventCallback<bool> E_relData { get; set; }
[Parameter]
public CommentiModel? CurrComm
{
set
@@ -101,8 +103,10 @@ namespace MP_TAB_SERV.Components
#region Protected Methods
protected void doCancel()
protected async Task doCancel()
{
await E_relData.InvokeAsync(true);
DoReset();
}
@@ -136,9 +140,11 @@ namespace MP_TAB_SERV.Components
// inserisco
await TabServ.EvListInsert(newRec, MP.Data.Objects.Enums.tipoInputEvento.commento);
// reset
await E_relData.InvokeAsync(true);
DoReset();
//StateHasChanged();
//ToggleCtrl();
await E_Updated.InvokeAsync(true);
}
protected override void OnInitialized()
@@ -245,6 +251,7 @@ namespace MP_TAB_SERV.Components
{
UserComment = "";
DateSel = DateTime.Now;
//CurrComm = null;
ShowBtn = true;
//StateHasChanged();
}
+1 -1
View File
@@ -1,5 +1,5 @@
<NotesEditor CanSave="true" Title="Nuovo Commento" RecMSE="@RecMSE" E_Updated="DoUpdate" CurrRecord="@currEv" CurrComm="currComm"></NotesEditor>
<NotesEditor CanSave="true" Title="Nuovo Commento" E_relData="reloadAfterDelOrUpd" RecMSE="@RecMSE" E_Updated="DoUpdate" CurrRecord="@currEv" CurrComm="currComm"></NotesEditor>
<div class="row mt-1">
<div class="col-12 pr-1">
+2 -1
View File
@@ -90,7 +90,8 @@ namespace MP_TAB_SERV.Components
{
if (rel)
{
await ReloadComments();
await ReloadData();
currComm = null;
await InvokeAsync(StateHasChanged);
}
}
+59 -27
View File
@@ -13,7 +13,7 @@
@if (isSlave)
{
<div class="col-12 my-2">
<div class="btn btn-warning w-100">
<div class="btn btn-danger text-warning w-100">
<div class="fs-1">@(Traduci("lblWarnHeadSlave"))</div>
<div class="fs-4">@(Traduci("lblWarnBodySlave"))</div>
</div>
@@ -23,10 +23,34 @@
{
@if (needConfProd)
{
@if (showSplitOdlOnTavVal || showReopOdlTav)
{
<div class="col-12 py-3">
<div class="row bg-danger">
<div class="col-12 col-md-6">
@if (showSplitOdlOnTavVal)
{
<button class="btn btn-lg btn-warning w-100" @onclick="OdlSetSameAsOtherTav"><i class="fa fa-check"></i> Attrezza stesso ODL da altra tavola <i class="fa fa-check"></i></button>
}
</div>
<div class="col-12 col-md-6">
@if (showReopOdlTav)
{
<button class="btn btn-lg btn-info w-100" @onclick="OdlReopenTav"><i class="fa fa-exclamation-triangle"></i> Riprendi ODL chiuso su tavola <i class="fa-solid fa-check me-1"></i></button>
}
</div>
</div>
</div>
}
<div class="col-12 my-2">
<div class="btn btn-danger w-100">
<div class="fs-1">@lblWarnHead</div>
<div class="fs-4">@lblWarnBody <b>@numPz2Conf.ToString("N0")</b> pz NC</div>
<div class="fs-4">
@lblWarnBody
<div>
Pezzi NC: <b>@numPz2Conf.ToString("N0")</b>
</div>
</div>
</div>
</div>
@if (!odlOk)
@@ -60,10 +84,10 @@
<div class="col-12">
Check articolo in revisione
</div>
@if (cancelSetupEnabled)
@if (cancelSetupEnabled && RecMSE.PezziConf == 0)
{
<div class="col-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>
<button class="btn btn-lg btn-danger w-100" @onclick="OdlAnnullaSetup">Annulla Setup ODL <i class="fa-solid fa-ban me-1"></i></button>
</div>
}
@@ -96,7 +120,7 @@
P.ODL:
</div>
<div class="px-0 text-end fw-bold">
@currPodl.IdxPromessa.ToString("N0")
@currPodl.IdxPromessa
</div>
</div>
<div class="col d-flex justify-content-between">
@@ -199,7 +223,7 @@
<button class="btn btn-lg btn-primary w-100" disabled="@endProdDisabled" @onclick="ProdEnd"><i class="fa-solid fa-ban me-1"></i>FINE Produzione</button>
}
</div>
<div class="col-12 col-md-6 mb-2">
<div class="col-12 col-md-6 mb-2 mt-2">
<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" @bind="IdxPOdlSel">
@@ -249,7 +273,7 @@
}
else
{
if (odlOk)
if (odlOk && showChkCloseOdlVal)
{
<div class="col-12 col-md-6 p-2">
<div class="form-check form-switch fs-3">
@@ -265,26 +289,34 @@
<button class="btn btn-lg btn-success w-100" @onclick="() => SendFixEndSetup()"><i class="fa-solid fa-wrench me-1"></i> Fix Chiusura Attrezzaggio (PLC)</button>
</div>
}
<div class="col-12 col-md-6 p-2">
<button class="btn btn-lg btn-info w-100" disabled="@needConfProd"><i class="fa-solid fa-triangle-exclamation me-1"></i> Mostra Riattrezzaggio</button>
</div>
<div class="col-12 col-md-6 p-2">
<button class="btn btn-lg btn-danger w-100" disabled="@needConfProd"><i class="fa-solid fa-circle-exclamation me-1"></i> Creazione ODL Provvisorio</button>
@* <div class="col-sm-12" runat="server" id="divOdlProvv">
<div class="card">
<div class="card-header p-0">
<div class="row">
<div class="col-12">
<asp:LinkButton runat="server" ID="lbtShowCreaOdlProvv" CssClass="btn w-100 btn-danger" OnClick="lbtShowCreaOdlProvv_Click"><i class="fa fa-exclamation-circle"></i> <%: lblCreaOdl %></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1 table-info text-dark table-secondary">
<uc1:cmp_newODL runat="server" ID="cmp_newODL" Visible="false" />
</div>
</div>
</div> *@
</div>
@if (enableRiattrezzaggio)
{
<div class="col-12 col-md-6 p-2">
<button class="btn btn-lg btn-info w-100" disabled="@needConfProd"><i class="fa-solid fa-triangle-exclamation me-1"></i> Mostra Riattrezzaggio</button>
</div>
}
@if (showOdlProvv)
{
<div class="col-12 col-md-6 p-2">
<button class="btn btn-lg btn-danger w-100" disabled="@needConfProd"><i class="fa-solid fa-circle-exclamation me-1"></i> Creazione ODL Provvisorio</button>
</div>
}
@* <div class="col-sm-12" runat="server" id="divOdlProvv">
<div class="card">
<div class="card-header p-0">
<div class="row">
<div class="col-12">
<asp:LinkButton runat="server" ID="lbtShowCreaOdlProvv" CssClass="btn w-100 btn-danger" OnClick="lbtShowCreaOdlProvv_Click"><i class="fa fa-exclamation-circle"></i> <%: lblCreaOdl %></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body p-1 table-info text-dark table-secondary">
<uc1:cmp_newODL runat="server" ID="cmp_newODL" Visible="false" />
</div>
</div>
</div> *@
<div class="col-12 text-center text-danger">
@lblOut
</div>
+175 -26
View File
@@ -14,6 +14,9 @@ namespace MP_TAB_SERV.Components
{
#region Public Properties
[Parameter]
public EventCallback<string> E_MachSel { get; set; }
/// <summary>
/// Post update restituisco nuova lista dati
/// </summary>
@@ -188,6 +191,72 @@ namespace MP_TAB_SERV.Components
return answ;
}
/// <summary>
/// Annulla setup ODL (come se avesse fatto FINE PROD)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected async Task OdlAnnullaSetup()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler annullare il setup ODL in corso, equivalente a registrare solo la fine produzione?"))
return;
// preparo gestione progress display
MaxVal = 9;
isProcessing = true;
int currStep = 0;
await advStep(currStep);
// leggo idxOdl da ultimo odl attivo x macchina
var odlLast = await TabDServ.OdlCurrByMacc(IdxMaccSel, true);
int idxODLCurr = odlLast.IdxOdl;
int idxEvento = 7; // !!!HARD CODED
await advStep(currStep++);
try
{
// confermo prod vecchio ODL
await confermaProdOdl(true);
await advStep(currStep++);
// processo x macchina selezionata
await TabDServ.OdlFineProd(idxODLCurr, IdxMaccSel);
await advStep(currStep++);
string evText = "Registrata ANNULLAMENTO ATTREZZAGGIO per ODL {0}";
StringBuilder sb = new StringBuilder();
sb.AppendLine(String.Format(evText, idxODLCurr));
await processaEvento(IdxMaccSel, idxEvento, sb.ToString(), idxODLCurr);
await advStep(currStep++);
// resetta PODL e rimuove ODL x poi TOGLIERE info di setup su macchina corrente
await TabDServ.OdlClearSetup(idxODLCurr, IdxMaccSel);
await advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
// hard coded 60gg last
await TabDServ.OdlFixMachineSlave(IdxMaccSel, 60, 1);
}
await advStep(currStep++);
// cancella dati correnti ODL
DoRemoveCurrOdlData();
await advStep(currStep++);
}
catch
{ }
// refresh finale
checkAll();
await RefreshData();
await CheckAttr();
await advStep(currStep++);
isProcessing = false;
await InvokeAsync(StateHasChanged);
}
/// <summary>
/// Effettua ripresa ODL su tavola
/// </summary>
@@ -195,12 +264,15 @@ namespace MP_TAB_SERV.Components
/// <param name="e"></param>
protected async Task OdlReopenTav()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler riprendere in carico l'ODL precedente?"))
return;
MaxVal = 3;
int currStep = 0;
await advStep(currStep);
isProcessing = true;
// chiamo stored x riprendere ODL (toglie data chiusura...)
var rowRes = TabDServ.OdlReopenOdlMacc(IdxMaccSel);
var rowRes = await TabDServ.OdlReopenOdlMacc(IdxMaccSel);
if (rowRes != null && rowRes.IdxOdl > 0)
{
// messaggio utente
@@ -227,6 +299,9 @@ namespace MP_TAB_SERV.Components
/// <param name="e"></param>
protected async Task OdlSetSameAsOtherTav()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler impostare lo stesso ODL dell'altra tavola?"))
return;
MaxVal = 3;
int currStep = 0;
await advStep(currStep);
@@ -261,7 +336,7 @@ namespace MP_TAB_SERV.Components
{
TimeSpan estDur = TimeSpan.FromMinutes((double)tcRichAttr * currPodl.NumPezzi);
string stima = estDur.TotalHours > 1 ? $"{estDur.TotalHours:N1} ore" : $"{estDur.TotalMinutes:N1} min";
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"PODL: {currPodl.IdxPromessa}{Environment.NewLine}Art: [{currPodl.CodArticolo}] {currPodl.DescArticolo}{Environment.NewLine}Pezzi: {currPodl.NumPezzi:N0} * TCiclo: {tcRichAttr:N3}min{Environment.NewLine}Tempo stimato: {stima}{Environment.NewLine}{Environment.NewLine}Confermi la chiusura della fase di attrezzaggio?"))
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"PODL: {currPodl.IdxPromessa}{Environment.NewLine}Art: [{currPodl.CodArticolo}] {currPodl.DescArticolo}{Environment.NewLine}Pezzi: {currPodl.NumPezzi} * TCiclo: {tcRichAttr:N3}min{Environment.NewLine}Tempo stimato: {stima}{Environment.NewLine}{Environment.NewLine}Confermi la chiusura della fase di attrezzaggio?"))
return;
// preparo gestione progress display
@@ -367,11 +442,10 @@ namespace MP_TAB_SERV.Components
{
TimeSpan estDur = TimeSpan.FromMinutes((double)tcRichAttr * currPodl.NumPezzi);
string stima = estDur.TotalHours > 1 ? $"{estDur.TotalHours:N1} ore" : $"{estDur.TotalMinutes:N1} min";
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"PODL: {currPodl.IdxPromessa}{Environment.NewLine}Art: [{currPodl.CodArticolo}] {currPodl.DescArticolo}{Environment.NewLine}Pezzi: {currPodl.NumPezzi:N0} * TCiclo: {tcRichAttr:N3}min{Environment.NewLine}Tempo stimato: {stima}{Environment.NewLine}{Environment.NewLine}Confermi inizio della fase di attrezzaggio?"))
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"PODL: {currPodl.IdxPromessa}{Environment.NewLine}Art: [{currPodl.CodArticolo}] {currPodl.DescArticolo}{Environment.NewLine}Pezzi: {currPodl.NumPezzi} * TCiclo: {tcRichAttr:N3}min{Environment.NewLine}Tempo stimato: {stima}{Environment.NewLine}{Environment.NewLine}Confermi inizio della fase di attrezzaggio?"))
return;
//if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi inizio della fase di attrezzaggio per l'articolo [{currPodl.CodArticolo}] {currPodl.DescArticolo}?"))
// return;
/***************************************************
* comprende gestione machineSlave x fix ODL master --> slave
*
@@ -419,6 +493,15 @@ namespace MP_TAB_SERV.Components
}
}
await advStep(currStep++);
#if false
// se fosse multi cambio dati di promODL x successivo setup...
if (isMulti)
{
currPodl.IdxMacchina = IdxMaccSel;
}
#endif
// fix idxmacchina selezionata (x ogni macchina, singola o multi...)
currPodl.IdxMacchina = IdxMaccSel;
// 2018.07.24 verifico se devo lavorare come ODL classico o come RPO (Richiesta /
// Promessa / ODL)
if (enableRPO)
@@ -562,14 +645,19 @@ namespace MP_TAB_SERV.Components
{
//baseLang = SMServ.GetConf("baseLang");
numDayOdl = SMServ.GetConfInt("numDaySelOdl");
forceCloseOdl = SMServ.GetConfBool("chkCloseOdl");
confRett = SMServ.GetConfBool("confRett");
enableSplitODL = SMServ.GetConfBool("enableSplitODL");
modoConfProd = SMServ.GetConfInt("modoConfProd");
enableRPO = SMServ.GetConfBool("enableRPO");
enableAnnullaSetup = SMServ.GetConfBool("enableAnnullaSetup");
enableSchedaTecnica = SMServ.GetConfBool("enableSchedaTecnica");
enableFixSetup = SMServ.GetConfBool("OptEnableFixSetup");
showSplitOdlOnTav = SMServ.GetConfBool("showSplitOdlOnTav");
showChkCloseOdlVal = SMServ.GetConfBool("showChkCloseOdl");
showReopenOdlTav = SMServ.GetConfBool("showReopenOdlTav");
showSplitOdlOnTav = SMServ.GetConfBool("showSplitOdlOnTav");
enableRiattrezzaggio = SMServ.GetConfBool("enableRiattrezzaggio");
showOdlProvv = SMServ.GetConfBool("showOdlProvv");
gPeriodReopenOdlTav = SMServ.GetConfInt("gPeriodReopenOdlTav");
string rawEmailDest = SMServ.GetConf("_adminEmail");
emailAdmDest = rawEmailDest.Split(',').ToList();
@@ -603,8 +691,8 @@ namespace MP_TAB_SERV.Components
// leggo idxOdl da ultimo odl attivo x macchina
var currOdl = await TabDServ.OdlCurrByMacc(IdxMaccSel, false);
int idxODLCurr = currOdl.IdxOdl;
int idxEvento = 7; // !!!HARD CODED
// confermo prod vecchio ODL
int idxEvento = 7;
// !!!HARD CODED confermo prod vecchio ODL
await confermaProdOdl(false);
await advStep(currStep++);
@@ -731,7 +819,7 @@ namespace MP_TAB_SERV.Components
protected async Task SendFixEndSetup()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi invio FIX chiusura atrtezzaggio ad impianto?"))
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi invio FIX chiusura attrezzaggio ad impianto?"))
return;
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
@@ -787,12 +875,17 @@ namespace MP_TAB_SERV.Components
protected async Task SetMacc(string selIdxMacc)
{
isProcessing = true;
await Task.Delay(10);
// imposto macchina
IdxMaccSel = selIdxMacc;
// recupero dati
RecMSE = TabDServ.MseGetSub(IdxMaccParent, selIdxMacc, true);
await ReloadData(true);
await DoUpdate();
isProcessing = false;
await Task.Delay(10);
if (showOdlDetail || inAttr)
{
await ReloadXDL(true);
}
await E_MachSel.InvokeAsync(selIdxMacc);
}
protected async Task ToggleOdlDetail()
@@ -816,16 +909,17 @@ namespace MP_TAB_SERV.Components
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool cancelSetupEnabled = false;
private bool confRett = true;
private double currVal = 0;
private List<string> emailAdmDest = new List<string>();
private bool enableAnnullaSetup = false;
private bool enableFixSetup = false;
private bool enableRiattrezzaggio = false;
private bool enableRPO = true;
private bool enableSchedaTecnica = false;
@@ -872,24 +966,26 @@ namespace MP_TAB_SERV.Components
private bool showAll = false;
private bool showChkCloseOdlVal = false;
private bool showOdlDetail = false;
private bool showOdlProvv = false;
private bool showReopenOdlTav = false;
private bool showSplitOdlOnTav = false;
private decimal tcRichAttr = 1;
#endregion Private Fields
#region Private Properties
private string _baseLang { get; set; } = "IT";
private string baseLang
{
get => _baseLang;
set { MServ.UserPrefGet("Lang"); }
get => MServ.UserPrefGet("Lang");
}
private bool cancelSetupEnabled
{
get => inAttr && enableSchedaTecnica && enableAnnullaSetup;
}
private string cssDetailOdl
@@ -932,7 +1028,17 @@ namespace MP_TAB_SERV.Components
/// </summary>
private int IdxOdl
{
get => RecMSE != null ? RecMSE.IdxOdl ?? 0 : 0;
get
{
int answ = 0;
var pUpd = Task.Run(async () =>
{
var tabOdl = await TabDServ.OdlCurrByMacc(IdxMaccSel, false);
answ = tabOdl.IdxOdl;
});
pUpd.Wait();
return answ;
}
}
/// <summary>
@@ -945,8 +1051,8 @@ namespace MP_TAB_SERV.Components
int answ = 0;
var pUpd = Task.Run(async () =>
{
var tabOdlAltra = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, false);
answ = tabOdlAltra.IdxOdl;
var tabOdl = await TabDServ.OdlCurrByMacc(idxMaccAltraTav, false);
answ = tabOdl.IdxOdl;
});
pUpd.Wait();
return answ;
@@ -1317,6 +1423,46 @@ namespace MP_TAB_SERV.Components
}
}
/// <summary>
/// Rimozione dati e parametri (TAB e su PLC) x ODL corrente
/// </summary>
private void DoRemoveCurrOdlData()
{
// invio task x end produzione...
string setArtVal = "NO ART";
string setPzCommVal = "0";
string setCommVal = $"NO ODL";
// FIXME TODO: scrivere come sotto? testare valvital x linea LASCO
TabDServ.addTask4Machine(IdxMaccSel, taskType.endProd, "");
TabDServ.addTask4Machine(IdxMaccSel, taskType.setArt, setArtVal);
TabDServ.addTask4Machine(IdxMaccSel, taskType.setPzComm, setPzCommVal);
TabDServ.addTask4Machine(IdxMaccSel, taskType.setComm, setCommVal);
// se è master --> chiamo update child!
if (isMaster)
{
// calcolo gli slave...
var slaveList = SMServ.ListM2S
.Where(x => x.IdxMacchina.Equals(IdxMaccSel, StringComparison.InvariantCultureIgnoreCase))
.ToList();
foreach (var machine in slaveList)
{
// invio task x end produzione...
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.endProd, "");
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.setArt, setArtVal);
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.setPzComm, setPzCommVal);
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.setComm, setCommVal);
}
}
// rimando a pagina dettaglio...
NavMan.NavigateTo("machine-detail", true);
}
#if false
{
get => RecMSE != null ? RecMSE.IdxOdl ?? 0 : 0;
}
#endif
/// <summary>
/// sistema buttons split
/// </summary>
@@ -1408,8 +1554,11 @@ namespace MP_TAB_SERV.Components
Log.Trace($"found {ListODL.Count} rec");
if (forceReload)
{
var rawData = await TabDServ.PezziProdMacchina(IdxMaccSel);
prodMacchina = rawData.FirstOrDefault() ?? new PzProdModel();
if (!isMulti || (isMulti && IdxMaccSel.IndexOf("#") > 0))
{
var rawData = await TabDServ.PezziProdMacchina(IdxMaccSel);
prodMacchina = rawData.FirstOrDefault() ?? new PzProdModel();
}
}
}
// imposto tcRichAttr in base allo stato...
+1 -1
View File
@@ -6,7 +6,7 @@
</div>*@
@*<div class="col-6">
</div>*@
<a runat="server" href="@navUrl" target="_blank" class="btn btn-primary btn-sm w-100 py-2 px-4">MAG</a>
<a runat="server" href="@navUrl" target="_blank" class="btn btn-primary btn-sm w-100 py-2 px-4">MAG &nbsp; <i class="fa-solid fa-print"></i></a>
</div>
+72 -53
View File
@@ -1,25 +1,28 @@

<div class="col-12 mt-1">
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
</div>
<div class="d-flex justify-content-between mt-2">
<div class="col-4">
<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
</div>
<div class="col-8 d-flex justify-content-end">
<div class="px-1 col-4">
<PrintMag RecMSE="RecMSE"></PrintMag>
</div>
<div class="col-12 d-flex justify-content-between">
@if (enableMagPrint)
{
<div class="px-1 col-6">
<PrintMag RecMSE="RecMSE"></PrintMag>
</div>
}
@if (odlOk)
{
<div class="px-1 col-8">
<button class="btn btn-sm @ConfBg py-2 px-4" style="width: 100%" @onclick="ToggleConfProd">
<div class="px-1 @ConfCssWidth">
<button class="btn btn-sm @ConfBg py-2 px-4" style="width: 100%" @onclick="()=>ToggleConfProd()">
<i class="fa-solid fa-check pe-1"></i><span>@ConfTitle</span>
</button>
</div>
}
else
{
<div class="alert alert-warning fs-3">MANCA ODL: conferma NON permessa</div>
<div class="alert alert-warning text-danger fw-bold fs-3">MANCA ODL: conferma NON permessa</div>
}
</div>
</div>
@@ -27,33 +30,23 @@
@if (showInnov)
{
@*class="d-flex justify-content-between"*@
<div class="cardBg p-2 mt-2">
<div class="d-flex justify-content-between">
<div class="col-3 p-1">
<div class="bg-success rounded">
<div class="ps-1 fw-bold" style="font-size: .9rem;">Pezzi confermati</div>
<input class="form-control text-light bg-success border-0" aria-label="Floating label select example" @bind="numPzProdotti2Rec" @onblur="() => setConfirmBtn(true)" @onfocus="() => setConfirmBtn(false)" />
<div class="col-6">
<div class="p-1">
<div class="ps-1 fw-bold" style="font-size: 1.3rem;">Pz Prodotti CONFERMATI</div>
<div class="rounded">
<input class="form-control border-0 fw-bold" style="font-size: 1.5rem; background-color: #fff3cd; color: #000" aria-label="Floating label select example" @bind="numPzProdotti2Rec" @onblur="() => setConfirmBtn(true)" @onfocus="() => setConfirmBtn(false)" />
</div>
</div>
@*<div class="form-floating">
<input class="form-select" id="floatingSelect" aria-label="Floating label select example" />
<label for="floatingSelect">Works with selects</label>
</div>*@
@*<div class="form-floating">
<input type="number" class="form-control bg-success" id="floatingInputConf" @bind="numPzProdotti2Rec" @onblur="() => setConfirmBtn(true)" @onfocus="() => setConfirmBtn(false)">
<label for="floatingInputConf" class="text-light bg-success fw-bold" style="font-size: .8rem;">
Pezzi confermati
</label>
</div>*@
</div>
<div class="col-3 p-1">
<div class="bg-secondary rounded">
<div class="p-1">
@if (enablePzProdLasciati)
{
<div class="ps-1 fw-bold" style="font-size: .9rem;">Lasciati</div>
<input class="form-control text-light bg-secondary border-0" aria-label="Floating label select example" @bind="numPzLasciati" @onblur="() => setConfirmBtn(true)" @onfocus="() => setConfirmBtn(false)" />
<div class="ps-1 fw-bold" style="font-size: 1.3rem;">Pz Prodotti LASCIATI</div>
<div class="bg-secondary rounded">
<input class="form-control text-light bg-secondary border-0" style="font-size: 1.5rem;" aria-label="Floating label select example" @bind="numPzLasciati" @onblur="() => setConfirmBtn(true)" @onfocus="() => setConfirmBtn(false)" />
</div>
}
else
{
@@ -61,15 +54,40 @@
}
</div>
</div>
<div class="col-3 p-1">
<div><span class="text-success">Pz Buoni</span>&nbsp;<span>@lblPz2RecBuoni</span></div>
<div><span class="text-danger">Pz scarto</span>&nbsp;<span>@lblPz2RecScarto</span></div>
</div>
<div class="col-3 p-1">
@if (showConfirm)
{
<button class="btn btn-success text-light btn-lg w-100 h-100" @onclick="SalvaConfPz"><i class="fa-regular fa-floppy-disk"></i></button>
}
<div class="col-6">
<div style="display: flex; flex-direction: column; justify-content: space-between; height: 100%;">
<div class="p-1" style="font-size: 1.5rem">
<div class="d-flex justify-content-between">
<span class="text-success">Pz Buoni</span>
<span>@lblPz2RecBuoni</span>
</div>
<div class="d-flex justify-content-between">
<span class="text-danger">Pz scarto</span>
<span>@lblPz2RecScarto</span>
</div>
</div>
<div class="text-center h-100 d-flex flex-column align-items-center flex-nowrap justify-content-end">
@($"{dtReqUpdate:HH:mm:ss} | {dtReqUpdate:ddd yyyy.MM.dd}")
</div>
<div class="p-1">
@if (showConfirm && lblPz2RecBuoni >= 0)
{
<button class="btn btn-success text-light btn-lg w-100 h-100" @onclick="SalvaConfPz"><i class="fa-regular fa-floppy-disk"></i></button>
}
else if (showConfirm && lblPz2RecBuoni < 0 && !chkPzBuoniNeg)
{
<button class="btn btn-success text-light btn-lg w-100 h-100" @onclick="SalvaConfPz"><i class="fa-regular fa-floppy-disk"></i></button>
}
else if (showConfirm && lblPz2RecBuoni < 0 && chkPzBuoniNeg)
{
<div class="alert bg-danger text-light fw-bold text-center">Pezzi buoni negativi!</div>
}
else
{
<div class="alert bg-info text-dark fw-bold text-center">Completare le modifiche!</div>
}
</div>
</div>
</div>
</div>
@@ -80,14 +98,7 @@
<div class="col-4 py-1 text-start text-uppercase">
<b>Dati Globali ODL</b>
</div>
<div class="col-8 d-flex justify-content-end pe-3">
<div>
<a class="btn btn-info btn-sm w-100 py-2 px-4" style="min-width: 72px; min-height: 39px" href="scrap"><i class="fa fa-bug"></i></a>
</div>
<div class="ms-2">
<a class="btn btn-primary btn-sm w-100 py-2 px-4" style="min-width: 72px; min-height: 39px" href="controls"><i class="fa fa-wrench"></i></a>
</div>
</div>
<div class="d-flex justify-content-between flex-wrap mt-2">
<div class="col-6 col-sm-3 p-1">
@@ -102,7 +113,7 @@
}
else
{
<span class="fw-bold" style="font-size: 3vh">@($"{numPzProdotti2Rec:N0}")</span>
<span class="fw-bold" style="font-size: 3vh">@numPzProdotti2Rec</span>
}
</div>
</div>
@@ -119,7 +130,7 @@
}
else
{
<span class="fw-bold" style="font-size: 3vh">@numPzProdotti.ToString("N0")</span>
<span class="fw-bold" style="font-size: 3vh">@numPzProdotti</span>
}
</div>
</div>
@@ -136,7 +147,7 @@
}
else
{
<span class="fw-bold" style="font-size: 3vh">@numPzScaConf.ToString("N0")</span>
<span class="fw-bold" style="font-size: 3vh">@numPzScaConf</span>
}
</div>
</div>
@@ -153,7 +164,7 @@
}
else
{
<span class="fw-bold" style="font-size: 3vh">@numPzBuoniConf.ToString("N0")</span>
<span class="fw-bold" style="font-size: 3vh">@numPzBuoniConf</span>
}
</div>
</div>
@@ -161,6 +172,14 @@
</div>
<div class="d-flex justify-content-between p-3 pe-4">
<div class="col-6">
<a class="btn btn-info btn-sm w-100 py-2 px-4" style="min-width: 72px; min-height: 39px" href="scrap"><i class="fa fa-bug"></i> Reg. SCARTI</a>
</div>
<div class="ms-2 col-6">
<a class="btn btn-primary btn-sm w-100 py-2 px-4" style="min-width: 72px; min-height: 39px" href="controls"><i class="fa fa-wrench"></i> Reg. CONTROLLI</a>
</div>
</div>
</div>
@if (!string.IsNullOrEmpty(lblOut))
{
+19 -5
View File
@@ -14,6 +14,9 @@ namespace MP_TAB_SERV.Components
[Parameter]
public EventCallback<bool> E_inserting { get; set; }
[Parameter]
public EventCallback<string> E_MachSel { get; set; }
/// <summary>
/// registrato nuovo valore
/// </summary>
@@ -50,6 +53,10 @@ namespace MP_TAB_SERV.Components
{
get => showInnov ? "Nascondi conferma" : "Mostra conferma";
}
protected string ConfCssWidth
{
get => enableMagPrint ? "col-6" : "col-12";
}
/// <summary>
/// Dati produzioen rilevati
@@ -152,7 +159,9 @@ namespace MP_TAB_SERV.Components
{
IdxMaccSel = RecMSE.IdxMacchina;
enablePzProdLasciati = SMServ.GetConfBool("enablePzProdLasciati");
chkPzBuoniNeg = SMServ.GetConfBool("TAB_ChkConfPz");
confRett = SMServ.GetConfBool("confRett");
enableMagPrint = SMServ.GetConfBool("enableMagPrint");
modoConfProd = SMServ.GetConfInt("modoConfProd");
await DoUpdate();
}
@@ -176,11 +185,11 @@ namespace MP_TAB_SERV.Components
RecMSE = ListMSE.Find(x => x.IdxMacchina == IdxMaccSel);
}
// mostro output
lblOut = $"Confermata produzione {numPzConfermati - numPzLasciati} pezzi (+{numPzLasciati} pz lasciati, +{numPzScarto2Rec:N0} pz scarto) |{dtReqUpdate:HH:mm:ss} | {dtReqUpdate:ddd yyyy.MM.dd}";
lblOut = $"Confermata produzione {numPzConfermati - numPzLasciati} pezzi (+{numPzLasciati} pz lasciati, +{numPzScarto2Rec} pz scarto) |{dtReqUpdate:HH:mm:ss} | {dtReqUpdate:ddd yyyy.MM.dd}";
// cambio button conferma...
showInnov = false;
// sollevo evento!
dtReqUpdate = DateTime.Now;
//dtReqUpdate = DateTime.Now;
numPzLasciati = 0;
await DoUpdate();
await Task.Delay(1);
@@ -196,20 +205,23 @@ namespace MP_TAB_SERV.Components
protected async Task SetMacc(string selIdxMacc)
{
isProcessing = true;
await Task.Delay(10);
await Task.Delay(1);
IdxMaccSel = selIdxMacc;
await DoUpdate();
isProcessing = false;
await Task.Delay(10);
await Task.Delay(1);
await E_MachSel.InvokeAsync(selIdxMacc);
}
/// <summary>
/// Cambio stato visibilità pannello e testo button
/// </summary>
protected void ToggleConfProd()
protected async Task ToggleConfProd()
{
showInnov = !showInnov;
dtReqUpdate = DateTime.Now;
await DoUpdate();
StateHasChanged();
}
#endregion Protected Methods
@@ -219,6 +231,8 @@ namespace MP_TAB_SERV.Components
private bool confRett = false;
private bool enablePzProdLasciati = false;
private bool enableMagPrint = false;
private bool chkPzBuoniNeg = false;
private string lblOut = "";
+1 -1
View File
@@ -72,7 +72,7 @@ else
<td>
<div class="row">
<div class="col-12 col-lg-6 text-nowrap text-success">
Tot: @($"{item.NumPezzi:N0}")
Tot: @($"{item.NumPezzi}")
<div class="text-secondary textCondens">
@item.PzPallet pz/pal
</div>
+2 -18
View File
@@ -49,7 +49,7 @@
<span>Nr Pezzi lanciati</span>
</div>
<div class="text-center fw-bold">
<span>@($"{RecMSE.NumPezzi:N0}") pz.</span>
<span>@($"{RecMSE.NumPezzi}") pz.</span>
</div>
<div class="text-center small">
</div>
@@ -68,22 +68,6 @@
</div>
</div>
</div>
<div class="d-flex justify-content-between ">
<div class="col-3 p-1 flex-fill">
<div class="cardFullHeight p-1">
@@ -91,7 +75,7 @@
<span>Nr pezzi fatti</span>
</div>
<div class="text-center fw-bold">
<span>(@($"{RecMSE.PezziProd:N0}") pz.)</span>
<span>(@($"{RecMSE.PezziProd}") pz.)</span>
</div>
<div class="text-center small">
</div>
+6
View File
@@ -10,6 +10,12 @@
</div>
</div>
</div>
@if(errMsg != "")
{
<div class="alert bg-danger mt-1">
@errMsg
</div>
}
@if (ShowDetail)
{
<div class="p-1">
+18 -6
View File
@@ -81,14 +81,26 @@ namespace MP_TAB_SERV.Components
Note = UserComment
};
// inserisco
await TabServ.RegScartiInsert(newRec);
// reset
DoReset();
//ToggleCtrl();
await E_Updated.InvokeAsync(true);
var done = await TabServ.RegScartiInsert(newRec);
if (done)
{
// reset
DoReset();
errMsg = "";
//ToggleCtrl();
await E_Updated.InvokeAsync(true);
await ReloadData();
StateHasChanged();
}
else
{
errMsg = "ODL non attivo o data/ora errato";
}
ShowDetail = false;
}
protected string errMsg { get; set; } = "";
protected override async Task OnInitializedAsync()
{
await ReloadData();
+31 -23
View File
@@ -1,33 +1,41 @@

<MachSel RecMSE="RecMSE" E_MachSel="SetMacc"></MachSel>
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<div style="font-size: .8rem">
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
</div>
}
<ShowProcessing Message="Caricamento" IsProcessing="@isProcessing"></ShowProcessing>
<div class="cardObj p-2 mt-2">
<div class="mb-2">
<ScrapEditor RecMSE="@RecMSE" E_Updated="doUpdate"></ScrapEditor>
@if (enableScarti)
{
<div class="mb-2">
<ScrapEditor RecMSE="@RecMSE" E_Updated="doUpdate"></ScrapEditor>
</div>
}
else
{
<div class="alert bg-info text-dark fw-bold">Registrazione scarti disabilitata</div>
}
<div class="row">
<div class="col-6">
<h2>Tipo Selezione</h2>
</div>
<div class="col-6">
<div class="form-check form-switch fs-3">
<input class="form-check-input" type="checkbox" @bind="@useOdl">
<label class="form-check-label">@selMessage</label>
</div>
</div>
</div>
@if (useOdl)
{
<MachineSelOdl IdxMacchina="@IdxMaccSel" E_OdlSel="SetOdl"></MachineSelOdl>
}
else
{
<div style="font-size: .8rem">
<EgwCoreLib.Razor.PeriodoSel CurrPeriodo="CurrPeriodo" E_PeriodoSel="SetPeriodo"></EgwCoreLib.Razor.PeriodoSel>
</div>
}
<div class="mb-2 p-1">
<div class="row">
<div class="col-12">
+5
View File
@@ -50,16 +50,21 @@ namespace MP_TAB_SERV.Components
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected bool enableScarti { get; set; } = true;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
if (RecMSE != null)
{
enableScarti = SMServ.GetConfBool("enableScarti");
IdxMaccSel = RecMSE.IdxMacchina;
DateTime fine = DateTime.Today.AddDays(1);
DateTime inizio = fine.AddDays(-8);
@@ -1,5 +1,6 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB_SERV.Components
{
@@ -16,6 +17,8 @@ namespace MP_TAB_SERV.Components
[Inject]
protected NavigationManager navManager { get; set; } = null!;
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
@@ -29,6 +32,11 @@ namespace MP_TAB_SERV.Components
protected async Task SetPage(string tgtUrl)
{
await Task.Delay(1);
if (tgtUrl.Contains("status-map"))
{
await MsgServ.IdxMaccSet("");
}
await MsgServ.LastOpenedPageSet(tgtUrl);
navManager.NavigateTo(tgtUrl);
}
+3 -4
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2311.1016</Version>
<Version>6.16.2312.1115</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB_SERV</RootNamespace>
</PropertyGroup>
@@ -17,15 +17,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2310.2417" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2310.2417" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2311.1612" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2311.1612" />
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
</ItemGroup>
<ItemGroup>
<Folder Include="Data\" />
<Folder Include="Controllers\" />
<Folder Include="wwwroot\lib\" />
</ItemGroup>
<ItemGroup>
+20
View File
@@ -0,0 +1,20 @@
@page "/"
@page "/home"
<img src="~/images/LogoEgw.png" />
@code {
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await Task.Delay(1);
}
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
}
}
+1 -3
View File
@@ -1,8 +1,6 @@
@page "/logout"
<h3>logout</h3>
<LoadingData></LoadingData>
@code {
}
+48
View File
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP_TAB_SERV;
using MP_TAB_SERV.Shared;
using MP_TAB_SERV.Components;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.Data.Services;
using Newtonsoft.Json;
using NLog;
using EgwCoreLib.Razor;
using Blazored.LocalStorage;
namespace MP_TAB_SERV.Pages
{
public partial class Logout
{
[Inject]
protected ILocalStorageService localStorage { get; set; } = null!;
[Inject]
protected TabDataService TDService { get; set; } = null!;
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
await localStorage.SetItemAsync("currTkn", "");
await TDService.OperatoreDeleteRedis(MsgServ.MatrOpr);
MsgServ.RigaOper = null;
NavMan.NavigateTo("reg-new-device");
}
}
}
+2 -2
View File
@@ -8,7 +8,7 @@
}
else
{
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<ProdConfirm RecMSE="CurrMSE" E_Updated="RefreshData"></ProdConfirm>
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
<ProdConfirm RecMSE="CurrMSE" E_Updated="RefreshData" E_MachSel="SetMacc"></ProdConfirm>
<ProdStat RecMSE="CurrMSE"></ProdStat>
}
+6 -1
View File
@@ -61,14 +61,19 @@ namespace MP_TAB_SERV.Pages
}
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
}
#endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private bool enableMagLotti = false;
private bool enableSchedaTecnica = false;
private string IdxMaccSubSel = "";
#endregion Private Fields
+2 -2
View File
@@ -7,6 +7,6 @@
}
else
{
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
<OdlMan RecMSE="CurrMSE" E_Updated="RefreshData"></OdlMan>
<MachineBlock RecMSE="CurrMSE" FullMode="false" IdxMacchSub="@IdxMaccSubSel"></MachineBlock>
<OdlMan RecMSE="CurrMSE" E_Updated="RefreshData" E_MachSel="SetMacc"></OdlMan>
}
+28 -19
View File
@@ -23,25 +23,6 @@ namespace MP_TAB_SERV.Pages
await ReloadData();
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
@@ -69,6 +50,34 @@ namespace MP_TAB_SERV.Pages
}
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
}
#endregion Protected Methods
#region Private Fields
private string IdxMaccSubSel = "";
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
+74
View File
@@ -0,0 +1,74 @@
@page "/reg-new-device"
<div class="text-center">
<span class="fs-2 fw-bold">QR-Scan USER LOGIN</span>
</div>
<div class="d-flex justify-content-center w-100">
<button class="btn btn-sm btn-info fw-bold w-100" @onclick="()=>ToggleCodeScan()"><i class="fa-solid fa-qrcode"></i> &nbsp; Scan</button>
</div>
@if (ShowScanBarcode)
{
<BarcodeReader ScanResult="(e) => ScanDoneHandler(e)"
Close="ToggleCodeScan"
ScanBtnTitle="Scan"
ResetBtnTitle="Reset"
CloseBtnTitle="Close"
UseBuiltinDiv="false"
@ref="barcodeReaderCustom"
SelectDeviceBtnTitle="Select Device">
</BarcodeReader>
<div @ref="barcodeReaderCustom.Element" class="d-flex justify-content-center">
<div class="col-12 col-md-8 col-lg-6">
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="startButton">Scan</button>
<button class="btn btn-outline-success p-2 m-1 w-25" data-action="resetButton">Reset</button>
<button class="btn btn-outline-success p-2 m-1 w-25" @onclick="() => ToggleCodeScan()">Close</button>
<div data-action="sourceSelectPanel" style="display:none">
<label for="sourceSelect">Source:</label>
<select data-action="sourceSelect" style="max-width:100%" class="form-control">
</select>
</div>
<div>
<video id="video" playsinline="true" autoplay="true" class="w-100 h-100 border rounded shadow" muted="true"></video>
</div>
</div>
</div>
}
@if (oprsList.Count > 0)
{
<div class="mb-1">
<span class="fs-5 fw-bold">Selezionare un operatore</span>
<select class="form-select" @bind="matrOpr">
@foreach (var opr in oprsList)
{
<option value="@opr.MatrOpr">@($"{opr.Cognome} {opr.Nome}")</option>
}
</select>
</div>
<div>
<span class="fs-5 fw-bold">User Auth Key</span>
<input type="password" class="form-control" @bind="authKey" />
</div>
}
<div class="d-flex justify-content-between my-2">
<div class="pe-2 col-6">
<button class="btn btn-sm btn-primary w-100" @onclick="()=>FirstLogIn()">Log In</button>
</div>
<div class="ps-2 col-6">
<button class="btn btn-sm btn-warning w-100">Cancel</button>
</div>
</div>
@if (!string.IsNullOrEmpty(txtError))
{
<div class="alert alert-danger fs-3">
@txtError
</div>
}
+173
View File
@@ -0,0 +1,173 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.WebUtilities;
//using MongoDB.Bson.IO;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.Data.Services;
using Newtonsoft.Json;
namespace MP_TAB_SERV.Pages
{
public partial class RegNewDevice
{
#region Protected Fields
protected int expDays = 1;
protected DateTime vetoScan = DateTime.Now;
#endregion Protected Fields
#region Protected Properties
protected string _authKey { get; set; } = "";
protected int _matrOpr { get; set; } = 0;
protected string authKey
{
get
{
return _authKey;
}
set
{
if (_authKey != value)
{
_authKey = value;
FirstLogIn().ConfigureAwait(false);
}
}
}
protected string CurrOprTknLS { get; set; } = null!;
protected string CurrOprTknRedis { get; set; } = null!;
protected DateTime expDT { get; set; } = DateTime.Now;
protected int matrOpr
{
get
{
return _matrOpr;
}
set => _matrOpr = value;
}
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
protected List<AnagOperatoriModel> oprsList { get; set; } = new List<AnagOperatoriModel>();
protected AnagOperatoriModel rigaOpr { get; set; } = null!;
[Inject]
protected TabDataService TDService { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task ToggleCodeScan()
{
await Task.Delay(1);
ShowScanBarcode = !ShowScanBarcode;
}
protected string txtError = "";
protected string Traduci(string lemma)
{
return SMServ.Traduci($"EN_{lemma}".ToUpper());
}
protected async Task FirstLogIn()
{
rigaOpr = await TDService.OperatoreSearch(matrOpr, authKey);
if (rigaOpr == null)
{
var deHash = TDService.DecryptData(authKey);
rigaOpr = await TDService.OperatoreSearch(matrOpr, deHash);
}
if (rigaOpr != null && rigaOpr.MatrOpr > 0)
{
userTknDTO newUserTkn = new userTknDTO()
{
currOpr = rigaOpr,
expTime = expDT
};
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
string hash = TDService.EncryptData(jsonTkn);
MsgServ.RigaOper = rigaOpr;
await MsgServ.SetCurrOperDtoAsync(hash);
await MsgServ.SetLastMatrOprAsync(rigaOpr.MatrOpr);
await TDService.OperatoreSetRedis(matrOpr, hash);
NavMan.NavigateTo("status-map");
}
else
{
txtError = Traduci("UserPwdMismatch");
authKey = "";
}
}
protected override async Task OnInitializedAsync()
{
txtError = "";
matrOpr = await MsgServ.GetLastMatrOprAsync();
TDService.ConfigGetVal("cookieDayExpire", ref expDays);
ShowScanBarcode = !SMServ.GetConfBool("TAB_WebCamHide");
expDT = DateTime.Now.AddDays(expDays);
oprsList = await TDService.ElencoOperatori();
}
protected async Task ScanDoneHandler(string value)
{
DateTime adesso = DateTime.Now;
// non nullo
if (!string.IsNullOrEmpty(value))
{
// non veto...
if (adesso.Subtract(vetoScan).TotalMinutes > 0)
{
vetoScan = adesso.AddSeconds(4);
//NavManager.NavigateTo($"CodeProcess/{value}");
var uri = NavMan.ToAbsoluteUri(value);
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("MatrOpr", out var Uri_matrOpr))
{
if (!string.IsNullOrEmpty(Uri_matrOpr))
{
matrOpr = int.Parse(Uri_matrOpr);
}
}
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var Uri_authKey))
{
if (!string.IsNullOrEmpty(Uri_authKey))
{
authKey = Uri_authKey;
}
}
await FirstLogIn();
}
}
}
#endregion Protected Methods
#region Private Properties
private bool ShowScanBarcode { get; set; } = false;
protected EgwCoreLib.Razor.BarcodeReader barcodeReaderCustom { get; set; } = null!;
#endregion Private Properties
}
}
+1 -3
View File
@@ -1,6 +1,4 @@
@page "/"
@page "/home"
@page "/status-map"
@page "/status-map"
<MseSampler SampleMult="1.5" E_Updated="SaveData"></MseSampler>
<div class="row">
+57 -65
View File
@@ -3,6 +3,7 @@ using Microsoft.JSInterop;
using MP.Data.Conf;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using MP_TAB_SERV.Shared;
using NLog;
using System.Runtime.ExceptionServices;
@@ -10,6 +11,20 @@ namespace MP_TAB_SERV.Pages
{
public partial class StatusMap
{
#region Public Classes
public class WindowDimension
{
#region Public Properties
public int Height { get; set; }
public int Width { get; set; }
#endregion Public Properties
}
#endregion Public Classes
#region Protected Fields
protected bool _showCard = false;
@@ -25,13 +40,20 @@ namespace MP_TAB_SERV.Pages
[Inject]
protected IConfiguration config { get; set; } = null!;
protected int Height { get; set; } = 0;
protected bool isCalcSize { get; set; } = false;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected StatusData MDataService { get; set; } = null!;
[Inject]
protected MessageService MServ { get; set; } = null!;
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime{ get; set; } = null!;
protected NavigationManager NavMan { get; set; } = null!;
protected bool ShowCard
{
@@ -46,50 +68,19 @@ namespace MP_TAB_SERV.Pages
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
protected int Width { get; set; } = 0;
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Recupera da conf eventuale setup tag dell'IOB indicato
/// </summary>
/// <param name="codIob"></param>
/// <returns></returns>
protected List<TagData>? getIobTag(string codIob)
protected async Task getWDim()
{
List<TagData>? answ = null;
if (MDataService.currTagConf != null)
{
// cerco x chiave IOB...
if (MDataService.currTagConf.ContainsKey(codIob))
{
answ = MDataService.currTagConf[codIob];
}
}
return answ;
var dimension = await JSRuntime.InvokeAsync<WindowDimension>("getWindowDimensions");
Height = dimension.Height;
Width = dimension.Width;
}
/// <summary>
/// Recupera da redis (in una chiamata soltanto) tutti i valori richiesti e compone un
/// dizionario x ottimizzare visualizzazione
/// </summary>
/// <param name="codIob"></param>
/// <returns></returns>
protected Dictionary<string, string> getTagVal(string codIob)
{
Dictionary<string, string> answ = new Dictionary<string, string>();
// recupero conf tags...
var currTags = getIobTag(codIob);
if (currTags != null && currTags.Count > 0)
{
// FIXME TODO !!!! FARE !!!! - da verificare
answ = currTags.ToDictionary(x => x.TagLocation, x => MDataService.getTagConf(x.TagLocation));
}
return answ;
}
protected bool isCalcSize { get; set; } = false;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
@@ -102,24 +93,31 @@ namespace MP_TAB_SERV.Pages
if (ListMSE != null)
{
// salvo in LocalStorage...
await MServ.SaveMse(ListMSE);
await MsgServ.SaveMse(ListMSE);
}
}
protected override void OnInitialized()
protected override async Task OnInitializedAsync()
{
var df = MServ.UserPrefGet("DefCardMode");
ShowCard = df == "shrink" ? false : true;
isCalcSize = true;
setDefaults();
ListMSE = null;
SetupConf();
var LastOpenedPage = await MsgServ.LastOpenedPageGet();
var currMacc = await MsgServ.IdxMaccGet();
if (currMacc != "" && currMacc != null)
{
await MsgServ.IdxMaccSet(currMacc);
if (LastOpenedPage != "" && LastOpenedPage != null)
{
NavMan.NavigateTo(LastOpenedPage);
}
//NavMan.NavigateTo($"machine-detail");
}
}
protected void SaveData(List<MappaStatoExpl> newList)
{
//await Task.Delay(1);
ListMSE = newList;
//await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
@@ -140,6 +138,19 @@ namespace MP_TAB_SERV.Pages
#region Private Methods
private void setDefaults()
{
string df = MsgServ.UserPrefSetup("DefCardMode", "full");
baseLang = MsgServ.UserPrefSetup("Lang", "IT");
tcMode = MsgServ.UserPrefSetup("TcMode", "ms");
ShowCard = df == "shrink" ? false : true;
isCalcSize = true;
}
private string baseLang { get; set; } = "";
private string tcMode { get; set; } = "";
private void SetupConf()
{
// sistemo i parametri opzionali...
@@ -149,24 +160,5 @@ namespace MP_TAB_SERV.Pages
}
#endregion Private Methods
protected int Width { get; set; } = 0;
protected int Height { get; set; } = 0;
public class WindowDimension
{
#region Public Properties
public int Height { get; set; }
public int Width { get; set; }
#endregion Public Properties
}
protected async Task getWDim()
{
var dimension = await JSRuntime.InvokeAsync<WindowDimension>("getWindowDimensions");
Height = dimension.Height;
Width = dimension.Width;
}
}
}
+44 -52
View File
@@ -14,15 +14,50 @@
<div class="col-3"></div>
}
<div class="card @mainSize">
<div class="card-header text-center">
@*<div class="card-header text-center">
<div style="font-size: 4rem;">
<i class="fa-solid fa-user"></i>
</div>
<div style="font-size: 1.5rem;">
<span>USER DATA</span>
</div>
</div>
</div>*@
<div class="card-body">
<div class="text-center fw-bold fs-3">
Preferenze
</div>
<div class="my-1">
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between">
<div class="text-center mb-1">Modalità di inserimento del tempo ciclo</div>
<div class="d-flex justify-content-center">
<div class="btn-group" role="group" aria-label="Basic outlined example">
<button class="btn btn-sm @btnMsStyle" @onclick='()=>setTcMode("ms")'>min:sec</button>
<button class="btn btn-sm @btnMcStyle" @onclick='()=>setTcMode("mc")'>min.cent</button>
</div>
</div>
</li>
<li class="list-group-item d-flex justify-content-between">
<div class="text-center mb-1">Lingua</div>
<select class="form-select w-25" @bind="langIns">
<option value="IT">IT</option>
<option value="EN">EN</option>
</select>
</li>
<li class="list-group-item d-flex justify-content-between">
<div class="text-center mb-1">Modalità di visualizzazione delle macchine in 'Mappa Stato'</div>
<div class="d-flex justify-content-center">
<div class="btn-group" role="group" aria-label="Basic outlined example">
<button class="btn btn-sm @btnShrinkStyle" @onclick='()=>setDefCardMode("shrink")'>Shrink</button>
<button class="btn btn-sm @btnFullStyle" @onclick='()=>setDefCardMode("full")'>Full</button>
</div>
</div>
</li>
</ul>
</div>
<div class="text-center fw-bold fs-3">
User Data
</div>
<div>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between">
@@ -43,47 +78,16 @@
</li>
</ul>
</div>
<div class="my-1 text-center fw-bold fs-3">
Preferenze
</div>
<div>
<ul class="list-group">
<li class="list-group-item">
<div class="text-center mb-1 fw-bold">Modalità di inserimento del tempo ciclo</div>
<div class="d-flex justify-content-center">
<div class="btn-group" role="group" aria-label="Basic outlined example">
<button class="btn btn-sm @btnMsStyle" @onclick='()=>setTcMode("ms")'>min:sec</button>
<button class="btn btn-sm @btnMcStyle" @onclick='()=>setTcMode("mc")'>min.cent</button>
</div>
</div>
</li>
<li class="list-group-item">
<div class="text-center mb-1 fw-bold">Lingua</div>
<select class="form-select" @bind="langIns">
<option value="IT">IT</option>
<option value="EN">EN</option>
</select>
</li>
<li class="list-group-item">
<div class="text-center mb-1 fw-bold">Modalità di visualizzazione delle macchine in 'Mappa Stato'</div>
<div class="d-flex justify-content-center">
<div class="btn-group" role="group" aria-label="Basic outlined example">
<button class="btn btn-sm @btnShrinkStyle" @onclick='()=>setDefCardMode("shrink")'>Shrink</button>
<button class="btn btn-sm @btnFullStyle" @onclick='()=>setDefCardMode("full")'>Full</button>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="card-footer">
<button class="w-100 btn btn-success">
<i class="fa-solid fa-gear"></i> &nbsp; ABOUT PAGE
</button>
<hr />
<button class="w-100 btn btn-danger">
<a class="w-100 btn btn-danger" href="logout">
<i class="fa-solid fa-right-from-bracket"></i> &nbsp; LOGOUT
</button>
</a>
</div>
</div>
@if (Width > 1021)
@@ -192,7 +196,7 @@
}
}
protected string _langIns { get; set; } = "";
protected string _langIns { get; set; } = "EN";
protected string langIns
{
@@ -242,21 +246,9 @@
}
protected async override Task OnInitializedAsync()
{
var tcPrefItem = MsgServ.UserPrefGet("TcMode");
if (tcPrefItem != null)
{
tcModIns = tcPrefItem;
}
var langPrefItem = MsgServ.UserPrefGet("Lang");
if (langPrefItem != null)
{
langIns = langPrefItem;
}
var defCardPrefItem = MsgServ.UserPrefGet("DefCardMode");
if (defCardPrefItem != null)
{
defCardModeIns = defCardPrefItem;
}
tcModIns = MsgServ.UserPrefSetup("TcMode", "ms");
langIns = MsgServ.UserPrefSetup("Lang", "IT");
defCardModeIns = MsgServ.UserPrefSetup("DefCardMode", "full");
await Task.Delay(1);
if (string.IsNullOrEmpty(currIpv4))
{
+8
View File
@@ -38,6 +38,14 @@
<a class="dismiss">🗙</a>
</div>
@*<script src="_content/ZXingBlazor/lib/barcodereader/zxing.js"></script>
<script src="_content/ZXingBlazor/lib/barcodereader/barcode.js"></script>*@
@*<script src="_content/ZXingBlazor/lib/barcodereader/zxing.js"></script>*@
@*<script src="_content/ZXingBlazor/lib/zxing/zxing.min.js"></script>
<script src="MP/TAB3/_content/ZXingBlazor/lib/zxing/zxing.min.js"></script>*@
@*<script src="_content/ZXingBlazor/lib/barcodereader/barcode.js"></script>*@
<script src="~/lib//BarcodeReade.razor.js"></script>
<script src="lib/WindowSize.js"></script>
<script src="lib/bootstrap/js/bootstrap.bundle.js"></script>
<script src="_framework/blazor.server.js"></script>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2311.1016</h4>
<h4>Versione: 6.16.2312.1115</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2311.1016
6.16.2312.1115
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2311.1016</version>
<version>6.16.2312.1115</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>
+15 -34
View File
@@ -4,42 +4,23 @@
<PageTitle>MP-TAB-SERV</PageTitle>
<div class="page">
<div class="page" @onclick="()=>handleBodyClick()">
<main>
<div class="top-row d-flex justify-content-between text-light">
<div class="col-4">
<span>
<button class="btn btn-sm @ResetClass" @onclick="() => ForceReload()" title="Update"><i class="fa-solid fa-rotate"></i></button>
Username
</span>
<sub>[999]</sub>
</div>
<div class="col-4 text-center d-flex justify-content-center">
<a href="status-map" class="text-decoration-none text-light">
<i class="fa-solid fa-house"></i> &nbsp;
MapoTAB2
&nbsp;
<img src="images/LogoSteamware.png" style="height: 1rem" />
</a>
</div>
<div class="col-4 text-end">
<div class="row w-100 slideMen">
<div class="p-0">
<SlideMenu MenuItems="@CurrMenuItems"></SlideMenu>
</div>
<CmpTop CurrMenuItems="@CurrMenuItems"></CmpTop>
@if (MsgServ.RigaOper != null || NavMan.Uri.Contains("reg-new-device"))
{
<article class="content pt-1 d-flex mb-5">
<div class="" id="@bodyTipe">
@Body
</div>
</div>
</div>
<article class="content pt-1 d-flex mb-5">
<div class="" id="mainBody">
@Body
</div>
<div class="sidebar" id="barLat">
<NavMenu MenuItems="@CurrMenuItems"></NavMenu>
</div>
</article>
@if (!HideMenu)
{
<div class="sidebar" id="barLat">
<NavMenu MenuItems="@CurrMenuItems"></NavMenu>
</div>
}
</article>
}
</main>
</div>
<div class="fixed-bottom">
+57 -24
View File
@@ -1,9 +1,9 @@
using global::Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
using System.Diagnostics;
namespace MP_TAB_SERV.Shared
{
@@ -36,11 +36,16 @@ namespace MP_TAB_SERV.Shared
/// </summary>
protected List<LinkMenu> CurrMenuItems { get; set; } = new List<LinkMenu>();
protected bool HideMenu
{
get => NavMan.Uri.Contains("reg-new-device");
}
[Inject]
protected ListSelectDataSrv MDataService { get; set; } = null!;
[Inject]
protected MessageService MServ { get; set; } = null!;
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected SharedMemService MStor { get; set; } = null!;
@@ -51,33 +56,59 @@ namespace MP_TAB_SERV.Shared
[Inject]
protected TabDataService TDataService { get; set; } = null!;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task ForceReload()
protected string bodyTipe
{
Stopwatch sw = new Stopwatch();
sw.Start();
Log.Info("Start ForceReload");
ResetClass = "btn-warning";
await InvokeAsync(StateHasChanged);
// reset cache varie
await MServ.ClearLocalStor();
await MServ.ClearSessionStor();
await MDataService.FlushCache();
// reload MStor
await ReloadMemStor();
// calcolo tempo esecuzione
sw.Stop();
int delta = 500 - (int)sw.ElapsedMilliseconds;
delta = delta > 0 ? delta : 50;
await Task.Delay(delta);
ResetClass = "btn-primary";
// await InvokeAsync(StateHasChanged);
Log.Info($"ForceReload completed in {sw.ElapsedMilliseconds}ms");
// ricarica pagina!
NavMan.NavigateTo("/", true);
get => NavMan.Uri.Contains("reg-new-device") ? "mainBodyNoSide" : "mainBody";
}
protected async Task handleBodyClick()
{
await Task.Delay(1);
await checkDtDiff2Logout();
}
private int MatrOpr
{
get => MsgServ.MatrOpr;
}
protected int typeScadLogin { get; set; } = 0;
protected int dtScadLogin { get; set; } = 0;
protected async Task checkDtDiff2Logout()
{
var diffOfTime = DateTime.Now - MsgServ.dtLastAction;
switch (typeScadLogin)
{
case 0:
if (diffOfTime.Minutes >= dtScadLogin)
{
NavMan.NavigateTo("logout");
}
break;
case 1:
if (diffOfTime.Minutes >= dtScadLogin)
{
var userTkn = await TDataService.OperatoreGetRedis(MatrOpr);
if (!string.IsNullOrEmpty(userTkn))
{
await MsgServ.DoLogIn(userTkn);
MsgServ.dtLastAction = DateTime.Now;
}
else
{
NavMan.NavigateTo("logout");
}
}
break;
}
}
/// <summary>
@@ -86,6 +117,8 @@ namespace MP_TAB_SERV.Shared
/// <returns></returns>
protected override async Task OnInitializedAsync()
{
typeScadLogin = MStor.GetConfInt("TAB_TypeScadLogin");
dtScadLogin = MStor.GetConfInt("TAB_dtTimerScadLogin");
NavMan.LocationChanged += HandleLocationChanged;
// verifica preliminare setup mdati
if (!MStor.MenuOk)
+4 -59
View File
@@ -13,59 +13,20 @@ main {
padding: 0 10px 0 0;
}
.top-row {
background-color: #05173d;
/*border-bottom: 1px solid #d6d5d5;*/
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
/*margin-left: 1.5rem;*/
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (min-width: 640.98px) {
.slideMen:not(.auth) {
/*.slideMen:not(.auth) {
display: none;
}
}*/
#mainBody {
width: 83%;
}
}
@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}
#mainBody {
width: 100%;
}
.top-row.auth {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
#mainBodyNoSide {
width: 100%;
}
@media (min-width: 641px) {
@@ -82,22 +43,6 @@ main {
}
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 1rem !important;
padding-right: .5rem !important;
}
#blazor-error-ui {
background: lightyellow;
+17 -1
View File
@@ -14,7 +14,7 @@
foreach (var item in MenuItems)
{
<div class="nav-item px-2">
<NavLink class="nav-link px-2" href="@item.NavigateUrl">
<NavLink class="nav-link px-2" @onclick="()=>SetPage(item.NavigateUrl)">
<i class="fa fa-lg @item.icona pe-2" aria-hidden="true"></i> @item.Testo
</NavLink>
</div>
@@ -28,4 +28,20 @@
[Parameter]
public List<LinkMenu> MenuItems { get; set; } = new List<LinkMenu>();
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected NavigationManager navManager { get; set; } = null!;
protected async Task SetPage(string tgtUrl)
{
await Task.Delay(1);
if (tgtUrl.Contains("status-map"))
{
await MsgServ.IdxMaccSet("");
}
await MsgServ.LastOpenedPageSet(tgtUrl);
navManager.NavigateTo(tgtUrl);
}
}
+1 -1
View File
@@ -35,7 +35,7 @@
}
@media (min-width: 640.98px) {
@media (max-width: 640.98px) {
.slideMen:not(.auth) {
display: none;
}
+52
View File
@@ -101,4 +101,56 @@ a,
}
.blazor-error-boundary::after {
content: "An error has occurred.";
}
.top-row {
background-color: #05173d;
/*border-bottom: 1px solid #d6d5d5;*/
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a,
.top-row ::deep .btn-link {
white-space: nowrap;
/*margin-left: 1.5rem;*/
text-decoration: none;
}
.top-row ::deep a:hover,
.top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}
#mainBody {
width: 100%;
}
.top-row.auth {
justify-content: space-between;
}
.top-row ::deep a,
.top-row ::deep .btn-link {
margin-left: 0;
}
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row,
article {
padding-left: 1rem !important;
padding-right: 0.5rem !important;
}
+60
View File
@@ -114,3 +114,63 @@ html, body {
.blazor-error-boundary::after {
content: "An error has occurred."
}
.top-row {
background-color: #05173d;
/*border-bottom: 1px solid #d6d5d5;*/
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
/*margin-left: 1.5rem;*/
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}
#mainBody {
width: 100%;
}
.top-row.auth {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 1rem !important;
padding-right: .5rem !important;
}
+1 -1
View File
@@ -1 +1 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');html,body{font-family:'Open Sans Condensed',sans-serif;background-color:#151321;color:#ededed;}.cardObj{border-radius:.375rem;background:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);box-shadow:0 4px 24px -1px rgba(0,0,0,.25);flex-shrink:0;}.cardObjNoBL{border-radius:.375rem 0 0 .375rem;background:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);box-shadow:0 4px 24px -1px rgba(0,0,0,.25);flex-shrink:0;}.cardFullHeight{border-radius:.375rem;background:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);box-shadow:0 4px 24px -1px rgba(0,0,0,.25);flex-shrink:0;height:100%;}.longStopListNotes{height:100%;}@media(max-width:640.98px){.longStopListNotes{max-height:120px;}}.borderStd{border-radius:.375rem;}.table-dark{--bs-table-color:#fff;--bs-table-bg:transparent;--bs-table-border-color:#4d5154;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;color:var(--bs-table-color);border-color:var(--bs-table-border-color);}h1:focus{outline:0;}a,.btn-link{color:#0071c1;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}.content{padding-top:1.1rem;}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}.blazor-error-boundary{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem,#b32121;padding:1rem 1rem 1rem 3.7rem;color:#fff;}.blazor-error-boundary::after{content:"An error has occurred.";}
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');html,body{font-family:'Open Sans Condensed',sans-serif;background-color:#151321;color:#ededed;}.cardObj{border-radius:.375rem;background:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);box-shadow:0 4px 24px -1px rgba(0,0,0,.25);flex-shrink:0;}.cardObjNoBL{border-radius:.375rem 0 0 .375rem;background:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);box-shadow:0 4px 24px -1px rgba(0,0,0,.25);flex-shrink:0;}.cardFullHeight{border-radius:.375rem;background:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);box-shadow:0 4px 24px -1px rgba(0,0,0,.25);flex-shrink:0;height:100%;}.longStopListNotes{height:100%;}@media(max-width:640.98px){.longStopListNotes{max-height:120px;}}.borderStd{border-radius:.375rem;}.table-dark{--bs-table-color:#fff;--bs-table-bg:transparent;--bs-table-border-color:#4d5154;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;color:var(--bs-table-color);border-color:var(--bs-table-border-color);}h1:focus{outline:0;}a,.btn-link{color:#0071c1;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}.content{padding-top:1.1rem;}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}.blazor-error-boundary{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem,#b32121;padding:1rem 1rem 1rem 3.7rem;color:#fff;}.blazor-error-boundary::after{content:"An error has occurred.";}.top-row{background-color:#05173d;justify-content:flex-end;height:3.5rem;display:flex;align-items:center;}.top-row ::deep a,.top-row ::deep .btn-link{white-space:nowrap;text-decoration:none;}.top-row ::deep a:hover,.top-row ::deep .btn-link:hover{text-decoration:underline;}.top-row ::deep a:first-child{overflow:hidden;text-overflow:ellipsis;}@media(max-width:640.98px){.top-row:not(.auth){display:none;}#mainBody{width:100%;}.top-row.auth{justify-content:space-between;}.top-row ::deep a,.top-row ::deep .btn-link{margin-left:0;}}.top-row{position:sticky;top:0;z-index:1;}.top-row.auth ::deep a:first-child{flex:1;text-align:right;width:0;}.top-row,article{padding-left:1rem!important;padding-right:.5rem!important;}
+317
View File
@@ -0,0 +1,317 @@
import '_content/ZXingBlazor/lib/zxing/zxing.min.js';
let codeReader = null;
let id = null;
let supportsVibrate = false;
let opt = null;
let inst = null;
let selectedDeviceId = null;
let deviceID = null;
let element = null;
let debug = false;
export function vibrate() {
if (supportsVibrate) navigator.vibrate(1000);
}
export function init(instance, ele, elementid, options, deviceid) {
console.log('init' + elementid);
inst = instance;
opt = options;
id = elementid;
deviceID = deviceid;
element = ele;
debug = options.debug;
supportsVibrate = "vibrate" in navigator;
let startButton = element.querySelector("[data-action=startButton]");
let resetButton = element.querySelector("[data-action=resetButton]");
let closeButton = element.querySelector("[data-action=closeButton]");
if (startButton) startButton.addEventListener('click', () => {
start(elementid);
})
if (resetButton) resetButton.addEventListener('click', () => {
stop(elementid);
if (debug) console.log('Reset.')
})
if (closeButton) closeButton.addEventListener('click', () => {
stop(elementid);
if (debug) console.log('closeButton.')
instance.invokeMethodAsync("CloseScan");
})
load(elementid);
}
export function reload(elementid) {
load(elementid);
}
function genHints(opt) {
const hints = new Map();
if (opt.TRY_HARDER) {
hints.set(ZXing.DecodeHintType.TRY_HARDER, opt.TRY_HARDER);
}
if (opt.ASSUME_CODE_39_CHECK_DIGIT) {
hints.set(ZXing.DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT, opt.ASSUME_CODE_39_CHECK_DIGIT);
}
if (opt.ASSUME_GS1) {
hints.set(ZXing.DecodeHintType.ASSUME_GS1, opt.ASSUME_GS1);
}
if (opt.CHARACTER_SET) {
hints.set(ZXing.DecodeHintType.CHARACTER_SET, opt.CHARACTER_SET);
}
if (opt.OTHER) {
hints.set(ZXing.DecodeHintType.OTHER, opt.OTHER);
}
if (opt.PURE_BARCODE) {
hints.set(ZXing.DecodeHintType.PURE_BARCODE, opt.PURE_BARCODE);
}
if (opt.RETURN_CODABAR_START_END) {
hints.set(ZXing.DecodeHintType.RETURN_CODABAR_START_END, opt.RETURN_CODABAR_START_END);
}
if (opt.TRY_HARDER) {
hints.set(ZXing.DecodeHintType.TRY_HARDER, opt.TRY_HARDER);
}
return hints;
}
export function load(elementid) {
if (id == elementid) {
const sourceSelect = element.querySelector("[data-action=sourceSelect]");
const sourceSelectPanel = element.querySelector("[data-action=sourceSelectPanel]");
const hints = genHints(opt);
if (opt.pdf417) {
codeReader = new ZXing.BrowserPDF417Reader(hints);
if (debug) console.log('ZXing code PDF417 reader initialized')
} else if (opt.decodeAllFormats) {
const formats = opt.formats;
hints.set(ZXing.DecodeHintType.POSSIBLE_FORMATS, formats);
codeReader = new ZXing.BrowserMultiFormatReader(hints)
if (debug) console.log('ZXing code reader initialized with all formats')
} else {
codeReader = new ZXing.BrowserMultiFormatReader(hints)
if (debug) console.log('ZXing code reader initialized')
}
codeReader.timeBetweenDecodingAttempts = opt.timeBetweenDecodingAttempts;
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices
.getUserMedia({ audio: false, video: true })
.then(() => {
codeReader.listVideoInputDevices()
.then((videoInputDevices) => {
if (deviceID != null) {
selectedDeviceId = deviceID
} else if (videoInputDevices.length > 1) {
selectedDeviceId = videoInputDevices[1].deviceId
} else {
selectedDeviceId = videoInputDevices[0].deviceId
}
if (debug) console.log('videoInputDevices:' + videoInputDevices.length);
if (videoInputDevices.length > 1) {
sourceSelect.innerHTML = '';
videoInputDevices.forEach((device) => {
const sourceOption = document.createElement('option');
if (device.label === '') {
sourceOption.text = 'Camera' + (sourceSelect.length + 1);
} else {
sourceOption.text = device.label
}
sourceOption.value = device.deviceId
if (selectedDeviceId != null && device.deviceId == selectedDeviceId) {
sourceOption.selected = true
}
sourceSelect.appendChild(sourceOption)
})
sourceSelect.onchange = () => {
selectedDeviceId = sourceSelect.value;
inst.invokeMethodAsync('SelectDeviceID', selectedDeviceId, sourceSelect.options[sourceSelect.selectedIndex].text);
codeReader.reset();
start(elementid);
}
sourceSelectPanel.style.display = 'block'
}
start(elementid);
})
.catch((err) => {
console.log(err)
inst.invokeMethodAsync("GetError", err + '');
})
})
.catch((err) => {
console.error(`An error occurred: ${err}`);
inst.invokeMethodAsync('GetError', `An error occurred: ${err}`);
});
}
}
}
export function start(elementid) {
if (undefined !== codeReader && null !== codeReader && id == elementid) {
if (opt.decodeonce) {
codeReader.decodeOnceFromVideoDevice(selectedDeviceId, 'video').then((result) => {
if (debug) console.log(result)
vibrate();
if (debug) console.log('autostop');
codeReader.reset();
return inst.invokeMethodAsync("GetResult", result.text);
}).catch((err) => {
if (err && !(err instanceof ZXing.NotFoundException)) {
console.log(err)
inst.invokeMethodAsync("GetError", err + '');
}
})
} else {
codeReader.decodeFromVideoDevice(selectedDeviceId, 'video', (result, err) => {
if (result) {
if (debug) console.log(result)
vibrate();
if (debug) console.log('None-stop');
inst.invokeMethodAsync("GetResult", result.text);
}
if (err && !(err instanceof ZXing.NotFoundException)) {
console.log(err)
inst.invokeMethodAsync("GetError", err + '');
}
})
}
var x = `decodeContinuously`;
if (opt.decodeonce) x = `decodeOnce`;
if (debug) console.log(`Started ` + x + ` decode from camera with id ${selectedDeviceId}`)
if (debug) console.log(id, 'start');
}
}
export function stop(elementid) {
if (undefined !== codeReader && null !== codeReader && id == elementid) {
codeReader.reset();
if (debug) console.log(id, 'stop');
}
}
export function QRCodeSvg(instance, input, element, tobase64, size = 300) {
const codeWriter = new ZXing.BrowserQRCodeSvgWriter()
if (debug) console.log('ZXing code writer initialized')
if (tobase64) {
const elementTemp = document.createElement('elementTemp');
codeWriter.writeToDom(elementTemp, input, size, size)
let svgElement = elementTemp.firstChild
const svgData = (new XMLSerializer()).serializeToString(svgElement)
//const blob = new Blob([svgData])
instance.invokeMethodAsync("GetQRCode", svgData);
} else {
codeWriter.writeToDom(element.querySelector("[data-action=result]"), input, size, size)
}
}
export function DecodeFormImage(instance, element, options, data) {
var codeReaderImage = null;
const hints = genHints(options);
if (options.pdf417) {
codeReaderImage = new ZXing.BrowserPDF417Reader(hints);
if (debug) console.log('ZXing code PDF417 reader initialized')
} else if (options.decodeAllFormats) {
const formats = options.formats;
hints.set(ZXing.DecodeHintType.POSSIBLE_FORMATS, formats);
codeReaderImage = new ZXing.BrowserMultiFormatReader(hints)
if (debug) console.log('ZXing code reader initialized with all formats')
} else {
codeReaderImage = new ZXing.BrowserMultiFormatReader(hints)
if (debug) console.log('ZXing code reader initialized')
}
if (debug) console.log('ZXing code reader initialized')
if (data != null) {
codeReaderImage.decodeFromImageUrl(data).then(result => {
if (result) {
vibrate();
if (debug) console.log(result.text);
instance.invokeMethodAsync('GetResult', result.text)
}
}).catch((err) => {
if (err) {
console.log(err)
instance.invokeMethodAsync('GetError', err.message)
}
})
}
else {
const resetFile = () => {
let file = element.querySelector('[type="file"]')
if (file) {
file.removeEventListener('change', scanImageHandler)
file.remove()
}
file = document.createElement('input')
file.setAttribute('type', 'file')
file.setAttribute('hidden', 'true')
file.setAttribute('accept', 'image/*')
//file.setAttribute('capture', 'true')
element.append(file)
file.addEventListener('change', scanImageHandler)
codeReaderImage.file = file
return file
}
const scanImageHandler = () => {
const files = codeReaderImage.file.files
if (files.length === 0) {
return
}
const reader = new FileReader()
reader.onloadend = e => {
codeReaderImage.decodeFromImageUrl(e.target.result).then(result => {
if (result) {
vibrate();
if (debug) console.log(result.text);
instance.invokeMethodAsync('GetResult', result.text)
} else {
instance.invokeMethodAsync('GetError', "no valid barcode detected")
}
}).catch((err) => {
if (err) {
console.log(err)
instance.invokeMethodAsync('GetError', err.message)
}
})
}
reader.readAsDataURL(files[0])
}
let file = resetFile()
file.click()
}
}
export function destroy(elementid) {
if (undefined !== codeReader && null !== codeReader && id == elementid) {
codeReader.reset();
codeReader = null;
//id = null;
id = null;
opt = null;
inst = null;
selectedDeviceId = null;
deviceID = null;
element = null;
if (debug) console.log(id, 'destroy');
}
}
+4
View File
@@ -20,6 +20,10 @@
public static string redisMseKey = "MP:MON:Cache:MSE";
public static string redisMseKeySingle = "MP:MON:Cache:MseSingle";
// passphrase cifratura
public const string passPhrase = "7871D817-C71F-4DFC-BF12-00A95BE507B5";
#endregion Public Fields
}
+21 -22
View File
@@ -611,7 +611,6 @@ namespace MP.Data.Controllers
numRecProc += numRec;
if (numRec > maxItem)
{
List<Periodo> listPeriodi = new List<Periodo>();
switch (valMode)
@@ -713,6 +712,27 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco Gruppi
/// </summary>
/// <returns></returns>
public List<ParetoFluxLogDTO> FluxLogPareto(string idxMacchina, DateTime dtFrom, DateTime dtTo)
{
List<ParetoFluxLogDTO> dbResult = new List<ParetoFluxLogDTO>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetFluxLog
.Where(x => (string.IsNullOrEmpty(idxMacchina) || x.IdxMacchina == idxMacchina) && (dtFrom <= x.dtEvento && x.dtEvento <= dtTo))
.AsNoTracking()
.GroupBy(x => x.CodFlux)
.Select(g => new ParetoFluxLogDTO() { IdxMacchina = idxMacchina, CodFlux = g.Key, Qty = g.Count() })
.OrderByDescending(x => x.Qty)
.ToList();
}
return dbResult;
}
/// <summary>
/// Stored manutenzione del DB
/// </summary>
@@ -1270,27 +1290,6 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco Gruppi
/// </summary>
/// <returns></returns>
public List<ParetoFluxLogDTO> ParetoFluxLog(string idxMacchina, DateTime dtFrom, DateTime dtTo)
{
List<ParetoFluxLogDTO> dbResult = new List<ParetoFluxLogDTO>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetFluxLog
.Where(x => (string.IsNullOrEmpty(idxMacchina) || x.IdxMacchina == idxMacchina) && (dtFrom <= x.dtEvento && x.dtEvento <= dtTo))
.AsNoTracking()
.GroupBy(x => x.CodFlux)
.Select(g => new ParetoFluxLogDTO() { IdxMacchina = idxMacchina, CodFlux = g.Key, Qty = g.Count() })
.OrderByDescending(x => x.Qty)
.ToList();
}
return dbResult;
}
/// <summary>
/// Stato prod macchina
/// </summary>
+177 -67
View File
@@ -54,6 +54,51 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco operatori
/// </summary>
/// <returns></returns>
public List<AnagOperatoriModel> ElencoOperatori()
{
List<AnagOperatoriModel> dbResult = new List<AnagOperatoriModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbOperatori
.Where(s => s.MatrOpr > 0)
.AsNoTracking()
.OrderBy(x => x.MatrOpr)
.ToList();
}
return dbResult;
}
/// <summary>
/// login operatori
/// </summary>
/// /// <param name="matrOpr"></param>
/// /// <param name="authKey"></param>
/// <returns></returns>
public AnagOperatoriModel OperatoreSearch(int matrOpr, string authKey)
{
AnagOperatoriModel dbResult = null;
AnagOperatoriModel answ = new AnagOperatoriModel();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbOperatori
.Where(s => (s.MatrOpr > 0) && (s.MatrOpr == matrOpr) && (s.authKey == authKey))
.AsNoTracking()
.FirstOrDefault();
if (dbResult != null)
{
answ = dbResult;
}
}
return answ;
}
/// <summary>
/// Registrato ACK allarme
/// </summary>
@@ -765,6 +810,35 @@ namespace MP.Data.Controllers
return fatto;
}
/// <summary>
/// Dati MSE x singola macchina SUB (tipicamente TAV)
/// </summary>
/// <param name="idxMacc"></param>
/// <param name="idxMacchSub"></param>
/// <returns></returns>
public List<MappaStatoExpl> MseGetSub(string idxMacc, string idxMacchSub)
{
List<MappaStatoExpl> dbResult = new List<MappaStatoExpl>();
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacc);
var IdxMacchSub = new SqlParameter("@IdxMacchSub", idxMacchSub);
dbResult = dbCtx
.DbSetMSE
.FromSqlRaw("EXEC stp_MSE_getByIdxMacchAndSub @IdxMacchina, @IdxMacchSub", IdxMacc, IdxMacchSub)
.AsNoTracking()
.ToList();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante MseGetSub{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// ODL da key
/// </summary>
@@ -794,6 +868,34 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Clear operazione setup ODL (annullamento)
/// </summary>
/// <param name="idxODL"></param>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public bool OdlClearSetup(int idxODL, string idxMacchina)
{
bool answ = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxODL = new SqlParameter("@idxODL", idxODL);
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
var result = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_ODL_clearSetup @IdxODL, @IdxMacchina", IdxODL, IdxMacchina);
answ = result != 0;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OdlClearSetup{Environment.NewLine}{exc}");
}
}
return answ;
}
/// <summary>
/// ODL corrente macchina
/// </summary>
@@ -821,33 +923,6 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Registro fine prod ODL
/// </summary>
/// <param name="idxODL"></param>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public bool OdlFineProd(int idxODL, string idxMacchina)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxODL = new SqlParameter("@IdxODL", idxODL);
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
var result = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacc);
fatto = result != 0;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OdlFineProd{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Attrezzo stesso ODL dell'altra tavola
/// </summary>
@@ -878,7 +953,33 @@ namespace MP.Data.Controllers
return fatto;
}
/// <summary>
/// Registro fine prod ODL
/// </summary>
/// <param name="idxODL"></param>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public bool OdlFineProd(int idxODL, string idxMacchina)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxODL = new SqlParameter("@IdxODL", idxODL);
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
var result = dbCtx
.Database
.ExecuteSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacc);
fatto = result != 0;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OdlFineProd{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Fix ODL per macchine SLAVE
@@ -946,6 +1047,33 @@ namespace MP.Data.Controllers
return fatto;
}
/// <summary>
/// Ultimo ODL data macchina
/// </summary>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public List<ODLModel> OdlLastByMacc(string idxMacchina)
{
List<ODLModel> dbResult = new List<ODLModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
dbResult = dbCtx
.DbSetODL
.FromSqlRaw("EXEC stp_ODL_getLastByMacchina @IdxMacchina", IdxMacchina)
.AsNoTracking()
.ToList();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OdlLastByMacc{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Elenco ODL data macchina e periodo
/// </summary>
@@ -977,34 +1105,6 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Ultimo ODL data macchina
/// </summary>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public List<ODLModel> OdlLastByMacc(string idxMacchina)
{
List<ODLModel> dbResult = new List<ODLModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
dbResult = dbCtx
.DbSetODL
.FromSqlRaw("EXEC stp_ODL_getLastByMacchina @IdxMacchina", IdxMacchina)
.AsNoTracking()
.ToList();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante OdlLastByMacc{Environment.NewLine}{exc}");
}
}
return dbResult;
}
/// <summary>
/// Riapertura ULTIMO ODL data macchina
/// </summary>
@@ -1032,8 +1132,6 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Setup ODL Postumo
/// </summary>
@@ -1137,6 +1235,9 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="idxODL"></param>
/// <param name="matrOpr"></param>
/// <param name="tCRichAttr"></param>
/// <param name="pzPallet"></param>
/// <param name="note"></param>
/// <returns></returns>
public bool OdlUpdate(int idxODL, int matrOpr, decimal tCRichAttr, int pzPallet, string note)
{
@@ -1174,11 +1275,16 @@ namespace MP.Data.Controllers
using (var dbCtx = new MoonProContext(_configuration))
{
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
dbResult = dbCtx
.DbSetPzProd
.FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina)
.AsNoTracking()
.ToList();
try
{
dbResult = dbCtx
.DbSetPzProd
.FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina)
.AsNoTracking()
.ToList();
}
catch
{ }
}
return dbResult;
}
@@ -1454,6 +1560,7 @@ namespace MP.Data.Controllers
/// <returns></returns>
public async Task<bool> RegScartiInsert(RegistroScartiModel newRec)
{
await Task.Delay(1);
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
@@ -1464,11 +1571,14 @@ namespace MP.Data.Controllers
var Note = new SqlParameter("@Note", newRec.Note);
var MatrOpr = new SqlParameter("@MatrOpr", newRec.MatrOpr);
var result = await dbCtx
.Database
.ExecuteSqlRawAsync("exec dbo.stp_RS_insert @idxMacchina, @DataOra, @Causale, @Qta, @Note, @MatrOpr", IdxMacchina, DataOra, Causale, Qta, Note, MatrOpr);
var result = dbCtx
.DbSetRegWithCheck
.FromSqlRaw("exec dbo.stp_RS_Insert_withCheck @idxMacchina, @DataOra, @Causale, @Qta, @Note, @MatrOpr", IdxMacchina, DataOra, Causale, Qta, Note, MatrOpr)
.AsNoTracking()
.ToList();
// indico eseguito!
fatto = result > 0;
// -1 = restituisce una select
fatto = result.Count > 0;
}
return fatto;
}
+15
View File
@@ -0,0 +1,15 @@
using MP.Data.DatabaseModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DTO
{
public class userTknDTO
{
public AnagOperatoriModel currOpr { get; set; } = null;
public DateTime expTime { get; set; } = DateTime.Now;
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class RegCheckModel
{
#region Public Properties
[Key]
public string IdxMacchina { get; set; }
#endregion Public Properties
}
}
+1
View File
@@ -78,6 +78,7 @@ namespace MP.Data
public virtual DbSet<RegistroControlliModel> DbSetRegControlli { get; set; }
public virtual DbSet<RegistroScartiModel> DbSetRegScarti { get; set; }
public virtual DbSet<RegistroDichiarazioniModel> DbSetRegDich { get; set; }
public virtual DbSet<RegCheckModel> DbSetRegWithCheck { get; set; }
public virtual DbSet<ST_Act> DbSetStAct { get; set; }
+184 -243
View File
@@ -1,7 +1,9 @@
using Blazored.LocalStorage;
using Blazored.SessionStorage;
using EgwCoreLib.Utils;
using Microsoft.Extensions.Configuration;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using Newtonsoft.Json;
using NLog;
using StackExchange.Redis;
@@ -24,13 +26,15 @@ namespace MP.Data.Services
#region Public Constructors
public MessageService(IConfiguration configuration, ILocalStorageService genLocalStorage, ISessionStorageService sessStore)
public MessageService(IConfiguration configuration, ILocalStorageService genLocalStorage, ISessionStorageService sessStore, TabDataService tdService, SharedMemService smServ)
{
_configuration = configuration;
// gestione sessioni in browser
localStorage = genLocalStorage;
sessionStore = sessStore;
TDService = tdService;
SMService = smServ;
// setup compoenti REDIS
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
@@ -45,10 +49,38 @@ namespace MP.Data.Services
public event Action EA_PageUpdated = null!;
public event Action EA_ResetFooterTimer = null!;
#endregion Public Events
#region Public Properties
#if false
protected bool _tReset { get; set; } = false;
protected bool tReset
{
get => _tReset;
set
{
if (_tReset != value)
{
_tReset = value;
resetTimer();
}
}
}
protected void resetTimer()
{
if (EA_ResetFooterTimer != null)
{
EA_ResetFooterTimer?.Invoke();
}
}
#endif
public DateTime dtLastAction { get; set; } = DateTime.Now;
public string CognomeNome
{
get
@@ -92,8 +124,7 @@ namespace MP.Data.Services
{
get
{
int answ = 102;
//int answ = -1;
int answ = -1;
if (_rigaOper != null)
{
answ = _rigaOper.MatrOpr;
@@ -211,6 +242,32 @@ namespace MP.Data.Services
await sessionStore.SetItemAsync(KeyCommText, Valore);
}
public string DecryptData(string encData)
{
return SteamCrypto.DecryptString(encData, Constants.passPhrase);
}
public string EncryptData(string rawData)
{
return SteamCrypto.EncryptString(rawData, Constants.passPhrase);
}
/// <summary>
/// Restituisce il record OperatoreDTO da localstorage
/// </summary>
/// <returns></returns>
public async Task<string> GetCurrOperDtoAsync()
{
string answ = "";
var result = await localStorage.GetItemAsync<string>("currTkn");
if (result != null)
{
//var data = JsonConvert.DeserializeObject<userTknDTO>(result);
answ = result;
}
return answ;
}
/// <summary>
/// Restituisce il valore Ipv4 del Device da localstorage
/// </summary>
@@ -241,6 +298,21 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Restituisce ultima matrOpr registrata da localstorage
/// </summary>
/// <returns></returns>
public async Task<int> GetLastMatrOprAsync()
{
int answ = -1;
var result = await localStorage.GetItemAsync<string>("lastMatrOpr");
if (!string.IsNullOrEmpty(result))
{
answ = int.Parse(result);
}
return answ;
}
/// <summary>
/// Recupero dati MSE x macchina
/// </summary>
@@ -262,7 +334,7 @@ namespace MP.Data.Services
/// </summary>
public async Task<string> IdxMaccGet()
{
return await sessionStore.GetItemAsync<string>("CurrMach");
return await localStorage.GetItemAsync<string>("CurrMach");
}
/// <summary>
@@ -270,7 +342,22 @@ namespace MP.Data.Services
/// </summary>
public async Task IdxMaccSet(string machSel)
{
await sessionStore.SetItemAsync("CurrMach", machSel);
await localStorage.SetItemAsync("CurrMach", machSel);
}
/// <summary>
/// Scrive sul local storage pagina corrente
/// </summary>
public async Task<string> LastOpenedPageGet()
{
return await localStorage.GetItemAsync<string>("LastPage");
}
/// <summary>
/// Ottiene sul local storage pagina corrente
/// </summary>
public async Task LastOpenedPageSet(string lastPage)
{
await localStorage.SetItemAsync("LastPage", lastPage);
}
/// <summary>
@@ -299,6 +386,18 @@ namespace MP.Data.Services
return hasKey;
}
/// <summary>
/// scrive il record OperatoreDTO nel localstorage
/// </summary>
/// <returns></returns>
public async Task<bool> SetCurrOperDtoAsync(string currTkn)
{
bool answ = false;
await localStorage.SetItemAsync("currTkn", currTkn);
answ = true;
return answ;
}
/// <summary>
/// Scrive il valore di IPV4 del device nel localstoragee
/// </summary>
@@ -339,6 +438,60 @@ namespace MP.Data.Services
return answ;
}
protected int expDays { get; set; } = 0;
public async Task<bool> DoLogIn(string decodValue)
{
bool answ = false;
expDays = SMService.GetConfInt("cookieDayExpire");
var expDT = DateTime.Now.AddDays(expDays);
// decifro i valori..
var decrVal = DecryptData(decodValue);
var opData = JsonConvert.DeserializeObject<userTknDTO>(decrVal);
if (opData != null)
{
var rigaOpr = await TDService.OperatoreSearch(opData.currOpr.MatrOpr, opData.currOpr.authKey);
if (rigaOpr != null)
{
userTknDTO newUserTkn = new userTknDTO()
{
currOpr = rigaOpr,
expTime = expDT
};
var jsonTkn = JsonConvert.SerializeObject(newUserTkn);
string hash = TDService.EncryptData(jsonTkn);
RigaOper = rigaOpr;
await SetLastMatrOprAsync(rigaOpr.MatrOpr);
await SetCurrOperDtoAsync(hash);
await TDService.OperatoreSetRedis(rigaOpr.MatrOpr, hash);
answ = true;
//if (LastOpenedPage != "" && CurrMacc != "")
//{
// NavMan.NavigateTo(LastOpenedPage);
//}
//else
//{
// NavMan.NavigateTo("status-map");
//}
}
}
return answ;
}
/// <summary>
/// Salva matrOpr nel localstorage
/// </summary>
/// <returns></returns>
public async Task<bool> SetLastMatrOprAsync(int matrOpr)
{
bool answ = false;
await localStorage.SetItemAsync("lastMatrOpr", matrOpr);
answ = true;
return answ;
}
/// <summary>
/// Recupero singola preferenza utente
/// </summary>
@@ -377,6 +530,30 @@ namespace MP.Data.Services
return done;
}
/// <summary>
/// Recupero singola preferenza utente se presente, oppure imposto quella di default
/// indicata e la rendo
/// </summary>
/// <param name="chiave"></param>
/// <returns></returns>
public string UserPrefSetup(string chiave, string defValue)
{
string answ = defValue;
var currDict = UsersPrefDict;
if (currDict.ContainsKey(chiave))
{
answ = currDict[chiave];
}
else
{
if (MatrOpr > 0)
{
UserPrefSave(chiave, defValue);
}
}
return answ;
}
#endregion Public Methods
#region Protected Fields
@@ -401,6 +578,8 @@ namespace MP.Data.Services
#region Protected Properties
protected ILocalStorageService localStorage { get; set; } = null!;
protected TabDataService TDService { get; set; } = null!;
protected SharedMemService SMService { get; set; } = null!;
protected ISessionStorageService sessionStore { get; set; } = null!;
@@ -483,243 +662,5 @@ namespace MP.Data.Services
}
#endregion Private Methods
#if false
public event Action EA_DateChanged = null!;
public event Action EA_CalModeChanged = null!;
public event Action EA_TimbUpd = null!;
#endif
#if false
public RegAttivitaModel? clonedRA { get; set; } = null;
/// <summary>
/// Calcola HASH del codice impiego = payload utente
/// </summary>
/// <returns></returns>
public string HashDip
{
get
{
DataValidator cDV = new DataValidator(_rigaOper);
string hash = cDV.HashDip;
return hash;
}
}
#endif
#if false
public bool IsActive
{
get
{
bool answ = false;
if (_rigaOper != null && _rigaOper.Attivo != null)
{
answ = (bool)_rigaOper.Attivo;
}
return answ;
}
}
public bool isRicTimb { get; set; } = false;
public CalendarModeEnum.modoControllo modoCal { get; set; } = CalendarModeEnum.modoControllo.showCalendar;
#endif
#if false
/// <summary>
/// Indica ultima azione compiuta
/// </summary>
public string LastAction
{
get => lastAction;
set
{
if (lastAction != value)
{
lastAction = value;
}
}
}
/// <summary>
/// Indica se il prossimo stato timbratura sia entrata
/// </summary>
public bool NextIsEntrata
{
get => nextIsEntrata;
set
{
if (nextIsEntrata != value)
{
nextIsEntrata = value;
}
}
}
public string PageIcon
{
get => _pageIcon;
set
{
if (_pageIcon != value)
{
_pageIcon = value;
ReportPageUpd();
}
}
}
public string PageName
{
get => _pageName;
set
{
if (_pageName != value)
{
_pageName = value;
ReportPageUpd();
}
}
}
public bool PayloadOk { get; set; } = false;
public RegAttivitaModel? recordRA { get; set; } = null;
#endif
#if false
public string SearchVal
{
get => _searchVal;
set
{
if (_searchVal != value)
{
_searchVal = value;
if (EA_DipUpdated != null)
{
EA_DipUpdated?.Invoke();
}
}
}
}
public int selWeekNum { get; set; } = 0;
public int selYear { get; set; } = DateTime.Today.Year;
public bool ShowSearch
{
get => showSearch;
set
{
if (showSearch != value)
{
showSearch = value;
}
}
}
public DateTime targetDate { get; set; } = DateTime.Today;
public DateTime targetDateMancTimb { get; set; }
#endif
#if false
public void ReportDateChange()
{
if (EA_DateChanged != null)
{
EA_DateChanged?.Invoke();
}
}
public void setModeCalendar()
{
modoCal = CalendarModeEnum.modoControllo.showCalendar;
if (EA_CalModeChanged != null)
{
EA_CalModeChanged?.Invoke();
}
}
public void setModeGauge()
{
modoCal = CalendarModeEnum.modoControllo.showGauge;
if (EA_CalModeChanged != null)
{
EA_CalModeChanged?.Invoke();
}
}
public void setModeProj()
{
modoCal = CalendarModeEnum.modoControllo.showProj;
if (EA_CalModeChanged != null)
{
EA_CalModeChanged?.Invoke();
}
}
public void setModeTempRil()
{
modoCal = CalendarModeEnum.modoControllo.showTempRil;
if (EA_CalModeChanged != null)
{
EA_CalModeChanged?.Invoke();
}
}
public void setModeRichTimb()
{
modoCal = CalendarModeEnum.modoControllo.showTimbr;
if (EA_CalModeChanged != null)
{
EA_CalModeChanged?.Invoke();
}
}
public void setModeShowWeek()
{
modoCal = CalendarModeEnum.modoControllo.showWeek;
if (EA_CalModeChanged != null)
{
EA_CalModeChanged?.Invoke();
}
}
public void ReportTimbratura()
{
if (EA_TimbUpd != null)
{
EA_TimbUpd?.Invoke();
}
}
#endif
#if false
private string _pageIcon = "";
private string _pageName = "";
#endif
#if false
private string _searchVal = "";
private bool showSearch;
#endif
#if false
private string lastAction { get; set; } = "";
private bool nextIsEntrata { get; set; } = true;
#endif
#if false
private void ReportPageUpd()
{
if (EA_PageUpdated != null)
{
EA_PageUpdated?.Invoke();
}
}
private void ReportSearch()
{
if (EA_DipUpdated != null)
{
EA_DipUpdated?.Invoke();
}
}
#endif
}
}
+357 -76
View File
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using EgwCoreLib.Utils;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
@@ -10,7 +11,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -375,7 +376,7 @@ namespace MP.Data.Services
result = dbTabController.CommentiGetLastByMacc(idxMacchina, numDays);
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, FastCache);
await redisDb.StringSetAsync(currKey, rawData, UltraFastCache);
}
if (result == null)
{
@@ -512,6 +513,36 @@ namespace MP.Data.Services
}
return answ;
}
/// <summary>
/// Recupera il valore in formato DOUBLE
/// </summary>
/// <param name="chiave">Valore da cercare</param>
/// <param name="varObj">Int in cui salvare il valore se trovato</param>
/// <returns></returns>
public bool ConfigGetVal(string chiave, ref double varObj)
{
bool answ = false;
// se mancasse provo a configurare..
if (CurrConfig == null || CurrConfig.Count == 0)
{
SetupConfig();
}
if (CurrConfig != null && CurrConfig.Count > 0)
{
// sistemo i parametri opzionali...
ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
if (risultato != null)
{
NumberStyles numStyle;
CultureInfo culture;
numStyle = NumberStyles.Number;
culture = CultureInfo.InvariantCulture;
//culture = CultureInfo.CreateSpecificCulture("en-US");
answ = double.TryParse(risultato.Valore, numStyle, culture, out varObj);
}
}
return answ;
}
/// <summary>
/// Recupera il valore in formato BOOL
@@ -567,6 +598,11 @@ namespace MP.Data.Services
return dbTabController.DDB_getNext(idxMacchina, inizioStato);
}
public string DecryptData(string encData)
{
return SteamCrypto.DecryptString(encData, Constants.passPhrase);
}
public void Dispose()
{
// Clear database controller
@@ -598,6 +634,45 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Elenco operatori
/// </summary>
/// <returns></returns>
public async Task<List<AnagOperatoriModel>> ElencoOperatori()
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<AnagOperatoriModel>? result = new List<AnagOperatoriModel>();
// cerco in redis...
string currKey = $"{redisBaseKey}:ElencoOpr";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<AnagOperatoriModel>>($"{rawData}");
source = "REDIS";
}
else
{
result = dbTabController.ElencoOperatori();
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
result = new List<AnagOperatoriModel>();
}
sw.Stop();
Log.Debug($"ElencoOperatori | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
public string EncryptData(string rawData)
{
return SteamCrypto.EncryptString(rawData, Constants.passPhrase);
}
/// <summary>
/// Elimina una riga in EventList se trovata
/// </summary>
@@ -653,7 +728,7 @@ namespace MP.Data.Services
result = await dbTabController.EvListGetLastBySearch(idxMacchina, dtLimit, idxTipo, maxRec);
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
@@ -817,7 +892,7 @@ namespace MP.Data.Services
result = await Task.FromResult(dbTabController.ListPODLByMacc(idxMacchina, onlyFree, onlyDirect));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
await redisDb.StringSetAsync(currKey, rawData, UltraFastCache);
}
if (result == null)
{
@@ -1057,6 +1132,49 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Recupera un valore MSE x una macchina sub specifica
/// </summary>
/// <param name="idxMacc"></param>
/// <param name="idxMacchSub"></param>
/// <param name="forceDb"></param>
/// <returns></returns>
public MappaStatoExpl MseGetSub(string idxMacc, string idxMacchSub, bool forceDb)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
MappaStatoExpl result = new MappaStatoExpl();
// cerco in redis...
string currKey = $"{Constants.redisMseKeySingle}:{idxMacchSub}";
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue && !forceDb)
{
result = JsonConvert.DeserializeObject<MappaStatoExpl>($"{rawData}");
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"Read from REDIS: {ts.TotalMilliseconds}ms");
}
else
{
var rawResult = dbTabController.MseGetSub(idxMacc, idxMacchSub);
if (rawResult != null && rawResult.Count > 0)
{
result = rawResult.FirstOrDefault();
}
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, UltraLongCache);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
}
if (result == null)
{
result = new MappaStatoExpl();
}
return result;
}
/// <summary>
/// ODL da key
/// </summary>
@@ -1094,6 +1212,31 @@ namespace MP.Data.Services
return result;
}
/// <summary>
/// Clear operazione setup ODL (annullamento)
/// </summary>
/// <param name="idxODL"></param>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public async Task<bool> OdlClearSetup(int idxODL, string idxMacchina)
{
bool answ = false;
try
{
// inserisco evento
answ = dbTabController.OdlClearSetup(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
string logMsg = $"Eccezione in OdlUpdate | idxODL: {idxODL} | idxMacchina: {idxMacchina}{Environment.NewLine}{exc}";
Log.Error(logMsg);
}
return answ;
}
/// <summary>
/// ODL corrente macchina
/// </summary>
@@ -1130,32 +1273,6 @@ namespace MP.Data.Services
return result;
}
/// <summary>
/// Registro fine prod ODL
/// </summary>
/// <param name="idxODL"></param>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public async Task<bool> OdlFineProd(int idxODL, string idxMacchina)
{
bool answ = false;
try
{
// inserisco evento
answ = dbTabController.OdlFineProd(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
string logMsg = $"Eccezione in OdlFineProd | idxODL: {idxODL} | idxMacchina: {idxMacchina}{Environment.NewLine}{exc}";
Log.Error(logMsg);
}
return answ;
}
/// <summary>
/// Attrezzo stesso ODL dell'altra tavola
/// </summary>
@@ -1182,14 +1299,39 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Fix ODL per macchine SLAVE
/// </summary>
/// <param name="idxMacchina"></param>
/// <param name="numDayPrev"></param>
/// <param name="doInsert"></param>
/// <returns></returns>
public async Task<bool> OdlFixMachineSlave(string idxMacchina, int numDayPrev, int doInsert)
/// <summary>
/// Registro fine prod ODL
/// </summary>
/// <param name="idxODL"></param>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public async Task<bool> OdlFineProd(int idxODL, string idxMacchina)
{
bool answ = false;
try
{
// inserisco evento
answ = dbTabController.OdlFineProd(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
}
catch (Exception exc)
{
string logMsg = $"Eccezione in OdlFineProd | idxODL: {idxODL} | idxMacchina: {idxMacchina}{Environment.NewLine}{exc}";
Log.Error(logMsg);
}
return answ;
}
/// <summary>
/// Fix ODL per macchine SLAVE
/// </summary>
/// <param name="idxMacchina"></param>
/// <param name="numDayPrev"></param>
/// <param name="doInsert"></param>
/// <returns></returns>
public async Task<bool> OdlFixMachineSlave(string idxMacchina, int numDayPrev, int doInsert)
{
bool answ = false;
try
@@ -1275,34 +1417,6 @@ namespace MP.Data.Services
return result;
}
/// <summary>
/// Riapertura ULTIMO ODL data macchina
/// </summary>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public ODLModel OdlReopenOdlMacc(string idxMacchina)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
ODLModel result = new ODLModel();
// cerco in redis...
string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:LAST";
var results = dbTabController.OdlReopenOdlMacc(idxMacchina);
// riordino
result = results.FirstOrDefault();
// serializzp e salvo...
var rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, UltraLongCache);
if (result == null)
{
result = new ODLModel();
}
sw.Stop();
Log.Debug($"OdlReopenOdlMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Elenco ODL data macchina e periodo
/// </summary>
@@ -1331,7 +1445,7 @@ namespace MP.Data.Services
result = result.OrderByDescending(x => x.DataInizio).ToList();
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
await redisDb.StringSetAsync(currKey, rawData, FastCache);
}
if (result == null)
{
@@ -1342,6 +1456,35 @@ namespace MP.Data.Services
return result;
}
/// <summary>
/// Riapertura ULTIMO ODL data macchina
/// </summary>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public async Task<ODLModel> OdlReopenOdlMacc(string idxMacchina)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
ODLModel result = new ODLModel();
// cerco in redis...
string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:LAST";
var results = await Task.FromResult(dbTabController.OdlReopenOdlMacc(idxMacchina));
// riordino
result = results.FirstOrDefault();
// svuoto cache
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
if (result == null)
{
result = new ODLModel();
}
sw.Stop();
Log.Debug($"OdlReopenOdlMacc | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Setup ODL Postumo
/// </summary>
@@ -1354,7 +1497,7 @@ namespace MP.Data.Services
try
{
// inserisco evento
answ = dbTabController.OdlSetupPostumo(idxODL, idxMacchina);
answ = await Task.FromResult(dbTabController.OdlSetupPostumo(idxODL, idxMacchina));
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
@@ -1380,7 +1523,7 @@ namespace MP.Data.Services
try
{
// inserisco evento
answ = dbTabController.OdlSetupPromPostuma(idxPromOdl, matrOpr, idxMacchina);
answ = await Task.FromResult(dbTabController.OdlSetupPromPostuma(idxPromOdl, matrOpr, idxMacchina));
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
@@ -1411,7 +1554,7 @@ namespace MP.Data.Services
try
{
// inserisco evento
answ = dbTabController.OdlSplit(idxODL, matrOpr, idxMacchina, TCRich, pzPallet, note, startNewOdl, qtyRich);
answ = await Task.FromResult(dbTabController.OdlSplit(idxODL, matrOpr, idxMacchina, TCRich, pzPallet, note, startNewOdl, qtyRich));
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
@@ -1429,6 +1572,9 @@ namespace MP.Data.Services
/// </summary>
/// <param name="idxODL"></param>
/// <param name="matrOpr"></param>
/// <param name="tCRichAttr"></param>
/// <param name="pzPallet"></param>
/// <param name="note"></param>
/// <returns></returns>
public async Task<bool> OdlUpdate(int idxODL, int matrOpr, decimal tCRichAttr, int pzPallet, string note)
{
@@ -1449,6 +1595,117 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Delete dell'oggetto opr serializzato
/// </summary>
/// <param name="matrOpr"></param>
/// <returns></returns>
public async Task<bool> OperatoreDeleteRedis(int matrOpr)
{
string source = "REDIS";
Stopwatch sw = new Stopwatch();
sw.Start();
bool answ = false;
// cerco in redis...
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
var done = await ExecFlushRedisPattern(currKey);
if (done)
{
answ = true;
}
}
sw.Stop();
Log.Debug($"OperatoreDeleteRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
await Task.Delay(1);
return answ;
}
/// <summary>
/// Scrive l'hash dell'oggetto curr opr
/// </summary>
/// <param name="matrOpr"></param>
/// <returns></returns>
public async Task<string> OperatoreGetRedis(int matrOpr)
{
string source = "REDIS";
Stopwatch sw = new Stopwatch();
sw.Start();
string answ = "";
// cerco in redis...
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
//var encrData = SteamCrypto.DecryptString(rawData, passPhrase);
//answ = JsonConvert.DeserializeObject<string>(rawData);
answ = rawData;
}
if (answ == null)
{
answ = "";
}
sw.Stop();
Log.Debug($"OperatoreGetRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
await Task.Delay(1);
return answ;
}
/// <summary>
/// Log in operatore
/// </summary>
/// <param name="matrOpr">matricola operatore</param>
/// <param name="authKey">Auth Key</param>
/// <returns></returns>
public async Task<AnagOperatoriModel> OperatoreSearch(int matrOpr, string authKey)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
AnagOperatoriModel answ = null;
answ = dbTabController.OperatoreSearch(matrOpr, authKey);
if (answ == null)
{
answ = new AnagOperatoriModel();
}
sw.Stop();
Log.Debug($"LoginOperatore | {source} | {sw.Elapsed.TotalMilliseconds}ms");
await Task.Delay(1);
return answ;
}
/// <summary>
/// legge l'hash dell'oggetto curr opr
/// </summary>
/// <param name="currOpr"></param>
/// <returns></returns>
public async Task<string> OperatoreSetRedis(int matrOpr, string currOpr)
{
setExpDays();
string source = "REDIS";
Stopwatch sw = new Stopwatch();
sw.Start();
string answ = "";
// cerco in redis...
string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}";
//RedisValue rawData = await redisDb.StringGetAsync(currKey);
// serializzo e salvo...
//rawData = JsonConvert.SerializeObject(currOpr);
answ = currOpr;
//var encrData = SteamCrypto.EncryptString(rawData, passPhrase);
await redisDb.StringSetAsync(currKey, currOpr, ConfigCache);
if (answ == null)
{
answ = "";
}
sw.Stop();
Log.Debug($"OperatoreSetRedis | {source} | {sw.Elapsed.TotalMilliseconds}ms");
await Task.Delay(1);
return answ;
}
/// <summary>
/// Stato prod macchina
/// </summary>
@@ -1537,7 +1794,7 @@ namespace MP.Data.Services
result = await Task.FromResult(dbTabController.PODLExp_getByKey(idxPODL));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
await redisDb.StringSetAsync(currKey, rawData, FastCache);
}
if (result == null)
{
@@ -2517,7 +2774,7 @@ namespace MP.Data.Services
result = dbIocController.VMSFDGetAll();
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
await redisDb.StringSetAsync(currKey, rawData, UltraFastCache);
}
if (result == null)
{
@@ -2591,7 +2848,7 @@ namespace MP.Data.Services
result = dbIocController.VMSFDGetByMacc(idxMacc);
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
@@ -2656,7 +2913,7 @@ namespace MP.Data.Services
result = await Task.FromResult(dbTabController.VSCS_getAll());
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
}
if (result == null)
{
@@ -2729,7 +2986,7 @@ namespace MP.Data.Services
result = await Task.FromResult(dbTabController.VSOdlGetUnused(idxMacchina, showAll, numDayAdd));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
await redisDb.StringSetAsync(currKey, rawData, UltraFastCache);
}
if (result == null)
{
@@ -2744,6 +3001,8 @@ namespace MP.Data.Services
#region Protected Fields
protected int expMinutes = 1;
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
@@ -2756,6 +3015,27 @@ namespace MP.Data.Services
#endregion Protected Fields
#region Protected Properties
/// <summary>
/// Durata cache data dal valore in config
/// </summary>
protected TimeSpan ConfigCache
{
get => TimeSpan.FromMinutes(expMinutes);
}
#endregion Protected Properties
#region Protected Methods
protected void setExpDays()
{
ConfigGetVal("TAB_dtTimerScadLogin", ref expMinutes);
}
#endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
@@ -2771,6 +3051,7 @@ namespace MP.Data.Services
private string DataSource = "";
private string redisBaseKey = "MP:TAB:Cache";
private string redisUserDataKey = "MP:TAB:Users";
#endregion Private Fields
+1 -1
View File
@@ -4,7 +4,7 @@
</div>
<div class="col-7 pl-0 text-right">
<span class="small">@adesso</span>
<a class="text-light" href="https://www.egalware.com/" target="_blank">Egalware<img class="img-fluid" width="16" src="img/LogoBlu.svg" /></a>
<a class="text-light" href="https://www.egalware.com/" target="_blank">Egalware &nbsp;<img class="img-fluid" width="16" src="img/LogoEgalware.svg" /></a>
</div>
</div>
+3 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.16.2311.1009</Version>
<Version>6.16.2311.1619</Version>
</PropertyGroup>
<ItemGroup>
@@ -44,6 +44,8 @@
<ItemGroup>
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2311.1612" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2311.1612" />
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
+15 -15
View File
@@ -6,7 +6,7 @@
<div class="row mx-2">
<div class="col-12 col-lg-10 offset-lg-1">
<div class="card">
<div class="card shadow">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
@@ -16,7 +16,7 @@
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare &nbsp;<img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
</div>
</div>
@@ -41,51 +41,51 @@
<h4>Info installazione</h4>
<hr />
<div class="d-flex justify-content-between @remSrvCss">
<div class="px-2">
<div class="px-1">
<i class="fa fa-server" aria-hidden="true"></i> Remote Server:
</div>
<div class="px-2">
<div class="px-1">
<b>@ServerStatus</b>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="px-2">
<div class="px-1">
<i class="fa fa-certificate" aria-hidden="true"></i> Cliente:
</div>
<div class="px-2">
<div class="px-1">
<b>@Installazione</b>
</div>
</div>
<div class="d-flex justify-content-between">
<div class="px-2">
<div class="px-1">
<i class="fa fa-desktop" aria-hidden="true"></i> App:
</div>
<div class="px-2">
<div class="px-1">
<b>@Applicazione</b>
</div>
</div>
<div class="d-flex justify-content-between @licenseCss">
<div class="px-2">
<div class="px-1">
<i class="fa fa-users" aria-hidden="true"></i> Licenze:
</div>
<div class="px-2">
<div class="px-1">
<b title="# Licenze locali / # Licenze Remote">@Licenze</b>
</div>
</div>
<div class="d-flex justify-content-between @expDateCss">
<div class="px-2">
<div class="px-1">
<i class="far fa-calendar-check" aria-hidden="true"></i> Scadenza:
</div>
<div class="px-2">
<div class="px-1">
<b>@($"{Scadenza:yyyy/MM/dd}")</b>
</div>
</div>
<div class="d-flex justify-content-between @licenseCss">
<div class="px-2">
<div class="px-1">
<i class="fa fa-key" aria-hidden="true"></i> Key
</div>
<div class="px-2">
<span Font-Size="0.6em" class="small">@MastKey</span>
<div class="px-1">
<EgwCoreLib.Razor.CopyToClipboard Text="@MastKey" ShowText="true"></EgwCoreLib.Razor.CopyToClipboard>
</div>
</div>
</div>
+2 -2
View File
@@ -5,7 +5,7 @@
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="card">
<div class="card shadow">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
@@ -15,7 +15,7 @@
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare &nbsp;<img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
</div>
</div>
+2 -2
View File
@@ -3,7 +3,7 @@
@using MP.Land.Data
@using MP.Land.Components
<div class="alert alert-secondary">
<div class="alert alert-secondary shadow">
<div class="row">
<div class="col-12 col-md-9">
<h1>MAPO Land</h1>
@@ -24,7 +24,7 @@
</div>
</div>
<div class="card">
<div class="card shadow">
<div class="card-body">
@if (ListRecords == null)
{
+2 -2
View File
@@ -9,7 +9,7 @@
<div class="row mx-2">
<div class="col-12 col-lg-10 offset-lg-1">
<div class="card">
<div class="card shadow">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
@@ -19,7 +19,7 @@
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoEgalware.svg" /></a>
</div>
</div>
</div>
+2 -2
View File
@@ -4,7 +4,7 @@
@using MP.Land.Components
@inject LicenseService LicServ
<div class="alert alert-secondary">
<div class="alert alert-secondary shadow">
<div class="row">
<div class="col-12 col-md-3">
<img src="img/LogoMapoFull.png" class="img-fluid" width="200" />
@@ -43,7 +43,7 @@
</div>
</div>
}
<div class="card">
<div class="card shadow">
<div class="card-body">
@if (ListRecords == null)
{
+1 -1
View File
@@ -3,7 +3,7 @@
@using MP.Land.Data
@using MP.Land.Components
<div class="card">
<div class="card shadow">
<div class="card-body">
<CmpGroupFilt></CmpGroupFilt>
@if (ListRecords == null)
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.16.2311.1009</h4>
<h4>Versione: 6.16.2311.1619</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2311.1009
6.16.2311.1619
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2311.1009</version>
<version>6.16.2311.1619</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1.36239,0,0,1.3719,-37.4073,-2.14718)">
<g id="Livello1">
<path d="M172.134,8.625C172.134,5.283 169.402,2.569 166.036,2.569L35.347,2.569C31.981,2.569 29.249,5.283 29.249,8.625L29.249,139.794C29.249,143.136 31.981,145.85 35.347,145.85L166.036,145.85C169.402,145.85 172.134,143.136 172.134,139.794L172.134,8.625Z" style="fill:white;"/>
</g>
</g>
<g transform="matrix(1.36807,0,0,1.36807,-37.5733,0.033733)">
<g id="Livello_3">
<g>
<path d="M98.9,32.9L61.4,32.8L98.9,32.9Z" style="fill:none;fill-rule:nonzero;"/>
<path d="M75.7,91.3L90.7,69.8L75.7,91.3Z" style="fill:none;fill-rule:nonzero;"/>
<path d="M167.9,111.6L61.5,111.6L61.4,32.8L98.9,32.9L118.9,4.6L32.7,4.6L33.1,140.8L167.9,140.6L167.9,111.6Z" style="fill:rgb(176,197,214);fill-rule:nonzero;"/>
<path d="M102.4,52.9L90.7,69.8L75.7,91.3L167.9,91.2L167.9,4.6L148.2,4.6L114.6,52.8L102.4,52.9Z" style="fill:rgb(60,137,201);fill-rule:nonzero;"/>
<path d="M148.2,4.6L118.9,4.6L148.2,4.6Z" style="fill:white;fill-rule:nonzero;"/>
<path d="M75.7,91.3L90.7,69.8L102.4,52.9L114.6,52.8L148.2,4.6L118.9,4.6L98.9,32.9L61.4,32.8L61.5,111.6L167.9,111.6L167.9,91.2L75.7,91.3Z" style="fill:white;fill-rule:nonzero;"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
<style type="text/css">
.st0{fill:#010202;}
.st1{fill:none;}
.st2{fill:#B0C5D6;}
.st3{fill:#3C89C9;}
.st4{fill:#FFFFFF;}
</style>
<g id="Livello_1">
</g>
<g id="Livello_2">
</g>
<g id="Livello_3">
<rect x="0.3" y="-0.2" class="st0" width="199.8" height="200.3"/>
<g>
<g>
<path class="st4" d="M33.6,158.2H47v3.6h-9.7v7.9h6.2l-1.1,3.5h-5.2v9.8h9.6v3.3H33.6V158.2z"/>
<path class="st4" d="M62,188.5v-3.2c-0.3,0.5-0.8,0.8-1.5,1.1c-0.7,0.3-1.5,0.4-2.5,0.4c-2.3,0-4.2-0.6-5.5-1.9
c-1.3-1.3-2-3.2-2-5.6v-6c0-2.4,0.7-4.2,2.1-5.5c1.4-1.3,3.2-2,5.5-2c0.9,0,1.7,0.1,2.4,0.4c0.7,0.3,1.2,0.6,1.5,1l0.5-1.1h3.1
V189c0,1.8-0.4,3.2-1.3,4.1c-0.9,1-2.3,1.6-4.3,1.7l-0.9-2.9C61.1,191.8,62,190.6,62,188.5z M61,170.5c-0.7-0.7-1.7-1-3-1
c-1.2,0-2.1,0.4-2.8,1.1c-0.7,0.7-1,1.7-1,3v5.5c0,1.3,0.3,2.4,0.9,3.2c0.6,0.8,1.6,1.2,2.9,1.2c1.4,0,2.4-0.5,3-1.4
c0.7-0.9,1-2.3,1-4.1v-4.5C62,172.1,61.7,171.1,61,170.5z"/>
<path class="st4" d="M77.9,186.8c-2.8,0-5-0.5-6.7-1.6c-1.7-1-2.5-2.9-2.5-5.7v-3.3c0-2.7,0.9-4.4,2.8-5.4
c0.9-0.4,1.9-0.6,3.1-0.6c1.1,0,2.1,0.2,3.2,0.5c1.1,0.3,2,0.7,2.6,1.1c0-1.1-0.4-2-1.3-2.5c-0.9-0.6-2.1-0.8-3.7-0.8l0.3-2.6
c2.6,0,4.4,0.4,5.7,1.2c1.2,0.8,2,1.8,2.2,2.9c0.3,1.1,0.4,2.6,0.4,4.4v12C81.3,186.7,79.2,186.8,77.9,186.8z M78,174.4
c-1-0.3-1.9-0.5-2.8-0.5c-1.9,0-2.8,0.9-2.8,2.7v2.7c0,2.8,1.8,4.1,5.3,4.1c0.9,0,1.8-0.1,2.8-0.2v-7.7
C79.8,175.1,79,174.8,78,174.4z"/>
<path class="st4" d="M88.7,158.2h3.6v28.2h-3.6V158.2z"/>
<path class="st4" d="M108.9,173.7l-3.3,12.7h-3.9l-6.3-20.2h4l4.2,14.3l3.7-14.3h3.5l3.7,14.3l4-14.3h3.9l-6.4,20.2h-3.8
L108.9,173.7z"/>
<path class="st4" d="M131.8,186.8c-2.8,0-5-0.5-6.7-1.6c-1.7-1-2.5-2.9-2.5-5.7v-3.3c0-2.7,0.9-4.4,2.8-5.4
c0.9-0.4,1.9-0.6,3.1-0.6c1.1,0,2.1,0.2,3.2,0.5c1.1,0.3,2,0.7,2.6,1.1c0-1.1-0.4-2-1.3-2.5c-0.9-0.6-2.1-0.8-3.7-0.8l0.3-2.6
c2.6,0,4.4,0.4,5.7,1.2c1.2,0.8,2,1.8,2.2,2.9c0.3,1.1,0.4,2.6,0.4,4.4v12C135.1,186.7,133.1,186.8,131.8,186.8z M131.9,174.4
c-1-0.3-1.9-0.5-2.8-0.5c-1.9,0-2.8,0.9-2.8,2.7v2.7c0,2.8,1.8,4.1,5.3,4.1c0.9,0,1.8-0.1,2.8-0.2v-7.7
C133.7,175.1,132.8,174.8,131.9,174.4z"/>
<path class="st4" d="M141.9,166.2h3.4l0.2,0.6c1.1-0.6,2.4-0.9,3.8-0.9c1,0,2.1,0.1,3.4,0.4l-0.9,3.5c-0.7-0.3-1.5-0.5-2.3-0.5
c-1.1,0-2,0.3-2.8,0.8c-0.8,0.6-1.1,1.3-1.1,2.3v13.9h-3.6V166.2z"/>
<path class="st4" d="M163.7,186.4c-1.2,0.3-2.5,0.5-3.7,0.5c-2,0-3.5-0.5-4.7-1.5c-1.2-1-1.7-2.5-1.7-4.4v-8.3
c0-2.2,0.7-3.9,2-5.1c1.3-1.2,3.1-1.8,5.3-1.8c2.2,0,3.9,0.6,5.2,1.8c1.2,1.2,1.9,2.9,1.9,5v5.8l-10.7,0.6v1.6
c0,0.9,0.3,1.7,0.8,2.2c0.5,0.5,1.3,0.7,2.3,0.7c1.5,0,3.2-0.5,5.2-1.6l1.4,3.1C166,185.6,164.9,186.1,163.7,186.4z M163.2,170.1
c-0.7-0.5-1.5-0.8-2.4-0.8c-1.1,0-2,0.3-2.7,0.9c-0.6,0.6-1,1.5-1,2.5v2.8l7-0.4v-2.6C164.3,171.5,163.9,170.7,163.2,170.1z"/>
</g>
<polygon class="st1" points="98.9,32.9 61.4,32.8 98.9,32.9 "/>
<polygon class="st1" points="75.7,91.3 90.7,69.8 75.7,91.3 "/>
<polygon class="st4" points="167.9,111.6 61.5,111.6 61.4,32.8 98.9,32.9 118.9,4.6 32.7,4.6 33.1,140.8 167.9,140.6 "/>
<polygon class="st4" points="102.4,52.9 90.7,69.8 75.7,91.3 167.9,91.2 167.9,4.6 148.2,4.6 114.6,52.8 "/>
<polygon class="st4" points="148.2,4.6 148.2,4.6 118.9,4.6 135.9,4.6 "/>
<polygon class="st0" points="75.7,91.3 75.7,91.3 90.7,69.8 102.4,52.9 114.6,52.8 148.2,4.6 135.9,4.6 118.9,4.6 98.9,32.9
98.9,32.9 61.4,32.8 61.5,111.6 167.9,111.6 167.9,91.2 "/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

+1 -1
View File
@@ -116,7 +116,7 @@ namespace MP.SPEC.Components
{
idxMaccLast = IdxMaccSel;
lastPeriodo = CurrPeriodo;
ListComplete = await MDataServ.ParetoFluxLog(IdxMaccSel, CurrPeriodo.Inizio, CurrPeriodo.Fine);
ListComplete = await MDataServ.FluxLogPareto(IdxMaccSel, CurrPeriodo.Inizio, CurrPeriodo.Fine);
TotalCount = ListComplete.Count;
TotalRecords = ListComplete.Sum(x => x.Qty);
FluxList = ListComplete.Select(x => x.CodFlux).ToList();
+1 -1
View File
@@ -98,7 +98,7 @@ namespace MP.SPEC.Components
SearchRecords = null;
ListRecords = null;
DateTime dataFrom = DateTime.Today.AddMonths(-1);
DateTime dataTo = DateTime.Now.AddMinutes(5);
DateTime dataTo = DateTime.Now.AddDays(1);
if (SelFilter != null && SelFilter.dtMin != null)
{
dataFrom = (DateTime)SelFilter.dtMin;
+1 -1
View File
@@ -204,7 +204,7 @@ namespace MP.SPEC.Components
currFilt.LiveUpdate = true;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
currFilt.dtMax = DateTime.Today.AddDays(1); //RoundDatetime(5);
currFilt.dtSnapMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
SelFilter = currFilt;
}
+35 -35
View File
@@ -800,6 +800,41 @@ namespace MP.SPEC.Data
return result;
}
/// <summary>
/// Elenco Gruppi
/// </summary>
/// <returns></returns>
public async Task<List<ParetoFluxLogDTO>> FluxLogPareto(string idxMacchina, DateTime dtFrom, DateTime dtTo)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string source = "DB";
List<ParetoFluxLogDTO>? result = new List<ParetoFluxLogDTO>();
// cerco in redis...
string redKey = $"{Utils.redisParetoFLKey}:{idxMacchina}:{dtFrom:yyyyMMdd}:{dtTo:yyyyMMdd}";
RedisValue rawData = await redisDb.StringGetAsync(redKey);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<ParetoFluxLogDTO>>($"{rawData}");
source = "REDIS";
}
else
{
result = await Task.FromResult(dbController.FluxLogPareto(idxMacchina, dtFrom, dtTo));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redKey, rawData, getRandTOut(redisLongTimeCache));
}
if (result == null)
{
result = new List<ParetoFluxLogDTO>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ParetoFluxLog Read from {source}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Stored manutenzione del DB
/// </summary>
@@ -1248,41 +1283,6 @@ namespace MP.SPEC.Data
return result;
}
/// <summary>
/// Elenco Gruppi
/// </summary>
/// <returns></returns>
public async Task<List<ParetoFluxLogDTO>> ParetoFluxLog(string idxMacchina, DateTime dtFrom, DateTime dtTo)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string source = "DB";
List<ParetoFluxLogDTO>? result = new List<ParetoFluxLogDTO>();
// cerco in redis...
string redKey = $"{Utils.redisParetoFLKey}:{idxMacchina}:{dtFrom:yyyyMMdd}:{dtTo:yyyyMMdd}";
RedisValue rawData = await redisDb.StringGetAsync(redKey);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<ParetoFluxLogDTO>>($"{rawData}");
source = "REDIS";
}
else
{
result = await Task.FromResult(dbController.ParetoFluxLog(idxMacchina, dtFrom, dtTo));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redKey, rawData, getRandTOut(redisLongTimeCache));
}
if (result == null)
{
result = new List<ParetoFluxLogDTO>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ParetoFluxLog Read from {source}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Eliminazione record selezionato
/// </summary>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2311.1016</Version>
<Version>6.16.2312.1117</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2311.1016</h4>
<h4>Versione: 6.16.2312.1117</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2311.1016
6.16.2312.1117
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2311.1016</version>
<version>6.16.2312.1117</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>