WellsOperationRequest.IdType заменен на WellOperationRequestBase.OperationType.

Добавлены тудушки
This commit is contained in:
ngfrolov 2024-03-13 16:04:49 +05:00
parent 7d1fdb7774
commit a91fc4f213
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7
3 changed files with 5 additions and 10 deletions

View File

@ -108,10 +108,5 @@ namespace AsbCloudApp.Requests
/// ids скважин
/// </summary>
public IEnumerable<int> IdsWell { get; set; } = null!;
/// <summary>
/// Тип 0 = План или 1 = Факт
/// </summary>
public int IdType { get; set; }
}
}

View File

@ -396,7 +396,6 @@ public class WellOperationRepository : IWellOperationRepository
.Include(s => s.OperationCategory)
.Where(o => o.IdWell == request.IdWell);
if (request.OperationType.HasValue)
query = query.Where(e => e.IdType == request.OperationType.Value);
@ -431,6 +430,7 @@ public class WellOperationRepository : IWellOperationRepository
.Where(subOp => subOp.IdType == 1)
.Where(subOp => WellOperationCategory.NonProductiveTimeSubIds.Contains(subOp.IdCategory));
// TODO: Вынести query.Select из метода BuildQuery
var dtos = query.Select(o => new WellOperationDto
{
Id = o.Id,
@ -493,7 +493,7 @@ public class WellOperationRepository : IWellOperationRepository
{
var query = db.WellOperations
.Where(o => request.IdsWell.Contains(o.IdWell))
.Where(o => request.IdType == o.IdType);
.Where(o => request.OperationType == o.IdType);
if (request.SectionTypeIds?.Any() == true)
query = query.Where(o => request.SectionTypeIds.Contains(o.IdWellSectionType));
@ -501,6 +501,7 @@ public class WellOperationRepository : IWellOperationRepository
if (request.OperationCategoryIds?.Any() == true)
query = query.Where(o => request.OperationCategoryIds.Contains(o.IdCategory));
// TODO: Вынести query.Select из метода BuildQuery
var dtos = query.Select(o => new WellOperationDataDto
{
DepthStart = o.DepthStart,

View File

@ -149,7 +149,7 @@ namespace AsbCloudInfrastructure.Services
IdsWell = idsWells,
OperationCategoryIds = usedCategories,
SectionTypeIds = idsWellSectionTypes,
IdType = WellOperation.IdOperationTypeFact
OperationType = WellOperation.IdOperationTypeFact
};
var operations = await wellOperationRepository.GetAsync(wellOperationRequest, token);
@ -189,7 +189,6 @@ namespace AsbCloudInfrastructure.Services
compositeDepth = composite.DepthStart;
var resultItem = aggreagtedByWell.ToDictionary(o => o.IdWell);
resultItem.Add(0, composite);
@ -198,7 +197,7 @@ namespace AsbCloudInfrastructure.Services
return wellOperationsWithComposite;
}
private WellOperationDataDto UpdateIdWellSectionAndIdCategory(
private static WellOperationDataDto UpdateIdWellSectionAndIdCategory(
WellOperationDataDto dto,
Dictionary<int, string> sectionTypes,
Dictionary<int, string> operationCategories)