fix SubsystemOperationTimeService. WelOperationCategories use valid constants.

This commit is contained in:
ngfrolov 2023-01-24 15:21:49 +05:00
parent bce61f97da
commit 05c238737d
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -94,8 +94,8 @@ namespace AsbCloudInfrastructure.Services.Subsystems
var detectedOperationsRequest = new DetectedOperationRequest() var detectedOperationsRequest = new DetectedOperationRequest()
{ {
IdWell = request.IdWell, IdWell = request.IdWell,
IdsCategories = new List<int>() { IdsCategories = new int[] {
1,3 WellOperationCategory.IdRotor, WellOperationCategory.IdSlide,
}, },
LtDate = request.LtDate, LtDate = request.LtDate,
GtDate = request.GtDate, GtDate = request.GtDate,
@ -158,9 +158,9 @@ namespace AsbCloudInfrastructure.Services.Subsystems
} }
private static (double depthIntervalRotor, double depthIntervalSlide) GetDepthInterval (IEnumerable<DetectedOperationDto> detectedOperations) private static (double depthIntervalRotor, double depthIntervalSlide) GetDepthInterval (IEnumerable<DetectedOperationDto> detectedOperations)
{ {
var depthIntervalRotor = detectedOperations.Where(o => o.IdCategory == 1) var depthIntervalRotor = detectedOperations.Where(o => o.IdCategory == WellOperationCategory.IdRotor)
.Sum(o => o.DepthEnd - o.DepthStart); .Sum(o => o.DepthEnd - o.DepthStart);
var depthIntervalSlide = detectedOperations.Where(o => o.IdCategory == 3) var depthIntervalSlide = detectedOperations.Where(o => o.IdCategory == WellOperationCategory.IdSlide)
.Sum(o => o.DepthEnd - o.DepthStart); .Sum(o => o.DepthEnd - o.DepthStart);
var depthInterval = (depthIntervalRotor, depthIntervalSlide); var depthInterval = (depthIntervalRotor, depthIntervalSlide);