From ca54ae517f91ab1187d84e8a5470d434350aeaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Mon, 2 Sep 2024 13:55:17 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BD=D0=B5=D0=B9?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B8=20=D1=81=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D0=B8=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/WellReport/DrillingBySetpointsDto.cs | 32 +++++++++---------- .../WellReport/WellReportExportService.cs | 25 ++++++++------- .../Services/WellReport/WellReportService.cs | 22 ++++++------- 3 files changed, 40 insertions(+), 39 deletions(-) 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);