[FE API] 新增匯出報表欄位 單位 (kWh)

This commit is contained in:
keke 2023-08-24 15:04:45 +08:00
parent 716ecde2af
commit 3259da82f6

View File

@ -493,6 +493,9 @@ namespace FrontendWebApi.ApiControllers
cell = row.CreateCell(i++);
cell.SetCellValue("設備");
cell.CellStyle = styleLine12;
cell = row.CreateCell(i++);
cell.SetCellValue("單位");
cell.CellStyle = styleLine12;
foreach (var rr in r.FirstOrDefault().rawData)
{
@ -515,7 +518,7 @@ namespace FrontendWebApi.ApiControllers
foreach (var rr in r)
{
RowPosition += 1;
int k = 3;
int k = 4;
row = sheet.CreateRow(RowPosition);
for (int j = 0; j <= i; j++)
{
@ -524,16 +527,20 @@ namespace FrontendWebApi.ApiControllers
{
cell.SetCellValue(rr.building_name);
}
if (j == 1)
else if (j == 1)
{
cell.SetCellValue(rr.floor_tag);
}
if (j == 2)
else if (j == 2)
{
cell.SetCellValue(rr.device_full_name);
}
else if (j == 3)
{
cell.SetCellValue("kWh");
}
if (j == 3)
else if (j == 4)
{
foreach (var rrr in rr.rawData)
{
@ -548,11 +555,11 @@ namespace FrontendWebApi.ApiControllers
{
cell.SetCellValue(rr.total);
}
if (j == k+1)
else if (j == k+1)
{
cell.SetCellValue(rr.price);
}
if (j == k+2)
else if (j == k+2)
{
cell.SetCellValue(rr.total_price);
}
@ -697,6 +704,9 @@ namespace FrontendWebApi.ApiControllers
cell = row.CreateCell(i++);
cell.SetCellValue("設備");
cell.CellStyle = styleLine12;
cell = row.CreateCell(i++);
cell.SetCellValue("單位");
cell.CellStyle = styleLine12;
foreach (var rr in rawDataTitle)
{
@ -736,7 +746,7 @@ namespace FrontendWebApi.ApiControllers
{
string compareDictKey = r.building_tag + r.floor_tag + r.device_serial_tag + r.device_number;
RowPosition += 1;
int k = 3;
int k = 4;
row = sheet.CreateRow(RowPosition);
for (int j = 0; j <= i; j++)
{
@ -745,16 +755,20 @@ namespace FrontendWebApi.ApiControllers
{
cell.SetCellValue(r.building_name);
}
if (j == 1)
else if (j == 1)
{
cell.SetCellValue(r.floor_tag);
}
if (j == 2)
else if (j == 2)
{
cell.SetCellValue(r.device_full_name);
}
else if (j == 3)
{
cell.SetCellValue("kWh");
}
if (j == 3)
else if (j == 4)
{
foreach (var rr in rawDataTitle)
{
@ -770,23 +784,23 @@ namespace FrontendWebApi.ApiControllers
{
cell.SetCellValue(r.total);
}
if (j == k + 1)
else if (j == k + 1)
{
cell.SetCellValue(compareDict.ContainsKey(compareDictKey) ? compareDict[compareDictKey][0] : "");
}
if (j == k + 2)
else if (j == k + 2)
{
cell.SetCellValue(r.price);
}
if (j == k + 3)
else if (j == k + 3)
{
cell.SetCellValue(compareDict.ContainsKey(compareDictKey) ? compareDict[compareDictKey][1] : "");
}
if (j == k + 4)
else if (j == k + 4)
{
cell.SetCellValue(r.total_price);
}
if (j == k + 5)
else if (j == k + 5)
{
cell.SetCellValue(compareDict.ContainsKey(compareDictKey) ? compareDict[compareDictKey][2] : "");
}