forked from ddrilling/AsbCloudServer
исправление мелких ошибок
This commit is contained in:
parent
f3e5e27511
commit
f10201d3ef
@ -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;
|
||||
}
|
||||
@ -215,15 +215,12 @@ namespace AsbCloudInfrastructure.Services.Subsystems
|
||||
beginUTC = gtDate.Value.ToUtcDateTimeOffset(firstWell.Timezone.Hours);
|
||||
}
|
||||
query = query.Where(d => d.DateStart >= beginUTC);
|
||||
query = query.Where(o => o.DateEnd <= endUTC);
|
||||
|
||||
query = query.Where(o => o.DateEnd <= endUTC);
|
||||
|
||||
var depthIntervals = await detectedOperationService.GetDepthIntervalAllOperationsAsync(beginUTC, endUTC, token);
|
||||
var result = new List<SubsystemActiveWellStatDto>();
|
||||
|
||||
var result = new List<SubsystemActiveWellStatDto>();
|
||||
var subsystemsOperationTime = await query.ToListAsync(token);
|
||||
var groupingSubsystemsOperationTime = subsystemsOperationTime.GroupBy(g => g.IdTelemetry);
|
||||
|
||||
var groupingSubsystemsOperationTime = subsystemsOperationTime.GroupBy(g => g.IdTelemetry);
|
||||
foreach (var group in groupingSubsystemsOperationTime)
|
||||
{
|
||||
var well = activeWell.Where(w => w.IdTelemetry == group.Key).FirstOrDefault();
|
||||
@ -235,8 +232,7 @@ 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 depthInterval = depthIntervals.Where(o => o.Item1 == well.IdTelemetry).Select(o => (o.Item2, o.Item3)).FirstOrDefault();
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user