Выработка нагрузки

This commit is contained in:
Olga Nemt 2024-06-30 13:13:33 +05:00
parent 40f6fdb7bf
commit 1eeb2fa92d
10 changed files with 42 additions and 77 deletions

View File

@ -1,35 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план выработка нагрузки
/// </summary>
public class ProcessMapPlanOperationLoadCapacityDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Время выработки минимальное, сек
/// </summary>
[Range(0.0, 800.0, ErrorMessage = "Время выработки минимальное, сек., должно быть в пределах от 0 до 800")]
public double TimeLoadCapacityMin { get; set; }
/// <summary>
/// Перепад давления минимальный, атм
/// </summary>
[Range(0.1, 400.0, ErrorMessage = "Перепад давления минимальный, атм., должно быть в пределах от 0.1 до 400")]
public double DifferentialPressureMin { get; set; }
/// <summary>
/// Нагрузка минимальная, т
/// </summary>
[Range(0.1, 99.0, ErrorMessage = "Нагрузка минимальная, т, должно быть в пределах от 0.1 до 99")]
public double WeightOnBitMin { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -24,7 +24,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanReam> ProcessMapPlanReams => Set<ProcessMapPlanReam>(); public virtual DbSet<ProcessMapPlanReam> ProcessMapPlanReams => Set<ProcessMapPlanReam>();
public virtual DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanReamingRotor>(); public virtual DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanReamingRotor>();
public virtual DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanReamingSlide>(); public virtual DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanReamingSlide>();
public virtual DbSet<ProcessMapPlanOperationLoadCapacity> ProcessMapPlanOperationLoadCapacity => Set<ProcessMapPlanOperationLoadCapacity>(); public virtual DbSet<ProcessMapPlanLoadCapacity> ProcessMapPlanOperationLoadCapacity => Set<ProcessMapPlanLoadCapacity>();
public virtual DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey => Set<ProcessMapPlanSurvey>(); public virtual DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey => Set<ProcessMapPlanSurvey>();
public virtual DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom => Set<ProcessMapPlanPositioningOffTheBottom>(); public virtual DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom => Set<ProcessMapPlanPositioningOffTheBottom>();
public virtual DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles => Set<ProcessMapPlanOscillationAngles>(); public virtual DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles => Set<ProcessMapPlanOscillationAngles>();
@ -483,7 +483,7 @@ namespace AsbCloudDb.Model
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanOperationLoadCapacity>() modelBuilder.Entity<ProcessMapPlanLoadCapacity>()
.HasOne(p => p.Author) .HasOne(p => p.Author)
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
@ -583,7 +583,7 @@ namespace AsbCloudDb.Model
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanOperationLoadCapacity>() modelBuilder.Entity<ProcessMapPlanLoadCapacity>()
.HasOne(p => p.Editor) .HasOne(p => p.Editor)
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);

View File

@ -85,7 +85,7 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide { get; } DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide { get; }
DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor { get; } DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor { get; }
DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide { get; } DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide { get; }
DbSet<ProcessMapPlanOperationLoadCapacity> ProcessMapPlanOperationLoadCapacity { get; } DbSet<ProcessMapPlanLoadCapacity> ProcessMapPlanOperationLoadCapacity { get; }
DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey { get; } DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey { get; }
DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom { get; } DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom { get; }
DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles { get; } DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles { get; }

View File

@ -5,8 +5,8 @@ using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.ProcessMaps; namespace AsbCloudDb.Model.ProcessMaps;
[Table("t_process_map_plan_operation_load_capacity"), Comment("РТК выработка нагрузки")] [Table("t_process_map_plan_load_capacity"), Comment("РТК выработка нагрузки")]
public class ProcessMapPlanOperationLoadCapacity : ProcessMapPlanBase public class ProcessMapPlanLoadCapacity : ProcessMapPlanBase
{ {
[Column("time_load_capacity_min"), Comment("Время выработки минимальное, сек")] [Column("time_load_capacity_min"), Comment("Время выработки минимальное, сек")]
[Range(0.0, 800.0)] [Range(0.0, 800.0)]
@ -27,5 +27,5 @@ public class ProcessMapPlanOperationLoadCapacity : ProcessMapPlanBase
public string Note { get; set; } = string.Empty; public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))] [ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanOperationLoadCapacity? Previous { get; set; } public virtual ProcessMapPlanLoadCapacity? Previous { get; set; }
} }

View File

