電站報表-報表匯出:新增日均獲利、更改名詞(累積日照度、日均發電度數)

This commit is contained in:
wanling040@gmail.com 2022-08-01 02:58:55 +08:00
parent 81777eab68
commit 112fb2ca0f

View File

@ -244,7 +244,7 @@ namespace SolarPower.Controllers
{ {
"小時發電量(kWh)", "小時發電量(kWh)",
"小時發電量百分比(%)", "小時發電量百分比(%)",
"小時平均日照度(W/㎡)", "小時累積日照度(W/㎡)",
"小時平均模組溫度(°C)" "小時平均模組溫度(°C)"
}; };
if(Formhead.Result.Data.ShowMoney == 1) if(Formhead.Result.Data.ShowMoney == 1)
@ -266,7 +266,7 @@ namespace SolarPower.Controllers
#region body //RowPosition = 1 #region body //RowPosition = 1
RowPosition++; RowPosition++;
var thour = ""; var tpr = ""; var tkwh = ""; var kWhkwp = ""; var ntd = ""; var ntdone = "";var GeneratingCapacity = ""; var thour = ""; var tpr = ""; var tkwh = ""; var kWhkwp = ""; var ntd = ""; var ntdone = "";var GeneratingCapacity = "";var AverageDailyProfit = "";
foreach (dynamic body in Formbody.Result.Data) foreach (dynamic body in Formbody.Result.Data)
{ {
index = 0; index = 0;
@ -284,6 +284,7 @@ namespace SolarPower.Controllers
onemoney = 0; onemoney = 0;
} }
ntdone = Checknull(Math.Round(onemoney, 4).ToString()); ntdone = Checknull(Math.Round(onemoney, 4).ToString());
AverageDailyProfit = Checknull(Math.Round((Convert.ToDouble(ntd) / Convert.ToDouble(GeneratingCapacity)), 2).ToString());
row = sheet.CreateRow(RowPosition); row = sheet.CreateRow(RowPosition);
cell = row.CreateCell(index); cell = row.CreateCell(index);
@ -342,7 +343,7 @@ namespace SolarPower.Controllers
index = 0; index = 0;
row = sheet.CreateRow(RowPosition); row = sheet.CreateRow(RowPosition);
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue("有效發電小時:"); cell.SetCellValue("日均發電度數:");
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
cell = row.CreateCell(1); cell = row.CreateCell(1);
cell.SetCellValue(Convert.ToDouble(kWhkwp)); cell.SetCellValue(Convert.ToDouble(kWhkwp));
@ -400,6 +401,16 @@ namespace SolarPower.Controllers
cell = row.CreateCell(1); cell = row.CreateCell(1);
cell.SetCellValue(Convert.ToDouble(ntdone)); cell.SetCellValue(Convert.ToDouble(ntdone));
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
RowPosition++;
index = 0;
row = sheet.CreateRow(RowPosition);
cell = row.CreateCell(index);
cell.SetCellValue("日均獲利(NTD):");
cell.CellStyle = styleLine12;
cell = row.CreateCell(1);
cell.SetCellValue(Convert.ToDouble(AverageDailyProfit));
cell.CellStyle = styleLine12;
} }
@ -430,9 +441,9 @@ namespace SolarPower.Controllers
"日發電量(kWh)", "日發電量(kWh)",
"日發電量百分比(%)", "日發電量百分比(%)",
"日照小時(hr)", "日照小時(hr)",
"有效發電小時", "日均發電度數",
"PR%", "PR%",
"累積日照(W/㎡)", "累積日照(W/㎡)",
"日平均模組溫度(°C)" "日平均模組溫度(°C)"
}; };
@ -530,7 +541,7 @@ namespace SolarPower.Controllers
//cell.CellStyle = styleLine12; //cell.CellStyle = styleLine12;
//index++; //index++;
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue("有效發電小時(日)"); cell.SetCellValue("日均發電度數(日)");
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index); cell = row.CreateCell(index);
@ -560,6 +571,10 @@ namespace SolarPower.Controllers
cell.SetCellValue("售電單價(NTD)(月)"); cell.SetCellValue("售電單價(NTD)(月)");
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index);
cell.SetCellValue("日均獲利(NTD)");
cell.CellStyle = styleLine12;
index++;
} }
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue("售電天數(月)"); cell.SetCellValue("售電天數(月)");
@ -606,6 +621,10 @@ namespace SolarPower.Controllers
cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoneyone) / Useday, 4)); cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoneyone) / Useday, 4));
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index);
cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoney) / Convert.ToDouble(monthGeneratingCapacity) / Useday, 2));
cell.CellStyle = styleLine12;
index++;
} }
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue(Useday); cell.SetCellValue(Useday);
@ -696,9 +715,9 @@ namespace SolarPower.Controllers
"月發電量(kWh)", "月發電量(kWh)",
"月發電量百分比(%)", "月發電量百分比(%)",
"日照小時(hr)", "日照小時(hr)",
"有效發電小時", "日均發電度數",
"PR%", "PR%",
"月平均日照度(W/㎡)", "月累積日照度(W/㎡)",
"月平均模組溫度(°C)" "月平均模組溫度(°C)"
}; };
@ -721,6 +740,7 @@ namespace SolarPower.Controllers
avghour = "0"; avgKWHKWP = "0"; avgdayKWH = "0"; monthKWH = "0"; monthmoney = "0"; monthmoneyone = "0"; avghour = "0"; avgKWHKWP = "0"; avgdayKWH = "0"; monthKWH = "0"; monthmoney = "0"; monthmoneyone = "0";
check_hire = false; check_hire = false;
sitedb = ""; sitedb = "";
monthGeneratingCapacity = "";
foreach (dynamic body in Formbody.Result.Data) foreach (dynamic body in Formbody.Result.Data)
{ {
index3 = 0; index3 = 0;
@ -732,6 +752,7 @@ namespace SolarPower.Controllers
monthKWH = dbody["monthKWH"] == null ? "0" : dbody["monthKWH"].ToString(); monthKWH = dbody["monthKWH"] == null ? "0" : dbody["monthKWH"].ToString();
monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString(); monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString();
monthmoneyone = (Convert.ToDouble(dbody["monthmoneyone"].ToString()) + Convert.ToDouble(monthmoneyone)).ToString(); monthmoneyone = (Convert.ToDouble(dbody["monthmoneyone"].ToString()) + Convert.ToDouble(monthmoneyone)).ToString();
monthGeneratingCapacity = Checknull(Math.Round(Convert.ToDouble(dbody["GeneratingCapacity"]), 2).ToString());
if (dbody["SolarType"].ToString() == "1" && Formhead.Result.Data.ShowMoney == 1)//檢驗是否為租用 if (dbody["SolarType"].ToString() == "1" && Formhead.Result.Data.ShowMoney == 1)//檢驗是否為租用
{ {
check_hire = true; check_hire = true;
@ -794,7 +815,7 @@ namespace SolarPower.Controllers
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue("平均有效發電小時(月)"); cell.SetCellValue("平均日均發電度數(月)");
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index); cell = row.CreateCell(index);
@ -815,6 +836,10 @@ namespace SolarPower.Controllers
cell.SetCellValue("售電單價(NTD)(年)"); cell.SetCellValue("售電單價(NTD)(年)");
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index);
cell.SetCellValue("日均獲利(NTD)");
cell.CellStyle = styleLine12;
index++;
} }
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue("售電月數(年)"); cell.SetCellValue("售電月數(年)");
@ -852,6 +877,10 @@ namespace SolarPower.Controllers
cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoneyone) / Useday, 2)); cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoneyone) / Useday, 2));
cell.CellStyle = styleLine12; cell.CellStyle = styleLine12;
index++; index++;
cell = row.CreateCell(index);
cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoney) / Convert.ToDouble(monthGeneratingCapacity) / Useday / 30, 2));//一個月為30天
cell.CellStyle = styleLine12;
index++;
} }
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.SetCellValue(Useday); cell.SetCellValue(Useday);