diff
This commit is contained in:
@@ -110,6 +110,9 @@ namespace FasdDesktopUi.Basics.Services.SupportCase.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_focusedRelation == relation)
|
||||
return;
|
||||
|
||||
_selectedHealthcard = _supportCaseProcessor.GetHealthcardFor(relation);
|
||||
HashSet<string> requiredTables = cHealthCard.GetRequiredTables(_selectedHealthcard);
|
||||
_ = Task.Run(async () => await _supportCaseProcessor.LoadSupportCaseDataAsync(relation, requiredTables));
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
private readonly Dictionary<string, Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData.cHealthCardTable>> _supportCaseDataCache = new Dictionary<string, Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData.cHealthCardTable>>();
|
||||
private readonly Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData> _rawDataCache = new Dictionary<cF4sdApiSearchResultRelation, cF4SDHealthCardRawData>(); // todo remove, currently only used for SupportCaseDataProviderArtifact
|
||||
|
||||
private readonly ICollection<cF4sdApiSearchResultRelation> _relationsCurrentlyLoadingData = new HashSet<cF4sdApiSearchResultRelation>();
|
||||
|
||||
internal readonly Guid Id;
|
||||
private readonly IRelationService _relationService;
|
||||
public cSupportCaseDataProvider SupportCaseDataProviderArtifact { get; }
|
||||
@@ -65,19 +67,18 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
if (relations is null)
|
||||
return;
|
||||
|
||||
foreach (var relationType in relations)
|
||||
{
|
||||
//TODO Max fragen obs passt! Bug: in den Ticketrelations (Header Ticketauswahl) sind nur zwei Tickets sichtbar anstatt 5 oder mehr..
|
||||
if (_caseRelations.TryGetValue(relationType.Key, out var caseRelation))
|
||||
_caseRelations[relationType.Key] = caseRelation.Union(relationType).ToList();
|
||||
else
|
||||
_caseRelations.Add(relationType.Key, relationType.ToList());
|
||||
|
||||
if (SupportCaseDataProviderArtifact?.CaseRelations?.TryGetValue(relationType.Key, out var caseRelations) ?? false)
|
||||
SupportCaseDataProviderArtifact.CaseRelations[relationType.Key] = caseRelations.Union(relationType).ToList();
|
||||
else
|
||||
SupportCaseDataProviderArtifact?.CaseRelations?.Add(relationType.Key, relationType.ToList());
|
||||
}
|
||||
foreach (var relationType in relations)
|
||||
{
|
||||
if (_caseRelations.TryGetValue(relationType.Key, out var caseRelation))
|
||||
caseRelation = caseRelation.Union(relationType).ToList();
|
||||
else
|
||||
_caseRelations.Add(relationType.Key, relationType.ToList());
|
||||
|
||||
if (SupportCaseDataProviderArtifact?.CaseRelations?.TryGetValue(relationType.Key, out var caseRelations) ?? false)
|
||||
caseRelations = caseRelations.Union(relationType).ToList();
|
||||
else
|
||||
SupportCaseDataProviderArtifact?.CaseRelations?.Add(relationType.Key, relationType.ToList());
|
||||
}
|
||||
|
||||
CaseRelationsAdded?.Invoke(this, new RelationEventArgs() { Relations = relations });
|
||||
}
|
||||
@@ -91,6 +92,11 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_relationsCurrentlyLoadingData.Contains(relation))
|
||||
return;
|
||||
|
||||
_relationsCurrentlyLoadingData.Add(relation);
|
||||
|
||||
cF4SDHealthCardRawData rawData = null;
|
||||
|
||||
// todo this is only a temporary fix. Currently the tablesToLoad contain also detail tables
|
||||
@@ -131,11 +137,17 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
.Where(table => table.Key.StartsWith("Computation_") == false)
|
||||
.All(table => !table.Value.IsIncomplete && !table.Value.Columns.Values.Any(c => c.IsIncomplete)) ?? false;
|
||||
}
|
||||
|
||||
SupportCaseDataProviderArtifact.HealthCardDataHelper.LoadingHelper.LastDataRequest = DateTime.Now;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogException(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_relationsCurrentlyLoadingData.Remove(relation);
|
||||
}
|
||||
|
||||
bool IsRawDataCacheComplete()
|
||||
{
|
||||
@@ -236,12 +248,12 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
|
||||
table.IsIncomplete = true;
|
||||
|
||||
foreach (var column in table.Columns.Values)
|
||||
{
|
||||
if (column.Values != null && column.Values.Count > 0)
|
||||
column.Values[0] = null;
|
||||
column.IsIncomplete = true;
|
||||
}
|
||||
foreach (var column in table.Columns.Values)
|
||||
{
|
||||
if (column.Values != null && column.Values.Count > 0)
|
||||
column.Values[0] = null;
|
||||
column.IsIncomplete = true;
|
||||
}
|
||||
|
||||
invalidatedTables.Add(table);
|
||||
}
|
||||
@@ -253,12 +265,12 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
{
|
||||
table.IsIncomplete = true;
|
||||
|
||||
foreach (var column in table.Columns.Values)
|
||||
{
|
||||
if (column.Values != null && column.Values.Count > 0)
|
||||
column.Values[0] = null;
|
||||
column.IsIncomplete = true;
|
||||
}
|
||||
foreach (var column in table.Columns.Values)
|
||||
{
|
||||
if (column.Values != null && column.Values.Count > 0)
|
||||
column.Values[0] = null;
|
||||
column.IsIncomplete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -140,6 +140,9 @@ namespace FasdDesktopUi.Basics.Services.SupportCase
|
||||
{
|
||||
var status = enumActualizeStatus.unknown;
|
||||
|
||||
if (!agentUserId.HasValue && !agentDeviceId.HasValue)
|
||||
return status;
|
||||
|
||||
try
|
||||
{
|
||||
TimeSpan refreshDelay = TimeSpan.FromMilliseconds(500);
|
||||
|
||||
Reference in New Issue
Block a user