forked from ddrilling/AsbCloudServer
корректировка скрипта миграции
корректировка стилей и блоков
This commit is contained in:
parent
73f804d3d6
commit
c5785fbb5f
@ -1,5 +1,4 @@
|
|||||||
using System;
|
namespace AsbCloudApp.Data.DailyReport
|
||||||
namespace AsbCloudApp.Data.DailyReport
|
|
||||||
{
|
{
|
||||||
public class DailyReportBhaDto
|
public class DailyReportBhaDto
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
namespace AsbCloudApp.Data.DailyReport
|
||||||
namespace AsbCloudApp.Data.DailyReport
|
|
||||||
{
|
{
|
||||||
public class DailyReportDimensionlessDto
|
public class DailyReportDimensionlessDto
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace AsbCloudApp.Data.DailyReport
|
namespace AsbCloudApp.Data.DailyReport
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
namespace AsbCloudApp.Data.DailyReport
|
||||||
namespace AsbCloudApp.Data.DailyReport
|
|
||||||
{
|
{
|
||||||
public class DailyReportSignDto
|
public class DailyReportSignDto
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
namespace AsbCloudApp.Data.DailyReport
|
||||||
namespace AsbCloudApp.Data.DailyReport
|
|
||||||
{
|
{
|
||||||
public class DailyReportTimeBalanceDto
|
public class DailyReportTimeBalanceDto
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ namespace AsbCloudDb.Migrations
|
|||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.Sql("DELETE FROM [t_daily_report]", true);
|
migrationBuilder.Sql("DELETE FROM t_daily_report", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
@ -7,12 +7,12 @@ namespace AsbCloudDb.Model.DailyReportDB
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Режимы бурения в роторе
|
/// Режимы бурения в роторе
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<string> RotorDrillingModes { get; set; }
|
public IEnumerable<string>? RotorDrillingModes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// режимы бурения в слайде
|
/// режимы бурения в слайде
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<string> SlideDrillingModes { get; set; }
|
public IEnumerable<string>? SlideDrillingModes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Количество метров пробуренных в роторе за отчетный период
|
/// Количество метров пробуренных в роторе за отчетный период
|
||||||
|
@ -68,8 +68,10 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
public override void Draw(IXLWorksheet sheet)
|
public override void Draw(IXLWorksheet sheet)
|
||||||
{
|
{
|
||||||
|
|
||||||
sheet._Range(AddressDimensionTitle, AddressDimensionTitle + (0, 1))
|
sheet.Range(AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber,
|
||||||
._SetValue("БЕЗМЕТРАЖНЫЕ РАБОТЫ");
|
AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber + 1)
|
||||||
|
.Merge()
|
||||||
|
.SetValue("БЕЗМЕТРАЖНЫЕ РАБОТЫ");
|
||||||
sheet._Range(AddressPreparationTitle, AddressPreparationTitle + (0, 2))
|
sheet._Range(AddressPreparationTitle, AddressPreparationTitle + (0, 2))
|
||||||
._SetValue("Подготовка ствола скв. к наращиванию");
|
._SetValue("Подготовка ствола скв. к наращиванию");
|
||||||
sheet._Range(AddressExtensionTitle, AddressExtensionTitle + (0, 2))
|
sheet._Range(AddressExtensionTitle, AddressExtensionTitle + (0, 2))
|
||||||
|
@ -88,7 +88,9 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
{
|
{
|
||||||
sheet._Range(AddressTitle, AddressTitle + (0, 7))
|
sheet._Range(AddressTitle, AddressTitle + (0, 7))
|
||||||
._SetValue($"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}")
|
._SetValue($"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}")
|
||||||
|
|
||||||
.Style.SetH1();
|
.Style.SetH1();
|
||||||
|
|
||||||
sheet._Range(AddressCustomer, AddressCustomer + (0, 7))
|
sheet._Range(AddressCustomer, AddressCustomer + (0, 7))
|
||||||
._SetValue($"Заказчик: {blockDto.Customer}")
|
._SetValue($"Заказчик: {blockDto.Customer}")
|
||||||
.Style.SetH1();
|
.Style.SetH1();
|
||||||
@ -109,9 +111,10 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
._SetValue("До");
|
._SetValue("До");
|
||||||
sheet._Range(AddressPeriodTableDataArray[0], AddressPeriodTableDataArray[0] + (0, 1))
|
sheet._Range(AddressPeriodTableDataArray[0], AddressPeriodTableDataArray[0] + (0, 1))
|
||||||
._SetValue($"{blockDto.ReportDate}");
|
._SetValue($"{blockDto.ReportDate}");
|
||||||
sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1));
|
sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1))._SetValue("");
|
||||||
sheet.Cell(AddressPeriodTableDataArray[1])
|
sheet.Cell(AddressPeriodTableDataArray[1])
|
||||||
.SetFormulaA1(string.Format("{0}-1", AddressPeriodTableDataArray[0].ToString()));
|
.SetFormulaA1(string.Format("{0}-1", AddressPeriodTableDataArray[0].ToString()))
|
||||||
|
.Style.DateFormat.Format= "DD.MM.YYYY HH:MM:SS";
|
||||||
sheet._Range(AddressPeriodTableDataArray[2], AddressPeriodTableDataArray[2] + (0, 1))
|
sheet._Range(AddressPeriodTableDataArray[2], AddressPeriodTableDataArray[2] + (0, 1))
|
||||||
._SetValue($"{blockDto.WellDepthIntervalStartDate}");
|
._SetValue($"{blockDto.WellDepthIntervalStartDate}");
|
||||||
sheet._Range(AddressPeriodTableDataArray[3], AddressPeriodTableDataArray[3] + (0, 1))
|
sheet._Range(AddressPeriodTableDataArray[3], AddressPeriodTableDataArray[3] + (0, 1))
|
||||||
|
@ -41,8 +41,9 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
public override CellAddress AddressBlockBegin { get; }
|
public override CellAddress AddressBlockBegin { get; }
|
||||||
public override CellAddress AddressBlockEnd { get; }
|
public override CellAddress AddressBlockEnd { get; }
|
||||||
|
|
||||||
public SaubBlock(CellAddress addressBlockBegin, DailyReportSaubDto blockDto)
|
public SaubBlock(CellAddress addressBlockBegin, DailyReportSaubDto blockDto, HeadBlock headBlock)
|
||||||
{
|
{
|
||||||
|
this.headBlock = headBlock;
|
||||||
AddressBlockBegin = addressBlockBegin.Copy();
|
AddressBlockBegin = addressBlockBegin.Copy();
|
||||||
this.blockDto = blockDto;
|
this.blockDto = blockDto;
|
||||||
AddressRotorDrilling = addressBlockBegin + (1, 0);
|
AddressRotorDrilling = addressBlockBegin + (1, 0);
|
||||||
@ -109,9 +110,13 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
|
|
||||||
private string FormulaSinking(CellAddress sinkingDrilling, CellAddress sinkingSlide, CellAddress slaughterEnd, CellAddress slaughterBegin)
|
private string FormulaSinking(CellAddress sinkingDrilling, CellAddress sinkingSlide, CellAddress slaughterEnd, CellAddress slaughterBegin)
|
||||||
{
|
{
|
||||||
return string.Format($"=IF(({{0}}+{{1}})<>({{2}}-{{3}});\"ОШИБКА\";({{4}}+{{5}}))", sinkingSlide.ToString(), sinkingDrilling.ToString()
|
return string.Format($"=IF(({{0}}+{{1}})<>({{2}}-{{3}}),\"ОШИБКА\",({{0}}+{{1}}))", sinkingSlide.ToString(), sinkingDrilling.ToString(),
|
||||||
, slaughterEnd.ToString(), slaughterBegin.ToString(),
|
slaughterEnd.ToString(), slaughterBegin.ToString());
|
||||||
sinkingSlide.ToString(), sinkingDrilling.ToString());
|
}
|
||||||
|
private string FormulaWatch(CellAddress cellSinkingDrill, CellAddress cellSinkingSlide)
|
||||||
|
{
|
||||||
|
return string.Format("={0}+{1}",
|
||||||
|
cellSinkingDrill.ToString(), cellSinkingSlide.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(IXLWorksheet sheet)
|
public override void Draw(IXLWorksheet sheet)
|
||||||
@ -134,7 +139,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
._SetValue($"{blockDto.PenetrationInRotor}");
|
._SetValue($"{blockDto.PenetrationInRotor}");
|
||||||
sheet._Range(AddressDrillingTableData[1], AddressDrillingTableData[1] + (0, 1))
|
sheet._Range(AddressDrillingTableData[1], AddressDrillingTableData[1] + (0, 1))
|
||||||
._SetValue($"{blockDto.NumberDrillingHours}");
|
._SetValue($"{blockDto.NumberDrillingHours}");
|
||||||
sheet._Range(AddressDrillingTableData[2], AddressDrillingTableData[2] + (0, 1));
|
sheet._Range(AddressDrillingTableData[2], AddressDrillingTableData[2] + (0, 1))._SetValue("");
|
||||||
sheet.Cell(AddressDrillingTableData[2])
|
sheet.Cell(AddressDrillingTableData[2])
|
||||||
.SetFormulaA1(FormulaMechanicalSpeed(AddressDrillingTableData[0], AddressDrillingTableData[1])).Style.SetAllBorders();
|
.SetFormulaA1(FormulaMechanicalSpeed(AddressDrillingTableData[0], AddressDrillingTableData[1])).Style.SetAllBorders();
|
||||||
sheet._Range(AddressDrillingTableData[3], AddressDrillingTableData[3] + (0, 1))
|
sheet._Range(AddressDrillingTableData[3], AddressDrillingTableData[3] + (0, 1))
|
||||||
@ -153,7 +158,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
._SetValue($"{blockDto.PenetrationInSlide}");
|
._SetValue($"{blockDto.PenetrationInSlide}");
|
||||||
sheet._Range(AddressSlideTableData[1], AddressSlideTableData[1] + (0, 1))
|
sheet._Range(AddressSlideTableData[1], AddressSlideTableData[1] + (0, 1))
|
||||||
._SetValue($"{blockDto.DrillingTimeInRotor}");
|
._SetValue($"{blockDto.DrillingTimeInRotor}");
|
||||||
sheet._Range(AddressSlideTableData[2], AddressSlideTableData[2] + (0, 1));
|
sheet._Range(AddressSlideTableData[2], AddressSlideTableData[2] + (0, 1))._SetValue("");
|
||||||
sheet.Cell(AddressSlideTableData[2])
|
sheet.Cell(AddressSlideTableData[2])
|
||||||
.SetFormulaA1(FormulaMechanicalSpeed(AddressSlideTableData[0], AddressSlideTableData[1])).Style.SetAllBorders();
|
.SetFormulaA1(FormulaMechanicalSpeed(AddressSlideTableData[0], AddressSlideTableData[1])).Style.SetAllBorders();
|
||||||
sheet._Range(AddressSlideTableData[3], AddressSlideTableData[3] + (0, 1))
|
sheet._Range(AddressSlideTableData[3], AddressSlideTableData[3] + (0, 1))
|
||||||
@ -168,14 +173,13 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
._SetValue("Часы бурения");
|
._SetValue("Часы бурения");
|
||||||
sheet._Range(AddressTotalTableHead[2], AddressTotalTableHead[2] + (0, 1))
|
sheet._Range(AddressTotalTableHead[2], AddressTotalTableHead[2] + (0, 1))
|
||||||
._SetValue("Мех. скорость");
|
._SetValue("Мех. скорость");
|
||||||
var formulaWatch = string.Format("={0}+{1}",
|
|
||||||
AddressDrillingTableData[1].ToString(), AddressSlideTableData[1].ToString());
|
sheet._Range(AddressTotalTableData[0], AddressTotalTableData[0] + (0, 1))._SetValue("");
|
||||||
sheet._Range(AddressTotalTableData[0], AddressTotalTableData[0] + (0, 1));
|
|
||||||
sheet.Cell(AddressTotalTableData[0])
|
sheet.Cell(AddressTotalTableData[0])
|
||||||
.SetFormulaA1(formulaWatch).Style.SetAllBorders();
|
.SetFormulaA1(FormulaSinking(AddressDrillingTableData[0], AddressSlideTableData[0], headBlock.AddressPeriodTableDataArray[3], headBlock.AddressPeriodTableDataArray[2]));
|
||||||
sheet._Range(AddressTotalTableData[1], AddressTotalTableData[1] + (0, 1));
|
sheet._Range(AddressTotalTableData[1], AddressTotalTableData[1] + (0, 1))._SetValue("");
|
||||||
sheet.Cell(AddressTotalTableData[1])
|
sheet.Cell(AddressTotalTableData[1])
|
||||||
.SetFormulaA1(formulaWatch).Style.SetAllBorders();
|
.SetFormulaA1(FormulaWatch(AddressDrillingTableData[1], AddressSlideTableData[1]));
|
||||||
sheet._Range(AddressTotalTableData[2], AddressTotalTableData[2] + (0, 1))
|
sheet._Range(AddressTotalTableData[2], AddressTotalTableData[2] + (0, 1))
|
||||||
._SetValue("");
|
._SetValue("");
|
||||||
sheet._Range(AddressTotalTableData[3], AddressTotalTableData[3] + (0, 1))
|
sheet._Range(AddressTotalTableData[3], AddressTotalTableData[3] + (0, 1))
|
||||||
@ -208,10 +212,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
._SetValue("Проходка за секцию");
|
._SetValue("Проходка за секцию");
|
||||||
sheet._Range(SectionPenetrationTotalValue, SectionPenetrationTotalValue + (0, 3))
|
sheet._Range(SectionPenetrationTotalValue, SectionPenetrationTotalValue + (0, 3))
|
||||||
._SetValue($"{blockDto.SectionPenetrationTotal}");
|
._SetValue($"{blockDto.SectionPenetrationTotal}");
|
||||||
|
sheet._Range(AddressExtensionsCount, AddressExtensionsCount + (0, 3))
|
||||||
CellAddress test = AddressExtensionsCount + (0, 3);
|
|
||||||
|
|
||||||
sheet._Range(AddressExtensionsCount, test)
|
|
||||||
._SetValue("Кол- во наращиваний");
|
._SetValue("Кол- во наращиваний");
|
||||||
sheet._Range(AddressExtensionsCountValue, AddressExtensionsCountValue + (0, 3))
|
sheet._Range(AddressExtensionsCountValue, AddressExtensionsCountValue + (0, 3))
|
||||||
._SetValue($"{blockDto.ExtensionsCount}");
|
._SetValue($"{blockDto.ExtensionsCount}");
|
||||||
@ -221,7 +222,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
._SetValue($"{blockDto.DeviationFromTVD}");
|
._SetValue($"{blockDto.DeviationFromTVD}");
|
||||||
sheet._Range(DeclinesReasonsROP, DeclinesReasonsROP + (1, 7))
|
sheet._Range(DeclinesReasonsROP, DeclinesReasonsROP + (1, 7))
|
||||||
._SetValue($"Примечание: {blockDto.DeclinesReasonsROP}");
|
._SetValue($"Примечание: {blockDto.DeclinesReasonsROP}");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,22 +19,30 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
AddressBlockBegin = addressBlockBegin.Copy();
|
AddressBlockBegin = addressBlockBegin.Copy();
|
||||||
this.blockDto = blockDto;
|
this.blockDto = blockDto;
|
||||||
AddressDrillMasterHead = addressBlockBegin + (3, 0);
|
AddressDrillMasterHead = addressBlockBegin + (3, 0);
|
||||||
AddressDrillMaster = AddressDrillMasterHead + (0, 6);
|
AddressDrillMaster = AddressDrillMasterHead + (0, 5);
|
||||||
AddressSupervisorHead = AddressDrillMasterHead + (2, 0);
|
AddressSupervisorHead = AddressDrillMasterHead + (2, 0);
|
||||||
AddressSupervisor = AddressSupervisorHead + (0, 6);
|
AddressSupervisor = AddressSupervisorHead + (0, 5);
|
||||||
AddressBlockEnd = AddressSupervisor + (0,1);
|
AddressBlockEnd = AddressSupervisor + (0,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(IXLWorksheet sheet)
|
public override void Draw(IXLWorksheet sheet)
|
||||||
{
|
{
|
||||||
sheet._Range(AddressDrillMasterHead, AddressDrillMasterHead + (0, 2))
|
sheet.Range(AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber
|
||||||
._SetValue("Мастер буровой ");
|
, AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber + 2)
|
||||||
sheet._Range(AddressDrillMaster, AddressDrillMaster + (0, 2))
|
.Merge()
|
||||||
._SetValue($"{blockDto.DrillingMaster}");
|
.SetValue("Мастер буровой ");
|
||||||
sheet._Range(AddressSupervisorHead, AddressSupervisorHead + (0, 2))
|
sheet.Range(AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber
|
||||||
._SetValue("Супервайзер ");
|
, AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber + 2)
|
||||||
sheet._Range(AddressSupervisor, AddressSupervisor + (0, 2))
|
.Merge()
|
||||||
._SetValue($"{blockDto.Supervisor}");
|
.SetValue($"{blockDto.DrillingMaster}");
|
||||||
|
sheet.Range(AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber
|
||||||
|
, AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber + 2)
|
||||||
|
.Merge()
|
||||||
|
.SetValue("Супервайзер ");
|
||||||
|
sheet.Range(AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber
|
||||||
|
, AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber + 2)
|
||||||
|
.Merge()
|
||||||
|
.SetValue($"{blockDto.Supervisor}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,50 +52,50 @@ namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks
|
|||||||
AddressBlockBegin = addressBlockBegin.Copy();
|
AddressBlockBegin = addressBlockBegin.Copy();
|
||||||
this.blockDto = blockDto;
|
this.blockDto = blockDto;
|
||||||
AddressTitle = addressBlockBegin + (1, 3);
|
AddressTitle = addressBlockBegin + (1, 3);
|
||||||
AddressDrilling = addressBlockBegin + (4, 1);
|
AddressDrilling = addressBlockBegin + (2, 1);
|
||||||
AddressFlushing = addressBlockBegin + (5, 1);
|
AddressFlushing = addressBlockBegin + (3, 1);
|
||||||
AddressBuilding = addressBlockBegin + (6, 1);
|
AddressBuilding = addressBlockBegin + (4, 1);
|
||||||
AddressElaboration = addressBlockBegin + (7, 1);
|
AddressElaboration = addressBlockBegin + (5, 1);
|
||||||
AddressExtension = addressBlockBegin + (8, 1);
|
AddressExtension = addressBlockBegin + (6, 1);
|
||||||
AddressRepair = addressBlockBegin + (9, 1);
|
AddressRepair = addressBlockBegin + (7, 1);
|
||||||
AddressDrillingValue = addressBlockBegin + (4, 2);
|
AddressDrillingValue = addressBlockBegin + (2, 2);
|
||||||
AddressFlushingValue = addressBlockBegin + (5, 2);
|
AddressFlushingValue = addressBlockBegin + (3, 2);
|
||||||
AddressBuildingValue = addressBlockBegin + (6, 2);
|
AddressBuildingValue = addressBlockBegin + (4, 2);
|
||||||
AddressElaborationValue = addressBlockBegin + (7, 2);
|
AddressElaborationValue = addressBlockBegin + (5, 2);
|
||||||
AddressExtensionValue = addressBlockBegin + (8, 2);
|
AddressExtensionValue = addressBlockBegin + (6, 2);
|
||||||
AddressRepairValue = addressBlockBegin + (9, 2);
|
AddressRepairValue = addressBlockBegin + (7, 2);
|
||||||
AddressKnbk = addressBlockBegin + (4, 3);
|
AddressKnbk = addressBlockBegin + (2, 3);
|
||||||
AddressSpo = addressBlockBegin + (5, 3);
|
AddressSpo = addressBlockBegin + (3, 3);
|
||||||
AddressPzr = addressBlockBegin + (6, 3);
|
AddressPzr = addressBlockBegin + (4, 3);
|
||||||
AddressPvo = addressBlockBegin + (7, 3);
|
AddressPvo = addressBlockBegin + (5, 3);
|
||||||
AddressPgr = addressBlockBegin + (8, 3);
|
AddressPgr = addressBlockBegin + (6, 3);
|
||||||
AddressGis = addressBlockBegin + (9, 3);
|
AddressGis = addressBlockBegin + (7, 3);
|
||||||
AddressKnbkValue = addressBlockBegin + (4, 4);
|
AddressKnbkValue = addressBlockBegin + (2, 4);
|
||||||
AddressSpoValue = addressBlockBegin + (5, 4);
|
AddressSpoValue = addressBlockBegin + (3, 4);
|
||||||
AddressPzrValue = addressBlockBegin + (6, 4);
|
AddressPzrValue = addressBlockBegin + (4, 4);
|
||||||
AddressPvoValue = addressBlockBegin + (7, 4);
|
AddressPvoValue = addressBlockBegin + (5, 4);
|
||||||
AddressPgrValue = addressBlockBegin + (8, 4);
|
AddressPgrValue = addressBlockBegin + (6, 4);
|
||||||
AddressGisValue = addressBlockBegin + (9, 4);
|
AddressGisValue = addressBlockBegin + (7, 4);
|
||||||
AddressOzc = addressBlockBegin + (4, 5);
|
AddressOzc = addressBlockBegin + (2, 5);
|
||||||
AddressEngineeringWorks = addressBlockBegin + (5, 5);
|
AddressEngineeringWorks = addressBlockBegin + (3, 5);
|
||||||
AddressTakingMeasure = addressBlockBegin + (6, 5);
|
AddressTakingMeasure = addressBlockBegin + (4, 5);
|
||||||
AddressCementing = addressBlockBegin + (7, 5);
|
AddressCementing = addressBlockBegin + (5, 5);
|
||||||
AddressSimple = addressBlockBegin + (8, 5);
|
AddressSimple = addressBlockBegin + (6, 5);
|
||||||
AddressNpv = addressBlockBegin + (9, 5);
|
AddressNpv = addressBlockBegin + (7, 5);
|
||||||
AddressOzcValue = addressBlockBegin + (4, 6);
|
AddressOzcValue = addressBlockBegin + (2, 6);
|
||||||
AddressEngineeringWorksValue = addressBlockBegin + (5, 6);
|
AddressEngineeringWorksValue = addressBlockBegin + (3, 6);
|
||||||
AddressTakingMeasureValue = addressBlockBegin + (6, 6);
|
AddressTakingMeasureValue = addressBlockBegin + (4, 6);
|
||||||
AddressCementingValue = addressBlockBegin + (7, 6);
|
AddressCementingValue = addressBlockBegin + (5, 6);
|
||||||
AddressSimpleValue = addressBlockBegin + (8, 6);
|
AddressSimpleValue = addressBlockBegin + (6, 6);
|
||||||
AddressNpvValue = addressBlockBegin + (9, 6);
|
AddressNpvValue = addressBlockBegin + (7, 6);
|
||||||
AddressBlockEnd = AddressNpvValue;
|
AddressBlockEnd = AddressNpvValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(IXLWorksheet sheet)
|
public override void Draw(IXLWorksheet sheet)
|
||||||
{
|
{
|
||||||
|
sheet.Range(AddressTitle.RowNumber, AddressTitle.ColumnNumber, AddressTitle.RowNumber, AddressTitle.ColumnNumber + 1)
|
||||||
sheet._Range(AddressTitle, AddressTitle + (0, 1))
|
.Merge()
|
||||||
._SetValue("БАЛАНС ВРЕМЕНИ");
|
.SetValue("БАЛАНС ВРЕМЕНИ");
|
||||||
sheet.Cell(AddressDrilling)
|
sheet.Cell(AddressDrilling)
|
||||||
._SetValue("Бурение");
|
._SetValue("Бурение");
|
||||||
sheet.Cell(AddressFlushing)
|
sheet.Cell(AddressFlushing)
|
||||||
|
@ -19,26 +19,26 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
|||||||
private void FillExampleBlocks(XLWorkbook workbook, DailyReportDto dto)
|
private void FillExampleBlocks(XLWorkbook workbook, DailyReportDto dto)
|
||||||
{
|
{
|
||||||
var sheet = workbook.Worksheets.Add(dto.Head.ReportDate.ToString("dd.MM.yyyy"));
|
var sheet = workbook.Worksheets.Add(dto.Head.ReportDate.ToString("dd.MM.yyyy"));
|
||||||
var addressStart = new CellAddress(sheet, 1, 1);
|
var addressStart = new CellAddress(sheet, 2, 2);
|
||||||
var blockHeader = new HeadBlock(addressStart, dto.Head);
|
var blockHeader = new HeadBlock(addressStart, dto.Head);
|
||||||
addressStart = blockHeader.AddressBlockEnd + (1, 0);
|
addressStart = blockHeader.AddressBlockEnd + (1, 0);
|
||||||
addressStart.ColumnNumber = 1;
|
addressStart.ColumnNumber = 2;
|
||||||
var blockBha = new BhaBlock(addressStart, dto.Bha);
|
var blockBha = new BhaBlock(addressStart, dto.Bha);
|
||||||
addressStart = blockBha.AddressBlockEnd + (1, 0);
|
addressStart = blockBha.AddressBlockEnd + (1, 0);
|
||||||
addressStart.ColumnNumber = 1;
|
addressStart.ColumnNumber = 2;
|
||||||
var timeBalance = new TimeBalanceBlock(addressStart, dto.TimeBalance);
|
var timeBalance = new TimeBalanceBlock(addressStart, dto.TimeBalance);
|
||||||
addressStart = timeBalance.AddressBlockEnd + (1, 0);
|
addressStart = timeBalance.AddressBlockEnd + (1, 0);
|
||||||
addressStart.ColumnNumber = 1;
|
addressStart.ColumnNumber = 2;
|
||||||
var blockDimensionless = new DimensionlessBlock(addressStart, dto.Dimensionless);
|
var blockDimensionless = new DimensionlessBlock(addressStart, dto.Dimensionless);
|
||||||
addressStart = blockDimensionless.AddressBlockEnd + (1, 0);
|
addressStart = blockDimensionless.AddressBlockEnd + (1, 0);
|
||||||
addressStart.ColumnNumber = 1;
|
addressStart.ColumnNumber = 2;
|
||||||
var blockSaub = new SaubBlock(addressStart, dto.Saub);
|
var blockSaub = new SaubBlock(addressStart, dto.Saub, blockHeader);
|
||||||
addressStart = blockSaub.AddressBlockEnd + (1, 0);
|
addressStart = blockSaub.AddressBlockEnd + (1, 0);
|
||||||
blockDimensionless.SaubBlock = blockSaub;
|
blockDimensionless.SaubBlock = blockSaub;
|
||||||
addressStart.ColumnNumber = 1;
|
addressStart.ColumnNumber = 2;
|
||||||
var blockSign = new SignBlock(addressStart, dto.Sign);
|
var blockSign = new SignBlock(addressStart, dto.Sign);
|
||||||
addressStart = blockSign.AddressBlockEnd + (1, 0);
|
addressStart = blockSign.AddressBlockEnd + (1, 0);
|
||||||
addressStart.ColumnNumber = 1;
|
addressStart.ColumnNumber = 2;
|
||||||
blockHeader.Draw(sheet);
|
blockHeader.Draw(sheet);
|
||||||
blockBha.Draw(sheet);
|
blockBha.Draw(sheet);
|
||||||
timeBalance.Draw(sheet);
|
timeBalance.Draw(sheet);
|
||||||
|
@ -8,8 +8,10 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
|||||||
public static IXLRange _SetValue(this IXLRange range, object value)
|
public static IXLRange _SetValue(this IXLRange range, object value)
|
||||||
{
|
{
|
||||||
var mergedRange = range.Merge();
|
var mergedRange = range.Merge();
|
||||||
|
mergedRange.Style.SetAllBorders()
|
||||||
|
.Alignment.WrapText = true; ;
|
||||||
mergedRange.FirstCell()._SetValue(value);
|
mergedRange.FirstCell()._SetValue(value);
|
||||||
mergedRange.Style.SetAllBorders();
|
|
||||||
return mergedRange;
|
return mergedRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
|||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IXLCell _SetValue(this IXLCell cell, string value, bool adaptRowHeight = false)
|
public static IXLCell _SetValue(this IXLCell cell, string value, bool adaptRowHeight = false, int noBorder = 0)
|
||||||
{
|
{
|
||||||
cell.Value = value;
|
cell.Value = value;
|
||||||
cell.Style
|
cell.Style
|
||||||
@ -46,18 +48,22 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
|||||||
if (adaptRowHeight)
|
if (adaptRowHeight)
|
||||||
{
|
{
|
||||||
var colWidth = cell.WorksheetColumn().Width;
|
var colWidth = cell.WorksheetColumn().Width;
|
||||||
var maxCharsToWrap = colWidth / (0.1d * cell.Style.Font.FontSize); // TODO: Подобрать коэффициент
|
var maxCharsToWrap = 88;
|
||||||
if(value.Length > maxCharsToWrap)
|
if (value.Length > maxCharsToWrap)
|
||||||
{
|
{
|
||||||
var row = cell.WorksheetRow();
|
var row = cell.WorksheetRow();
|
||||||
var baseHeight = row.Height;
|
var baseHeight = row.Height;
|
||||||
row.Height = 0.82d * baseHeight * Math.Ceiling(1d + value.Length / maxCharsToWrap);
|
row.Height = 0.82d * baseHeight * Math.Ceiling(1d + value.Length / maxCharsToWrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static IXLCell _SetValue(this IXLCell cell, DateTime value, string dateFormat = "DD.MM.YYYY HH:MM:SS")
|
public static IXLCell _SetValue(this IXLCell cell, DateTime value, string dateFormat = "DD.MM.YYYY HH:MM:SS")
|
||||||
{
|
{
|
||||||
cell.Value = value;
|
cell.Value = value;
|
||||||
@ -122,5 +128,6 @@ namespace AsbCloudInfrastructure.Services.DailyReport
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static IXLRange _Range(this IXLWorksheet sheet, CellAddress begin, CellAddress end)
|
public static IXLRange _Range(this IXLWorksheet sheet, CellAddress begin, CellAddress end)
|
||||||
=> sheet.Range(begin.RowNumber, begin.ColumnNumber, end.RowNumber, end.ColumnNumber);
|
=> sheet.Range(begin.RowNumber, begin.ColumnNumber, end.RowNumber, end.ColumnNumber);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user