refact warnings to WellOperationService

This commit is contained in:
eugeniy_ivanov 2022-12-06 22:34:10 +05:00
parent 81d3ef3146
commit 1cf2d745b3
2 changed files with 14 additions and 14 deletions

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
#nullable enable
/// <summary>
/// сервис операций по скважине
/// </summary>
@ -36,8 +37,8 @@ namespace AsbCloudApp.Services
Task<PaginationContainer<WellOperationDto>> GetOperationsAsync(
int idWell,
int? operationType = null,
IEnumerable<int> sectionTypeIds = null,
IEnumerable<int> operationCategoryIds = null,
IEnumerable<int>? sectionTypeIds = null,
IEnumerable<int>? operationCategoryIds = null,
DateTime begin = default,
DateTime end = default,
double minDepth = double.MinValue,
@ -62,8 +63,8 @@ namespace AsbCloudApp.Services
Task<IEnumerable<WellGroupOpertionDto>> GetGroupOperationsStatAsync(
int idWell,
int? operationType = null,
IEnumerable<int> sectionTypeIds = null,
IEnumerable<int> operationCategoryIds = null,
IEnumerable<int>? sectionTypeIds = null,
IEnumerable<int>? operationCategoryIds = null,
DateTime begin = default,
DateTime end = default,
double minDepth = double.MinValue,
@ -76,7 +77,7 @@ namespace AsbCloudApp.Services
/// <param name="id"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<WellOperationDto> GetAsync(int id, CancellationToken token);
Task<WellOperationDto?> GetAsync(int id, CancellationToken token);
//todo: idWell Не нужен
/// <summary>
@ -122,4 +123,5 @@ namespace AsbCloudApp.Services
/// <returns></returns>
DateTimeOffset? FirstOperationDate(int idWell);
}
#nullable disable
}

View File

@ -77,8 +77,8 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
public async Task<PaginationContainer<WellOperationDto>> GetOperationsAsync(
int idWell,
int? operationType = default,
IEnumerable<int> sectionTypeIds = default,
IEnumerable<int> operationCategoryIds = default,
IEnumerable<int>? sectionTypeIds = null,
IEnumerable<int>? operationCategoryIds = null,
DateTime begin = default,
DateTime end = default,
double minDepth = double.MinValue,
@ -139,7 +139,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
return result;
}
public async Task<IEnumerable<WellGroupOpertionDto>?> GetGroupOperationsStatAsync(
public async Task<IEnumerable<WellGroupOpertionDto>> GetGroupOperationsStatAsync(
int idWell,
int? operationType = default,
IEnumerable<int>? sectionTypeIds = default,
@ -159,9 +159,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
end,
minDepth,
maxDepth,
token);
if (query is null)
return null;
token);
var entities = await query
.Select(o => new {
o.IdCategory,
@ -210,7 +208,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
return dtos;
}
public async Task<WellOperationDto> GetAsync(int id,
public async Task<WellOperationDto?> GetAsync(int id,
CancellationToken token = default)
{
@ -274,8 +272,8 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
private IQueryable<WellOperation> BuildQuery(
int idWell,
int? operationType = default,
IEnumerable<int> sectionTypeIds = default,
IEnumerable<int> operationCategoryIds = default,
IEnumerable<int>? sectionTypeIds = null,
IEnumerable<int>? operationCategoryIds = null,
DateTime begin = default,
DateTime end = default,
double minDepth = double.MinValue,