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

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<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanReamingRotor>();
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<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom => Set<ProcessMapPlanPositioningOffTheBottom>();
public virtual DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles => Set<ProcessMapPlanOscillationAngles>();
@ -483,7 +483,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanOperationLoadCapacity>()
modelBuilder.Entity<ProcessMapPlanLoadCapacity>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
@ -583,7 +583,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanOperationLoadCapacity>()
modelBuilder.Entity<ProcessMapPlanLoadCapacity>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);

View File

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

View File

@ -5,8 +5,8 @@ using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.ProcessMaps;
[Table("t_process_map_plan_operation_load_capacity"), Comment("РТК выработка нагрузки")]
public class ProcessMapPlanOperationLoadCapacity : ProcessMapPlanBase
[Table("t_process_map_plan_load_capacity"), Comment("РТК выработка нагрузки")]
public class ProcessMapPlanLoadCapacity : ProcessMapPlanBase
{
[Column("time_load_capacity_min"), Comment("Время выработки минимальное, сек")]
[Range(0.0, 800.0)]
@ -27,5 +27,5 @@ public class ProcessMapPlanOperationLoadCapacity : ProcessMapPlanBase
public string Note { get; set; } = string.Empty;
[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>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOperationLoadCapacityDto>>.NewConfig()
.Include<ProcessMapPlanOperationLoadCapacity, ChangeLogDto<ProcessMapPlanOperationLoadCapacityDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOperationLoadCapacityDto>()
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanLoadCapacityDto>>.NewConfig()
.Include<ProcessMapPlanLoadCapacity, ChangeLogDto<ProcessMapPlanLoadCapacityDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanLoadCapacityDto>()
{
Item = src.Adapt<ProcessMapPlanOperationLoadCapacityDto>()
Item = src.Adapt<ProcessMapPlanLoadCapacityDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSurveyDto>>.NewConfig()
@ -431,7 +431,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanReamParser>();
services.AddTransient<ProcessMapPlanReamingRotorParser>();
services.AddTransient<ProcessMapPlanReamingSlideParser>();
services.AddTransient<ProcessMapPlanOperationLoadCapacityParser>();
services.AddTransient<ProcessMapPlanLoadCapacityParser>();
services.AddTransient<ProcessMapPlanSurveyParser>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomParser>();
services.AddTransient<ProcessMapPlanOscillationAnglesParser>();
@ -457,7 +457,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanReamExportService>();
services.AddTransient<ProcessMapPlanReamingRotorExportService>();
services.AddTransient<ProcessMapPlanReamingSlideExportService>();
services.AddTransient<ProcessMapPlanOperationLoadCapacityExportService>();
services.AddTransient<ProcessMapPlanLoadCapacityExportService>();
services.AddTransient<ProcessMapPlanSurveyExportService>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomExportService>();
services.AddTransient<ProcessMapPlanOscillationAnglesExportService>();
@ -503,8 +503,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanReamingSlide, ProcessMapPlanReamingSlideDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanOperationLoadCapacityDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanOperationLoadCapacity, ProcessMapPlanOperationLoadCapacityDto>>();
IChangeLogRepository<ProcessMapPlanLoadCapacityDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell>,
@ -570,7 +570,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingRotorDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationLoadCapacityDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanLoadCapacityDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSurveyDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanPositioningOffTheBottomDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationAnglesDto>>();

View File

@ -2,13 +2,13 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanOperationLoadCapacityTemplate : ITemplateParameters
public class ProcessMapPlanLoadCapacityTemplate : ITemplateParameters
{
public string SheetName => "Выработка нагрузки";
public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanOperationLoadCapacityTemplate.xlsx";
public string FileName => "ProcessMapPlanLoadCapacityTemplate.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 ProcessMapPlanOperationLoadCapacityExportService : ProcessMapPlanExportService<ProcessMapPlanOperationLoadCapacityDto>
public class ProcessMapPlanLoadCapacityExportService : ProcessMapPlanExportService<ProcessMapPlanLoadCapacityDto>
{
public ProcessMapPlanOperationLoadCapacityExportService(
IChangeLogRepository<ProcessMapPlanOperationLoadCapacityDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
public ProcessMapPlanLoadCapacityExportService(
IChangeLogRepository<ProcessMapPlanLoadCapacityDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService 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)
{

View File

@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp
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)
{
}
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);

View File

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

View File

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