Merge branch 'dev' into feature/refactoring_api_route

This commit is contained in:
ngfrolov 2023-08-04 13:48:50 +05:00
commit 2f415bc027
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7
2 changed files with 4 additions and 9 deletions

View File

@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services
}; };
} }
if (limitingLast.IdFeedRegulator != idLimiting) if (limitingLast.IdFeedRegulator != idLimiting || limitingLast.DepthStart < wellDepth)
{ {
limitingParameters.Add(new LimitingParameter { limitingParameters.Add(new LimitingParameter {
IdTelemetry = idTelemetry, IdTelemetry = idTelemetry,
@ -114,7 +114,7 @@ namespace AsbCloudInfrastructure.Services
DateEnd = date, DateEnd = date,
DepthStart = limitingLast.DepthStart, DepthStart = limitingLast.DepthStart,
DepthEnd = wellDepth DepthEnd = wellDepth
}); });
limitingLast = new LimitingParameter limitingLast = new LimitingParameter
{ {

View File

@ -45,13 +45,8 @@ namespace AsbCloudInfrastructure.Services
{ {
var trimData = TrimLimitingParameters(item, request).ToArray(); var trimData = TrimLimitingParameters(item, request).ToArray();
//TODO: временный фикс, нужно избежать отрицательных значений в ограничивающих параметрах. var allItemDepths = trimData.Sum(x => x.DepthEnd - x.DepthStart);
//Проблема возникает при при формировании LimitingParameter в LimitingParameterCalcWorkFactory. var allItemDates = trimData.Sum(x => (x.DateEnd - x.DateStart).TotalMinutes);
//Начальная глубина ограничивающего параметра не может быть больше конечной.
var allItemDepths = trimData.Where(x => x.DepthStart < x.DepthEnd)
.Sum(x => x.DepthEnd - x.DepthStart);
var allItemDates = trimData.Where(x => x.DepthStart < x.DepthEnd)
.Sum(x => (x.DateEnd - x.DateStart).TotalMinutes);
result.Add(new LimitingParameterDto result.Add(new LimitingParameterDto
{ {