@ -160,11 +160,11 @@ namespace AsbCloudInfrastructure
Item = src.Adapt<ProcessMapPlanReamingSlideDto>() Item = src.Adapt<ProcessMapPlanReamingSlideDto>()
}); });
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOperationLoadCapacityDto>>.NewConfig() TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanLoadCapacityDto>>.NewConfig()
.Include<ProcessMapPlanOperationLoadCapacity, ChangeLogDto<ProcessMapPlanOperationLoadCapacityDto>>() .Include<ProcessMapPlanLoadCapacity, ChangeLogDto<ProcessMapPlanLoadCapacityDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOperationLoadCapacityDto>() .Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanLoadCapacityDto>()
{ {
Item = src.Adapt<ProcessMapPlanOperationLoadCapacityDto>() Item = src.Adapt<ProcessMapPlanLoadCapacityDto>()
}); });
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSurveyDto>>.NewConfig() TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSurveyDto>>.NewConfig()
@ -431,7 +431,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanReamParser>(); services.AddTransient<ProcessMapPlanReamParser>();
services.AddTransient<ProcessMapPlanReamingRotorParser>(); services.AddTransient<ProcessMapPlanReamingRotorParser>();
services.AddTransient<ProcessMapPlanReamingSlideParser>(); services.AddTransient<ProcessMapPlanReamingSlideParser>();
services.AddTransient<ProcessMapPlanOperationLoadCapacityParser>(); services.AddTransient<ProcessMapPlanLoadCapacityParser>();
services.AddTransient<ProcessMapPlanSurveyParser>(); services.AddTransient<ProcessMapPlanSurveyParser>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomParser>(); services.AddTransient<ProcessMapPlanPositioningOffTheBottomParser>();
services.AddTransient<ProcessMapPlanOscillationAnglesParser>(); services.AddTransient<ProcessMapPlanOscillationAnglesParser>();
@ -457,7 +457,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanReamExportService>(); services.AddTransient<ProcessMapPlanReamExportService>();
services.AddTransient<ProcessMapPlanReamingRotorExportService>(); services.AddTransient<ProcessMapPlanReamingRotorExportService>();
services.AddTransient<ProcessMapPlanReamingSlideExportService>(); services.AddTransient<ProcessMapPlanReamingSlideExportService>();
services.AddTransient<ProcessMapPlanOperationLoadCapacityExportService>(); services.AddTransient<ProcessMapPlanLoadCapacityExportService>();
services.AddTransient<ProcessMapPlanSurveyExportService>(); services.AddTransient<ProcessMapPlanSurveyExportService>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomExportService>(); services.AddTransient<ProcessMapPlanPositioningOffTheBottomExportService>();
services.AddTransient<ProcessMapPlanOscillationAnglesExportService>(); services.AddTransient<ProcessMapPlanOscillationAnglesExportService>();
@ -503,8 +503,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanReamingSlide, ProcessMapPlanReamingSlideDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanReamingSlide, ProcessMapPlanReamingSlideDto>>();
services.AddTransient< services.AddTransient<
IChangeLogRepository<ProcessMapPlanOperationLoadCapacityDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanLoadCapacityDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanOperationLoadCapacity, ProcessMapPlanOperationLoadCapacityDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>>();
services.AddTransient< services.AddTransient<
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell>,
@ -570,7 +570,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingRotorDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingRotorDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingSlideDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationLoadCapacityDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanLoadCapacityDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSurveyDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSurveyDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanPositioningOffTheBottomDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanPositioningOffTheBottomDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationAnglesDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationAnglesDto>>();

View File

