Шаблоны

This commit is contained in:
Olga Nemt 2024-06-30 23:43:11 +05:00
parent 2105dcb953
commit dc7cd5dc23
12 changed files with 67 additions and 54 deletions

View File

@ -1,27 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps.Operations;
/// <summary>
/// РТК план выход на обороты перед ротором
/// </summary>
public class RotorRpmAccelerationDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Зенитный угол, градусы
/// </summary>
[Range(0.0, 100.0, ErrorMessage = "Зенитный угол, градусы, должно быть в пределах от 0 до 100")]
public double ZenithAngle { get; set; }
/// <summary>
/// Складывание, м
/// </summary>
[Range(0.0, 20.0, ErrorMessage = "Складывание, м., должно быть в пределах от 0 до 20")]
public double Buckling { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -240,11 +240,11 @@ namespace AsbCloudInfrastructure
Item = src.Adapt<ProcessMapPlanAutoHoldTFDto>() Item = src.Adapt<ProcessMapPlanAutoHoldTFDto>()
}); });
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<RotorRpmAccelerationDto>>.NewConfig() TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanRotorRpmAccelerationDto>>.NewConfig()
.Include<ProcessMapPlanRotorRpmAcceleration, ChangeLogDto<RotorRpmAccelerationDto>>() .Include<ProcessMapPlanRotorRpmAcceleration, ChangeLogDto<ProcessMapPlanRotorRpmAccelerationDto>>()
.Map(dest => dest, src => new ChangeLogDto<RotorRpmAccelerationDto>() .Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanRotorRpmAccelerationDto>()
{ {
Item = src.Adapt<RotorRpmAccelerationDto>() Item = src.Adapt<ProcessMapPlanRotorRpmAccelerationDto>()
}); });
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanUpdatingNoloadParametersDto>>.NewConfig() TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanUpdatingNoloadParametersDto>>.NewConfig()
@ -410,8 +410,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanAutoHoldTF, ProcessMapPlanAutoHoldTFDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanAutoHoldTF, ProcessMapPlanAutoHoldTFDto>>();
services.AddTransient< services.AddTransient<
IChangeLogRepository<RotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanRotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanRotorRpmAcceleration, RotorRpmAccelerationDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanRotorRpmAcceleration, ProcessMapPlanRotorRpmAccelerationDto>>();
services.AddTransient< services.AddTransient<
IChangeLogRepository<ProcessMapPlanUpdatingNoloadParametersDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanUpdatingNoloadParametersDto, ProcessMapPlanBaseRequestWithWell>,
@ -498,7 +498,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanShockTestDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanShockTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDamperDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDamperDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAutoHoldTFDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAutoHoldTFDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<RotorRpmAccelerationDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRotorRpmAccelerationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanUpdatingNoloadParametersDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanUpdatingNoloadParametersDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAntiCrashRotationDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAntiCrashRotationDto>>();

View File

@ -8,7 +8,7 @@ public class ProcessMapPlanAntiCrashRotationTemplate : ITemplateParameters
{ {
public string SheetName => "Противоаварийное вращение"; public string SheetName => "Противоаварийное вращение";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 3;
public string FileName => "ProcessMapPlanAntiCrashRotationTemplate.xlsx"; public string FileName => "ProcessMapPlanAntiCrashRotationTemplate.xlsx";

View File

@ -1,3 +1,5 @@
using AsbCloudApp.Data.ProcessMaps.Functions;
using AsbCloudApp.Data.ProcessMaps.Operations;
using System.Collections.Generic; using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
@ -6,12 +8,18 @@ public class ProcessMapPlanLoadCapacityTemplate : ITemplateParameters
{ {
public string SheetName => "Выработка нагрузки"; public string SheetName => "Выработка нагрузки";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 3;
public string FileName => "ProcessMapPlanLoadCapacityTemplate.xlsx"; public string FileName => "ProcessMapPlanLoadCapacityTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {
{ nameof(ProcessMapPlanLoadCapacityDto.Section), new Cell(1, typeof(string)) },
{ nameof(ProcessMapPlanLoadCapacityDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanLoadCapacityDto.DepthEnd), new Cell(3, typeof(double)) },
{ nameof(ProcessMapPlanLoadCapacityDto.TimeLoadCapacityMin), new Cell(4, typeof(double)) },
{ nameof(ProcessMapPlanLoadCapacityDto.DifferentialPressureMin), new Cell(5, typeof(double)) },
{ nameof(ProcessMapPlanLoadCapacityDto.WeightOnBitMin), new Cell(6, typeof(double)) },
{ nameof(ProcessMapPlanLoadCapacityDto.Note), new Cell(7, typeof(string)) },
}; };
} }

View File

