forked from ddrilling/AsbCloudServer
Проработка слайд
This commit is contained in:
parent
814515d8ac
commit
328f580100
@ -23,6 +23,7 @@ namespace AsbCloudDb.Model
|
|||||||
public virtual DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide => Set<ProcessMapPlanSlide>();
|
public virtual DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide => Set<ProcessMapPlanSlide>();
|
||||||
public virtual DbSet<ProcessMapPlanReam> ProcessMapPlanReams => Set<ProcessMapPlanReam>();
|
public virtual DbSet<ProcessMapPlanReam> ProcessMapPlanReams => Set<ProcessMapPlanReam>();
|
||||||
public virtual DbSet<ProcessMapPlanOperationReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanOperationReamingRotor>();
|
public virtual DbSet<ProcessMapPlanOperationReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanOperationReamingRotor>();
|
||||||
|
public virtual DbSet<ProcessMapPlanOperationReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanOperationReamingSlide>();
|
||||||
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
|
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
|
||||||
public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>();
|
public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>();
|
||||||
public virtual DbSet<FileInfo> Files => Set<FileInfo>();
|
public virtual DbSet<FileInfo> Files => Set<FileInfo>();
|
||||||
@ -454,6 +455,16 @@ namespace AsbCloudDb.Model
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ProcessMapPlanOperationReamingRotor>()
|
||||||
|
.HasOne(p => p.Author)
|
||||||
|
.WithMany()
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ProcessMapPlanOperationReamingSlide>()
|
||||||
|
.HasOne(p => p.Author)
|
||||||
|
.WithMany()
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
modelBuilder.Entity<ProcessMapPlanRotor>()
|
modelBuilder.Entity<ProcessMapPlanRotor>()
|
||||||
.HasOne(p => p.Editor)
|
.HasOne(p => p.Editor)
|
||||||
.WithMany()
|
.WithMany()
|
||||||
@ -464,6 +475,16 @@ namespace AsbCloudDb.Model
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.OnDelete(DeleteBehavior.Restrict);
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ProcessMapPlanOperationReamingRotor>()
|
||||||
|
.HasOne(p => p.Editor)
|
||||||
|
.WithMany()
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
|
modelBuilder.Entity<ProcessMapPlanOperationReamingSlide>()
|
||||||
|
.HasOne(p => p.Editor)
|
||||||
|
.WithMany()
|
||||||
|
.OnDelete(DeleteBehavior.Restrict);
|
||||||
|
|
||||||
DefaultData.DefaultContextData.Fill(modelBuilder);
|
DefaultData.DefaultContextData.Fill(modelBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,10 @@ namespace AsbCloudDb.Model
|
|||||||
DbSet<DataSaubStat> DataSaubStat { get; }
|
DbSet<DataSaubStat> DataSaubStat { get; }
|
||||||
DatabaseFacade Database { get; }
|
DatabaseFacade Database { get; }
|
||||||
DbSet<ProcessMapPlanReam> ProcessMapPlanReams { get; }
|
DbSet<ProcessMapPlanReam> ProcessMapPlanReams { get; }
|
||||||
|
DbSet<ProcessMapPlanRotor> ProcessMapPlanRotor { get; }
|
||||||
|
DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide { get; }
|
||||||
DbSet<ProcessMapPlanOperationReamingRotor> ProcessMapPlanOperationReamingRotor { get; }
|
DbSet<ProcessMapPlanOperationReamingRotor> ProcessMapPlanOperationReamingRotor { get; }
|
||||||
|
DbSet<ProcessMapPlanOperationReamingSlide> ProcessMapPlanOperationReamingSlide { get; }
|
||||||
|
|
||||||
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);
|
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);
|
||||||
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class;
|
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class;
|
||||||
|
@ -0,0 +1,158 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using AsbCloudDb.Model.ProcessMapPlan;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace AsbCloudDb.Model.ProcessMaps;
|
||||||
|
|
||||||
|
[Table("t_process_map_plan_operation_reaming_slide"), Comment("РТК проработка слайд")]
|
||||||
|
public class ProcessMapPlanOperationReamingSlide : ProcessMapPlanBase
|
||||||
|
{
|
||||||
|
[Column("max_pressure"), Comment("Максимальное давление, атм")]
|
||||||
|
[Range(0.0, 400.0)]
|
||||||
|
[Required]
|
||||||
|
public double MaxPressure { get; set; }
|
||||||
|
|
||||||
|
[Column("differential_pressure"), Comment("Перепад давления, атм.")]
|
||||||
|
[Range(0.0, 60.0)]
|
||||||
|
[Required]
|
||||||
|
public double DifferentialPressure { get; set; }
|
||||||
|
|
||||||
|
[Column("setpoints_tight"), Comment("Уставки, т., затяжка")]
|
||||||
|
[Range(0.0, 20.0)]
|
||||||
|
[Required]
|
||||||
|
public double SetpointsTight { get; set; }
|
||||||
|
|
||||||
|
[Column("setpoints_slacking_off"), Comment("Уставки, т., посадка")]
|
||||||
|
[Range(0.0, 20.0)]
|
||||||
|
[Required]
|
||||||
|
public double SetpointsSlackingOff { get; set; }
|
||||||
|
|
||||||
|
[Column("max_torque"), Comment("Максимально допустимый момент, кН*м.")]
|
||||||
|
[Range(0.0, 35.0)]
|
||||||
|
[Required]
|
||||||
|
public double MaxTorque { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_number_of_ repetitions"), Comment("Проработка 1, Количество повторений, шт.")]
|
||||||
|
[Range(0.0, 99.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1NumberOfRepetitions { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_rop_up"), Comment("Проработка 1, Скорость, м/ч., Вверх")]
|
||||||
|
[Range(0.0, 999.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1ROPUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_rop_down"), Comment("Проработка 1, Скорость, м/ч., Вниз")]
|
||||||
|
[Range(0.0, 999.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1ROPDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_rpm_up"), Comment("Проработка 1, Обороты, об/мин., Вверх")]
|
||||||
|
[Range(0.0, 270.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1RPMUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_rpm_down"), Comment("Проработка 1, Обороты, об/мин., Вниз")]
|
||||||
|
[Range(0.0, 270.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1RPMDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_flow_rate_up"), Comment("Проработка 1, Расход, л/с., Вверх")]
|
||||||
|
[Range(0.0, 100.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1FlowRateUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_flow_rate_down"), Comment("Проработка 1, Расход, л/с., Вниз")]
|
||||||
|
[Range(0.0, 100.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1FlowRateDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_interval"), Comment("Проработка 1, Интервал проработки, м.")]
|
||||||
|
[Range(0.0, 30.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1Interval { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming1_stop_point_off_bottom"), Comment("Остановка над забоем, м.")]
|
||||||
|
[Range(0.0, 10.0)]
|
||||||
|
[Required]
|
||||||
|
public double Reaming1StopPointOffBottom { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_number_of_ repetitions"), Comment("Проработка 2, Количество повторений, шт.")]
|
||||||
|
[Range(0.0, 99.0)]
|
||||||
|
public double Reaming2NumberOfRepetitions { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_rop_up"), Comment("Проработка 2, Скорость, м/ч., Вверх")]
|
||||||
|
[Range(0.0, 999.0)]
|
||||||
|
public double Reaming2ROPUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_rop_down"), Comment("Проработка 2, Скорость, м/ч., Вниз")]
|
||||||
|
[Range(0.0, 999.0)]
|
||||||
|
public double Reaming2ROPDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_rpm_up"), Comment("Проработка 2, Обороты, об/мин., Вверх")]
|
||||||
|
[Range(0.0, 270.0)]
|
||||||
|
public double Reaming2RPMUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_rpm_down"), Comment("Проработка 2, Обороты, об/мин., Вниз")]
|
||||||
|
[Range(0.0, 270.0)]
|
||||||
|
public double Reaming2RPMDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_flow_rate_up"), Comment("Проработка 2, Расход, л/с., Вверх")]
|
||||||
|
[Range(0.0, 100.0)]
|
||||||
|
public double Reaming2FlowRateUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_flow_rate_down"), Comment("Проработка 2, Расход, л/с., Вниз")]
|
||||||
|
[Range(0.0, 100.0)]
|
||||||
|
public double Reaming2FlowRateDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_interval"), Comment("Проработка 2, Интервал проработки, м.")]
|
||||||
|
[Range(0.0, 30.0)]
|
||||||
|
public double Reaming2Interval { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming2_stop_point_off_bottom"), Comment("Остановка над забоем, м.")]
|
||||||
|
[Range(0.0, 10.0)]
|
||||||
|
public double Reaming2StopPointOffBottom { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_number_of_ repetitions"), Comment("Проработка 3, Количество повторений, шт.")]
|
||||||
|
[Range(0.0, 99.0)]
|
||||||
|
public double Reaming3NumberOfRepetitions { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_rop_up"), Comment("Проработка 3, Скорость, м/ч., Вверх")]
|
||||||
|
[Range(0.0, 999.0)]
|
||||||
|
public double Reaming3ROPUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_rop_down"), Comment("Проработка 3, Скорость, м/ч., Вниз")]
|
||||||
|
[Range(0.0, 999.0)]
|
||||||
|
public double Reaming3ROPDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_rpm_up"), Comment("Проработка 3, Обороты, об/мин., Вверх")]
|
||||||
|
[Range(0.0, 270.0)]
|
||||||
|
public double Reaming3RPMUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_rpm_down"), Comment("Проработка 3, Обороты, об/мин., Вниз")]
|
||||||
|
[Range(0.0, 270.0)]
|
||||||
|
public double Reaming3RPMDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_flow_rate_up"), Comment("Проработка 3, Расход, л/с., Вверх")]
|
||||||
|
[Range(0.0, 100.0)]
|
||||||
|
public double Reaming3FlowRateUp { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_flow_rate_down"), Comment("Проработка 3, Расход, л/с., Вниз")]
|
||||||
|
[Range(0.0, 100.0)]
|
||||||
|
public double Reaming3FlowRateDown { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_interval"), Comment("Проработка 3, Интервал проработки, м.")]
|
||||||
|
[Range(0.0, 30.0)]
|
||||||
|
public double Reaming3Interval { get; set; }
|
||||||
|
|
||||||
|
[Column("reaming3_stop_point_off_bottom"), Comment("Остановка над забоем, м.")]
|
||||||
|
[Range(0.0, 10.0)]
|
||||||
|
public double Reaming3StopPointOffBottom { get; set; }
|
||||||
|
|
||||||
|
[Column("note"), Comment("Примечание"), StringLength(1024)]
|
||||||
|
public string Note { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[ForeignKey(nameof(IdPrevious))]
|
||||||
|
public virtual ProcessMapPlanOperationReamingSlide? Previous { get; set; }
|
||||||
|
}
|
@ -145,6 +145,20 @@ namespace AsbCloudInfrastructure
|
|||||||
{
|
{
|
||||||
Item = src.Adapt<ProcessMapPlanSlideDto>()
|
Item = src.Adapt<ProcessMapPlanSlideDto>()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOperationReamingRotorDto>>.NewConfig()
|
||||||
|
.Include<ProcessMapPlanOperationReamingRotor, ChangeLogDto<ProcessMapPlanOperationReamingRotorDto>>()
|
||||||
|
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOperationReamingRotorDto>()
|
||||||
|
{
|
||||||
|
Item = src.Adapt<ProcessMapPlanOperationReamingRotorDto>()
|
||||||
|
});
|
||||||
|
|
||||||
|
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOperationReamingSlideDto>>.NewConfig()
|
||||||
|
.Include<ProcessMapPlanOperationReamingSlide, ChangeLogDto<ProcessMapPlanOperationReamingSlideDto>>()
|
||||||
|
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOperationReamingSlideDto>()
|
||||||
|
{
|
||||||
|
Item = src.Adapt<ProcessMapPlanOperationReamingSlideDto>()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
|
||||||
@ -218,6 +232,10 @@ namespace AsbCloudInfrastructure
|
|||||||
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell>,
|
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell>,
|
||||||
ProcessMapPlanBaseRepository<ProcessMapPlanOperationReamingRotor, ProcessMapPlanOperationReamingRotorDto>>();
|
ProcessMapPlanBaseRepository<ProcessMapPlanOperationReamingRotor, ProcessMapPlanOperationReamingRotorDto>>();
|
||||||
|
|
||||||
|
services.AddTransient<
|
||||||
|
IChangeLogRepository<ProcessMapPlanOperationReamingSlideDto, ProcessMapPlanBaseRequestWithWell>,
|
||||||
|
ProcessMapPlanBaseRepository<ProcessMapPlanOperationReamingSlide, ProcessMapPlanOperationReamingSlideDto>>();
|
||||||
|
|
||||||
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>();
|
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>();
|
||||||
|
|
||||||
services.AddTransient<TrajectoryService>();
|
services.AddTransient<TrajectoryService>();
|
||||||
@ -266,6 +284,7 @@ namespace AsbCloudInfrastructure
|
|||||||
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRotorDto>>();
|
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRotorDto>>();
|
||||||
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>();
|
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>();
|
||||||
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationReamingRotorDto>>();
|
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationReamingRotorDto>>();
|
||||||
|
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationReamingSlideDto>>();
|
||||||
services.AddTransient<IUserRoleRepository, UserRoleRepository>();
|
services.AddTransient<IUserRoleRepository, UserRoleRepository>();
|
||||||
services.AddTransient<IUserRepository, UserRepository>();
|
services.AddTransient<IUserRepository, UserRepository>();
|
||||||
services.AddTransient<ILimitingParameterRepository, LimitingParameterRepository>();
|
services.AddTransient<ILimitingParameterRepository, LimitingParameterRepository>();
|
||||||
@ -323,6 +342,7 @@ namespace AsbCloudInfrastructure
|
|||||||
services.AddTransient<ProcessMapPlanSlideParser>();
|
services.AddTransient<ProcessMapPlanSlideParser>();
|
||||||
services.AddTransient<ProcessMapPlanReamParser>();
|
services.AddTransient<ProcessMapPlanReamParser>();
|
||||||
services.AddTransient<ProcessMapPlanOperationReamingRotorParser>();
|
services.AddTransient<ProcessMapPlanOperationReamingRotorParser>();
|
||||||
|
services.AddTransient<ProcessMapPlanOperationReamingSlideParser>();
|
||||||
|
|
||||||
services.AddTransient<TrajectoryPlanExportService>();
|
services.AddTransient<TrajectoryPlanExportService>();
|
||||||
services.AddTransient<TrajectoryFactManualExportService>();
|
services.AddTransient<TrajectoryFactManualExportService>();
|
||||||
@ -332,6 +352,7 @@ namespace AsbCloudInfrastructure
|
|||||||
services.AddTransient<ProcessMapPlanSlideExportService>();
|
services.AddTransient<ProcessMapPlanSlideExportService>();
|
||||||
services.AddTransient<ProcessMapPlanReamExportService>();
|
services.AddTransient<ProcessMapPlanReamExportService>();
|
||||||
services.AddTransient<ProcessMapPlanOperationReamingRotorExportService>();
|
services.AddTransient<ProcessMapPlanOperationReamingRotorExportService>();
|
||||||
|
services.AddTransient<ProcessMapPlanOperationReamingSlideExportService>();
|
||||||
|
|
||||||
services.AddTransient<WellOperationParserFactory>();
|
services.AddTransient<WellOperationParserFactory>();
|
||||||
services.AddTransient<WellOperationExportServiceFactory>();
|
services.AddTransient<WellOperationExportServiceFactory>();
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
|
||||||
|
|
||||||
|
public class ProcessMapPlanOperationReamingSlideTemplate : ITemplateParameters
|
||||||
|
{
|
||||||
|
public string SheetName => "Проработка слайд";
|
||||||
|
|
||||||
|
public int HeaderRowsCount => 2;
|
||||||
|
|
||||||
|
public string FileName => "ProcessMapPlanOperationReamingSlideTemplate.xlsx";
|
||||||
|
|
||||||
|
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
using AsbCloudApp.Data.ProcessMaps;
|
||||||
|
using AsbCloudApp.Repositories;
|
||||||
|
using AsbCloudApp.Requests;
|
||||||
|
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 ProcessMapPlanOperationReamingSlideExportService : ProcessMapPlanExportService<ProcessMapPlanOperationReamingSlideDto>
|
||||||
|
{
|
||||||
|
public ProcessMapPlanOperationReamingSlideExportService(
|
||||||
|
IChangeLogRepository<ProcessMapPlanOperationReamingSlideDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
|
||||||
|
IWellService wellService)
|
||||||
|
: base(processMapPlanRepository, wellService)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanOperationReamingSlideTemplate();
|
||||||
|
|
||||||
|
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
|
||||||
|
{
|
||||||
|
var caption = await wellService.GetWellCaptionByIdAsync(options.IdWell, token);
|
||||||
|
|
||||||
|
return $"{caption}_РТК_План_проработка_слайд.xlsx";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using AsbCloudApp.Data.ProcessMaps;
|
||||||
|
using AsbCloudApp.Repositories;
|
||||||
|
using AsbCloudInfrastructure.Services.ExcelServices.Templates;
|
||||||
|
using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
|
||||||
|
|
||||||
|
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
|
||||||
|
|
||||||
|
public class ProcessMapPlanOperationReamingSlideParser : ProcessMapPlanParser<ProcessMapPlanOperationReamingSlideDto>
|
||||||
|
{
|
||||||
|
public ProcessMapPlanOperationReamingSlideParser(IWellOperationRepository wellOperationRepository)
|
||||||
|
: base(wellOperationRepository)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanOperationReamingSlideTemplate();
|
||||||
|
|
||||||
|
protected override ProcessMapPlanOperationReamingSlideDto BuildDto(IDictionary<string, object?> row, int rowNumber)
|
||||||
|
{
|
||||||
|
var dto = base.BuildDto(row, rowNumber);
|
||||||
|
|
||||||
|
var section = sections.FirstOrDefault(s =>
|
||||||
|
string.Equals(s.Caption.Trim(), dto.Section?.Trim(), StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
|
||||||
|
if (section is null)
|
||||||
|
{
|
||||||
|
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
|
||||||
|
TemplateParameters.SheetName,
|
||||||
|
rowNumber,
|
||||||
|
TemplateParameters.Cells[nameof(ProcessMapPlanBaseDto.Section)],
|
||||||
|
"Указана некорректная секция");
|
||||||
|
throw new FileFormatException(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
dto.IdWellSectionType = section.Id;
|
||||||
|
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,7 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps;
|
|||||||
/// РТК план проработка для ротора
|
/// РТК план проработка для ротора
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ProcessMapPlanOperationReamingRotorController :
|
public class ProcessMapPlanOperationReamingRotorController :
|
||||||
ProcessMapPlanBaseController<ProcessMapPlanSlide, ProcessMapPlanOperationReamingRotorDto>
|
ProcessMapPlanBaseController<ProcessMapPlanOperationReamingRotor, ProcessMapPlanOperationReamingRotorDto>
|
||||||
{
|
{
|
||||||
public ProcessMapPlanOperationReamingRotorController(
|
public ProcessMapPlanOperationReamingRotorController(
|
||||||
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell> repository,
|
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell> repository,
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
using AsbCloudApp.Data.ProcessMaps;
|
||||||
|
using AsbCloudApp.Repositories;
|
||||||
|
using AsbCloudApp.Requests;
|
||||||
|
using AsbCloudApp.Services;
|
||||||
|
using AsbCloudDb.Model.ProcessMaps;
|
||||||
|
using AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
|
||||||
|
using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
|
||||||
|
|
||||||
|
namespace AsbCloudWebApi.Controllers.ProcessMaps;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// РТК план проработка для слайда
|
||||||
|
/// </summary>
|
||||||
|
public class ProcessMapPlanOperationReamingSlideController :
|
||||||
|
ProcessMapPlanBaseController<ProcessMapPlanOperationReamingSlide, ProcessMapPlanOperationReamingSlideDto>
|
||||||
|
{
|
||||||
|
public ProcessMapPlanOperationReamingSlideController(
|
||||||
|
IChangeLogRepository<ProcessMapPlanOperationReamingSlideDto, ProcessMapPlanBaseRequestWithWell> repository,
|
||||||
|
IWellService wellService,
|
||||||
|
ProcessMapPlanOperationReamingSlideParser parserService,
|
||||||
|
ITelemetryService telemetryService,
|
||||||
|
ProcessMapPlanOperationReamingSlideExportService processMapPlanExportService)
|
||||||
|
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_проработка_слайд.xlsx";
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user