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
|
|
|
|
class BhaBlock : BlockAbstract
|
|
|
|
|
{
|
2022-07-25 18:02:39 +05:00
|
|
|
|
private readonly BhaDto blockDto;
|
2022-06-29 13:04:30 +05:00
|
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
public override CellAddress AddressBlockBegin { get; }
|
|
|
|
|
public override CellAddress AddressBlockEnd { get; }
|
|
|
|
|
|
2022-07-25 18:02:39 +05:00
|
|
|
|
public BhaBlock(CellAddress addressBlockBegin, BhaDto blockDto)
|
2022-06-29 13:04:30 +05:00
|
|
|
|
{
|
|
|
|
|
this.blockDto = blockDto;
|
2022-07-04 05:29:16 +05:00
|
|
|
|
AddressBlockBegin = addressBlockBegin.Copy();
|
2022-06-29 13:04:30 +05:00
|
|
|
|
AddressBhaDescription = addressBlockBegin + (1,0);
|
|
|
|
|
AddressOperationTitle = addressBlockBegin + (3, 0);
|
|
|
|
|
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];
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-04 05:29:16 +05:00
|
|
|
|
private string FormulaBhaBlock(CellAddress beginTime, CellAddress endTime)
|
|
|
|
|
{
|
2022-07-05 11:30:25 +05:00
|
|
|
|
return string.Format("IF({0}>0,({0}-{1})*24, \"\")", endTime.ToString(), beginTime.ToString());
|
|
|
|
|
}
|
2022-07-04 05:29:16 +05:00
|
|
|
|
|
2022-06-29 13:04:30 +05:00
|
|
|
|
public override void Draw(IXLWorksheet sheet)
|
|
|
|
|
{
|
|
|
|
|
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])
|
|
|
|
|
._SetValue($"{blockDto.ExtensionDrillingOneBegin}");
|
|
|
|
|
sheet.Cell(AddressDurationDataFinish[0])
|
|
|
|
|
._SetValue($"{blockDto.ExtensionDrillingOneFinish}");
|
|
|
|
|
sheet.Cell(AddressTotaData[0])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[0], AddressDurationDataFinish[0])}").Style.SetAllBorders();
|
2022-06-29 13:04:30 +05:00
|
|
|
|
sheet._Range(AddressOperationData[1], AddressOperationData[1] + (0, 4))
|
|
|
|
|
._SetValue("Промывка.");
|
|
|
|
|
sheet.Cell(AddressDurationDataStart[1])
|
|
|
|
|
._SetValue($"{blockDto.SluiceBegin}");
|
|
|
|
|
sheet.Cell(AddressDurationDataFinish[1])
|
2023-02-21 10:19:07 +05:00
|
|
|
|
._SetValue($"{blockDto.SluiceFinish}");
|
2022-06-29 13:04:30 +05:00
|
|
|
|
sheet.Cell(AddressTotaData[1])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[1], AddressDurationDataFinish[1])}").Style.SetAllBorders();
|
2022-06-29 13:04:30 +05:00
|
|
|
|
sheet._Range(AddressOperationData[2], AddressOperationData[2] + (0, 4))
|
|
|
|
|
._SetValue("Подъем КНБК в инт. 2763-2442м.");
|
|
|
|
|
sheet.Cell(AddressDurationDataStart[2])
|
|
|
|
|
._SetValue($"{blockDto.ClimbBegin}");
|
|
|
|
|
sheet.Cell(AddressDurationDataFinish[2])
|
|
|
|
|
._SetValue($"{blockDto.ClimbFinish}");
|
|
|
|
|
sheet.Cell(AddressTotaData[2])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[2], AddressDurationDataFinish[2])}").Style.SetAllBorders();
|
2022-06-29 13:04:30 +05:00
|
|
|
|
sheet._Range(AddressOperationData[3], AddressOperationData[3] + (0, 4))
|
|
|
|
|
._SetValue("Спуск КНБК в инт. 2442-2763м.");
|
|
|
|
|
sheet.Cell(AddressDurationDataStart[3])
|
|
|
|
|
._SetValue($"{blockDto.DescentBegin}");
|
|
|
|
|
sheet.Cell(AddressDurationDataFinish[3])
|
|
|
|
|
._SetValue($"{blockDto.DescentFinish}");
|
|
|
|
|
sheet.Cell(AddressTotaData[3])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[3], AddressDurationDataFinish[3])}").Style.SetAllBorders();
|
2022-06-29 13:04:30 +05:00
|
|
|
|
sheet._Range(AddressOperationData[4], AddressOperationData[4] + (0, 4))
|
|
|
|
|
._SetValue("Бурение с наращиваниями в инт. 2763-2850м.");
|
|
|
|
|
sheet.Cell(AddressDurationDataStart[4])
|
|
|
|
|
._SetValue($"{blockDto.ExtensionDrillingTwoBegin}");
|
|
|
|
|
sheet.Cell(AddressDurationDataFinish[4])
|
|
|
|
|
._SetValue($"{blockDto.ExtensionDrillingTwoFinish}");
|
|
|
|
|
sheet.Cell(AddressTotaData[4])
|
2022-07-05 12:05:04 +05:00
|
|
|
|
.SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[4], AddressDurationDataFinish[4])}").Style.SetAllBorders();
|
2022-06-29 13:04:30 +05:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-06-29 13:04:30 +05:00
|
|
|
|
}
|
2023-04-13 11:15:45 +05:00
|
|
|
|
|
2022-06-29 13:04:30 +05:00
|
|
|
|
|
|
|
|
|
|