From a4669bd6702d1862154deae92ba737654e13b7ec Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 5 Dec 2022 18:28:39 +0100 Subject: [PATCH] =?UTF-8?q?gestione=20scansione=20x=20udc,=20lotto,=20codi?= =?UTF-8?q?ce=20gi=C3=A0=20scansionato?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MP.INVE/Components/CodeScan.razor | 2 +- MP.INVE/Components/CodeScan.razor.cs | 1 - MP.INVE/Components/ProcSuggestion.razor | 57 ++++++-- MP.INVE/Components/ProcSuggestion.razor.cs | 152 +++++++++++++++++---- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Pages/Acquisizione.razor | 14 +- MP.INVE/Pages/Acquisizione.razor.cs | 11 +- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- 10 files changed, 195 insertions(+), 50 deletions(-) diff --git a/MP.INVE/Components/CodeScan.razor b/MP.INVE/Components/CodeScan.razor index 4327b9cb..d60a1402 100644 --- a/MP.INVE/Components/CodeScan.razor +++ b/MP.INVE/Components/CodeScan.razor @@ -1,3 +1,3 @@ 
- +
diff --git a/MP.INVE/Components/CodeScan.razor.cs b/MP.INVE/Components/CodeScan.razor.cs index a28b87a9..ad39073a 100644 --- a/MP.INVE/Components/CodeScan.razor.cs +++ b/MP.INVE/Components/CodeScan.razor.cs @@ -54,7 +54,6 @@ namespace MP.INVE.Components } } - protected string cssHide { get; set; } = ""; private void saveSel(string scanToSend) { diff --git a/MP.INVE/Components/ProcSuggestion.razor b/MP.INVE/Components/ProcSuggestion.razor index 9ee35e70..8f1271cd 100644 --- a/MP.INVE/Components/ProcSuggestion.razor +++ b/MP.INVE/Components/ProcSuggestion.razor @@ -8,20 +8,20 @@
  • totalmente ignoto
  • *@ -@if (currUdc != null) +@if (currUdc != null || currLotto != null) {
    - + +
    +} +else if (alreadyScan != null) +{ + +
    + +
    } else { - +
    NO RECORD FOUND
    } diff --git a/MP.INVE/Components/ProcSuggestion.razor.cs b/MP.INVE/Components/ProcSuggestion.razor.cs index 492254d0..eba5c875 100644 --- a/MP.INVE/Components/ProcSuggestion.razor.cs +++ b/MP.INVE/Components/ProcSuggestion.razor.cs @@ -40,43 +40,84 @@ namespace MP.INVE.Components private string tipo { get; set; } = ""; private string canMod = "false"; - protected List? searchrecords; + protected List? searchRecordsUDC; + protected List? searchRecordsLotto; + protected List? elencoScansioni; protected AnagUdcModel? udc; + protected AnagLottoModel? lotto; + protected ScanDataModel? alreadyScan; protected AnagUdcModel? currUdc; + protected AnagLottoModel? currLotto; protected override async Task OnParametersSetAsync() { - await MIService.ConfigResetCache(); - var result = await MIService.tryGetConfig("MAG_SmartUdcEdit"); - if (result != null) - { - canMod = result; - } - await Task.Delay(1); - searchrecords = MIService.ElencoUDC(); - udc = searchrecords.Where(x => x.UDC == lastScan).FirstOrDefault(); + elencoScansioni = MIService.ScanList(); + var exists = elencoScansioni.Select(x => x.ScanValue).Contains(lastScan); - - if (udc != null) + if (exists) { - currUdc = udc; - if (udc.UDC.Contains("MFI")) + var alert = await JSRuntime.InvokeAsync("confirm", $"L'oggetto {lastScan} è già stato scannerizzato, si desidera modificarlo?"); + if (alert) { - tipo = "FINITO"; + alreadyScan = elencoScansioni.Where(x => x.ScanValue == lastScan).FirstOrDefault(); + } + } + else + { + + + await MIService.ConfigResetCache(); + var result = await MIService.tryGetConfig("MAG_SmartUdcEdit"); + if (result != null) + { + canMod = result; + } + await Task.Delay(1); + searchRecordsUDC = MIService.ElencoUDC(); + udc = searchRecordsUDC.Where(x => x.UDC == lastScan).FirstOrDefault(); + + if (udc != null && !udc.UDC.Contains("MSL")) + { + currUdc = udc; + tipo = "UDC"; + lottoScan = udc.lottoNav.Lotto; + articoloScan = udc.lottoNav.CodArt; + quantitaScan = udc.Qta; + noteScan = udc.Note; + } + else + { + searchRecordsLotto = MIService.ElencoLotti(); + lotto = searchRecordsLotto.Where(x => x.Lotto == lastScan).FirstOrDefault(); + if (lotto != null) + { + currLotto = lotto; + tipo = "LOTTO"; + lottoScan = lotto.Lotto; + articoloScan = lotto.CodArt; + } + else + { + lottoScan = ""; + articoloScan = ""; + quantitaScan = 0; + noteScan = ""; + } } } } protected bool isForced = false; + protected decimal qtaLotto = 0; protected async void insertScan() { var alert = await JSRuntime.InvokeAsync("confirm", $"Confermi di voler salvare la seguente scansione per la sessione {sessID}?"); - - if (currUdc != null) + if (alert) { - if (alert) + + if (currUdc != null) { - if((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta)) + if ((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta)) { isForced = true; } @@ -97,19 +138,84 @@ namespace MP.INVE.Components IsUnique = true, InveSessID = sessID }; + + + + await MIService.InsertNewScansione(newScan); + NavManager.NavigateTo(NavManager.Uri, true); + } + else if (currLotto != null) + { + ScanDataModel newScan = new ScanDataModel() + { + DtScan = DateTime.Now, + UserScan = userScan, + ScanValue = lastScan, + IsForced = true, + CodArticolo = currLotto.CodArt, + Lotto = currLotto.Lotto, + RifExt = currLotto.RifExt, + Qty = qtaLotto, + Note = currLotto.Note, + IsKnown = true, + IsUnique = true, + InveSessID = sessID + }; await MIService.InsertNewScansione(newScan); NavManager.NavigateTo(NavManager.Uri, true); } } - else - { - NavManager.NavigateTo(NavManager.Uri, true); - } } + + protected async void updateScansione(ScanDataModel modScan) + { + var alert = await JSRuntime.InvokeAsync("confirm", $"Confermi di voler modificare la seguente scansione {modScan.ScanValue}?"); + if (alert) + { + if (alreadyScan != null) + { + modScan.CodArticolo = alreadyScan.CodArticolo; + modScan.Qty = alreadyScan.Qty; + modScan.Note = alreadyScan.Note; + } + await MIService.UpdateScan(modScan); + } + } + + public void resetAll() + { + NavManager.NavigateTo(NavManager.Uri, true); + } + protected string reqArtMod = "disabilita"; protected string reqQtaMod = "disabilita"; + protected string _lotto = ""; + protected string lottoScan + { + get => _lotto; + set => _lotto = value; + } + protected string _articolo = ""; + protected string articoloScan + { + get => _articolo; + set => _articolo = value; + } + protected decimal _qta = 0; + protected decimal quantitaScan + { + get => _qta; + set => _qta = value; + } + protected string _note = ""; + protected string noteScan + { + get => _note; + set => _note = value; + } + protected void cssDisableArt() { reqArtMod = ""; diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 7c264036..c94a3d34 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2212.515 + 6.16.2212.518 diff --git a/MP.INVE/Pages/Acquisizione.razor b/MP.INVE/Pages/Acquisizione.razor index 8639b396..f199ef93 100644 --- a/MP.INVE/Pages/Acquisizione.razor +++ b/MP.INVE/Pages/Acquisizione.razor @@ -4,14 +4,18 @@
    -

    Acquisizione

    - +

    Acquisizione

    -
    +
    +
    +
    + Last scan: @rawScan +
    +
    @*if (rawScan != null) { @@ -22,8 +26,8 @@
    \ No newline at end of file diff --git a/MP.INVE/Pages/Acquisizione.razor.cs b/MP.INVE/Pages/Acquisizione.razor.cs index 3e5ef97e..9226e7c2 100644 --- a/MP.INVE/Pages/Acquisizione.razor.cs +++ b/MP.INVE/Pages/Acquisizione.razor.cs @@ -33,10 +33,12 @@ namespace MP.INVE.Pages private SelectScanParams currParams = new SelectScanParams(); - private bool logged { get;set; } = false; + private bool logged { get; set; } = false; protected string rawScan { get; set; } = null!; protected string idOPeratore { get; set; } = null!; protected int sessionId { get; set; } = 0; + protected int nScansioniTot { get; set; } = 0; + protected List? eleScansioni; //protected AnagUdcModel currUdc{ get; set; } = null!; protected override async Task OnInitializedAsync() { @@ -46,15 +48,14 @@ namespace MP.INVE.Pages { idOPeratore = _matrOpr; sessionId = int.Parse(_inveSessionId); + eleScansioni = MIService.ScanBySession(sessionId); + + nScansioniTot = eleScansioni.Count(); } } protected void saveScan(string newScan) { rawScan = newScan; } - //protected void saveUdc(AnagUdcModel newUdc) - //{ - // currUdc = newUdc; - //} } } \ No newline at end of file diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index ef7bc889..bff2b932 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

    Versione: 6.16.2212.515

    +

    Versione: 6.16.2212.518


    Note di rilascio:
    • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 8a5610b9..e391da48 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2212.515 +6.16.2212.518 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index fbbb03b3..6cdd0445 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2212.515 + 6.16.2212.518 https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html false