forked from ddrilling/AsbCloudServer
fix WellOperationRepository.GetGroupOperationsStatAsync()
This commit is contained in:
parent
20ae812363
commit
94a152388f
@ -226,25 +226,25 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
DeltaDepth = g.Sum(o => o.DurationDepth),
|
DeltaDepth = g.Sum(o => o.DurationDepth),
|
||||||
IdParent = parentRelationDictionary[g.Key].IdParent
|
IdParent = parentRelationDictionary[g.Key].IdParent
|
||||||
});
|
});
|
||||||
var defaultId = 0;
|
|
||||||
while (dtos.Any(x => x.IdParent == null))
|
while (dtos.All(x => x.IdParent != null))
|
||||||
{
|
{
|
||||||
defaultId--;
|
|
||||||
dtos = dtos
|
dtos = dtos
|
||||||
.GroupBy(o => o.IdParent)
|
.GroupBy(o => o.IdParent!)
|
||||||
.Select(g => new WellGroupOpertionDto
|
.Select(g => {
|
||||||
{
|
var idCategory = g.Key ?? int.MinValue;
|
||||||
IdCategory = g.Key ?? defaultId,
|
var category = parentRelationDictionary.GetValueOrDefault(idCategory);
|
||||||
Category = g.Key.HasValue
|
var newDto = new WellGroupOpertionDto
|
||||||
? parentRelationDictionary.GetValueOrDefault(g.Key.Value)?.Name ?? "unknown"
|
{
|
||||||
: "unknown",
|
IdCategory = idCategory,
|
||||||
Count = g.Sum(o => o.Count),
|
Category = category?.Name ?? "unknown",
|
||||||
DeltaDepth = g.Sum(o => o.DeltaDepth),
|
Count = g.Sum(o => o.Count),
|
||||||
TotalMinutes = g.Sum(o => o.TotalMinutes),
|
DeltaDepth = g.Sum(o => o.DeltaDepth),
|
||||||
Items = g.ToList(),
|
TotalMinutes = g.Sum(o => o.TotalMinutes),
|
||||||
IdParent = g.Key.HasValue
|
Items = g.ToList(),
|
||||||
? parentRelationDictionary.GetValueOrDefault(g.Key.Value)?.IdParent ?? defaultId
|
IdParent = category?.IdParent,
|
||||||
: defaultId,
|
};
|
||||||
|
return newDto;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return dtos;
|
return dtos;
|
||||||
|
12
AsbCloudWebApi/Rest/WellOperation.http
Normal file
12
AsbCloudWebApi/Rest/WellOperation.http
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
@baseUrl = http://127.0.0.1:5000
|
||||||
|
@contentType = application/json
|
||||||
|
@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2NjI1NDgxNjIsImV4cCI6MTY5NDEwNTc2MiwiaXNzIjoiYSIsImF1ZCI6ImEifQ.OEAlNzxi7Jat6pzDBTAjTbChskc-tdJthJexyWwwUKE
|
||||||
|
|
||||||
|
@wellId = 1
|
||||||
|
|
||||||
|
###
|
||||||
|
GET {{baseUrl}}/api/well/{{wellId}}/wellOperations/groupStat
|
||||||
|
Content-Type: {{contentType}}
|
||||||
|
accept: */*
|
||||||
|
Authorization: {{auth}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user