Merge pull request 'feature/add-page-rtk-method' (#25) from feature/add-page-rtk-method into dev

Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/25
This commit is contained in:
Никита Фролов 2023-02-09 09:04:10 +05:00
commit d4d3041a14
3 changed files with 48 additions and 13 deletions

View File

@ -13,9 +13,9 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
public class ProcessMapReportService : IProcessMapReportService
{
const int firstColumn = 2;
const int lastColumn = 27;
const int lastColumn = 61;
const int headerRowsCount = 3;
const int headerRowsCount = 8;
private readonly IProcessMapService processMapService;
@ -68,7 +68,9 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
sheet.Range(row, firstColumn, row, lastColumn)
.Merge()
.FirstCell()
.SetVal(sectionName);
.SetVal(sectionName)
.Style
.Fill.SetBackgroundColor(XLColor.LightGray);
row++;
@ -82,14 +84,17 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
private static int FillIntervalData(IXLWorksheet sheet, ProcessMapReportDto interval, int row)
{
const int columnDepth = firstColumn;
const int columnDate = firstColumn + 1;
const int columnRopTime = firstColumn + 2;
const int columnMode = firstColumn + 3;
const int columnDepth = firstColumn + 1;
const int columnDate = firstColumn + 2;
const int columnRopTime = firstColumn + 3;
const int columnMode = firstColumn + 4;
int rowRotor = row;
int rowSlide = row + 1;
sheet.Range(rowRotor, firstColumn, rowSlide, firstColumn)
.Merge();
sheet.Range(rowRotor, columnDepth, rowSlide, columnDepth)
.Merge().FirstCell()
.SetVal(interval.DepthStart, "0.0");
@ -103,7 +108,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
.SetVal(interval.MechDrillingHours);
row = FillIntervalModeData(sheet, "Ротор", interval.Rotor, columnMode, row);
row = FillIntervalModeData(sheet, "Слайд", interval.Rotor, columnMode, row);
row = FillIntervalModeData(sheet, "Слайд", interval.Slide, columnMode, row);
return row;
}
@ -115,8 +120,9 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
int columnLoad = columnPressure + 5;
int columnTorque = columnLoad + 5;
int columnSpeed = columnTorque + 5;
int columnUsage = columnSpeed + 4;
int columnRop = columnUsage + 1;
int columnUsagePlan = columnSpeed + 5;
int columnUsageFact = columnUsagePlan + 1;
int columnRop = columnUsageFact + 12;
sheet.Cell(row, column)
.SetVal(modeName);
@ -129,7 +135,10 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
FillIntervalModeDataParam(sheet, modeData.TopDriveTorque, columnTorque, row);
FillIntervalModeDataSpeed(sheet, modeData.SpeedLimit, columnSpeed, row);
sheet.Cell(row, columnUsage)
sheet.Cell(row, columnUsagePlan)
.SetVal(100);
sheet.Cell(row, columnUsageFact)
.SetVal(modeData.Usage);
sheet.Cell(row, columnRop)
@ -167,7 +176,8 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
const int columnOffsetSpPlan = 0;
const int columnOffsetSpFact = 1;
const int columnOffsetFact = 2;
const int columnOffsetPercent = 3;
const int columnOffsetLimit = 3;
const int columnOffsetPercent = 4;
sheet.Cell(row, column + columnOffsetSpPlan)
.SetVal(dataParam.SetpointPlan);
@ -178,6 +188,9 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
sheet.Cell(row, column + columnOffsetFact)
.SetVal(dataParam.Fact);
sheet.Cell(row, column + columnOffsetLimit)
.SetVal(dataParam.Limit);
sheet.Cell(row, column + columnOffsetPercent)
.SetVal(dataParam.PercDrillingSetpoint);
}

View File

@ -22,13 +22,20 @@ namespace AsbCloudWebApi.Controllers
{
private readonly ITelemetryService telemetryService;
private readonly IProcessMapReportService processMapReportService;
private readonly IProcessMapService processMapService;
public ProcessMapController(IWellService wellService, IProcessMapRepository repository, IProcessMapReportService processMapReportService,
public ProcessMapController(
IWellService wellService,
IProcessMapRepository repository,
IProcessMapReportService processMapReportService,
IProcessMapService processMapService,
ITelemetryService telemetryService)
: base(wellService, repository)
{
this.telemetryService = telemetryService;
this.processMapReportService = processMapReportService;
this.processMapService = processMapService;
}
/// <summary>
@ -104,6 +111,21 @@ namespace AsbCloudWebApi.Controllers
return NoContent();
}
/// <summary>
/// Выгрузка режимной карты по бурению скважины
/// </summary>
/// <param name="wellId"></param>
/// <param name="token"></param>
/// <returns></returns>
[HttpGet]
[Route("getDrillProcessMap/{wellId}")]
[ProducesResponseType(typeof(IEnumerable<ProcessMapReportDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetDrillProcessMap(int wellId, CancellationToken token)
{
var data = await processMapService.GetProcessMapAsync(wellId, token);
return Ok(data);
}
/// <summary>
/// Добавить запись
/// </summary>