@ -1,3 +1,4 @@
using AsbCloudApp.Data.ProcessMaps.Functions;
using System.Collections.Generic; using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
@ -6,12 +7,21 @@ public class ProcessMapPlanOscillationTemplate : ITemplateParameters
{ {
public string SheetName => "Осцилляция"; public string SheetName => "Осцилляция";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 3;
public string FileName => "ProcessMapPlanOscillationTemplate.xlsx"; public string FileName => "ProcessMapPlanOscillationTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {
{ nameof(ProcessMapPlanOscillationDto.Section), new Cell(1, typeof(string)) },
{ nameof(ProcessMapPlanOscillationDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.DepthEnd), new Cell(3, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.OptimalOscillationAngle), new Cell(4, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.RpmRight), new Cell(5, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.RpmLeft), new Cell(6, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.TorqueMaxRight), new Cell(7, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.TorqueMaxLeft), new Cell(8, typeof(double)) },
{ nameof(ProcessMapPlanOscillationDto.Mode), new Cell(10, typeof(int)) },
{ nameof(ProcessMapPlanOscillationDto.Note), new Cell(11, typeof(string)) },
}; };
} }

View File

@ -1,3 +1,4 @@
using AsbCloudApp.Data.ProcessMaps.Operations;
using System.Collections.Generic; using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
@ -6,12 +7,18 @@ public class ProcessMapPlanRotorLoweringBitTemplate : ITemplateParameters
{ {
public string SheetName => "Подход к забою в роторе"; public string SheetName => "Подход к забою в роторе";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 3;
public string FileName => "ProcessMapPlanRotorLoweringBitTemplate.xlsx"; public string FileName => "ProcessMapPlanRotorLoweringBitTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {
{ nameof(ProcessMapPlanRotorLoweringBitDto.Section), new Cell(1, typeof(string)) },
{ nameof(ProcessMapPlanRotorLoweringBitDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanRotorLoweringBitDto.DepthEnd), new Cell(3, typeof(double)) },
{ nameof(ProcessMapPlanRotorLoweringBitDto.PressureMax), new Cell(4, typeof(double)) },
{ nameof(ProcessMapPlanRotorLoweringBitDto.DifferentialPressure), new Cell(5, typeof(double)) },
{ nameof(ProcessMapPlanRotorLoweringBitDto.SlackingOff), new Cell(6, typeof(double)) },
{ nameof(ProcessMapPlanRotorLoweringBitDto.Note), new Cell(7, typeof(string)) },
}; };
} }

View File

@ -1,3 +1,6 @@
using AsbCloudApp.Data.ProcessMaps.Functions;
using AsbCloudApp.Data.ProcessMaps.Operations;
using AsbCloudDb.Model.ProcessMapPlan.Operations;
using System.Collections.Generic; using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
@ -12,6 +15,9 @@ public class ProcessMapPlanRotorRpmAccelerationTemplate : ITemplateParameters
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {
{ nameof(ProcessMapPlanRotorRpmAccelerationDto.Section), new Cell(1, typeof(string)) },
{ nameof(ProcessMapPlanRotorRpmAccelerationDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanRotorRpmAccelerationDto.DepthEnd), new Cell(3, typeof(double)) },
{ nameof(ProcessMapPlanRotorRpmAccelerationDto.Note), new Cell(11, typeof(string)) },
}; };
} }

View File

@ -1,3 +1,6 @@
using AsbCloudApp.Data.ProcessMaps.Functions;
using AsbCloudApp.Data.ProcessMaps.Operations;
using AsbCloudDb.Model.ProcessMapPlan.Operations;
using System.Collections.Generic; using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
@ -6,12 +9,18 @@ public class ProcessMapPlanSwitchingToTheModeTemplate : ITemplateParameters
{ {
public string SheetName => "Выход на плановый расход"; public string SheetName => "Выход на плановый расход";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 3;
public string FileName => "ProcessMapPlanSwitchingToTheModeTemplate.xlsx"; public string FileName => "ProcessMapPlanSwitchingToTheModeTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {
{ nameof(ProcessMapPlanSwitchingToTheModeDto.Section), new Cell(1, typeof(string)) },
{ nameof(ProcessMapPlanSwitchingToTheModeDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanSwitchingToTheModeDto.DepthEnd), new Cell(3, typeof(double)) },
{ nameof(ProcessMapPlanSwitchingToTheModeDto.RampTime), new Cell(4, typeof(double)) },
{ nameof(ProcessMapPlanSwitchingToTheModeDto.FlowRate), new Cell(5, typeof(double)) },
{ nameof(ProcessMapPlanSwitchingToTheModeDto.PressureMax), new Cell(6, typeof(double)) },
{ nameof(ProcessMapPlanAntiCrashRotationDto.Note), new Cell(7, typeof(string)) },
}; };
} }

View File

