From 292bd0ca885e31f4fee7cadf4a7444746715ac8d Mon Sep 17 00:00:00 2001 From: b110212000 Date: Mon, 14 Feb 2022 17:56:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=99=82=E9=96=93=E5=95=8F=E9=A1=8C=E4=BF=AE?= =?UTF-8?q?=E5=BE=A9=202.=E6=AD=B7=E5=8F=B2=E8=B3=87=E6=96=99-=E7=B4=AF?= =?UTF-8?q?=E7=A9=8D=E6=97=A5=E7=85=A7=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Models/Overview.cs | 1 + SolarPower/Repository/Implement/OverviewRepository.cs | 6 +++--- SolarPower/Views/StationOverview/StationOverviewInfo.cshtml | 3 ++- SolarPower/Views/StationOverview/_History.cshtml | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/SolarPower/Models/Overview.cs b/SolarPower/Models/Overview.cs index 5c19206..62af16c 100644 --- a/SolarPower/Models/Overview.cs +++ b/SolarPower/Models/Overview.cs @@ -186,6 +186,7 @@ namespace SolarPower.Models public double DiffSOLARHOUR { get; set; } public string TOTALTIME { get; set; } public double KWHKWP { get; set; } + public double IrrDay { get; set; } } public class ExceptionEmailInfo diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index 8f8c63a..a1907e3 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -403,8 +403,8 @@ namespace SolarPower.Repository.Implement { post.StartTime = post.Range.Split('-')[0] + " 00:00:00"; post.EndTime = post.Range.Split('-')[1] + " 23:59:59"; - start = Convert.ToDateTime(post.StartTime); - end = Convert.ToDateTime(post.EndTime).AddDays(-1); + start = Convert.ToDateTime(post.StartTime).AddHours(-8); + end = Convert.ToDateTime(post.EndTime).AddHours(-8); var startime = (Int64)(start.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; var endtime = (Int64)(end.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; sql += @$" AND `timestamp` BETWEEN {startime*1000} AND {endtime*1000}"; @@ -670,7 +670,7 @@ namespace SolarPower.Repository.Implement ( SELECT DENSE_RANK() OVER(ORDER BY C.TIMESTAMP) AS ROWID , (DENSE_RANK() OVER(ORDER BY C.TIMESTAMP)) - 1 AS PreROWID, - C.TIMESTAMP,{kwh} AS KWH,C.SOLARHOUR,C.PR,P.Irradiance,P.Temperature AS Temp ,C.KWHKWP + C.TIMESTAMP,{kwh} AS KWH,C.SOLARHOUR,C.PR,P.Irradiance,P.Temperature AS Temp ,C.KWHKWP,P.IrrDay FROM {usedb} C LEFT JOIN {pyrdb} P ON DATE_FORMAT(P.TIMESTAMP,'{timeGroup}') = DATE_FORMAT(C.TIMESTAMP,'{timeGroup}') AND P.PowerStationId = C.PowerStationId WHERE C.PowerStationId = {post.PowerstationId}{range2} GROUP BY C.TIMESTAMP ORDER BY C.TIMESTAMP diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index 43f3c40..1f3d3ab 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -2505,12 +2505,13 @@ kwhkwp = (ALLkwhkwp / times).toFixed(2); times++; } + console.log(val); diffSOLARHOURALL = val.solarhour; $('#HistoryDetailTable').append('' + '' + val.timestamp + '' + '' + val.kwh.toFixed(2) + '' + '' + val.kwhkwp.toFixed(2) + '' + - + '' + val.irrDay.toFixed(2) + '' + '' + val.irradiance.toFixed(2) + '' + '' + val.pr.toFixed(2) + '' + '' + val.temp.toFixed(2) + '' + diff --git a/SolarPower/Views/StationOverview/_History.cshtml b/SolarPower/Views/StationOverview/_History.cshtml index 4010d53..17ad5e9 100644 --- a/SolarPower/Views/StationOverview/_History.cshtml +++ b/SolarPower/Views/StationOverview/_History.cshtml @@ -84,7 +84,8 @@ 時間 發電量(kWh) 有效發電小時 - 日照度(W/m2) + 累積日照量(W/m2) + 日照量(W/m2) PR(%) 溫度(℃)