изменение моделей Dto

внесение корректировок в сервис DailyReport
Убраны лишние комментарии и лишний код :
-из классов создающих блоки отчета
-из метода MakerExcel
Добавлен блок Dimensionless
This commit is contained in:
IvanovEugeniy 2022-06-30 16:01:46 +05:00
parent c6f089421a
commit e16df1f705
25 changed files with 283 additions and 2243 deletions

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudApp.Data.DailyReport
{
public class DailyReportBhaDto
{

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudApp.Data.DailyReport
{
public class DailyReportDimensionlessDto
{

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudApp.Data.DailyReport
{
public class DailyReportHeadDto

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudApp.Data.DailyReport
{
public class DailyReportSaubDto
{

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudApp.Data.DailyReport
{
public class DailyReportSignDto
{

View File

@ -1,216 +1,23 @@
using System;
using System.Collections.Generic;
using AsbCloudApp.Data.DailyReport;
namespace AsbCloudApp.Data
{
/// <summary>
/// Параметры для формирования суточного рапорта
/// Блоки для формирования суточного рапорта
/// </summary>
public class DailyReportDto
{
/// <summary>
/// название скважины
/// </summary>
public string WellName { get; set; }
public DailyReportHeadDto HeadDto { get; set; }
public DailyReportBhaDto BhaDto { get; set; }
public DailyReportDimensionlessDto DimensionlessDto { get; set; }
public DailyReportTimeBalanceDto TimeBalanceDto { get; set; }
public DailyReportSaubDto SaubDto { get; set; }
public DailyReportSignDto SignDto { get; set; }
/// <summary>
/// название куста
/// </summary>
public string ClusterName { get; set; }
/// <summary>
/// заказчик
/// </summary>
public string Customer { get; set; }
/// <summary>
/// подрядчик
/// </summary>
public string Contractor { get; set; }
/// <summary>
/// дата рапорта
/// </summary>
public DateTime ReportDate { get; set; }
/// <summary>
/// глубина забоя на дату начала интервала
/// </summary>
public double? WellDepthIntervalStartDate { get; set; }
/// <summary>
/// глубина забоя на дату окончания интервала
/// </summary>
public double? WellDepthIntervalFinishDate { get; set; }
/// <summary>
/// Глубина забоя по стволу на окончание отчетного периода
/// </summary>
public double? BottomholeDepth { get; set; }
/// <summary>
/// Глубина забоя по вертикали на дату окончания отчетного периода
/// </summary>
public double? VerticalDepth { get; set; }
/// <summary>
/// Зенитный угол на дату окончания отчетного периода
/// </summary>
public double? ZenithAngle { get; set; }
/// <summary>
/// Азимутальный угол на дату окончания отчетного периода
/// </summary>
public double? AzimuthAngle { get; set; }
/// <summary>
/// ФИО бурильщиков
/// </summary>
public string FirstDriller { get; set; }
/// <summary>
/// ФИО бурильщиков
/// </summary>
public string SecondDriller { get; set; }
/// <summary>
/// Время работы АПД
/// </summary>
public double? WorkTimeSAUB { get; set; }
/// <summary>
/// Время работы спин мастер
/// </summary>
public double? WorkTimeSpinMaster { get; set; }
/// <summary>
/// Время работы torqueMaster
/// </summary>
public double? WorkTimeTorkMaster { get; set; }
/// <summary>
/// количество метров пробуренных с включенным АПД
/// </summary>
public double? PenetrationSAUB { get; set; }
/// <summary>
/// количество метров пробуренных с включенным Спин мастер
/// </summary>
public double? PenetrationSpinMaster { get; set; }
/// <summary>
/// количество метров пробуренных с включенным torqueMaster
/// </summary>
public double? PenetrationTorkMaster { get; set; }
/// <summary>
/// Количество запусков МСЕ
/// </summary>
public int CountLaunchesMSE { get; set; }
/// <summary>
/// КНБК описание
/// </summary>
public string BHADescription { get; set; }
/// <summary>
/// Нормативное время на одну операцию по подготовке ствола скважины к наращиванию
/// </summary>
public double? StandardTimeBarrelPreparation { get; set; }
/// <summary>
/// Нормативное время на одну операцию по наращиванию
/// </summary>
public double? StandardTimeExtension { get; set; }
/// <summary>
/// Фактическое время проработок при подготовке ствола скважины к наращиванию.
/// </summary>
public double? ActualTimeBarrelPreparation { get; set; }
/// <summary>
/// Фактическое время наращиваний
/// </summary>
public double? ActualTimeExtension { get; set; }
/// <summary>
/// Режимы бурения в роторе
/// </summary>
public IEnumerable<string> RotorDrillingModes { get; set; }
/// <summary>
/// режимы бурения в слайде
/// </summary>
public IEnumerable<string> SlideDrillingModes { get; set; }
/// <summary>
/// Количество метров пробуренных в роторе за отчетный период
/// </summary>
public double? PenetrationInRotor { get; set; }
/// <summary>
/// Количество часов бурения в роторе за отчетный период
/// </summary>
public double? NumberDrillingHours { get; set; }
/// <summary>
/// средний диф перепад в роторе за отчетный период
/// </summary>
public double? AVGDiffDropRotor { get; set; }
/// <summary>
/// количество метров пробуренных в слайде за отчетный период
/// </summary>
public double? PenetrationInSlide { get; set; }
/// <summary>
/// время бурения в роторе за отчетный период
/// </summary>
public double? DrillingTimeInRotor { get; set; }
/// <summary>
/// средний диф. перепад в слайде за отчетный период
/// </summary>
public double? AVGDiffPressureSlide { get; set; }
/// <summary>
/// Плановая МСП за секцию
/// </summary>
public double? SectionROPPlan { get; set; }
/// <summary>
/// Общее время бурения за секцию
/// </summary>
public double? SectionDrillingTimeTotal { get; set; }
/// <summary>
/// Общая проходка за секцию
/// </summary>
public double? SectionPenetrationTotal { get; set; }
/// <summary>
/// Количество наращиваний за отчетный период
/// </summary>
public int ExtensionsCount { get; set; }
/// <summary>
/// Отклонение относительно ГГД
/// </summary>
public double? DeviationFromTVD { get; set; }
/// <summary>
/// указываются все причины, которые влияют на снижение МСП.
/// </summary>
public string DeclinesReasonsROP { get; set; }
/// <summary>
/// ФИО Мастера буровой
/// </summary>
public string DrillingMaster { get; set; }
/// <summary>
/// ФИО супервайзера
/// </summary>
public string Supervisor { get; set; }
}
}

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudDb.Model.DailyReportDB
{
public class DailyReportBha
{

View File

@ -1,7 +1,7 @@
using System;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using AsbCloudApp.Data.DailyReportModel;
namespace AsbCloudDb.Model.DailyReportDB
{
#nullable disable
@ -15,7 +15,7 @@ namespace AsbCloudDb.Model.DailyReportDB
public DateTimeOffset StartDate { get; set; }
[Column("blockHead", TypeName = "jsonb"), Comment("1 блок параметров для отчёта")]
public DailyReportHead BlockHead { get; set; }
public DailyReportInfo BlockHead { get; set; }
[Column("blockBha", TypeName = "jsonb"), Comment("2 блок параметров для отчёта")]
public DailyReportBha BlockBha { get; set; }

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudDb.Model.DailyReportDB
{
public class DailyReportDimensionless
{

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudDb.Model.DailyReportDB
{
public class DailyReportHead
{

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudDb.Model.DailyReportDB
{
public class DailyReportSaub
{

View File

@ -1,5 +1,5 @@
using System;
namespace AsbCloudApp.Data.DailyReportModel
namespace AsbCloudDb.Model.DailyReportDB
{
public class DailyReportSign
{

View File

@ -0,0 +1,103 @@
using System;
namespace AsbCloudDb.Model.DailyReportDB
{
public class DailyReportTimeBalance
{
/// <summary>
/// Бурение
/// </summary>
public string Drilling { get; set; }
/// <summary>
/// Промывка
/// </summary>
public string Flushing { get; set; }
/// <summary>
/// Наращивание
/// </summary>
public string Building { get; set; }
/// <summary>
/// Проработка
/// </summary>
public string Elaboration { get; set; }
/// <summary>
/// Расширка
/// </summary>
public string Extension { get; set; }
/// <summary>
/// Ремонт
/// </summary>
public string Repair { get; set; }
/// <summary>
/// КНБК
/// </summary>
public string Knbk { get; set; }
/// <summary>
/// СПО
/// </summary>
public string Spo { get; set; }
/// <summary>
/// ПЗР
/// </summary>
public string Pzr { get; set; }
/// <summary>
/// ПВО
/// </summary>
public string Pvo { get; set; }
/// <summary>
/// ПГР
/// </summary>
public string Pgr { get; set; }
/// <summary>
/// ГИС
/// </summary>
public string Gis { get; set; }
/// <summary>
/// ОЗЦ
/// </summary>
public string Ozc { get; set; }
/// <summary>
/// Тех. работы
/// </summary>
public string EngineeringWorks { get; set; }
/// <summary>
/// Снятие замера
/// </summary>
public string TakingMeasure { get; set; }
/// <summary>
/// Цементирование
/// </summary>
public string Cementing { get; set; }
/// <summary>
/// Простой
/// </summary>
public string Simple { get; set; }
/// <summary>
/// НПВ
/// </summary>
public string Npv { get; set; }
}
}

View File

@ -1,215 +1,18 @@
using System;
using System.Collections.Generic;
using AsbCloudDb.Model.DailyReportDB;
namespace AsbCloudDb.Model
{
#nullable disable
public class DailyReportInfo
{
/// <summary>
/// название скважины
/// </summary>
public string WellName { get; set; }
/// <summary>
/// название куста
/// </summary>
public string ClusterName { get; set; }
/// <summary>
/// заказчик
/// </summary>
public string Customer { get; set; }
/// <summary>
/// подрядчик
/// </summary>
public string Contractor { get; set; }
/// <summary>
/// дата рапорта
/// </summary>
public DateTimeOffset ReportDate { get; set; }
/// <summary>
/// глубина забоя на дату начала интервала
/// </summary>
public double? WellDepthIntervalStartDate { get; set; }
/// <summary>
/// глубина забоя на дату окончания интервала
/// </summary>
public double? WellDepthIntervalFinishDate { get; set; }
/// <summary>
/// Глубина забоя по стволу на окончание отчетного периода
/// </summary>
public double? BottomholeDepth { get; set; }
/// <summary>
/// Глубина забоя по вертикали на дату окончания отчетного периода
/// </summary>
public double? VerticalDepth { get; set; }
/// <summary>
/// Зенитный угол на дату окончания отчетного периода
/// </summary>
public double? ZenithAngle { get; set; }
/// <summary>
/// Азимутальный угол на дату окончания отчетного периода
/// </summary>
public double? AzimuthAngle { get; set; }
/// <summary>
/// ФИО бурильщиков
/// </summary>
public string FirstDriller { get; set; }
/// <summary>
/// ФИО бурильщиков
/// </summary>
public string SecondDriller { get; set; }
/// <summary>
/// Время работы АПД
/// </summary>
public double? WorkTimeSAUB { get; set; }
/// <summary>
/// Время работы спин мастер
/// </summary>
public double? WorkTimeSpinMaster { get; set; }
/// <summary>
/// Время работы torqueMaster
/// </summary>
public double? WorkTimeTorkMaster { get; set; }
/// <summary>
/// количество метров пробуренных с включенным АПД
/// </summary>
public double? PenetrationSAUB { get; set; }
/// <summary>
/// количество метров пробуренных с включенным Спин мастер
/// </summary>
public double? PenetrationSpinMaster { get; set; }
/// <summary>
/// количество метров пробуренных с включенным torqueMaster
/// </summary>
public double? PenetrationTorkMaster { get; set; }
/// <summary>
/// Количество запусков МСЕ
/// </summary>
public int CountLaunchesMSE { get; set; }
/// <summary>
/// КНБК описание
/// </summary>
public string BHADescription { get; set; }
/// <summary>
/// Нормативное время на одну операцию по подготовке ствола скважины к наращиванию
/// </summary>
public double? StandardTimeBarrelPreparation { get; set; }
/// <summary>
/// Нормативное время на одну операцию по наращиванию
/// </summary>
public double? StandardTimeExtension { get; set; }
/// <summary>
/// Фактическое время проработок при подготовке ствола скважины к наращиванию.
/// </summary>
public double? ActualTimeBarrelPreparation { get; set; }
/// <summary>
/// Фактическое время наращиваний
/// </summary>
public double? ActualTimeExtension { get; set; }
/// <summary>
/// Режимы бурения в роторе
/// </summary>
public IEnumerable<string> RotorDrillingModes { get; set; }
/// <summary>
/// режимы бурения в слайде
/// </summary>
public IEnumerable<string> SlideDrillingModes { get; set; }
/// <summary>
/// Количество метров пробуренных в роторе за отчетный период
/// </summary>
public double? PenetrationInRotor { get; set; }
/// <summary>
/// Количество часов бурения в роторе за отчетный период
/// </summary>
public double? NumberDrillingHours { get; set; }
/// <summary>
/// средний диф перепад в роторе за отчетный период
/// </summary>
public double? AVGDiffDropRotor { get; set; }
/// <summary>
/// количество метров пробуренных в слайде за отчетный период
/// </summary>
public double? PenetrationInSlide { get; set; }
/// <summary>
/// время бурения в роторе за отчетный период
/// </summary>
public double? DrillingTimeInRotor { get; set; }
/// <summary>
/// средний диф перепад в слайде за отчетный период
/// </summary>
public double? AVGDiffPressureSlide { get; set; }
/// <summary>
/// Плановая МСП за секцию
/// </summary>
public double? SectionROPPlan { get; set; }
/// <summary>
/// Общее время бурения за секцию
/// </summary>
public double? SectionDrillingTimeTotal { get; set; }
/// <summary>
/// Общая проходка за секцию
/// </summary>
public double? SectionPenetrationTotal { get; set; }
/// <summary>
/// Количество наращиваний за отчетный период
/// </summary>
public int ExtensionsCount { get; set; }
/// <summary>
/// Отклонение относительно ГГД
/// </summary>
public double? DeviationFromTVD { get; set; }
/// <summary>
/// указываются все причины, которые влияют на снижение МСП.
/// </summary>
public string DeclinesReasonsROP { get; set; }
/// <summary>
/// ФИО Мастера буровой
/// </summary>
public string DrillingMaster { get; set; }
/// <summary>
/// ФИО супервайзера
/// </summary>
public string Supervisor { get; set; }
public DailyReportHead HeadInfo { get; set; }
public DailyReportBha BhaDto { get; set; }
public DailyReportDimensionless DimensionlessInfo { get; set; }
public DailyReportTimeBalance TimeBalanceInfo { get; set; }
public DailyReportSaub SaubInfo { get; set; }
public DailyReportSign SignInfo { get; set; }
}
}

View File

@ -1,95 +1,7 @@
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks;
using ClosedXML.Excel;
using System.Linq;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport
{
internal class BlockHeader : BlockAbstract
{
private readonly DailyReportHeadDto blockDto;
public CellAddress AddressTitle { get; }
public CellAddress AddressCustomer { get; }
public CellAddress AddressDriller { get; }
public CellAddress AddressPeriod { get; }
public CellAddress AddressExampleData1 { get; }
public CellAddress[] AddressesExampleDataArray { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockBegin { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockEnd { get; }
public BlockHeader(CellAddress addressBlockBegin, DailyReportHeadDto blockDto)
{
AddressBlockBegin = addressBlockBegin.Copy();
this.blockDto = blockDto;
AddressTitle = addressBlockBegin + (0, 0);
AddressCustomer = addressBlockBegin + (1,0);
AddressDriller = addressBlockBegin + (2, 0);
AddressPeriod = addressBlockBegin + (3, 0);
AddressExampleData1 = addressBlockBegin + (5, 0);
AddressesExampleDataArray = new CellAddress[5];
for (int i = 0; i < 5; i++)
AddressesExampleDataArray[i] = addressBlockBegin + (6 + i, 0);
AddressBlockEnd = AddressesExampleDataArray.Last();
}
public override void Draw(IXLWorksheet sheet)
{
// значение в одну ячейку
sheet.Cell(AddressTitle)
._SetValue($"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}")
.Style.SetH1();
// значение в несколько ячеек с объединением
sheet._Range(AddressCustomer, AddressCustomer + (0,7))
._SetValue($"Заказчик: {blockDto.Customer}");
sheet.Cell(AddressDriller)
._SetValue($"Подрядчик: {blockDto.Contractor}");
sheet._Range(AddressExampleData1, AddressExampleData1 + (0, 4))
._SetValue(blockDto.BottomholeDepth); // для примера с будущей формулой
}
}
internal class BlockWithFormula : BlockAbstract
{
private readonly HeadBlock blockHeader;
public override CellAddress AddressBlockBegin { get; }
public override CellAddress AddressBlockEnd { get; }
public CellAddress AddressFomulaExample { get; set; }
public BlockWithFormula(CellAddress addressBlockBegin, HeadBlock blockHeader)
{
AddressFomulaExample = addressBlockBegin + (0, 0);
AddressBlockBegin = addressBlockBegin.Copy();
AddressBlockEnd = addressBlockBegin + (1, 0);
this.blockHeader = blockHeader;
}
public override void Draw(IXLWorksheet sheet)
{
// var formula = string.Format("{0}/5", blockHeader.AddressExampleData1.ToString());
// sheet.Cell(AddressFomulaExample)
// .SetFormulaA1(formula);
}
}
abstract class BlockAbstract
{
public abstract CellAddress AddressBlockBegin { get; }

View File

@ -1,5 +1,5 @@
using System;
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudApp.Data.DailyReport;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
@ -10,24 +10,14 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
private readonly DailyReportBhaDto blockDto;
public CellAddress AddressBhaDescription { get; }
public CellAddress AddressOperationTitle { get; }
public CellAddress AddressDurationTitle { get; }
public CellAddress AddressTotalTitle { get; }
public CellAddress[] AddressOperationData { get; }
public CellAddress[] AddressDurationDataStart { get; }
public CellAddress[] AddressDurationDataFinish { get; }
public CellAddress[] AddressTotaData { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockBegin { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockEnd { get; }
public BhaBlock(CellAddress addressBlockBegin, DailyReportBhaDto blockDto)
@ -40,36 +30,29 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
AddressDurationTitle = addressBlockBegin + (3, 5);
AddressTotalTitle = addressBlockBegin + (3, 7);
AddressOperationData = new CellAddress[5];
AddressOperationData[0] = addressBlockBegin + (4, 0);
AddressOperationData[1] = addressBlockBegin + (5, 0);
AddressOperationData[2] = addressBlockBegin + (6, 0);
AddressOperationData[3] = addressBlockBegin + (7, 0);
AddressOperationData[4] = addressBlockBegin + (8, 0);
AddressDurationDataStart = new CellAddress[5];
AddressDurationDataStart[0] = addressBlockBegin + (4, 5);
AddressDurationDataStart[1] = addressBlockBegin + (5, 5);
AddressDurationDataStart[2] = addressBlockBegin + (6, 5);
AddressDurationDataStart[3] = addressBlockBegin + (7, 5);
AddressDurationDataStart[4] = addressBlockBegin + (8, 5);
AddressDurationDataFinish = new CellAddress[5];
AddressDurationDataFinish[0] = addressBlockBegin + (4, 6);
AddressDurationDataFinish[1] = addressBlockBegin + (5, 6);
AddressDurationDataFinish[2] = addressBlockBegin + (6, 6);
AddressDurationDataFinish[3] = addressBlockBegin + (7, 6);
AddressDurationDataFinish[4] = addressBlockBegin + (8, 6);
AddressTotaData = new CellAddress[5];
AddressTotaData[0] = addressBlockBegin + (4, 7);
AddressTotaData[1] = addressBlockBegin + (5, 7);
AddressTotaData[2] = addressBlockBegin + (6, 7);
AddressTotaData[3] = addressBlockBegin + (7, 7);
AddressTotaData[4] = addressBlockBegin + (8, 7);
AddressBlockEnd = AddressTotaData[4];
}
@ -83,15 +66,12 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
sheet._Range(AddressBhaDescription, AddressBhaDescription + (0, 7))
._SetValue($"{blockDto.BHADescription}");
sheet._Range(AddressOperationTitle, AddressOperationTitle + (0, 4))
._SetValue("Выполняемые операции в отчетный период, комментарии:");
sheet._Range(AddressDurationTitle, AddressDurationTitle + (0, 1))
._SetValue("Продолжительность, ч. ");
sheet.Cell(AddressTotalTitle)
._SetValue("Итого");
sheet._Range(AddressOperationData[0], AddressOperationData[0] + (0, 4))
._SetValue("Бурение с наращиваниями в инт. 2195-2763м.");
sheet.Cell(AddressDurationDataStart[0])
@ -100,7 +80,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.ExtensionDrillingOneFinish}");
sheet.Cell(AddressTotaData[0])
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[0], AddressDurationDataFinish[0])}");
sheet._Range(AddressOperationData[1], AddressOperationData[1] + (0, 4))
._SetValue("Промывка.");
sheet.Cell(AddressDurationDataStart[1])
@ -109,7 +88,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.SluiceBegin}");
sheet.Cell(AddressTotaData[1])
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[1], AddressDurationDataFinish[1])}");
sheet._Range(AddressOperationData[2], AddressOperationData[2] + (0, 4))
._SetValue("Подъем КНБК в инт. 2763-2442м.");
sheet.Cell(AddressDurationDataStart[2])
@ -118,7 +96,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.ClimbFinish}");
sheet.Cell(AddressTotaData[2])
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[2], AddressDurationDataFinish[2])}");
sheet._Range(AddressOperationData[3], AddressOperationData[3] + (0, 4))
._SetValue("Спуск КНБК в инт. 2442-2763м.");
sheet.Cell(AddressDurationDataStart[3])
@ -127,7 +104,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.DescentFinish}");
sheet.Cell(AddressTotaData[3])
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[3], AddressDurationDataFinish[3])}");
sheet._Range(AddressOperationData[4], AddressOperationData[4] + (0, 4))
._SetValue("Бурение с наращиваниями в инт. 2763-2850м.");
sheet.Cell(AddressDurationDataStart[4])
@ -136,8 +112,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.ExtensionDrillingTwoFinish}");
sheet.Cell(AddressTotaData[4])
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[4], AddressDurationDataFinish[4])}");
}
}
}

View File

@ -1,5 +1,5 @@
using System;
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudApp.Data.DailyReport;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
@ -9,50 +9,106 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
private readonly DailyReportDimensionlessDto blockDto;
public CellAddress AddressBhaDescription { get; }
public CellAddress[] AddressPeriodTableDataArray { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
private readonly SaubBlock saubBlock;
public CellAddress AddressDimensionTitle { get; }
public CellAddress AddressPreparationTitle { get; }
public CellAddress AddressExtensionTitle { get; }
public CellAddress AddressPreparationDescription { get; }
public CellAddress AddressExtensionDescription { get; }
public CellAddress[] AddressPreparationHead { get; }
public CellAddress[] AddressPreparationValue { get; }
public CellAddress[] AddressExtensionHead { get; }
public CellAddress[] AddressExtensionValue { get; }
public CellAddress AddressBlockFormula { get; }
public override CellAddress AddressBlockBegin { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockEnd { get; }
public DimensionlessBlock(CellAddress addressBlockBegin, DailyReportDimensionlessDto blockDto)
{
AddressBlockBegin = addressBlockBegin.Copy();
this.blockDto = blockDto;
AddressBhaDescription = addressBlockBegin + (0, 0);
AddressDimensionTitle = addressBlockBegin + (2, 3);
AddressPreparationTitle = addressBlockBegin + (3, 1);
AddressExtensionTitle = addressBlockBegin + (3, 4);
AddressPreparationHead = new CellAddress[4];
AddressPreparationHead[0] = addressBlockBegin + (4, 1);
AddressPreparationHead[1] = addressBlockBegin + (5, 1);
AddressPreparationHead[2] = addressBlockBegin + (6, 1);
AddressPreparationHead[3] = addressBlockBegin + (7, 1);
AddressPreparationValue = new CellAddress[4];
AddressPreparationValue[0] = addressBlockBegin + (4, 3);
AddressPreparationValue[1] = addressBlockBegin + (5, 3);
AddressPreparationValue[2] = addressBlockBegin + (6, 3);
AddressPreparationValue[3] = addressBlockBegin + (7, 3);
AddressPreparationDescription = addressBlockBegin + (8, 1);
AddressExtensionHead = new CellAddress[4];
AddressExtensionHead[0] = addressBlockBegin + (4, 4);
AddressExtensionHead[1] = addressBlockBegin + (5, 4);
AddressExtensionHead[2] = addressBlockBegin + (6, 4);
AddressExtensionHead[3] = addressBlockBegin + (7, 4);
AddressExtensionValue = new CellAddress[4];
AddressExtensionValue[0] = addressBlockBegin + (4, 6);
AddressExtensionValue[1] = addressBlockBegin + (5, 6);
AddressExtensionValue[2] = addressBlockBegin + (6, 6);
AddressExtensionValue[3] = addressBlockBegin + (7, 6);
AddressExtensionDescription = addressBlockBegin + (8, 4);
AddressBlockEnd = addressBlockBegin + (9,0);
}
//AddressExampleData1 = addressBlockBegin + (5, 0);
private string FormulaBlockPlan(CellAddress cellTarget)
{
return $"={cellTarget}/60*{saubBlock.AddressBhaWithFormula}";
}
//AddressBlockEnd = AddressesExampleDataArray.Last();
private string FormulaBlockExcess(CellAddress cellFact, CellAddress cellPlan)
{
return $"={cellFact}-{cellPlan}";
}
public override void Draw(IXLWorksheet sheet)
{
// sheet.Range(AddressBhaDescription, AddressBhaDescription + (0, 7))
// ._SetValue($"{blockDto.BHADescription}");
// sheet._Range(AddressExampleData1, AddressExampleData1 + (0, 4))
// ._SetValue(blockDto.BottomholeDepth); // для примера с будущей формулой
sheet._Range(AddressDimensionTitle, AddressDimensionTitle + (0, 1))
._SetValue("БЕЗМЕТРАЖНЫЕ РАБОТЫ");
sheet._Range(AddressPreparationTitle, AddressPreparationTitle + (0, 2))
._SetValue("Подготовка ствола скв. к наращиванию");
sheet._Range(AddressExtensionTitle, AddressExtensionTitle + (0, 2))
._SetValue("Наращивание");
sheet._Range(AddressPreparationHead[0], AddressPreparationHead[0] + (0, 1))
._SetValue("Норматив на одну операцию, (мин):");
sheet.Cell(AddressPreparationValue[0])
._SetValue($"{blockDto.StandardTimeBarrelPreparation}");
sheet._Range(AddressPreparationHead[1], AddressPreparationHead[1] + (0, 1))
._SetValue("Проработка при бур, план (ч):");
sheet.Cell(AddressPreparationValue[1])
.SetFormulaA1($"{FormulaBlockPlan(AddressPreparationValue[0])}");
sheet._Range(AddressPreparationHead[2], AddressPreparationHead[2] + (0, 1))
._SetValue("Проработка при бур, факт (ч):");
sheet.Cell(AddressPreparationValue[2])
._SetValue($"{blockDto.StandardTimeExtension}");
sheet._Range(AddressPreparationHead[3], AddressPreparationHead[3] + (0, 1))
._SetValue("Превышение плановых норм, (ч):");
sheet.Cell(AddressPreparationValue[3])
.SetFormulaA1($"{FormulaBlockExcess(AddressPreparationValue[2], AddressPreparationValue[1])}");
sheet._Range(AddressExtensionHead[0], AddressExtensionHead[0] + (0, 1))
._SetValue("Норматив на одну операцию, (мин):");
sheet.Cell(AddressExtensionValue[0])
._SetValue($"{blockDto.StandardTimeExtension}");
sheet._Range(AddressExtensionHead[1], AddressExtensionHead[1] + (0, 1))
._SetValue("Наращивание, план (ч):");
sheet.Cell(AddressExtensionValue[1])
.SetFormulaA1($"{FormulaBlockPlan(AddressExtensionValue[0])}");
sheet._Range(AddressExtensionHead[2], AddressExtensionHead[2] + (0, 1))
._SetValue("Наращивание, факт (ч):");
sheet.Cell(AddressExtensionValue[2])
._SetValue($"{blockDto.ActualTimeExtension}");
sheet._Range(AddressExtensionHead[3], AddressExtensionHead[3] + (0, 1))
._SetValue("Превышение плановых норм, (ч):");
sheet.Cell(AddressExtensionValue[3])
.SetFormulaA1($"{FormulaBlockExcess(AddressExtensionValue[2], AddressExtensionValue[1])}");
sheet._Range(AddressPreparationDescription, AddressPreparationDescription + (1, 2))
._SetValue("Подготовка ствола скв. к наращиванию");
sheet._Range(AddressExtensionDescription, AddressExtensionDescription + (1, 2))
._SetValue("Наращивание");
}
}

View File

@ -1,7 +1,5 @@
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks;
using AsbCloudApp.Data.DailyReport;
using ClosedXML.Excel;
using System.Linq;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
@ -20,39 +18,21 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
public CellAddress AddressDrillerOne { get; }
public CellAddress AddressDrillerTwoTitle { get; }
public CellAddress AddressDrillerTwo { get; }
public CellAddress AddressWorkSaubTitle { get; }
public CellAddress AddressWatchTitle { get; }
public CellAddress AddressMetreTitle { get; }
public CellAddress[] AddressWorkSaubData { get; }
public CellAddress[] AddressWatchData { get; }
public CellAddress[] AddressMetreData { get; }
public CellAddress[] AddressPeriodTableHeadArray { get; }
public CellAddress[] AddressPeriodTableDataArray { get; }
public CellAddress[] AddressTrajectoryTableHeadArray { get; }
public CellAddress[] AddressTrajectoryTableDataArray { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockBegin { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockEnd { get; }
public void WriteRowToArray(CellAddress[] cellsArray, CellAddress startCells)
{
}
public override CellAddress AddressBlockEnd { get; }
public HeadBlock(CellAddress addressBlockBegin, DailyReportHeadDto blockDto)
{
AddressBlockBegin = addressBlockBegin.Copy();
this.blockDto = blockDto;
AddressTitle = addressBlockBegin + (0, 0);
AddressCustomer = addressBlockBegin + (1, 0);
@ -87,24 +67,20 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
AddressWorkSaubTitle = addressBlockBegin + (15, 0);
AddressWatchTitle = addressBlockBegin + (15, 3);
AddressMetreTitle = addressBlockBegin + (15, 4);
AddressWorkSaubData = new CellAddress[4];
AddressWorkSaubData[0] = addressBlockBegin + (16, 0);
AddressWorkSaubData[1] = addressBlockBegin + (17, 0);
AddressWorkSaubData[2] = addressBlockBegin + (18, 0);
AddressWorkSaubData[3] = addressBlockBegin + (19, 0);
AddressWatchData = new CellAddress[4];
AddressWatchData[0] = addressBlockBegin + (16, 3);
AddressWatchData[1] = addressBlockBegin + (17, 3);
AddressWatchData[2] = addressBlockBegin + (18, 3);
AddressWatchData[3] = addressBlockBegin + (19, 3);
AddressMetreData = new CellAddress[4];
AddressMetreData[0] = addressBlockBegin + (16, 4);
AddressMetreData[1] = addressBlockBegin + (17, 4);
AddressMetreData[2] = addressBlockBegin + (18, 4);
AddressBlockEnd = AddressWatchData[3]+(0,1);
}
@ -114,22 +90,17 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
sheet._Range(AddressTitle, AddressTitle + (0, 7))
._SetValue($"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}")
.Style.SetH1();
.Style.SetH1();
sheet._Range(AddressCustomer, AddressCustomer + (0, 7))
._SetValue($"Заказчик: {blockDto.Customer}")
.Style.SetH1();
sheet._Range(AddressDriller, AddressDriller + (0, 7))
._SetValue($"Подрядчик: {blockDto.Contractor}")
.Style.SetH1();
sheet._Range(AddressPeriod, AddressPeriod + (0, 3))
._SetValue("Отчетный период");
sheet._Range(AddressSlaughter, AddressSlaughter + (0, 3))
._SetValue("Забой за отчетный период, м");
sheet._Range(AddressPeriodTableHeadArray[0], AddressPeriodTableHeadArray[0] + (0, 1))
._SetValue("От (дата, время)");
sheet._Range(AddressPeriodTableHeadArray[1], AddressPeriodTableHeadArray[1] + (0, 1))
@ -138,19 +109,17 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue("От");
sheet._Range(AddressPeriodTableHeadArray[3], AddressPeriodTableHeadArray[3] + (0, 1))
._SetValue("До");
sheet._Range(AddressPeriodTableDataArray[0], AddressPeriodTableDataArray[0] + (0, 1))
._SetValue($"{blockDto.ReportDate}");
sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1))
._SetValue("До (дата, время)");
sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1));
sheet.Cell(AddressPeriodTableDataArray[1])
.SetFormulaA1($"={AddressPeriodTableDataArray[0].ToString()}-1");
sheet._Range(AddressPeriodTableDataArray[2], AddressPeriodTableDataArray[2] + (0, 1))
._SetValue($"{blockDto.WellDepthIntervalStartDate}");
sheet._Range(AddressPeriodTableDataArray[3], AddressPeriodTableDataArray[3] + (0, 1))
._SetValue($"{blockDto.WellDepthIntervalFinishDate}");
sheet._Range(AddressTrajectoryTableTitle, AddressTrajectoryTableTitle + (0, 7))
._SetValue("Данные по траектории скважины на конец суток");
sheet._Range(AddressTrajectoryTableHeadArray[0], AddressTrajectoryTableHeadArray[0] + (0, 1))
._SetValue("Глубина по стволу");
sheet._Range(AddressTrajectoryTableHeadArray[1], AddressTrajectoryTableHeadArray[1] + (0, 1))
@ -159,7 +128,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue("Зенитный угол");
sheet._Range(AddressTrajectoryTableHeadArray[3], AddressTrajectoryTableHeadArray[3] + (0, 1))
._SetValue("Азимут");
sheet._Range(AddressTrajectoryTableDataArray[0], AddressTrajectoryTableDataArray[0] + (0, 1))
._SetValue($"{blockDto.BottomholeDepth}");
sheet._Range(AddressTrajectoryTableDataArray[1], AddressTrajectoryTableDataArray[1] + (0, 1))
@ -168,7 +136,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.ZenithAngle}");
sheet._Range(AddressTrajectoryTableDataArray[3], AddressTrajectoryTableDataArray[3] + (0, 1))
._SetValue($"{blockDto.AzimuthAngle}");
sheet._Range(AddressDrillerOneTitle, AddressDrillerOneTitle + (0, 1))
._SetValue("Бурильщик 1 смена");
sheet._Range(AddressDrillerOne, AddressDrillerOne + (0, 1))
@ -177,40 +144,34 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue("Бурильщик 2 смена");
sheet._Range(AddressDrillerTwo, AddressDrillerTwo + (0, 1))
._SetValue($"{blockDto.SecondDriller}");
sheet._Range(AddressWorkSaubTitle, AddressWorkSaubTitle + (0, 2))
._SetValue("Работа модулей САУБ:");
sheet.Cell(AddressWatchTitle)
._SetValue("Часов:");
sheet.Cell(AddressMetreTitle)
._SetValue("Метров:");
sheet._Range(AddressWorkSaubData[0], AddressWorkSaubData[0] + (0, 2))
._SetValue("АПД (автоматическая подача долота), ч/м:");
sheet.Cell(AddressWatchData[0])
._SetValue($"{blockDto.WorkTimeSAUB}");
sheet.Cell(AddressMetreData[0])
._SetValue($"{blockDto.PenetrationSAUB}");
sheet._Range(AddressWorkSaubData[1], AddressWorkSaubData[1] + (0, 2))
._SetValue("Спин Мастер (осцилляция),ч/м:");
sheet.Cell(AddressWatchData[1])
._SetValue($"{blockDto.WorkTimeSpinMaster}");
sheet.Cell(AddressMetreData[1])
._SetValue($"{blockDto.PenetrationTorkMaster}");
sheet._Range(AddressWorkSaubData[2], AddressWorkSaubData[2] + (0, 2))
._SetValue("Торк Мастер (демпфирование), ч/:");
sheet.Cell(AddressWatchData[2])
._SetValue($"{blockDto.WorkTimeTorkMaster}");
sheet.Cell(AddressMetreData[2])
._SetValue($"{blockDto.PenetrationTorkMaster}");
sheet._Range(AddressWorkSaubData[3], AddressWorkSaubData[3] + (0, 2))
._SetValue("МСЕ, колличество запусков, раз:");
sheet._Range(AddressWatchData[3], AddressWatchData[3] + (0, 1))
._SetValue($"{blockDto.CountLaunchesMSE}");
}
}
}

View File

@ -1,5 +1,5 @@
using System;
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudApp.Data.DailyReport;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
@ -9,7 +9,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
private readonly DailyReportSaubDto blockDto;
public CellAddress AddressBhaDescription { get; }
public CellAddress AddressBhaWithFormula { get; }
public CellAddress[] AddressPeriodTableDataArray { get; }
@ -28,7 +28,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
{
AddressBlockBegin = addressBlockBegin.Copy();
this.blockDto = blockDto;
AddressBhaDescription = addressBlockBegin + (0, 0);
AddressBhaWithFormula = addressBlockBegin + (0, 0);
//AddressExampleData1 = addressBlockBegin + (5, 0);

View File

@ -1,5 +1,5 @@
using System;
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudApp.Data.DailyReport;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
@ -13,16 +13,8 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
public CellAddress AddressDrillMaster { get; }
public CellAddress AddressSupervisorHead { get; }
public CellAddress AddressSupervisor { get; }
public CellAddress[] AddressPeriodTableDataArray { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockBegin { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public CellAddress[] AddressPeriodTableDataArray { get; }
public override CellAddress AddressBlockBegin { get; }
public override CellAddress AddressBlockEnd { get; }
public SignBlock(CellAddress addressBlockBegin, DailyReportSignDto blockDto)
@ -38,7 +30,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
public override void Draw(IXLWorksheet sheet)
{
sheet.Range(AddressDrillMasterHead, AddressDrillMasterHead + (0, 2))
._SetValue("Мастер буровой ");
sheet.Range(AddressDrillMaster, AddressDrillMaster + (0, 2))
@ -47,7 +38,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue("Супервайзер ");
sheet.Range(AddressSupervisor, AddressSupervisor + (0, 2))
._SetValue($"{blockDto.Supervisor}");
}
}

View File

@ -17,55 +17,38 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
public CellAddress AddressElaboration { get; set; }
public CellAddress AddressExtension { get; set; }
public CellAddress AddressRepair { get; set; }
public CellAddress AddressDrillingValue { get; set; }
public CellAddress AddressFlushingValue { get; set; }
public CellAddress AddressBuildingValue { get; set; }
public CellAddress AddressElaborationValue { get; set; }
public CellAddress AddressExtensionValue { get; set; }
public CellAddress AddressRepairValue { get; set; }
public CellAddress AddressKnbk { get; set; }
public CellAddress AddressSpo { get; set; }
public CellAddress AddressPzr { get; set; }
public CellAddress AddressPvo { get; set; }
public CellAddress AddressPgr { get; set; }
public CellAddress AddressGis { get; set; }
public CellAddress AddressKnbkValue { get; set; }
public CellAddress AddressSpoValue { get; set; }
public CellAddress AddressPzrValue { get; set; }
public CellAddress AddressPvoValue { get; set; }
public CellAddress AddressPgrValue { get; set; }
public CellAddress AddressGisValue { get; set; }
public CellAddress AddressOzc { get; set; }
public CellAddress AddressEngineeringWorks { get; set; }
public CellAddress AddressTakingMeasure { get; set; }
public CellAddress AddressCementing { get; set; }
public CellAddress AddressSimple { get; set; }
public CellAddress AddressNpv { get; set; }
public CellAddress AddressOzcValue { get; set; }
public CellAddress AddressEngineeringWorksValue { get; set; }
public CellAddress AddressTakingMeasureValue { get; set; }
public CellAddress AddressCementingValue { get; set; }
public CellAddress AddressSimpleValue { get; set; }
public CellAddress AddressNpvValue { get; set; }
public CellAddress[] AddressPeriodTableDataArray { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockBegin { get; }
/// <summary>
/// Значение нижняя правая ячейка блока
/// </summary>
public override CellAddress AddressBlockEnd { get; }
public TimeBalanceBlock(CellAddress addressBlockBegin, DailyReportTimeBalanceDto blockDto)
@ -73,49 +56,42 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
AddressBlockBegin = addressBlockBegin.Copy();
this.blockDto = blockDto;
AddressTitle = addressBlockBegin + (3, 0);
AddressDrilling = addressBlockBegin + (4, 1);
AddressFlushing = addressBlockBegin + (5, 1);
AddressBuilding = addressBlockBegin + (6, 1);
AddressElaboration = addressBlockBegin + (7, 1);
AddressExtension = addressBlockBegin + (8, 1);
AddressRepair = addressBlockBegin + (9, 1);
AddressDrillingValue = addressBlockBegin + (4, 2);
AddressFlushingValue = addressBlockBegin + (5, 2);
AddressBuildingValue = addressBlockBegin + (6, 2);
AddressElaborationValue = addressBlockBegin + (7, 2);
AddressExtensionValue = addressBlockBegin + (8, 2);
AddressRepairValue = addressBlockBegin + (9, 2);
AddressKnbk = addressBlockBegin + (4, 3);
AddressSpo = addressBlockBegin + (5, 3);
AddressPzr = addressBlockBegin + (6, 3);
AddressPvo = addressBlockBegin + (7, 3);
AddressPgr = addressBlockBegin + (8, 3);
AddressGis = addressBlockBegin + (9, 3);
AddressKnbkValue = addressBlockBegin + (4, 4);
AddressSpoValue = addressBlockBegin + (5, 4);
AddressPzrValue = addressBlockBegin + (6, 4);
AddressPvoValue = addressBlockBegin + (7, 4);
AddressPgrValue = addressBlockBegin + (8, 4);
AddressGisValue = addressBlockBegin + (9, 4);
AddressOzc = addressBlockBegin + (4, 5);
AddressEngineeringWorks = addressBlockBegin + (5, 5);
AddressTakingMeasure = addressBlockBegin + (6, 5);
AddressCementing = addressBlockBegin + (7, 5);
AddressSimple = addressBlockBegin + (8, 5);
AddressNpv = addressBlockBegin + (9, 5);
AddressOzcValue = addressBlockBegin + (4, 6);
AddressEngineeringWorksValue = addressBlockBegin + (5, 6);
AddressTakingMeasureValue = addressBlockBegin + (6, 6);
AddressCementingValue = addressBlockBegin + (7, 6);
AddressSimpleValue = addressBlockBegin + (8, 6);
AddressNpvValue = addressBlockBegin + (9, 6);
AddressBlockEnd = AddressNpvValue;
}
@ -124,7 +100,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
sheet._Range(AddressTitle, AddressTitle + (0, 1))
._SetValue("БАЛАНС ВРЕМЕНИ");
sheet.Cell(AddressDrilling)
._SetValue("Бурение");
sheet.Cell(AddressFlushing)
@ -149,7 +124,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.Extension}");
sheet.Cell(AddressRepairValue)
._SetValue($"{blockDto.Repair}");
sheet.Cell(AddressKnbk)
._SetValue("КНБК");
sheet.Cell(AddressSpo)
@ -174,7 +148,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.Pgr}");
sheet.Cell(AddressGisValue)
._SetValue($"{blockDto.Gis}");
sheet.Cell(AddressOzc)
._SetValue("ОЗЦ");
sheet.Cell(AddressEngineeringWorks)
@ -199,16 +172,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
._SetValue($"{blockDto.Simple}");
sheet.Cell(AddressNpvValue)
._SetValue($"{blockDto.Npv}");
}
}