@ -10,10 +10,10 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanRotorRpmAccelerationExportService : ProcessMapPlanExportService<RotorRpmAccelerationDto> public class ProcessMapPlanRotorRpmAccelerationExportService : ProcessMapPlanExportService<ProcessMapPlanRotorRpmAccelerationDto>
{ {
public ProcessMapPlanRotorRpmAccelerationExportService( public ProcessMapPlanRotorRpmAccelerationExportService(
IChangeLogRepository<RotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository, IChangeLogRepository<ProcessMapPlanRotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService) IWellService wellService)
: base(processMapPlanRepository, wellService) : base(processMapPlanRepository, wellService)
{ {

View File

@ -10,7 +10,7 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanRotorRpmAccelerationParser : ProcessMapPlanParser<RotorRpmAccelerationDto> public class ProcessMapPlanRotorRpmAccelerationParser : ProcessMapPlanParser<ProcessMapPlanRotorRpmAccelerationDto>
{ {
public ProcessMapPlanRotorRpmAccelerationParser(IWellOperationRepository wellOperationRepository) public ProcessMapPlanRotorRpmAccelerationParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository) : base(wellOperationRepository)
@ -19,7 +19,7 @@ public class ProcessMapPlanRotorRpmAccelerationParser : ProcessMapPlanParser<Rot
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanRotorRpmAccelerationTemplate(); protected override ITemplateParameters TemplateParameters => new ProcessMapPlanRotorRpmAccelerationTemplate();
protected override RotorRpmAccelerationDto BuildDto(IDictionary<string, object?> row, int rowNumber) protected override ProcessMapPlanRotorRpmAccelerationDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{ {
var dto = base.BuildDto(row, rowNumber); var dto = base.BuildDto(row, rowNumber);

View File

@ -16,12 +16,12 @@ namespace AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan.Operations;
/// РТК план встряхивание бурового инструмента /// РТК план встряхивание бурового инструмента
/// </summary> /// </summary>
public class ProcessMapPlanRotorRpmAccelerationControllerTest : public class ProcessMapPlanRotorRpmAccelerationControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanRotorRpmAcceleration, RotorRpmAccelerationDto> ProcessMapPlanBaseControllerTest<ProcessMapPlanRotorRpmAcceleration, ProcessMapPlanRotorRpmAccelerationDto>
{ {
public ProcessMapPlanRotorRpmAccelerationControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsJarrDrillTool") public ProcessMapPlanRotorRpmAccelerationControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsJarrDrillTool")
{ {
} }
private readonly RotorRpmAccelerationDto dto = new RotorRpmAccelerationDto() private readonly ProcessMapPlanRotorRpmAccelerationDto dto = new ProcessMapPlanRotorRpmAccelerationDto()
{ {
IdWell = 1, IdWell = 1,
DepthStart = 1, DepthStart = 1,
@ -54,12 +54,12 @@ public class ProcessMapPlanRotorRpmAccelerationControllerTest :
await Get(entity, dto); await Get(entity, dto);
} }
protected override ProcessMapPlanRotorRpmAcceleration GetByNote(DbSet<ProcessMapPlanRotorRpmAcceleration> dbSet, RotorRpmAccelerationDto dto) protected override ProcessMapPlanRotorRpmAcceleration GetByNote(DbSet<ProcessMapPlanRotorRpmAcceleration> dbSet, ProcessMapPlanRotorRpmAccelerationDto dto)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
protected override RotorRpmAccelerationDto GetByNote(IEnumerable<RotorRpmAccelerationDto> dtos, RotorRpmAccelerationDto dto) protected override ProcessMapPlanRotorRpmAccelerationDto GetByNote(IEnumerable<ProcessMapPlanRotorRpmAccelerationDto> dtos, ProcessMapPlanRotorRpmAccelerationDto dto)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -12,10 +12,10 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps.Operations;
/// РТК план выход на обороты перед ротором /// РТК план выход на обороты перед ротором
/// </summary> /// </summary>
public class ProcessMapPlanRotorRpmAccelerationController : public class ProcessMapPlanRotorRpmAccelerationController :
ProcessMapPlanBaseController<ProcessMapPlanRotorRpmAcceleration, RotorRpmAccelerationDto> ProcessMapPlanBaseController<ProcessMapPlanRotorRpmAcceleration, ProcessMapPlanRotorRpmAccelerationDto>
{ {
public ProcessMapPlanRotorRpmAccelerationController( public ProcessMapPlanRotorRpmAccelerationController(
IChangeLogRepository<RotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell> repository, IChangeLogRepository<ProcessMapPlanRotorRpmAccelerationDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService, IWellService wellService,
ProcessMapPlanRotorRpmAccelerationParser parserService, ProcessMapPlanRotorRpmAccelerationParser parserService,
ITelemetryService telemetryService, ITelemetryService telemetryService,