@ -2,13 +2,13 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanOperationLoadCapacityTemplate : ITemplateParameters public class ProcessMapPlanLoadCapacityTemplate : ITemplateParameters
{ {
public string SheetName => "Выработка нагрузки"; public string SheetName => "Выработка нагрузки";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanOperationLoadCapacityTemplate.xlsx"; public string FileName => "ProcessMapPlanLoadCapacityTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {

View File

@ -10,16 +10,16 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanOperationLoadCapacityExportService : ProcessMapPlanExportService<ProcessMapPlanOperationLoadCapacityDto> public class ProcessMapPlanLoadCapacityExportService : ProcessMapPlanExportService<ProcessMapPlanLoadCapacityDto>
{ {
public ProcessMapPlanOperationLoadCapacityExportService( public ProcessMapPlanLoadCapacityExportService(
IChangeLogRepository<ProcessMapPlanOperationLoadCapacityDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository, IChangeLogRepository<ProcessMapPlanLoadCapacityDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService) IWellService wellService)
: base(processMapPlanRepository, wellService) : base(processMapPlanRepository, wellService)
{ {
} }
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanOperationLoadCapacityTemplate(); protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanLoadCapacityTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token) 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; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanOperationLoadCapacityParser : ProcessMapPlanParser<ProcessMapPlanOperationLoadCapacityDto> public class ProcessMapPlanLoadCapacityParser : ProcessMapPlanParser<ProcessMapPlanLoadCapacityDto>
{ {
public ProcessMapPlanOperationLoadCapacityParser(IWellOperationRepository wellOperationRepository) public ProcessMapPlanLoadCapacityParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository) : base(wellOperationRepository)
{ {
} }
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanOperationLoadCapacityTemplate(); protected override ITemplateParameters TemplateParameters => new ProcessMapPlanLoadCapacityTemplate();
protected override ProcessMapPlanOperationLoadCapacityDto BuildDto(IDictionary<string, object?> row, int rowNumber) protected override ProcessMapPlanLoadCapacityDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{ {
var dto = base.BuildDto(row, rowNumber); var dto = base.BuildDto(row, rowNumber);

View File

@ -10,18 +10,18 @@ using AsbCloudWebApi.IntegrationTests;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Xunit; using Xunit;
namespace AsbCloudWebApi.Controllers.ProcessMaps; namespace AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan.Operations;
/// <summary> /// <summary>
/// РТК план выработка нагрузки /// РТК план выработка нагрузки
/// </summary> /// </summary>
public class ProcessMapPlanOperationLoadCapacityControllerTest : public class ProcessMapPlanLoadCapacityControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanOperationLoadCapacity, ProcessMapPlanOperationLoadCapacityDto> ProcessMapPlanBaseControllerTest<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>
{ {
public ProcessMapPlanOperationLoadCapacityControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanOperationLoadCapacity") public ProcessMapPlanLoadCapacityControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanOperationLoadCapacity")
{ {
} }
private readonly ProcessMapPlanOperationLoadCapacityDto dto = new ProcessMapPlanOperationLoadCapacityDto() private readonly ProcessMapPlanLoadCapacityDto dto = new ProcessMapPlanLoadCapacityDto()
{ {
IdWell = 1, IdWell = 1,
DepthStart = 1, DepthStart = 1,
@ -34,7 +34,7 @@ public class ProcessMapPlanOperationLoadCapacityControllerTest :
WeightOnBitMin = 3, WeightOnBitMin = 3,
}; };
private readonly ProcessMapPlanOperationLoadCapacity entity = new ProcessMapPlanOperationLoadCapacity() private readonly ProcessMapPlanLoadCapacity entity = new ProcessMapPlanLoadCapacity()
{ {
IdWell = 1, IdWell = 1,
DepthEnd = 10, DepthEnd = 10,
@ -56,17 +56,17 @@ public class ProcessMapPlanOperationLoadCapacityControllerTest :
await Get(entity, dto); await Get(entity, dto);
} }
protected override ProcessMapPlanOperationLoadCapacity GetByNote(DbSet<ProcessMapPlanOperationLoadCapacity> dbSet, ProcessMapPlanOperationLoadCapacityDto dto) protected override ProcessMapPlanLoadCapacity GetByNote(DbSet<ProcessMapPlanLoadCapacity> dbSet, ProcessMapPlanLoadCapacityDto dto)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
protected override ProcessMapPlanOperationLoadCapacityDto GetByNote(IEnumerable<ProcessMapPlanOperationLoadCapacityDto> dtos, ProcessMapPlanOperationLoadCapacityDto dto) protected override ProcessMapPlanLoadCapacityDto GetByNote(IEnumerable<ProcessMapPlanLoadCapacityDto> dtos, ProcessMapPlanLoadCapacityDto dto)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
protected override ProcessMapPlanOperationLoadCapacity? GetByWellId() protected override ProcessMapPlanLoadCapacity? GetByWellId()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -6,20 +6,20 @@ using AsbCloudDb.Model.ProcessMaps;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Export; using AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
namespace AsbCloudWebApi.Controllers.ProcessMaps; namespace AsbCloudWebApi.Controllers.ProcessMaps.Operations;
/// <summary> /// <summary>
/// РТК план выработка нагрузки /// РТК план выработка нагрузки
/// </summary> /// </summary>
public class ProcessMapPlanOperationLoadCapacityController : public class ProcessMapPlanLoadCapacityController :
ProcessMapPlanBaseController<ProcessMapPlanOperationLoadCapacity, ProcessMapPlanOperationLoadCapacityDto> ProcessMapPlanBaseController<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>
{ {
public ProcessMapPlanOperationLoadCapacityController( public ProcessMapPlanLoadCapacityController(
IChangeLogRepository<ProcessMapPlanOperationLoadCapacityDto, ProcessMapPlanBaseRequestWithWell> repository, IChangeLogRepository<ProcessMapPlanLoadCapacityDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService, IWellService wellService,
ProcessMapPlanOperationLoadCapacityParser parserService, ProcessMapPlanLoadCapacityParser parserService,
ITelemetryService telemetryService, ITelemetryService telemetryService,
ProcessMapPlanOperationLoadCapacityExportService processMapPlanExportService) ProcessMapPlanLoadCapacityExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService) : base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{ {
} }