правки по результатам ревью

This commit is contained in:
Olga Nemt 2024-06-21 17:22:29 +05:00
parent 5834d42758
commit 17aef5b619
8 changed files with 37 additions and 66 deletions

View File

@ -1,10 +1,9 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план бурение скважины
/// РТК план бурение скважины в роторе
/// </summary>
public class ProcessMapPlanRotorDto : ProcessMapPlanBaseDto
{

View File

@ -1,10 +1,9 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план бурение скважины
/// РТК план бурение скважины в слайде
/// </summary>
public class ProcessMapPlanSlideDto : ProcessMapPlanBaseDto
{
@ -72,5 +71,5 @@ public class ProcessMapPlanSlideDto : ProcessMapPlanBaseDto
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, не должно превышать 1024 символов")]
public string Note { get; set; } = string.Empty;
public string Note { get; set; } = string.Empty;
}

View File

@ -41,7 +41,6 @@
<EmbeddedResource Include="Services\DailyReport\DailyReportTemplate.xlsx" />
<EmbeddedResource Include="Services\DrillTestReport\DrillTestReportTemplate.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanReamTemplate.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanDrillingTemplate.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanRotorTemplate.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanSlideTemplate.xlsx" />
<EmbeddedResource Include="Services\ProcessMaps\Report\ProcessMapReportDataSaubStatTemplate.xlsx" />

View File

@ -5,7 +5,6 @@ using AsbCloudApp.Requests.ExportOptions;
using AsbCloudApp.Services;
using AsbCloudInfrastructure.Services.ExcelServices.Templates;
using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@ -20,7 +19,7 @@ public class ProcessMapPlanRotorExportService : ProcessMapPlanExportService<Proc
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanRotorTemplate();
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanRotorTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
{
@ -28,11 +27,4 @@ public class ProcessMapPlanRotorExportService : ProcessMapPlanExportService<Proc
return $"{caption}_РТК_План_бурение_ротор.xlsx";
}
protected override async Task<IEnumerable<ProcessMapPlanRotorDto>> GetDtosAsync(WellRelatedExportRequest options,
CancellationToken token)
{
var dtos = await base.GetDtosAsync(options, token);
return dtos;
}
}

View File

@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
@ -10,31 +5,26 @@ using AsbCloudApp.Requests.ExportOptions;
using AsbCloudApp.Services;
using AsbCloudInfrastructure.Services.ExcelServices.Templates;
using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanSlideExportService : ProcessMapPlanExportService<ProcessMapPlanSlideDto>
{
public ProcessMapPlanSlideExportService(
IChangeLogRepository<ProcessMapPlanSlideDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
public ProcessMapPlanSlideExportService(
IChangeLogRepository<ProcessMapPlanSlideDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanSlideTemplate();
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanSlideTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
{
var caption = await wellService.GetWellCaptionByIdAsync(options.IdWell, token);
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
{
var caption = await wellService.GetWellCaptionByIdAsync(options.IdWell, token);
return $"{caption}_РТК_План_бурение_слайд.xlsx";
}
protected override async Task<IEnumerable<ProcessMapPlanSlideDto>> GetDtosAsync(WellRelatedExportRequest options,
CancellationToken token)
{
var dtos = await base.GetDtosAsync(options, token);
return dtos;
}
return $"{caption}_РТК_План_бурение_слайд.xlsx";
}
}

View File

@ -27,12 +27,4 @@ public abstract class ProcessMapPlanParser<TDto> : ParserExcelService<TDto, Well
return result;
}
protected static int? GetIdMode(string? modeName) =>
modeName?.Trim().ToLower() switch
{
"ротор" => 1,
"слайд" => 2,
_ => null
};
}

View File

