電站報表-日報: 累積日照顯示 IrrDayHour

This commit is contained in:
wanling040@gmail.com 2022-08-04 10:26:34 +08:00
parent ed1b3d212c
commit 04d4186264
4 changed files with 16 additions and 12 deletions

View File

@ -244,7 +244,7 @@ namespace SolarPower.Controllers
{
"小時發電量(kWh)",
"小時發電量百分比(%)",
"小時累積日照度(W/㎡)",
"累積日照度(Wh/㎡)",
"小時平均模組溫度(°C)"
};
if(Formhead.Result.Data.ShowMoney == 1)
@ -443,7 +443,7 @@ namespace SolarPower.Controllers
"日照小時(hr)",
"日均發電度數",
"PR%",
"累積日照度(W/㎡)",
"累積日照度(Wh/㎡)",
"日平均模組溫度(°C)"
};
@ -717,7 +717,7 @@ namespace SolarPower.Controllers
"日照小時(hr)",
"日均發電度數",
"PR%",
"累積日照度(W/㎡)",
"累積日照度(Wh/㎡)",
"月平均模組溫度(°C)"
};
@ -1116,7 +1116,7 @@ namespace SolarPower.Controllers
{
"小時發電量(kWh)",
"小時發電量百分比(%)",
"小時累積日照度(W/㎡)",
"累積日照度(Wh/㎡)",
"小時平均模組溫度(°C)"
};
if (Formhead.Result.Data.ShowMoney == 1)
@ -1317,7 +1317,7 @@ namespace SolarPower.Controllers
"日照小時(hr)",
"有效發電小時",
"PR%",
"累積日照量(W/㎡)",
"累積日照量(Wh/㎡)",
"日平均模組溫度(°C)"
};

View File

@ -733,6 +733,7 @@ namespace SolarPower.Models.PowerStation
public double Dust { get; set; } //落塵計
public double WingDirection { get; set; } //風向計
public double IrrDay { get; set; } //累計日照量
public double IrrDayHour { get; set; }//每小時的累積日照
}
public class AvgPyrheliometerHistory

View File

@ -97,6 +97,9 @@ namespace SolarPower.Models
public double PowerRate { get; set; }
public double GeneratingCapacity { get; set; }
public double TotalKWH { get; set; }
public double IrrDay { get; set; }
public double IrrDayHour { get; set; }
private string mintime;
private string maxtime;

View File

@ -89,7 +89,7 @@ namespace SolarPower.Repository.Implement
DROP TABLE IF EXISTS temp_inv;
create TEMPORARY TABLE temp_inv as
SELECT DATE_FORMAT(a.report_date,'%m-%d %H') report_date, {inv}
a.hourKWH hourKWH, a.hourKWHp 'hourKWHp', a.irradiance 'irradiance', a.Temperature 'temperature',
a.hourKWH hourKWH, a.hourKWHp 'hourKWHp', IFNULL(a.irrDay, 0) irrDay, IFNULL(a.irrDayHour, 0) irrDayHour, a.Temperature 'temperature',
a.hourmoney 'hourmoney', c.TODAYKWH 'totKWH', c.KWHKWP 'totKWHKWP', c.money 'totmoney', stationName, powerRate daymoney, c.SOLARHOUR tothour,round(a.PR, 2) as pr,GeneratingCapacity
FROM report_invday a
left join
@ -114,7 +114,7 @@ namespace SolarPower.Repository.Implement
select * from temp_inv
union
SELECT '' report_date, {inv}
round(sum(hourKWH), 2) hourKWH, round(sum(hourKWHp), 2) hourKWHp, round(sum(irradiance), 2) irradiance,
round(sum(hourKWH), 2) hourKWH, round(sum(hourKWHp), 2) hourKWHp, avg(irrDay) irrDay, avg(irrDayHour) irrDayHour,
avg(temperature) temperature, round(sum(hourmoney), 2) hourmoney, avg(totKWH) totKWH, avg(totKWHKWP) totKWHKWP, avg(totmoney) totmoney, '' stationName,
avg(daymoney) daymoney, avg(tothour) tothour, avg(pr) pr, avg(GeneratingCapacity) GeneratingCapacity
from temp_inv2 a; ";
@ -363,7 +363,7 @@ namespace SolarPower.Repository.Implement
break;
}
a = await conn.QueryAsync<dynamic>(sql, commandTimeout: 300);
a = await conn.QueryAsync<dynamic>(sql, commandTimeout: 600);
}
catch (Exception exception)
{
@ -406,7 +406,7 @@ namespace SolarPower.Repository.Implement
sql = @$"select Id from power_station_history_month where powerstationid = {post.PowerStation} and DATE_FORMAT(`TIMESTAMP`,'%Y') = '{post.Time}'";
break;
}
a = await conn.QueryFirstOrDefaultAsync<int>(sql);
a = await conn.QueryFirstOrDefaultAsync<int>(sql, 600);
}
catch (Exception exception)
{
@ -572,7 +572,7 @@ namespace SolarPower.Repository.Implement
LEFT JOIN area ar ON ar.Id = ps.AreaId
left JOIN
(
SELECT powerStationid id, ps.SOLARHOUR AS 'SolarHour',ps.TODAYKWH 'Kwh' , PR, KWHKWP, TODAYKWH, TOTALKWH,
SELECT powerStationid id, ps.SOLARHOUR AS 'SolarHour',SUM(ps.TODAYKWH) 'Kwh' , PR, KWHKWP, TODAYKWH, TOTALKWH,
DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d') AS 'time',
MAX(DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d %H:%i')) AS 'maxtime',
MIN(DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d %H:%i')) AS 'mintime', ps.PowerStationId
@ -588,7 +588,7 @@ namespace SolarPower.Repository.Implement
GROUP BY ps.PowerStationId
) c ON a.Id = c.PowerStationId and a.time = c.time
WHERE ps.Id IN @ids ORDER BY ps.CityId";
result = (await conn.QueryAsync<MaxFormbody>(sql,new { ids = ids}, commandTimeout: 300)).ToList();
result = (await conn.QueryAsync<MaxFormbody>(sql,new { ids = ids}, commandTimeout: 600)).ToList();
}
catch (Exception exception)
{
@ -792,7 +792,7 @@ namespace SolarPower.Repository.Implement
break;
}
a = await conn.QueryAsync<dynamic>(sql,commandTimeout: 300);
a = await conn.QueryAsync<dynamic>(sql,commandTimeout: 600);
}
catch (Exception exception)
{