исправление мелких ошибок

This commit is contained in:
eugeniy_ivanov 2022-11-03 14:02:56 +05:00
parent f3e5e27511
commit f10201d3ef

View File

@ -170,17 +170,17 @@ namespace AsbCloudInfrastructure.Services.Subsystems
{
var depthIntervalSubsystem = 0d;
//AKB - MSE
if (idSubsystem == 1 | idSubsystem == 2)
if (idSubsystem == IdSubsystemAKB | idSubsystem == IdSubsystemMSE)
{
depthIntervalSubsystem = depthInterval.depthIntervalRotor + depthInterval.depthIntervalSlide;
}
//Spin
if (idSubsystem == 65536)
if (idSubsystem == IdSubsystemSpin)
{
depthIntervalSubsystem = depthInterval.depthIntervalSlide;
}
//Torque
if (idSubsystem == 65537)
if (idSubsystem == IdSubsystemTorque)
{
depthIntervalSubsystem = depthInterval.depthIntervalRotor;
}
@ -217,13 +217,10 @@ namespace AsbCloudInfrastructure.Services.Subsystems
query = query.Where(d => d.DateStart >= beginUTC);
query = query.Where(o => o.DateEnd <= endUTC);
var depthIntervals = await detectedOperationService.GetDepthIntervalAllOperationsAsync(beginUTC, endUTC, token);
var result = new List<SubsystemActiveWellStatDto>();
var subsystemsOperationTime = await query.ToListAsync(token);
var groupingSubsystemsOperationTime = subsystemsOperationTime.GroupBy(g => g.IdTelemetry);
foreach (var group in groupingSubsystemsOperationTime)
{
var well = activeWell.Where(w => w.IdTelemetry == group.Key).FirstOrDefault();
@ -236,7 +233,6 @@ namespace AsbCloudInfrastructure.Services.Subsystems
if (depthIntervals is not null)
{
var depthInterval = depthIntervals.Where(o => o.Item1 == well.IdTelemetry).Select(o => (o.Item2, o.Item3)).FirstOrDefault();
//var groupSubsystem = group.GroupBy(g => g.IdSubsystem);
var dto = group.Select(s => s.Adapt<SubsystemOperationTimeDto>());
var subsystemStat = CalcStat(dto, depthInterval);
wellStat.SubsystemAKB = subsystemStat.FirstOrDefault(s => s.IdSubsystem == IdSubsystemAKB);
@ -245,14 +241,11 @@ namespace AsbCloudInfrastructure.Services.Subsystems
wellStat.SubsystemTorqueMaster = subsystemStat.FirstOrDefault(s => s.IdSubsystem == IdSubsystemTorque);
result.Add(wellStat);
}
}
}
return result;
}
/// <inheritdoc/>
public async Task<DatesRangeDto?> GetDateRangeOperationTimeAsync(SubsystemOperationTimeRequest request, CancellationToken token)
{