From 112fb2ca0f9efbe64573b5108fb828a4e62a1eaf Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Mon, 1 Aug 2022 02:58:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=BB=E7=AB=99=E5=A0=B1=E8=A1=A8-=E5=A0=B1?= =?UTF-8?q?=E8=A1=A8=E5=8C=AF=E5=87=BA:=E6=96=B0=E5=A2=9E=E6=97=A5?= =?UTF-8?q?=E5=9D=87=E7=8D=B2=E5=88=A9=E3=80=81=E6=9B=B4=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E8=A9=9E(=E7=B4=AF=E7=A9=8D=E6=97=A5=E7=85=A7=E5=BA=A6?= =?UTF-8?q?=E3=80=81=E6=97=A5=E5=9D=87=E7=99=BC=E9=9B=BB=E5=BA=A6=E6=95=B8?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StationReportController.cs | 49 +++++++++++++++---- 1 file changed, 39 insertions(+), 10 deletions(-) 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);