ProcessMapReportDataSaubStatExportService nit

This commit is contained in:
ngfrolov 2024-02-16 16:22:06 +05:00
parent 8f271eac0a
commit 11873c6764
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
2 changed files with 237 additions and 238 deletions

View File

@ -10,18 +10,18 @@ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
{
namespace AsbCloudInfrastructure.Services.ProcessMaps.Report;
public class ProcessMapReportDataSaubStatExportService : IProcessMapReportDataSaubStatExportService
{
const int firstColumn = 2;
const int lastColumn = 35;
const int headerRowsCount = 5;
private const int firstColumn = 2;
private const int lastColumn = 35;
private const int headerRowsCount = 5;
private const string TemplateName = "ProcessMapReportDataSaubStatTemplate.xlsx";
private const string sheetName = "Отчёт";
private readonly IWellService wellService;
private readonly IProcessMapReportDataSaubStatService processMapReportDataSaubStatService;
private readonly string TemplateName = "ProcessMapReportDataSaubStatTemplate.xlsx";
public ProcessMapReportDataSaubStatExportService(IWellService wellService,
IProcessMapReportDataSaubStatService processMapReportDataSaubStatService)
@ -53,11 +53,8 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
return (name, memoryStream);
}
private static void FillProcessMapToWorkbook(XLWorkbook workbook,
IEnumerable<ProcessMapReportDataSaubStatDto> data)
private static void FillProcessMapToWorkbook(XLWorkbook workbook, IEnumerable<ProcessMapReportDataSaubStatDto> data)
{
const string sheetName = "Отчёт";
var sheet = workbook.GetWorksheet(sheetName);
var startRow = headerRowsCount + 1;
@ -68,8 +65,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
}
private static int FillRow(IXLWorksheet sheet, ProcessMapReportDataSaubStatDto item,
int startRow)
private static int FillRow(IXLWorksheet sheet, ProcessMapReportDataSaubStatDto item, int startRow)
{
var endRow = FillIntervalData(sheet, item, startRow);
@ -256,4 +252,3 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
}
}
}

View File

@ -11,6 +11,7 @@ using AsbCloudWebApi.SignalR.Clients;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
@ -91,6 +92,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
/// <param name="file"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[Obsolete]
[HttpPost("import/{options}")]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
public async Task<IActionResult> ImportAsync(int idWell,
@ -129,6 +131,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
/// <param name="idWell">Id скважины</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[Obsolete]
[HttpGet("export")]
[ProducesResponseType(typeof(PhysicalFileResult), StatusCodes.Status200OK, "application/octet-stream")]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
@ -143,6 +146,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
/// Возвращает шаблон файла для импорта
/// </summary>
/// <returns>Запрашиваемый файл</returns>
[Obsolete]
[HttpGet("template")]
[ProducesResponseType(typeof(PhysicalFileResult), StatusCodes.Status200OK, "application/octet-stream")]
public async Task<IActionResult> GetTemplateAsync(CancellationToken cancellationToken)