View File

@ -9,7 +9,7 @@ using AsbCloudApp.Data;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using System.Collections.Generic;
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudApp.Data.DailyReport;
namespace AsbCloudInfrastructure.Services.DailyReport
@ -62,7 +62,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
public async Task<int> AddAsync(int idWell, DailyReportDto dto, CancellationToken token = default)
{
var offsetHours = wellService.GetTimezone(idWell).Hours;
var reportDateOffset = dto.ReportDate.ToUtcDateTimeOffset(offsetHours);
var reportDateOffset = dto.HeadDto.ReportDate.ToUtcDateTimeOffset(offsetHours);
var info = Convert(dto, offsetHours);
var entity = new AsbCloudDb.Model.DailyReport
{
@ -101,7 +101,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
if (dailyReportDto is null)
return null;
var memoryStream = dailyReportMaker.MakeReport(dailyReportDto);
var memoryStream = dailyReportMaker.MakeReportFromBlocks(dailyReportDto);
return memoryStream;
}
@ -127,12 +127,16 @@ namespace AsbCloudInfrastructure.Services.DailyReport
{
var well = await wellService.GetAsync(idWell, token);
var offsetHours = wellService.GetTimezone(idWell).Hours;
var dto = new DailyReportDto()
var headDto = new DailyReportHeadDto()
{
ReportDate = date,
WellName = well.Caption,
ClusterName = well.Cluster,
};
var dto = new DailyReportDto()
{
HeadDto = headDto
};
DailyReportDto result = dto;
return result;
}
@ -140,7 +144,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
private static DailyReportDto Convert(AsbCloudDb.Model.DailyReport entity, double offsetHours)
{
var dto = entity.Info.Adapt<DailyReportDto>();
dto.ReportDate = entity.StartDate
dto.HeadDto.ReportDate = entity.StartDate
.ToRemoteDateTime(offsetHours);
return dto;
}
@ -148,83 +152,11 @@ namespace AsbCloudInfrastructure.Services.DailyReport
private static DailyReportInfo Convert(DailyReportDto dto, double offsetHours)
{
var entity = dto.Adapt<DailyReportInfo>();
entity.ReportDate = dto.ReportDate
entity.HeadInfo.ReportDate = dto.HeadDto.ReportDate
.ToUtcDateTimeOffset(offsetHours)
.Date;
return entity;
}
// черновик реализации "по блокам"
public async Task<Stream?> MakeReportFromBlocksAsync(int idWell, DateTime date, CancellationToken token = default)
{
var dailyReportDto = await GetAsync(idWell, date, token);
if (dailyReportDto is null)
return null;
var block1 = new DailyReportHeadDto()
{
WellName = dailyReportDto.WellName,
ClusterName = dailyReportDto.ClusterName,
Customer = dailyReportDto.Customer,
Contractor = dailyReportDto.Contractor,
ReportDate = dailyReportDto.ReportDate,
WellDepthIntervalStartDate = dailyReportDto.WellDepthIntervalStartDate,
WellDepthIntervalFinishDate = dailyReportDto.WellDepthIntervalFinishDate,
BottomholeDepth = dailyReportDto.BottomholeDepth,
VerticalDepth = dailyReportDto.VerticalDepth,
ZenithAngle = dailyReportDto.ZenithAngle,
AzimuthAngle = dailyReportDto.AzimuthAngle,
FirstDriller = dailyReportDto.FirstDriller,
SecondDriller = dailyReportDto.SecondDriller,
WorkTimeSAUB = dailyReportDto.WorkTimeSAUB,
WorkTimeSpinMaster = dailyReportDto.WorkTimeSpinMaster,
WorkTimeTorkMaster = dailyReportDto.WorkTimeTorkMaster,
PenetrationSAUB = dailyReportDto.PenetrationSAUB,
PenetrationSpinMaster = dailyReportDto.PenetrationSpinMaster,
PenetrationTorkMaster = dailyReportDto.PenetrationTorkMaster,
CountLaunchesMSE = dailyReportDto.CountLaunchesMSE
};
var block2 = new DailyReportBhaDto()
{
BHADescription = dailyReportDto.BHADescription
};
var block3 = new DailyReportTimeBalanceDto();
var block4 = new DailyReportDimensionlessDto()
{
ActualTimeBarrelPreparation = dailyReportDto.ActualTimeBarrelPreparation,
ActualTimeExtension = dailyReportDto.ActualTimeExtension,
StandardTimeBarrelPreparation = dailyReportDto.StandardTimeBarrelPreparation,
StandardTimeExtension = dailyReportDto.StandardTimeExtension
};
var block5 = new DailyReportSaubDto()
{
AVGDiffDropRotor = dailyReportDto.AVGDiffDropRotor,
AVGDiffPressureSlide = dailyReportDto.AVGDiffPressureSlide,
DeclinesReasonsROP = dailyReportDto.DeclinesReasonsROP,
DeviationFromTVD = dailyReportDto.DeviationFromTVD,
DrillingTimeInRotor = dailyReportDto.DrillingTimeInRotor,
NumberDrillingHours = dailyReportDto.NumberDrillingHours,
ExtensionsCount = dailyReportDto.ExtensionsCount,
PenetrationInRotor = dailyReportDto.PenetrationInRotor,
PenetrationInSlide = dailyReportDto.PenetrationInSlide,
RotorDrillingModes = dailyReportDto.RotorDrillingModes,
SectionDrillingTimeTotal = dailyReportDto.SectionDrillingTimeTotal,
SectionPenetrationTotal = dailyReportDto.SectionPenetrationTotal,
SectionROPPlan = dailyReportDto.SectionROPPlan,
SlideDrillingModes = dailyReportDto.SlideDrillingModes
};
var block6 = new DailyReportSignDto()
{
DrillingMaster = dailyReportDto.DrillingMaster,
Supervisor = dailyReportDto.Supervisor
};
var memoryStream = dailyReportMaker.MakeReportFromBlocks(block1, block2, block3, block4, block5, block6);
return memoryStream;
}
}
}
#nullable disable
}

