1. bug fix

This commit is contained in:
Kai 2021-08-10 18:34:00 +08:00
parent 09d355ae98
commit 5873750d59
3 changed files with 23 additions and 5 deletions

View File

@ -34,6 +34,8 @@ namespace SolarPower.Quartz.Jobs
{
try
{
logger.LogInformation("【CalcAvgPowerStationJob】【任務開始】");
#region
var users = userRepository.GetAllAsync();
@ -199,11 +201,13 @@ namespace SolarPower.Quartz.Jobs
logger.LogInformation("【CalcAvgPowerStationJob】【電站資料】 - {0}", System.Text.Json.JsonSerializer.Serialize(powerStations));
#endregion
//電站資訊
List<PowerStation> calcAvgPowerStations = new List<PowerStation>();
List<PowerStationHistoryDay> powerStationHistoryDays = new List<PowerStationHistoryDay>();
List<PowerStationHistoryMonth> insertPowerStationHistoryMonths = new List<PowerStationHistoryMonth>();
List<PowerStationHistoryMonth> updatePowerStationHistoryMonths = new List<PowerStationHistoryMonth>();
//日照計、溫度資訊
List<PyrheliometerHistory> pyrheliometerHistoryDays = new List<PyrheliometerHistory>();
List<PyrheliometerHistory> insertPyrheliometerHistoryMonths = new List<PyrheliometerHistory>();
List<PyrheliometerHistory> updatePyrheliometerHistoryMonths = new List<PyrheliometerHistory>();
@ -215,6 +219,7 @@ namespace SolarPower.Quartz.Jobs
"Temperature"
};
//逆變器
List<InverterHistory> allofInverterHistorDays = new List<InverterHistory>();
List<InverterHistory> insertInverterHistoryMonths = new List<InverterHistory>();
List<InverterHistory> updateInverterHistoryMonths = new List<InverterHistory>();
@ -277,6 +282,7 @@ namespace SolarPower.Quartz.Jobs
"KWHKWP",
};
//sensor
List<SensorAvgHistory> sensorAvgHistoryDays = new List<SensorAvgHistory>();
List<SensorAvgHistory> insertSensorAvgHistoryMonths = new List<SensorAvgHistory>();
List<SensorAvgHistory> updateSensorAvgHistoryMonths = new List<SensorAvgHistory>();
@ -336,6 +342,7 @@ namespace SolarPower.Quartz.Jobs
"SENSORAVG50",
};
//電錶
List<MeterHistory> meterHistoriesDays = new List<MeterHistory>();
List<MeterHistory> insertmeterHistoryMonths = new List<MeterHistory>();
List<MeterHistory> updatemeterHistoryMonths = new List<MeterHistory>();
@ -483,7 +490,7 @@ namespace SolarPower.Quartz.Jobs
logger.LogInformation("【CalcAvgPowerStationJob】【計算完成電站[{0}]在{1}的30天平均資料】", powerStation.Code, dateNowDay);
}
#region step2-2 30
#region 30
logger.LogInformation("【CalcAvgPowerStationJob】【開始計算電站[{0}]在{1}的30天日照計平均資料】", powerStation.Code, dateNowDay);
var avgPyrheliometerHistory = await powerStationRepository.CalcAvgPyrheliometerHistory30day(dateNowDay, powerStation.Id);
logger.LogInformation("【CalcAvgPowerStationJob】【取得成功電站[{0}]在{1}的30天日照計平均資料】", powerStation.Code, dateNowDay);
@ -532,7 +539,7 @@ namespace SolarPower.Quartz.Jobs
}
}
//日照計
//日照計、溫度
logger.LogInformation("【CalcAvgPowerStationJob】【開始計算電站[{0}]在{1}的日照計所有值的平均】", powerStation.Code, dateNowDay);
var pyrheliometerHistorDay = await powerStationRepository.CalcPyrheliometerHistoryDayDataByPowerStationId(dateNowDay, powerStation.Id);
logger.LogInformation("【CalcAvgPowerStationJob】【計算完成電站[{0}]在{1}的日照計所有值的平均】", powerStation.Code, dateNowDay);
@ -545,7 +552,7 @@ namespace SolarPower.Quartz.Jobs
logger.LogInformation("【CalcAvgPowerStationJob】【開始計算電站[{0}]在{1}的逆變器所有值的平均】", powerStation.Code, dateNowDay);
var inverterHistoriesDay = await powerStationRepository.CalcInverterHistoryDayDataByPowerStationId(dateNowDay, powerStation.SiteDB, powerStation.Id);
logger.LogInformation("【CalcAvgPowerStationJob】【計算完成電站[{0}]在{1}的逆變器所有值的平均】", powerStation.Code, dateNowDay);
if (inverterHistoriesDay != null)
if (inverterHistoriesDay != null && inverterHistoriesDay.Count() > 0)
{
foreach (var inverterHistoryDay in inverterHistoriesDay)
{

View File

@ -311,7 +311,7 @@ namespace SolarPower.Quartz.Jobs
var meter_table_name = String.Format("s{0}01_meter", powerStation.Code);
var full_meter_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, meter_table_name);
var exist_meter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, meter_table_name);
if (!string.IsNullOrEmpty(exist_seneoravg_table))
if (!string.IsNullOrEmpty(exist_meter_table))
{
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
var meterHistory = await powerStationRepository.CalcMeterHistory(dateTime, full_meter_table_name);

View File

@ -1956,7 +1956,18 @@
text: '逆變器單日kWhkWp'
},
xAxis: {
categories: HeatMap.xAxisOnTime
categories: HeatMap.xAxis,
labels: {
step: 1,
formatter: function () {
var aa = this.value.substr(-2);
if (aa == "00") {
return '<span>' + this.value + '</span>';
} else {
return '<span style="display:none">' + this.value + '</span>';
}
}
}
},
yAxis: {
categories: HeatMap.yAxis,