forked from ddrilling/AsbCloudServer
небольшие корректировки интерфейса IDetectedOperationService и сервиса расчета статистики по наработке подсистем
This commit is contained in:
parent
5a23853cdf
commit
a457da8ead
@ -45,7 +45,6 @@ namespace AsbCloudApp.Services
|
||||
/// <param name="request"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Task<int> DeleteAsync(DetectedOperationRequest request, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
|
@ -97,6 +97,8 @@ namespace AsbCloudInfrastructure.Services.Subsystems
|
||||
GtDate = request.GtDate,
|
||||
};
|
||||
var detectedOperations = await detectedOperationService.GetOperationsAsync(detectedOperationsRequest, token);
|
||||
if(detectedOperations?.Any() != true)
|
||||
return null;
|
||||
var depthInterval = GetDepthInterval(detectedOperations);
|
||||
|
||||
var statList = CalcStat(data,depthInterval,request, token);
|
||||
@ -150,20 +152,20 @@ namespace AsbCloudInfrastructure.Services.Subsystems
|
||||
|
||||
return result;
|
||||
}
|
||||
private (double,double) GetDepthInterval (IEnumerable<DetectedOperationDto>? detectedOperations)
|
||||
private (double depthIntervalRotor, double depthIntervalSlide) GetDepthInterval (IEnumerable<DetectedOperationDto> detectedOperations)
|
||||
{
|
||||
var depthInterval = (depthIntervalRotor:(double)0, depthIntervalSlide: (double)0);
|
||||
if (detectedOperations is null)
|
||||
return depthInterval;
|
||||
depthInterval.depthIntervalRotor = detectedOperations.Where(o => o.IdCategory == 1)
|
||||
|
||||
var depthIntervalRotor = detectedOperations.Where(o => o.IdCategory == 1)
|
||||
.Sum(o => o.DepthEnd - o.DepthStart);
|
||||
depthInterval.depthIntervalSlide = detectedOperations.Where(o => o.IdCategory == 3)
|
||||
var depthIntervalSlide = detectedOperations.Where(o => o.IdCategory == 3)
|
||||
.Sum(o => o.DepthEnd - o.DepthStart);
|
||||
var depthInterval = (depthIntervalRotor, depthIntervalSlide);
|
||||
|
||||
return depthInterval;
|
||||
}
|
||||
private double GetDepthIntervalSubsystem(int idSubsystem, (double depthIntervalRotor, double depthIntervalSlide) depthInterval)
|
||||
{
|
||||
double depthIntervalSubsystem = 0;
|
||||
var depthIntervalSubsystem = 0d;
|
||||
//AKB - MSE
|
||||
if (idSubsystem == 1 | idSubsystem == 2)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user