View File

@ -115,8 +115,8 @@ namespace AsbCloudWebApi.Tests.ServicesTests
public async Task GetDriller_by_workTime_shift1()
{
var dto = MakeScheduleDto();
dto.ShiftStart = new TimeOnly(8, 00);
dto.ShiftEnd = new TimeOnly(20, 00);
dto.ShiftStart = new TimeDto(8, 00);
dto.ShiftEnd = new TimeDto(20, 00);
var id = await scheduleService.InsertAsync(dto, CancellationToken.None);
var drillerWorkTime = new DateTime(
dto.DrillStart.Year,
@ -131,8 +131,8 @@ namespace AsbCloudWebApi.Tests.ServicesTests
public async Task GetDriller_by_workTime_shift2()
{
var dto = MakeScheduleDto();
dto.ShiftStart = new TimeOnly(20, 00);
dto.ShiftEnd = new TimeOnly(8, 00);
dto.ShiftStart = new TimeDto(20, 00);
dto.ShiftEnd = new TimeDto(8, 00);
var id = await scheduleService.InsertAsync(dto, CancellationToken.None);
var drillerWorkTime = new DateTime(
dto.DrillStart.Year,

View File

@ -1,13 +1,8 @@
using AsbCloudApp.Data.DailyReport;
using AsbCloudApp.Data.DailyReportModel;
using AsbCloudInfrastructure.EfCache;
using AsbCloudInfrastructure.Services.DailyReport;
using ClosedXML.Excel;
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp1
{
@ -19,15 +14,15 @@ namespace ConsoleApp1
{
var block = new DailyReportHeadDto()
{
AzimuthAngle=12,
WellName= "WellName",
ClusterName= "clusterName",
Customer="customer",
Contractor="Contractor",
AzimuthAngle = 12,
WellName = "WellName",
ClusterName = "clusterName",
Customer = "customer",
Contractor = "Contractor",
ReportDate = DateTime.Now,
WellDepthIntervalFinishDate= 27.5,
WellDepthIntervalStartDate= 26.5,
BottomholeDepth= 66.6
WellDepthIntervalFinishDate = 27.5,
WellDepthIntervalStartDate = 26.5,
BottomholeDepth = 66.6
};
var block2 = new DailyReportBhaDto()
{
@ -35,7 +30,7 @@ namespace ConsoleApp1
};
var block3 = new DailyReportTimeBalanceDto();
//------------- example -----------------
/*
var service = new DailyReportMakerExcel();
var stream = service.MakeReportFromBlocks(block, block2, block3,null, null, null);
var filename = "____.xlsx";
@ -45,11 +40,11 @@ namespace ConsoleApp1
stream.CopyTo(fileStream);
return;
//------------- end of example -----------------
*/
//var ms = MakeReportFromBlocks(block,block3);
////File.Create("", MakeReportFromBlocks(block));
@ -60,482 +55,8 @@ namespace ConsoleApp1
//ms.Close();
}
public static Stream MakeReportFromBlocks(DailyReportHeadDto blockHead, DailyReportSaubDto blockD)
{
using var workbook = new XLWorkbook();
FillSheet6blocks(workbook, blockHead, blockD);
MemoryStream memoryStream = new MemoryStream();
workbook.SaveAs(memoryStream, new SaveOptions { });
memoryStream.Seek(0, SeekOrigin.Begin);
return memoryStream;
}
private static String converteCellCoordinate(int row, bool isCaps, int column)
{
var c = (Char)((isCaps ? 65 : 97) + (column - 1));
string convertColumn = c.ToString();
return $"{convertColumn}{row}";
}
private static string FormulaMechanicalSpeed((int row, int col) tuple)
{
return $"=IF({converteCellCoordinate(tuple.row,true,tuple.col-2)}>0," +
$"{converteCellCoordinate(tuple.row,true,tuple.col-4)}/{converteCellCoordinate(tuple.row,true,tuple.col-2)},0)";
}
private static string FormulaDrillingWatch((int row, int col) tuple)
{
return $"=IF({converteCellCoordinate(tuple.row - 8,true,tuple.col)}+" +
$"{converteCellCoordinate(tuple.row - 4,true,tuple.col)}";
}
private static string FormulaSinking((int row, int col) tuple)
{
return $"=IF(({converteCellCoordinate(tuple.row - 4,true,tuple.col)}+{converteCellCoordinate(tuple.row - 8,true,tuple.col)})" +
$"<>({converteCellCoordinate(tuple.row - 54,true,tuple.col + 6)}-{converteCellCoordinate(tuple.row - 54,true,tuple.col + 4)}),\"ОШИБКА\"" +
$",{converteCellCoordinate(tuple.row - 4,true,tuple.col)}+{converteCellCoordinate(tuple.row - 8,true,tuple.col)})";
//return $"=IF({converteCellCoordinate(tuple.row - 8,true,tuple.col)}+" +
// $"{converteCellCoordinate(tuple.row - 4,true,tuple.col)}";
}
public static void FillSheet6blocks(XLWorkbook workbook, DailyReportHeadDto blockHead, DailyReportSaubDto blockD)
{
var sheet = workbook.Worksheets.Add(blockHead.ReportDate.ToString("dd.MM.yyyy"));
//sheet.Name = blockHead.ReportDate.ToString("dd.MM.yyyy");
var tuple = (row: 3, column: 3);
sheet.Style.Font.FontName = "TimesNewRoman";
sheet.Style.Font.FontSize = 10;
tuple = (AddBlockHead1(sheet, blockHead, (tuple.row, tuple.column)).row, AddBlockHead1(sheet, blockHead, (tuple.row, tuple.column)).column);
AddBlockBha(sheet, blockD, tuple);
//sheet.Columns().AdjustToContents(8,9);
//sheet.Rows().AdjustToContents(3,21);
}
//
private static IXLStyle SetBorder(IXLStyle style)
{
style.Border.RightBorder = XLBorderStyleValues.Thin;
style.Border.LeftBorder = XLBorderStyleValues.Thin;
style.Border.TopBorder = XLBorderStyleValues.Thin;
style.Border.BottomBorder = XLBorderStyleValues.Thin;
style.Border.InsideBorder = XLBorderStyleValues.Thin;
return style;
}
private static IXLCell SetDateTime(IXLCell cell)
{
cell.DataType = XLDataType.DateTime;
cell.Style.DateFormat.Format = "DD.MM.YYYY HH:MM:SS";
return cell;
}
private static IXLCell SetNumber(IXLCell cell)
{
cell.DataType = XLDataType.Number;
cell.Style.NumberFormat.Format = "0.00";
return cell;
}
private static IXLCell SetCell(IXLRow row, int colunm, object value, int maxChartsToWrap = 88)
{
var cell = row.Cell(colunm);
cell.Value = value;
SetBorder(cell.Style);
cell.Style.Alignment.WrapText = true;
if (value is string valueString && valueString.Length > maxChartsToWrap)
{
var baseHeight = row.Height;
row.Height = 0.82d * baseHeight * Math.Ceiling(1d + valueString.Length / maxChartsToWrap);
}
if (value is DateTime)
{
SetDateTime(cell);
}
else if (value is IFormattable)
{
SetNumber(cell);
}
return cell;
}
private static (int row, int column) AddBlockHead1(IXLWorksheet sheet, DailyReportHeadDto blockDto, (int row, int column) tupleStart)
{
var tuple = (row: tupleStart.row, column: tupleStart.column);
sheet.Cell(tuple.row, tuple.column).Value =
$"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 7).Merge();
tuple.row += 1;
sheet.Cell(tuple.row, tuple.column).Value =
$"Заказчик: {blockDto.Customer}";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 7).Merge();
tuple.row += 1;
sheet.Cell(tuple.row, tuple.column).Value =
$"Подрядчик: {blockDto.Contractor}";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 7).Merge();
tuple.row += 2;
//7,3
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Отчетный период");
tuple.column += 4;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 3).Merge();
sheet.Cell(tuple.row, tuple.column+3).Style.Border.RightBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Забой за отчетный период, м");
tuple.column = tupleStart.column;
tuple.row += 1;
//8,3
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "От (дата, время)");
tuple.column += 2; //8,5
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "До (дата, время)");
tuple.column += 2; //8,7
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "От");
tuple.column += 2; //8,9
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "До");
sheet.Cell(tuple.row, tuple.column+1).Style.Border.RightBorder = XLBorderStyleValues.Thin;
tuple.column = tupleStart.column;
tuple.row += 1; //9,3
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.ReportDate}");
tuple.column += 2;
//согласно формуле в шаблоне - ячейка С9
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "");
sheet.Cell(tuple.row,tuple.column).FormulaA1 = $"={converteCellCoordinate(tuple.row, true, tuple.column - 2)}-1";
SetDateTime(sheet.Cell(tuple.row,tuple.column));
tuple.column += 2;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.WellDepthIntervalStartDate}");
tuple.column += 2;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.WellDepthIntervalFinishDate}");
tuple.column = tupleStart.column;
tuple.row += 2; //11,3
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 7).Merge().Style.Border.RightBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Данные по траектории скважины на конец суток");
tuple.column = tupleStart.column;
tuple.row += 1;//12
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Глубина по стволу");
tuple.column += 2; //12,5
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Глубина по вертикали");
tuple.column += 2; //12,7
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Зенитный угол");
tuple.column += 2; //12,9
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge().Style.Border.RightBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Азимут");
tuple.column = tupleStart.column;
tuple.row += 1; //13,3
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.BottomholeDepth}");
tuple.column += 2;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.VerticalDepth}");
tuple.column += 2;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.ZenithAngle}");
tuple.column += 2;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge().Style.Border.RightBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.AzimuthAngle}");
tuple.column = tupleStart.column;
tuple.row += 2; //15,3
sheet.Cell(tuple.row, tuple.column).Value = "Бурильщик 1 смена";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
tuple.column += 2;
sheet.Cell(tuple.row, tuple.column).Value = $"{blockDto.FirstDriller}";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
tuple.row += 1;
tuple.column = tupleStart.column;
sheet.Cell(tuple.row, tuple.column).Value = "Бурильщик 2 смена";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
tuple.column += 2;
sheet.Cell(tuple.row, tuple.column).Value = $"{blockDto.SecondDriller}";
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge();
tuple.row += 2;
tuple.column = tupleStart.column;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 2).Merge();
SetCell(sheet.Row(tuple.row),tuple.column,"Работа модулей САУБ:");
tuple.column += 3;
SetCell(sheet.Row(tuple.row),tuple.column,"Часов:");
tuple.column += 1;
SetCell(sheet.Row(tuple.row),tuple.column, "Метров:").Style.Border.RightBorder = XLBorderStyleValues.Thin;
tuple.row += 1;
tuple.column = tupleStart.column;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 2).Merge();
SetCell(sheet.Row(tuple.row),tuple.column,"АПД (автоматическая подача долота), ч/м:");
tuple.column += 3;
SetCell(sheet.Row(tuple.row),tuple.column,$"{blockDto.WorkTimeSAUB}");
tuple.column += 1;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.PenetrationSAUB}").Style.Border.RightBorder = XLBorderStyleValues.Thin;
tuple.row += 1;
tuple.column = tupleStart.column;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 2).Merge();
SetCell(sheet.Row(tuple.row),tuple.column,"Спин Мастер (осцилляция),ч/м:");
tuple.column += 3;
SetCell(sheet.Row(tuple.row),tuple.column,$"{blockDto.WorkTimeSpinMaster}");
tuple.column += 1;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.PenetrationSpinMaster}").Style.Border.RightBorder = XLBorderStyleValues.Thin;
tuple.row += 1;
tuple.column = tupleStart.column;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 2).Merge();
SetCell(sheet.Row(tuple.row),tuple.column,"Торк Мастер (демпфирование), ч/:");
tuple.column += 3;
SetCell(sheet.Row(tuple.row),tuple.column,$"{blockDto.WorkTimeTorkMaster}");
tuple.column += 1;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.PenetrationTorkMaster}").Style.Border.RightBorder = XLBorderStyleValues.Thin;
tuple.row += 1;
tuple.column = tupleStart.column;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 2).Merge();
SetCell(sheet.Row(tuple.row),tuple.column,"МСЕ, колличество запусков, раз:");
tuple.column += 3;
sheet.Range(tuple.row, tuple.column, tuple.row, tuple.column + 1).Merge().Style.Border.RightBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.CountLaunchesMSE}");
tuple.column+=2;
return tuple;
}
private static (int row, int column) AddBlockBha(IXLWorksheet sheet, DailyReportSaubDto blockDto, (int row, int column) tupleStart)
{
tupleStart.row += 2;
tupleStart.column = 3;
var tuple = (row: tupleStart.row, column: tupleStart.column);
sheet.Range(tuple.row, tuple.column, tuple.row,tuple.column + 7).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"Бурение в роторе : {blockDto.RotorDrillingModes}");
tuple.row+=1;
sheet.Range(tuple.row, tuple.column, tuple.row,tuple.column + 7).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"Бурение в слайде : {blockDto.SlideDrillingModes}");
tuple.row+=2;
sheet.Range(tuple.row, tuple.column, tuple.row,tuple.column + 7).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Бурение в роторе (за отчетный период) с использование САУБ-1");
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Проходка");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Часы бурения");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Мех. скорость");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Среднее диф. Давление")
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.PenetrationInRotor}");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.NumberDrillingHours}");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "");
sheet.Cell(tuple.row,tuple.column).FormulaA1 = FormulaMechanicalSpeed(tuple);
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.AVGDiffDropRotor}")
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
tuple.column=tupleStart.column;
tuple.row+=2;
sheet.Range(tuple.row, tuple.column, tuple.row,tuple.column + 7).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Бурение в слайде (за отчетный период) с использование САУБ-1");
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Проходка");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Часы бурения");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Мех. скорость");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Среднее диф. Давление");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.PenetrationInSlide}");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.DrillingTimeInRotor}");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "");
sheet.Cell(tuple.row,tuple.column).FormulaA1 = FormulaMechanicalSpeed(tuple);
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.AVGDiffPressureSlide}");
tuple.column=tupleStart.column;
tuple.row+=2;
sheet.Range(tuple.row, tuple.column, tuple.row,tuple.column + 5).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Итого за отчетный период, использование САУБ-1");
tuple.column+=6;
sheet.Range(tuple.row,tuple.column, tuple.row + 1,tuple.column + 1).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "Плановая мех скорость");
tuple.column = tupleStart.column;
tuple.row += 1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Проходка");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Часы бурения");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Мех. скорость");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "");
sheet.Cell(tuple.row,tuple.column).FormulaA1 = FormulaSinking(tuple);
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "");
sheet.Cell(tuple.row,tuple.column).FormulaA1 = FormulaDrillingWatch(tuple);
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "");
tuple.column+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 1).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.SectionROPPlan}");
tuple.column=tupleStart.column;
tuple.row+=2;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Увеличение мех скорости за секцию %");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Увеличение мех скорости за сутки %");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Сокращение времени бурения за секцию, ч");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Ротор / слайд, %");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "МСП за секцию м/ч.");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, "");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Время бурения за секцию");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.SectionDrillingTimeTotal}");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Проходка за секцию");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.SectionPenetrationTotal}");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Кол- во наращиваний");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.ExtensionsCount}");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge();
SetCell(sheet.Row(tuple.row),tuple.column, "Отклонение от ГГД +/-, сут");
tuple.column+=4;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 3).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"{blockDto.DeviationFromTVD}");
tuple.column=tupleStart.column;
tuple.row+=1;
sheet.Range(tuple.row,tuple.column, tuple.row,tuple.column + 7).Merge()
.Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
SetCell(sheet.Row(tuple.row),tuple.column, $"Примечание: {blockDto.DeclinesReasonsROP}");
tuple.column += 7;
return tuple;
}
}
struct CellAddress
{
public int Col { get; set; }
public int Row { get; set; }
//public string GetExcelAddress()
//{
//}
}
}