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