diff --git a/AsbCloudApp/Data/WellReport/DrillingBySetpointsDto.cs b/AsbCloudApp/Data/WellReport/DrillingBySetpointsDto.cs index d7175141..a1c43036 100644 --- a/AsbCloudApp/Data/WellReport/DrillingBySetpointsDto.cs +++ b/AsbCloudApp/Data/WellReport/DrillingBySetpointsDto.cs @@ -5,23 +5,23 @@ /// public class DrillingBySetpointsDto { - /// - /// Давление - /// - public double? Pressure { get; set; } + /// + /// Метры пробуренные по уставке давления + /// + public double? MetersByPressure { get; set; } - /// - /// Нагрузка - /// - public double? AxialLoad { get; set; } + /// + /// Метры пробуренные по уставке нагрузки + /// + public double? MetersByLoad { get; set; } - /// - /// Момент - /// - public double? TopDriveTorque { get; set; } + /// + /// Метры пробуренные по уставке момента + /// + public double? MetersByTorque { get; set; } - /// - /// Скорость - /// - public double? SpeedLimit { get; set; } + /// + /// Метры пробуренные по уставке скорости + /// + public double? MetersBySpeed { get; set; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/WellReport/WellReportExportService.cs b/AsbCloudInfrastructure/Services/WellReport/WellReportExportService.cs index 457a620c..55ec4fb0 100644 --- a/AsbCloudInfrastructure/Services/WellReport/WellReportExportService.cs +++ b/AsbCloudInfrastructure/Services/WellReport/WellReportExportService.cs @@ -199,16 +199,17 @@ public class WellReportExportService : IWellReportExportService var row = 6; foreach (var contact in contacts) - { - var position = positionsByCompanyType[contact.IdCompanyType]; + { + if (!positionsByCompanyType.TryGetValue(contact.IdCompanyType, out var position)) + continue; - sheet.Cell(row, positionColumn).SetCellValue(position); - sheet.Cell(row, fullNameColumn).SetCellValue(contact.FullName); - sheet.Cell(row, companyColumn).SetCellValue(contact.Company); - sheet.Cell(row, phoneColumn).SetCellValue(contact.Phone); + sheet.Cell(row, positionColumn).SetCellValue(position); + sheet.Cell(row, fullNameColumn).SetCellValue(contact.FullName); + sheet.Cell(row, companyColumn).SetCellValue(contact.Company); + sheet.Cell(row, phoneColumn).SetCellValue(contact.Phone); - row++; - } + row++; + } } private static void FillDrillerReports(IXLWorksheet sheet, IEnumerable drillerReports) @@ -284,10 +285,10 @@ public class WellReportExportService : IWellReportExportService if (!SetpointsRows.TryGetValue(idSection, out var row)) return; - sheet.Cell(row, pressureColumn).SetCellValue(drillingBySetpoints.Pressure); - sheet.Cell(row, axialLoadColumn).SetCellValue(drillingBySetpoints.AxialLoad); - sheet.Cell(row, topDriveTorqueColumn).SetCellValue(drillingBySetpoints.TopDriveTorque); - sheet.Cell(row, speedLimitColumn).SetCellValue(drillingBySetpoints.SpeedLimit); + sheet.Cell(row, pressureColumn).SetCellValue(drillingBySetpoints.MetersByPressure); + sheet.Cell(row, axialLoadColumn).SetCellValue(drillingBySetpoints.MetersByLoad); + sheet.Cell(row, topDriveTorqueColumn).SetCellValue(drillingBySetpoints.MetersByTorque); + sheet.Cell(row, speedLimitColumn).SetCellValue(drillingBySetpoints.MetersBySpeed); } private static void FillSubsystemsStat(IXLWorksheet sheet, int idSection, diff --git a/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs b/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs index 49b7d1fa..59626c04 100644 --- a/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs +++ b/AsbCloudInfrastructure/Services/WellReport/WellReportService.cs @@ -35,13 +35,15 @@ public class WellReportService : IWellReportService private IEnumerable factWellOperations; private IEnumerable planWellOperations; - public WellReportService(IWellService wellService, IWellOperationService wellOperationService, - IWellContactService wellContactService, IProcessMapReportDrillingService processMapReportDrillingService, - ISubsystemService subsystemService, ITrajectoryRepository trajectoryPlanRepository, + public WellReportService(IWellService wellService, + IWellOperationService wellOperationService, + IWellContactService wellContactService, + IProcessMapReportDrillingService processMapReportDrillingService, + ISubsystemService subsystemService, + ITrajectoryRepository trajectoryPlanRepository, ITrajectoryRepository trajectoryFactRepository, IChangeLogRepository processMapPlanRotorRepository, - IScheduleRepository scheduleRepository, IEnumerable factWellOperations, - IEnumerable planWellOperations) + IScheduleRepository scheduleRepository) { this.wellService = wellService; this.wellOperationService = wellOperationService; @@ -52,8 +54,6 @@ public class WellReportService : IWellReportService this.trajectoryFactRepository = trajectoryFactRepository; this.processMapPlanRotorRepository = processMapPlanRotorRepository; this.scheduleRepository = scheduleRepository; - this.factWellOperations = factWellOperations; - this.planWellOperations = planWellOperations; } public async Task GetAsync(int idWell, CancellationToken token) @@ -194,10 +194,10 @@ public class WellReportService : IWellReportService if (processMapReportBySection.TryGetValue(group.Key, out var processMapReport)) sectionReport.DrillingBySetpoints = new DrillingBySetpointsDto { - Pressure = processMapReport.Sum(x => x.DeltaDepth * x.PressureDiff.SetpointUsage / 100), - AxialLoad = processMapReport.Sum(x => x.DeltaDepth * x.AxialLoad.SetpointUsage / 100), - TopDriveTorque = processMapReport.Sum(x => x.DeltaDepth * x.TopDriveTorque.SetpointUsage / 100), - SpeedLimit = processMapReport.Sum(x => x.DeltaDepth * x.SpeedLimit.SetpointUsage / 100) + MetersByPressure = processMapReport.Sum(x => x.DeltaDepth * x.PressureDiff.SetpointUsage / 100), + MetersByLoad = processMapReport.Sum(x => x.DeltaDepth * x.AxialLoad.SetpointUsage / 100), + MetersByTorque = processMapReport.Sum(x => x.DeltaDepth * x.TopDriveTorque.SetpointUsage / 100), + MetersBySpeed = processMapReport.Sum(x => x.DeltaDepth * x.SpeedLimit.SetpointUsage / 100) }; sectionReports.Add(sectionReport);