@ -272,28 +272,28 @@ public class ProcessMapReportDrillingService : IProcessMapReportDrillingService
if(processMapPlanFilteredByDepth is ProcessMapPlanRotorDto processMapPlanRotorFilteredByDepth)
{
result.PressureDiff.SetpointPlan = processMapPlanRotorFilteredByDepth?.DifferentialPressure;
result.PressureDiff.Limit = processMapPlanRotorFilteredByDepth?.DifferentialPressureLimitMax;
result.AxialLoad.SetpointPlan = processMapPlanRotorFilteredByDepth?.WeightOnBit;
result.AxialLoad.Limit = processMapPlanRotorFilteredByDepth?.WeightOnBitLimitMax;
result.TopDriveTorque.SetpointPlan = processMapPlanRotorFilteredByDepth?.TopDriveTorque;
result.TopDriveTorque.Limit = processMapPlanRotorFilteredByDepth?.TopDriveTorqueLimit;
result.SpeedLimit.SetpointPlan = processMapPlanRotorFilteredByDepth?.RopLimitMax;
result.TopDriveSpeed.SetpointPlan = processMapPlanRotorFilteredByDepth?.RevolutionsPerMinute;
result.Flow.SetpointPlan = processMapPlanRotorFilteredByDepth?.FlowRate;
result.Flow.Limit = processMapPlanRotorFilteredByDepth?.FlowRateLimitMax;
result.Rop.Plan = processMapPlanRotorFilteredByDepth?.RopLimitMax;
result.PressureDiff.SetpointPlan = processMapPlanRotorFilteredByDepth.DifferentialPressure;
result.PressureDiff.Limit = processMapPlanRotorFilteredByDepth.DifferentialPressureLimitMax;
result.AxialLoad.SetpointPlan = processMapPlanRotorFilteredByDepth.WeightOnBit;
result.AxialLoad.Limit = processMapPlanRotorFilteredByDepth.WeightOnBitLimitMax;
result.TopDriveTorque.SetpointPlan = processMapPlanRotorFilteredByDepth.TopDriveTorque;
result.TopDriveTorque.Limit = processMapPlanRotorFilteredByDepth.TopDriveTorqueLimit;
result.SpeedLimit.SetpointPlan = processMapPlanRotorFilteredByDepth.RopLimitMax;
result.TopDriveSpeed.SetpointPlan = processMapPlanRotorFilteredByDepth.RevolutionsPerMinute;
result.Flow.SetpointPlan = processMapPlanRotorFilteredByDepth.FlowRate;
result.Flow.Limit = processMapPlanRotorFilteredByDepth.FlowRateLimitMax;
result.Rop.Plan = processMapPlanRotorFilteredByDepth.RopLimitMax;
}
if (processMapPlanFilteredByDepth is ProcessMapPlanSlideDto processMapPlanSlideFilteredByDepth)
{
result.PressureDiff.SetpointPlan = processMapPlanSlideFilteredByDepth?.DifferentialPressure;
result.PressureDiff.Limit = processMapPlanSlideFilteredByDepth?.DifferentialPressureLimitMax;
result.AxialLoad.SetpointPlan = processMapPlanSlideFilteredByDepth?.WeightOnBit;
result.AxialLoad.Limit = processMapPlanSlideFilteredByDepth?.WeightOnBitLimitMax;
result.SpeedLimit.SetpointPlan = processMapPlanSlideFilteredByDepth?.RopLimitMax;
result.Flow.SetpointPlan = processMapPlanSlideFilteredByDepth?.FlowRate;
result.Flow.Limit = processMapPlanSlideFilteredByDepth?.FlowRateLimitMax;
result.Rop.Plan = processMapPlanSlideFilteredByDepth?.RopLimitMax;
result.PressureDiff.SetpointPlan = processMapPlanSlideFilteredByDepth.DifferentialPressure;
result.PressureDiff.Limit = processMapPlanSlideFilteredByDepth.DifferentialPressureLimitMax;
result.AxialLoad.SetpointPlan = processMapPlanSlideFilteredByDepth.WeightOnBit;
result.AxialLoad.Limit = processMapPlanSlideFilteredByDepth.WeightOnBitLimitMax;
result.SpeedLimit.SetpointPlan = processMapPlanSlideFilteredByDepth.RopLimitMax;
result.Flow.SetpointPlan = processMapPlanSlideFilteredByDepth.FlowRate;
result.Flow.Limit = processMapPlanSlideFilteredByDepth.FlowRateLimitMax;
result.Rop.Plan = processMapPlanSlideFilteredByDepth.RopLimitMax;
}
return result;