From 8ffc46e79e805f2b060365a5324bc7983291ca78 Mon Sep 17 00:00:00 2001 From: Kai Date: Sat, 11 Sep 2021 19:46:46 +0800 Subject: [PATCH] 1. bug fix --- SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs | 2 +- solarApp/Service/procInvSvc.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs index eff4892..35d4e13 100644 --- a/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs +++ b/SolarPower/Quartz/Jobs/CalcAvgPowerStationJob.cs @@ -796,7 +796,7 @@ namespace SolarPower.Quartz.Jobs procStationSvc siteSvc = new procStationSvc(Connection_string); foreach (var powerStation in powerStations) { - + start_date = DateTimeNow.AddDays(-1 * gobackDay); for (; start_date <= end_date; start_date = start_date.AddDays(1)) { var day_str = start_date.ToString("yyyy-MM-dd"); diff --git a/solarApp/Service/procInvSvc.cs b/solarApp/Service/procInvSvc.cs index fb8adbf..e8ebfc7 100644 --- a/solarApp/Service/procInvSvc.cs +++ b/solarApp/Service/procInvSvc.cs @@ -119,7 +119,7 @@ namespace solarApp.Service #region 15 min string sql = @" INSERT INTO solar_master.inverter_history_15min( PowerStationId, TIMESTAMP, INVERTERID, KWH, TODAYKWH, KWHKWP) - select PowerStationId, reportdate, a.inverterid, KWH, TODAYKWH, (kwh/capacity) kwpkwp from + select PowerStationId, reportdate, a.inverterid, KWH, TODAYKWH, (kwh/(capacity/4)) kwpkwp from ( select @PowerStationId PowerStationId, CONCAT(FROM_UNIXTIME(`TIMESTAMP`/1000,'%Y-%m-%d %H'), ':00:00')reportdate, inverterid, (sum(WH)/1000) KWH, max(TODAYKWH) TODAYKWH