Compare commits
4
Commits
0e00fb273a
..
v1.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
deda374b5b | ||
|
|
92271e20fb | ||
|
|
e524c12a96 | ||
|
|
de889ef8c7 |
No files matched your search
@@ -155,14 +155,29 @@ public class IspezioniService(AppDbContext db) : IIspezioniService
|
|||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<List<Scheda>> GetAllSchedeOfIspezioneAsync(string codMdep, DateTime data, string rilevatore) =>
|
public async Task<List<Scheda>> GetAllSchedeOfIspezioneAsync(string codMdep, DateTime data, string rilevatore)
|
||||||
db.Schede
|
{
|
||||||
|
// Le versioni precedenti dell'app hanno lasciato schede non bozza senza
|
||||||
|
// reparto o motivo: risultano inviabili ma il server le rifiuta, e
|
||||||
|
// bloccano la conclusione dell'ispezione. Tornano bozze, cosi' il
|
||||||
|
// rilevatore le completa. Quelle gia' inviate non si toccano.
|
||||||
|
await db.Schede
|
||||||
|
.Where(x => x.CodMdep == codMdep &&
|
||||||
|
x.Data == data &&
|
||||||
|
x.Rilevatore == rilevatore &&
|
||||||
|
!x.Bozza &&
|
||||||
|
x.ActivityId == null &&
|
||||||
|
(string.IsNullOrEmpty(x.CodJfas) || string.IsNullOrEmpty(x.ActivityTypeId)))
|
||||||
|
.ExecuteUpdateAsync(s => s.SetProperty(x => x.Bozza, true));
|
||||||
|
|
||||||
|
return await db.Schede
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Include(s => s.Articoli)
|
.Include(s => s.Articoli)
|
||||||
.Where(x => x.CodMdep == codMdep &&
|
.Where(x => x.CodMdep == codMdep &&
|
||||||
x.Data == data &&
|
x.Data == data &&
|
||||||
x.Rilevatore == rilevatore)
|
x.Rilevatore == rilevatore)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public Task<Scheda?> GetSchedaAsync(int schedaId) =>
|
public Task<Scheda?> GetSchedaAsync(int schedaId) =>
|
||||||
db.Schede
|
db.Schede
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
<ApplicationId>it.integry.SteUp</ApplicationId>
|
<ApplicationId>it.integry.SteUp</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>1.2.1</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>1.2.2</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>7</ApplicationVersion>
|
<ApplicationVersion>8</ApplicationVersion>
|
||||||
|
|
||||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
|
||||||
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">-->
|
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">-->
|
||||||
|
|||||||
@@ -157,6 +157,7 @@
|
|||||||
@foreach (var group in SchedeGrouped)
|
@foreach (var group in SchedeGrouped)
|
||||||
{
|
{
|
||||||
var reparto = group.Key;
|
var reparto = group.Key;
|
||||||
|
var senzaReparto = ReferenceEquals(reparto, SenzaReparto);
|
||||||
var chiuso = IsCollapsed(reparto);
|
var chiuso = IsCollapsed(reparto);
|
||||||
var daInviare = group.Value.CountDaInviare();
|
var daInviare = group.Value.CountDaInviare();
|
||||||
|
|
||||||
@@ -172,7 +173,9 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="reparto__actions">
|
<div class="reparto__actions">
|
||||||
@if (!IsCompleted)
|
@* Il gruppo "Senza reparto" raccoglie solo bozze da
|
||||||
|
sistemare: non ha un "+" ne' un invio suo. *@
|
||||||
|
@if (!IsCompleted && !senzaReparto)
|
||||||
{
|
{
|
||||||
@* Da qui la scheda nasce gia' con il suo reparto: e'
|
@* Da qui la scheda nasce gia' con il suo reparto: e'
|
||||||
l'unica differenza con il "+" della barra. *@
|
l'unica differenza con il "+" della barra. *@
|
||||||
@@ -326,13 +329,15 @@
|
|||||||
// schermata, non del documento.
|
// schermata, non del documento.
|
||||||
private readonly HashSet<string> _collapsed = new(StringComparer.OrdinalIgnoreCase);
|
private readonly HashSet<string> _collapsed = new(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
private bool IsCollapsed(JtbFasiDto reparto) =>
|
// Il gruppo "Senza reparto" non ha codice: la chiave vuota e' la sua.
|
||||||
reparto.CodJfas is not null && _collapsed.Contains(reparto.CodJfas);
|
private static string CollapseKey(JtbFasiDto reparto) => reparto.CodJfas ?? string.Empty;
|
||||||
|
|
||||||
|
private bool IsCollapsed(JtbFasiDto reparto) => _collapsed.Contains(CollapseKey(reparto));
|
||||||
|
|
||||||
private void Toggle(JtbFasiDto reparto)
|
private void Toggle(JtbFasiDto reparto)
|
||||||
{
|
{
|
||||||
if (reparto.CodJfas is null) return;
|
var key = CollapseKey(reparto);
|
||||||
if (!_collapsed.Remove(reparto.CodJfas)) _collapsed.Add(reparto.CodJfas);
|
if (!_collapsed.Remove(key)) _collapsed.Add(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string Conteggi(List<Scheda> schede)
|
private static string Conteggi(List<Scheda> schede)
|
||||||
@@ -542,15 +547,22 @@
|
|||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Una bozza si puo' salvare anche senza reparto: senza questo gruppo
|
||||||
|
// sparirebbe dall'elenco pur restando sul dispositivo e contata fra le bozze.
|
||||||
|
private static readonly JtbFasiDto SenzaReparto = new() { Descrizione = "Senza reparto" };
|
||||||
|
|
||||||
private void GroupSchede()
|
private void GroupSchede()
|
||||||
{
|
{
|
||||||
SchedeGrouped = SchedeList
|
var grouped = new Dictionary<JtbFasiDto, List<Scheda>>();
|
||||||
.Where(s => s.Reparto != null)
|
|
||||||
.GroupBy(s => s.CodJfas)
|
// In testa: sono schede a meta' che chiedono di essere completate.
|
||||||
.ToDictionary(
|
var senzaReparto = SchedeList.FindAll(s => s.Reparto == null);
|
||||||
g => g.First().Reparto!,
|
if (senzaReparto.Count > 0) grouped[SenzaReparto] = senzaReparto;
|
||||||
g => g.ToList()
|
|
||||||
);
|
foreach (var g in SchedeList.Where(s => s.Reparto != null).GroupBy(s => s.CodJfas))
|
||||||
|
grouped[g.First().Reparto!] = g.ToList();
|
||||||
|
|
||||||
|
SchedeGrouped = grouped;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSchedaModified(Scheda obj)
|
private void OnSchedaModified(Scheda obj)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="list-card" aria-label="@SemanticLabel">
|
<div class="list-card" aria-label="@SemanticLabel">
|
||||||
<div class="list-card__head">
|
<div class="list-card__head">
|
||||||
<div class="list-card__ident">
|
<div class="list-card__ident">
|
||||||
<div class="t-ident">@Scheda.DescrizioneReparto</div>
|
<div class="t-ident">@(Scheda.DescrizioneReparto ?? "Senza reparto")</div>
|
||||||
<h3 class="list-card__title">@Titolo</h3>
|
<h3 class="list-card__title">@Titolo</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
private string SemanticLabel =>
|
private string SemanticLabel =>
|
||||||
$"Scheda {Titolo}, reparto {Scheda.DescrizioneReparto}, {SyncState.ToBadge().Label}, {ArticoliLabel}, {FotoLabel}";
|
$"Scheda {Titolo}, reparto {Scheda.DescrizioneReparto ?? "non indicato"},{SyncState.ToBadge().Label}, {ArticoliLabel}, {FotoLabel}";
|
||||||
|
|
||||||
private async Task SetBusy(bool value)
|
private async Task SetBusy(bool value)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user