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
|
IdParent = parentRelationDictionary[g.Key].IdParent
|
||||||
});
|
});
|
||||||
var defaultId = 0;
|
var defaultId = 0;
|
||||||
while (dtos.Any(x => x.IdParent != null))
|
while (dtos.Any(x => x.IdParent == null))
|
||||||
{
|
{
|
||||||
defaultId--;
|
defaultId--;
|
||||||
dtos = dtos
|
dtos = dtos
|
||||||
@ -235,12 +235,16 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
.Select(g => new WellGroupOpertionDto
|
.Select(g => new WellGroupOpertionDto
|
||||||
{
|
{
|
||||||
IdCategory = g.Key ?? defaultId,
|
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),
|
Count = g.Sum(o => o.Count),
|
||||||
DeltaDepth = g.Sum(o => o.DeltaDepth),
|
DeltaDepth = g.Sum(o => o.DeltaDepth),
|
||||||
TotalMinutes = g.Sum(o => o.TotalMinutes),
|
TotalMinutes = g.Sum(o => o.TotalMinutes),
|
||||||
Items = g.ToList(),
|
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;
|
return dtos;
|
||||||
|
Loading…
Reference in New Issue
Block a user