forked from ddrilling/AsbCloudServer
Фикс бага при формировании данных (метод GetGroupOperationsStatAsync в WellOperationRepository)
This commit is contained in:
parent
312d653aec
commit
5961260ccd
@ -227,7 +227,7 @@ namespace AsbCloudInfrastructure.Repository
|
||||
IdParent = parentRelationDictionary[g.Key].IdParent
|
||||
});
|
||||
var defaultId = 0;
|
||||
while (dtos.Any(x => x.IdParent != null))
|
||||
while (dtos.Any(x => x.IdParent == null))
|
||||
{
|
||||
defaultId--;
|
||||
dtos = dtos
|
||||
@ -235,12 +235,16 @@ namespace AsbCloudInfrastructure.Repository
|
||||
.Select(g => new WellGroupOpertionDto
|
||||
{
|
||||
IdCategory = g.Key ?? defaultId,
|
||||
Category = g.Key.HasValue ? parentRelationDictionary[g.Key.Value].Name : "unknown",
|
||||
Category = g.Key.HasValue
|
||||
? parentRelationDictionary.GetValueOrDefault(g.Key.Value)?.Name ?? "unknown"
|
||||
: "unknown",
|
||||
Count = g.Sum(o => o.Count),
|
||||
DeltaDepth = g.Sum(o => o.DeltaDepth),
|
||||
TotalMinutes = g.Sum(o => o.TotalMinutes),
|
||||
Items = g.ToList(),
|
||||
IdParent = g.Key.HasValue ? parentRelationDictionary[g.Key.Value].IdParent : defaultId,
|
||||
IdParent = g.Key.HasValue
|
||||
? parentRelationDictionary.GetValueOrDefault(g.Key.Value)?.IdParent ?? defaultId
|
||||
: defaultId,
|
||||
});
|
||||
}
|
||||
return dtos;
|
||||
|
Loading…
Reference in New Issue
Block a user