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('