Демпфер

This commit is contained in:
Olga Nemt 2024-06-29 23:32:34 +05:00
parent e71b59a1ed
commit 92c2843897
11 changed files with 41 additions and 62 deletions

View File

@ -1,21 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план демпфер
/// </summary>
public class ProcessMapPlanFunctionsDamperDto : ProcessMapPlanBaseDto
{
/// <summary>
/// StickSlip
/// </summary>
[Range(0.0, 1000.0, ErrorMessage = "StickSlip, должно быть в пределах от 0 до 1000")]
public double StickSlip { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -33,7 +33,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanOperationSwitchingToTheMode> ProcessMapPlanOperationSwitchMode => Set<ProcessMapPlanOperationSwitchingToTheMode>();
public virtual DbSet<ProcessMapPlanDrillTest> ProcessMapPlanFunctionsDrillTest => Set<ProcessMapPlanDrillTest>();
public virtual DbSet<ProcessMapPlanShockTest> ProcessMapPlanFunctionsShockTest => Set<ProcessMapPlanShockTest>();
public virtual DbSet<ProcessMapPlanFunctionsDamper> ProcessMapPlanFunctionsDamper => Set<ProcessMapPlanFunctionsDamper>();
public virtual DbSet<ProcessMapPlanDamper> ProcessMapPlanFunctionsDamper => Set<ProcessMapPlanDamper>();
public virtual DbSet<ProcessMapPlanAutoHoldTF> ProcessMapPlanFunctionsAutoHold => Set<ProcessMapPlanAutoHoldTF>();
public virtual DbSet<ProcessMapPlanFunctionsJarrDrillTool> ProcessMapPlanFunctionsJarrDrillTool => Set<ProcessMapPlanFunctionsJarrDrillTool>();
public virtual DbSet<ProcessMapPlanUpdatingNoloadParameters> ProcessMapPlanFunctionsUpgradeNoload => Set<ProcessMapPlanUpdatingNoloadParameters>();
@ -528,7 +528,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanFunctionsDamper>()
modelBuilder.Entity<ProcessMapPlanDamper>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
@ -628,7 +628,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanFunctionsDamper>()
modelBuilder.Entity<ProcessMapPlanDamper>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);

View File

@ -94,7 +94,7 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanOperationSwitchingToTheMode> ProcessMapPlanOperationSwitchMode { get; }
DbSet<ProcessMapPlanDrillTest> ProcessMapPlanFunctionsDrillTest { get; }
DbSet<ProcessMapPlanShockTest> ProcessMapPlanFunctionsShockTest { get; }
DbSet<ProcessMapPlanFunctionsDamper> ProcessMapPlanFunctionsDamper { get; }
DbSet<ProcessMapPlanDamper> ProcessMapPlanFunctionsDamper { get; }
DbSet<ProcessMapPlanAutoHoldTF> ProcessMapPlanFunctionsAutoHold { get; }
DbSet<ProcessMapPlanFunctionsJarrDrillTool> ProcessMapPlanFunctionsJarrDrillTool { get; }
DbSet<ProcessMapPlanUpdatingNoloadParameters> ProcessMapPlanFunctionsUpgradeNoload { get; }

View File

@ -6,9 +6,9 @@ using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.ProcessMaps;
[Table("t_process_map_plan_functions_damper"), Comment("Демпфер")]
public class ProcessMapPlanFunctionsDamper : ProcessMapPlanBase
public class ProcessMapPlanDamper : ProcessMapPlanBase
{
[Column("stickslip"), Comment("StickSlip")]
[Column("stick_slip"), Comment("StickSlip")]
[Range(0.0, 1000.0)]
[Required]
public double StickSlip { get; set; }
@ -17,5 +17,5 @@ public class ProcessMapPlanFunctionsDamper : ProcessMapPlanBase
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanFunctionsDamper? Previous { get; set; }
public virtual ProcessMapPlanDamper? Previous { get; set; }
}

View File

@ -8,7 +8,7 @@ namespace AsbCloudDb.Model.ProcessMaps;
[Table("t_process_map_shock_test"), Comment("ShockTest")]
public class ProcessMapPlanShockTest : ProcessMapPlanBase
{
[Column("stickSlip"), Comment("stickSlip")]
[Column("stick_slip"), Comment("stickSlip")]
[Range(0.0, 1000.0)]
[Required]
public double StickSlip { get; set; }

View File

@ -223,11 +223,11 @@ namespace AsbCloudInfrastructure
Item = src.Adapt<ProcessMapPlanShockTestDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanFunctionsDamperDto>>.NewConfig()
.Include<ProcessMapPlanFunctionsDamper, ChangeLogDto<ProcessMapPlanFunctionsDamperDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanFunctionsDamperDto>()
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanDamperDto>>.NewConfig()
.Include<ProcessMapPlanDamper, ChangeLogDto<ProcessMapPlanDamperDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanDamperDto>()
{
Item = src.Adapt<ProcessMapPlanFunctionsDamperDto>()
Item = src.Adapt<ProcessMapPlanDamperDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanAutoHoldTFDto>>.NewConfig()
@ -440,7 +440,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanOperationSwitchingToTheModeParser>();
services.AddTransient<ProcessMapPlanDrillTestParser>();
services.AddTransient<ProcessMapPlanShockTestParser>();
services.AddTransient<ProcessMapPlanFunctionsDamperParser>();
services.AddTransient<ProcessMapPlanDamperParser>();
services.AddTransient<ProcessMapPlanAutoHoldTFParser>();
services.AddTransient<ProcessMapPlanFunctionsJarrDrillToolParser>();
services.AddTransient<ProcessMapPlanUpdatingNoloadParametersParser>();
@ -466,7 +466,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanOperationSwitchingToTheModeExportService>();
services.AddTransient<ProcessMapPlanDrillTestExportService>();
services.AddTransient<ProcessMapPlanShockTestExportService>();
services.AddTransient<ProcessMapPlanFunctionsDamperExportService>();
services.AddTransient<ProcessMapPlanDamperExportService>();
services.AddTransient<ProcessMapPlanAutoHoldTFExportService>();
services.AddTransient<ProcessMapPlanFunctionsJarrDrillToolExportService>();
services.AddTransient<ProcessMapPlanUpdatingNoloadParametersExportService>();
@ -539,8 +539,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanShockTest, ProcessMapPlanShockTestDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanFunctionsDamperDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanFunctionsDamper, ProcessMapPlanFunctionsDamperDto>>();
IChangeLogRepository<ProcessMapPlanDamperDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanDamper, ProcessMapPlanDamperDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanAutoHoldTFDto, ProcessMapPlanBaseRequestWithWell>,
@ -579,7 +579,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationSwitchingToTheModeDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDrillTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanShockTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsDamperDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDamperDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAutoHoldTFDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsJarrDrillToolDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanUpdatingNoloadParametersDto>>();

View File

@ -2,13 +2,13 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanFunctionsDamperTemplate : ITemplateParameters
public class ProcessMapPlanDamperTemplate : ITemplateParameters
{
public string SheetName => "Демпфер";
public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanFunctionsDamperTemplate.xlsx";
public string FileName => "ProcessMapPlanDamperTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{

View File

@ -10,16 +10,16 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanFunctionsDamperExportService : ProcessMapPlanExportService<ProcessMapPlanFunctionsDamperDto>
public class ProcessMapPlanDamperExportService : ProcessMapPlanExportService<ProcessMapPlanDamperDto>
{
public ProcessMapPlanFunctionsDamperExportService(
IChangeLogRepository<ProcessMapPlanFunctionsDamperDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
public ProcessMapPlanDamperExportService(
IChangeLogRepository<ProcessMapPlanDamperDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanFunctionsDamperTemplate();
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanDamperTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
{

View File

@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanFunctionsDamperParser : ProcessMapPlanParser<ProcessMapPlanFunctionsDamperDto>
public class ProcessMapPlanDamperParser : ProcessMapPlanParser<ProcessMapPlanDamperDto>
{
public ProcessMapPlanFunctionsDamperParser(IWellOperationRepository wellOperationRepository)
public ProcessMapPlanDamperParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanFunctionsDamperTemplate();
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanDamperTemplate();
protected override ProcessMapPlanFunctionsDamperDto BuildDto(IDictionary<string, object?> row, int rowNumber)
protected override ProcessMapPlanDamperDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{
var dto = base.BuildDto(row, rowNumber);

View File

@ -15,13 +15,13 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план демпфер
/// </summary>
public class ProcessMapPlanFunctionsDamperControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanFunctionsDamper, ProcessMapPlanFunctionsDamperDto>
public class ProcessMapPlanDamperControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanDamper, ProcessMapPlanDamperDto>
{
public ProcessMapPlanFunctionsDamperControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsDamper")
public ProcessMapPlanDamperControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsDamper")
{
}
private readonly ProcessMapPlanFunctionsDamperDto dto = new ProcessMapPlanFunctionsDamperDto()
private readonly ProcessMapPlanDamperDto dto = new ProcessMapPlanDamperDto()
{
IdWell = 1,
DepthStart = 1,
@ -32,7 +32,7 @@ public class ProcessMapPlanFunctionsDamperControllerTest :
StickSlip = 1
};
private readonly ProcessMapPlanFunctionsDamper entity = new ProcessMapPlanFunctionsDamper()
private readonly ProcessMapPlanDamper entity = new ProcessMapPlanDamper()
{
IdWell = 1,
DepthEnd = 10,
@ -52,17 +52,17 @@ public class ProcessMapPlanFunctionsDamperControllerTest :
await Get(entity, dto);
}
protected override ProcessMapPlanFunctionsDamper GetByNote(DbSet<ProcessMapPlanFunctionsDamper> dbSet, ProcessMapPlanFunctionsDamperDto dto)
protected override ProcessMapPlanDamper GetByNote(DbSet<ProcessMapPlanDamper> dbSet, ProcessMapPlanDamperDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanFunctionsDamperDto GetByNote(IEnumerable<ProcessMapPlanFunctionsDamperDto> dtos, ProcessMapPlanFunctionsDamperDto dto)
protected override ProcessMapPlanDamperDto GetByNote(IEnumerable<ProcessMapPlanDamperDto> dtos, ProcessMapPlanDamperDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanFunctionsDamper? GetByWellId()
protected override ProcessMapPlanDamper? GetByWellId()
{
throw new NotImplementedException();
}

View File

@ -11,15 +11,15 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план демпфер
/// </summary>
public class ProcessMapPlanFunctionsDamperController :
ProcessMapPlanBaseController<ProcessMapPlanFunctionsDamper, ProcessMapPlanFunctionsDamperDto>
public class ProcessMapPlanDamperController :
ProcessMapPlanBaseController<ProcessMapPlanDamper, ProcessMapPlanDamperDto>
{
public ProcessMapPlanFunctionsDamperController(
IChangeLogRepository<ProcessMapPlanFunctionsDamperDto, ProcessMapPlanBaseRequestWithWell> repository,
public ProcessMapPlanDamperController(
IChangeLogRepository<ProcessMapPlanDamperDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanFunctionsDamperParser parserService,
ProcessMapPlanDamperParser parserService,
ITelemetryService telemetryService,
ProcessMapPlanFunctionsDamperExportService processMapPlanExportService)
ProcessMapPlanDamperExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}