1. bug fix
This commit is contained in:
parent
e84437412d
commit
c5caf227b4
@ -146,8 +146,6 @@ namespace SolarPower.Quartz.Jobs
|
||||
calcPowerStation.Id = powerStation.Id;
|
||||
var dateNowDay = DateTimeNow.AddDays(-1).ToString("yyyy-MM-dd");
|
||||
|
||||
dateNowDay = "2021-07-19";
|
||||
|
||||
#region step2-1. 計算該電站的30天平均資料
|
||||
var table_name = String.Format("`{0}`.`s{1}01_station`", powerStation.SiteDB, powerStation.Code);
|
||||
logger.LogInformation("【CalcAvgPowerStationJob】【開始計算電站[{0}]在{1}的30天平均資料】", powerStation.Code, dateNowDay);
|
||||
|
||||
@ -68,7 +68,7 @@ namespace SolarPower.Quartz.Jobs
|
||||
var calcPowerStation = new PowerStation();
|
||||
calcPowerStation.Id = powerStation.Id;
|
||||
|
||||
var dateTime = DateTimeNow.AddHours(-3).ToString("yyyy-MM-dd HH");
|
||||
var dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH");
|
||||
|
||||
#region step2-1. 取得該電站的當前這小時的歷史資料
|
||||
var table_name = String.Format("`{0}`.s{1}01_station", powerStation.SiteDB, powerStation.Code);
|
||||
|
||||
@ -200,7 +200,7 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp,'%H %p') AS Label, ps.KWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_hour ps
|
||||
LEFT JOIN sensor_history_hour pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d %H') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d %H')
|
||||
LEFT JOIN sensor_history_hour pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d %H') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d %H')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = @NowDay";
|
||||
|
||||
@ -224,7 +224,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_day ps
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(FROM_UNIXTIME(pyr.timestamp), '%Y-%m-%d')
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') BETWEEN @StartDay AND @NowDay";
|
||||
|
||||
@ -248,7 +248,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_day ps
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(FROM_UNIXTIME(pyr.timestamp), '%Y-%m-%d')
|
||||
LEFT JOIN sensor_history_day pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') = DATE_FORMAT(pyr.timestamp, '%Y-%m-%d')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y-%m-%d') BETWEEN @StartDay AND @NowDay";
|
||||
|
||||
@ -273,7 +273,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData
|
||||
FROM power_station_history_month ps
|
||||
LEFT JOIN sensor_history_month pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m') = DATE_FORMAT(FROM_UNIXTIME(pyr.timestamp), '%Y-%m')
|
||||
LEFT JOIN sensor_history_month pyr ON ps.PowerStationId = pyr.PowerStationId AND DATE_FORMAT(ps.timestamp, '%Y-%m') = DATE_FORMAT(pyr.timestamp, '%Y-%m')
|
||||
WHERE ps.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(ps.timestamp, '%Y') = @Year";
|
||||
|
||||
@ -385,7 +385,7 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql_power = @$"SELECT DATE_FORMAT(inv.TIMESTAMP, '%Y-%m-%d %H') AS TIMESTAMP,
|
||||
var sql_power = @$"SELECT DATE_FORMAT(inv.TIMESTAMP, '%H %p') AS TIMESTAMP,
|
||||
inv.INVERTERID,
|
||||
inv.KWH
|
||||
FROM inverter_history_hour inv
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<div id="panel-5" class="panel">
|
||||
<div class="panel-container show">
|
||||
<div class="panel-content">
|
||||
<div class="row subheader">
|
||||
<div class="row subheader d-flex justify-content-between">
|
||||
<div class="col-xl-2">
|
||||
<h1 class="subheader-title">
|
||||
<span class="icon-stack fa-1x">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user