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

View File

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