網頁: 累積日照量差,修正半夜12的值會是負數問題
This commit is contained in:
parent
8bcdd703a2
commit
1735aca3ed
@ -53,7 +53,7 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站資料】");
|
logger.LogInformation("【CalcPowerStationJob】【開始取得電站資料】");
|
||||||
var powerStations = await powerStationRepository.GetAllAsync();
|
var powerStations = await powerStationRepository.GetAllAsync();
|
||||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站資料】");
|
logger.LogInformation("【CalcPowerStationJob】【取得成功電站資料】");
|
||||||
logger.LogInformation("【CalcPowerStationJob】【電站資料】 - {0}", System.Text.Json.JsonSerializer.Serialize(powerStations));
|
logger.LogInformation("【CalcPowerStationJob】【電站資料");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
List<PowerStationHistory> powerStationHistoriesHour = new List<PowerStationHistory>();
|
List<PowerStationHistory> powerStationHistoriesHour = new List<PowerStationHistory>();
|
||||||
@ -611,11 +611,28 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
var twoHourAgoIrrDay = await powerStationRepository.CalcIrrDayHistoryPerTwoHour(dateTime, powerStation.Id);
|
var twoHourAgoIrrDay = await powerStationRepository.CalcIrrDayHistoryPerTwoHour(dateTime, powerStation.Id);
|
||||||
if (twoHourAgoIrrDay != null)
|
if (twoHourAgoIrrDay != null)
|
||||||
{
|
{
|
||||||
sensorHistory.IrrDayHour = sensorHistory.IrrDay - double.Parse(twoHourAgoIrrDay);// 前一小時的IrrDay - 前兩小時的IrrDay
|
|
||||||
|
if (DateTimeNow.AddHours(-1).Hour == 0)//半夜12點的值
|
||||||
|
{
|
||||||
|
sensorHistory.IrrDayHour = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sensorHistory.IrrDayHour = sensorHistory.IrrDay - double.Parse(twoHourAgoIrrDay);// 前一小時的IrrDay - 前兩小時的IrrDay
|
||||||
|
}
|
||||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的相減的累計日照量】", powerStation.Code, dateTime);
|
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的相減的累計日照量】", powerStation.Code, dateTime);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sensorHistory.IrrDayHour = 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sensorHistory.IrrDay = 0;
|
||||||
|
sensorHistory.IrrDayHour = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user