2022-07-04 05:29:16 +05:00
|
|
|
|
using AsbCloudApp.Data.DailyReport;
|
2022-06-29 13:04:30 +05:00
|
|
|
|
using ClosedXML.Excel;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|
|
|
|
{
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-06-29 13:04:30 +05:00
|
|
|
|
internal class DimensionlessBlock : BlockAbstract
|
|
|
|
|
{
|
2022-07-25 18:02:39 +05:00
|
|
|
|
private readonly NoDrillingDto blockDto;
|
2022-06-29 13:04:30 +05:00
|
|
|
|
|
2023-04-13 11:15:45 +05:00
|
|
|
|
public SaubBlock SaubBlock { get; set; } = null!;
|
2022-07-05 11:30:25 +05:00
|
|
|
|
|
2022-06-30 16:01:46 +05:00
|
|
|
|
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; }
|
2023-04-13 11:15:45 +05:00
|
|
|
|
public CellAddress AddressBlockFormula { get; } = null!;
|
2022-06-29 13:04:30 +05:00
|
|
|
|
public override CellAddress AddressBlockBegin { get; }
|
|
|
|
|
public override CellAddress AddressBlockEnd { get; }
|
2022-07-25 18:02:39 +05:00
|
|
|
|
public DimensionlessBlock(CellAddress addressBlockBegin, NoDrillingDto blockDto)
|
2022-06-29 13:04:30 +05:00
|
|
|
|
{
|
|
|
|
|
AddressBlockBegin = addressBlockBegin.Copy();
|
|
|
|
|
this.blockDto = blockDto;
|
2022-07-05 11:30:25 +05:00
|
|
|
|
|
2022-06-30 16:01:46 +05:00
|
|
|
|
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);
|
|
|
|
|
}
|
2022-06-29 13:04:30 +05:00
|
|
|
|
|
2022-06-30 16:01:46 +05:00
|
|
|
|
private string FormulaBlockPlan(CellAddress cellTarget)
|
|
|
|
|
{
|
2022-07-05 12:05:04 +05:00
|
|
|
|
return $"={cellTarget}/60*{SaubBlock.AddressExtensionsCountValue}";
|
2022-06-30 16:01:46 +05:00
|
|
|
|
}
|
2022-06-29 13:04:30 +05:00
|
|
|
|
|
2022-06-30 16:01:46 +05:00
|
|
|
|
private string FormulaBlockExcess(CellAddress cellFact, CellAddress cellPlan)
|
|
|
|
|
{
|
2022-07-04 05:29:16 +05:00
|
|
|
|
return string.Format("={0}-{1}", cellFact.ToString(), cellPlan.ToString());
|
2022-06-29 13:04:30 +05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Draw(IXLWorksheet sheet)
|
|
|
|
|
{
|
2022-07-06 09:21:35 +05:00
|
|
|
|
sheet.Range(AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber,
|
|
|
|
|
AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber + 1)
|
2022-07-06 15:04:03 +05:00
|
|
|
|
.Merge()
|
|
|
|
|
.Style.Alignment.SetWrapText(true);
|
|
|
|
|
sheet.Cell(AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber)._ValueNoBorder("БЕЗМЕТРАЖНЫЕ РАБОТЫ",true);
|
2022-06-30 16:01:46 +05:00
|
|
|
|
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])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBlockPlan(AddressPreparationValue[0])}").Style.SetAllBorders();
|
2022-06-30 16:01:46 +05:00
|
|
|
|
sheet._Range(AddressPreparationHead[2], AddressPreparationHead[2] + (0, 1))
|
|
|
|
|
._SetValue("Проработка при бур, факт (ч):");
|
|
|
|
|
sheet.Cell(AddressPreparationValue[2])
|
2023-02-21 10:19:07 +05:00
|
|
|
|
._SetValue($"{blockDto.ActualTimeBarrelPreparation}");
|
2022-06-30 16:01:46 +05:00
|
|
|
|
sheet._Range(AddressPreparationHead[3], AddressPreparationHead[3] + (0, 1))
|
|
|
|
|
._SetValue("Превышение плановых норм, (ч):");
|
|
|
|
|
sheet.Cell(AddressPreparationValue[3])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBlockExcess(AddressPreparationValue[2], AddressPreparationValue[1])}").Style.SetAllBorders();
|
2022-06-30 16:01:46 +05:00
|
|
|
|
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])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBlockPlan(AddressExtensionValue[0])}").Style.SetAllBorders();
|
2022-06-30 16:01:46 +05:00
|
|
|
|
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])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBlockExcess(AddressExtensionValue[2], AddressExtensionValue[1])}").Style.SetAllBorders();
|
2022-06-30 16:01:46 +05:00
|
|
|
|
sheet._Range(AddressPreparationDescription, AddressPreparationDescription + (1, 2))
|
|
|
|
|
._SetValue("Подготовка ствола скв. к наращиванию");
|
|
|
|
|
sheet._Range(AddressExtensionDescription, AddressExtensionDescription + (1, 2))
|
|
|
|
|
._SetValue("Наращивание");
|
2022-06-29 13:04:30 +05:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-06-29 13:04:30 +05:00
|
|
|
|
}
|
|
|
|
|
|