Фикс шаблона + мелкие фиксы в контроллере

This commit is contained in:
parent 1413e80f09
commit 1a33cfb0ad
5 changed files with 24 additions and 27 deletions

View File

@ -5,33 +5,30 @@ namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.Autogenerate
public class HeadExcelBlockWriter : IExcelBlockWriter
{
private const int columnCustomer = 1;
private const int columnDeposit = 2;
private const int columnCluster = 3;
private const int columnWell = 4;
private static readonly (int, int) customerCell = (2, 2);
private static readonly (int, int) depositCell = (4, 2);
private static readonly (int, int) clusterCell = (5, 2);
private static readonly (int, int) wellCell = (6, 2);
private const int columnFrom = 1;
private const int columnTo = 2;
private const int columnWellDepthIntervalStartDate = 3;
private const int columnWellDepthIntervalFinishDate = 4;
private const int dateRow = 9;
private const int dateFromColumn = 2;
private const int dateFromToColumn = 3;
private const int depthRow = 10;
private const int depthFromColumn = 2;
private const int depthToColumn = 3;
public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report)
{
const int rowHeaderBlockSectionOne = 2;
const int rowHeaderBlockSectionTwo = 5;
var rowSectionOne = sheet.Row(1 + rowHeaderBlockSectionOne);
sheet.Cell(customerCell.Item1, customerCell.Item2).Value = report.Head.Customer;
sheet.Cell(depositCell.Item1, depositCell.Item2).Value = report.Head.Deposit;
sheet.Cell(clusterCell.Item1, clusterCell.Item2).Value = report.Head.ClusterName;
sheet.Cell(wellCell.Item1, wellCell.Item2).Value = report.Head.WellName;
rowSectionOne.Cell(columnCustomer).Value = report.Head.Customer;
rowSectionOne.Cell(columnDeposit).Value = report.Head.Deposit;
rowSectionOne.Cell(columnCluster).Value = report.Head.ClusterName;
rowSectionOne.Cell(columnWell).Value = report.Head.WellName;
sheet.Cell(dateRow, dateFromColumn).Value = report.Head.From;
sheet.Cell(dateRow, dateFromToColumn).Value = report.Head.To;
var rowSectionTwo = sheet.Row(1 + rowHeaderBlockSectionTwo);
rowSectionTwo.Cell(columnFrom).Value = report.Head.From;
rowSectionTwo.Cell(columnTo).Value = report.Head.To;
rowSectionTwo.Cell(columnWellDepthIntervalStartDate).Value = report.Head.WellDepthIntervalStartDate;
rowSectionTwo.Cell(columnWellDepthIntervalFinishDate).Value = report.Head.WellDepthIntervalFinishDate;
sheet.Cell(depthRow, depthFromColumn).Value = report.Head.WellDepthIntervalStartDate;
sheet.Cell(depthRow, depthToColumn).Value = report.Head.WellDepthIntervalFinishDate;
}
}

View File

@ -6,7 +6,7 @@ namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.Autogenerate
public class LimitingParameterExcelBlockWriter : IExcelBlockWriter
{
private const int rowHeaderBlock = 18;
private const int rowHeaderBlock = 20;
private const int columnNameFeedRegulator = 1;
private const int columnDepth = 2;

View File

@ -6,7 +6,7 @@ namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.Autogenerate
public class SubsystemExcelBlockWriter : IExcelBlockWriter
{
private const int rowHeaderBlock = 10;
private const int rowHeaderBlock = 13;
private const int columnName = 1;
private const int columnKUsage = 2;

View File

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Data;
using AsbCloudApp.Data.AutogeneratedDailyReport;
using AsbCloudApp.Requests;
using AsbCloudApp.Services;
@ -39,7 +39,7 @@ public class AutoGeneratedDailyReportController : ControllerBase
/// <param name="reportDate">Дата отчёта</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost]
[HttpGet]
[Route("generate")]
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
@ -65,7 +65,7 @@ public class AutoGeneratedDailyReportController : ControllerBase
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpGet]
[ProducesResponseType(typeof(IEnumerable<AutoGeneratedDailyReportDto>), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(PaginationContainer<AutoGeneratedDailyReportDto>), (int)HttpStatusCode.OK)]
public async Task<IActionResult> GetListAsync([FromRoute][Required] int idWell,
[FromQuery] AutoGeneratedDailyReportRequest request,
CancellationToken cancellationToken)