1. 即時資訊 and 合併電站圖表:增加模組溫度

2.Sensor 如有多個需修正為多個平均
3.合併電站:選擇電站改為跟交叉分析中的左側選單相同
4. bug fix
This commit is contained in:
Kai 2021-08-05 17:12:38 +08:00
parent e5dd87a6cb
commit 6ad6054bba
25 changed files with 802 additions and 482 deletions

View File

@ -215,6 +215,7 @@ namespace SolarPower.Controllers
powerIrradianceTodayChart.Labels = powerIrradianceToday.Select(x => x.Label).ToList();
powerIrradianceTodayChart.PowerDatas = powerIrradianceToday.Select(x => x.PowerData).ToList();
powerIrradianceTodayChart.IrradianceDatas = powerIrradianceToday.Select(x => x.IrradianceData).ToList();
powerIrradianceTodayChart.TemperatureDatas = powerIrradianceToday.Select(x => x.TemperatureData).ToList();
chartUptoDate.ChartToday = powerIrradianceTodayChart;
//7日發電量日照度List
@ -224,24 +225,27 @@ namespace SolarPower.Controllers
powerIrradiance7dayChart.Labels = powerIrradiance7day.Select(x => x.Label).ToList();
powerIrradiance7dayChart.PowerDatas = powerIrradiance7day.Select(x => x.PowerData).ToList();
powerIrradiance7dayChart.IrradianceDatas = powerIrradiance7day.Select(x => x.IrradianceData).ToList();
powerIrradiance7dayChart.TemperatureDatas = powerIrradiance7day.Select(x => x.TemperatureData).ToList();
chartUptoDate.Chart7day = powerIrradiance7dayChart;
//本月發電量日照度List
var powerIrradianceMonth = await overviewRepository.GetListPowerIrradianceMonthByPowerStationId(id, nowDay);
//今日資料轉換
//本月資料轉換
PowerIrradianceChart powerIrradianceMonthChart = new PowerIrradianceChart();
powerIrradianceMonthChart.Labels = powerIrradianceMonth.Select(x => x.Label).ToList();
powerIrradianceMonthChart.PowerDatas = powerIrradianceMonth.Select(x => x.PowerData).ToList();
powerIrradianceMonthChart.IrradianceDatas = powerIrradianceMonth.Select(x => x.IrradianceData).ToList();
powerIrradianceMonthChart.TemperatureDatas = powerIrradianceMonth.Select(x => x.TemperatureData).ToList();
chartUptoDate.ChartMonth = powerIrradianceMonthChart;
//本年發電量日照度List
var powerIrradianceYear = await overviewRepository.GetListPowerIrradianceYearByPowerStationId(id, nowDay);
//今日資料轉換
//本月資料轉換
PowerIrradianceChart powerIrradianceYearChart = new PowerIrradianceChart();
powerIrradianceYearChart.Labels = powerIrradianceYear.Select(x => x.Label).ToList();
powerIrradianceYearChart.PowerDatas = powerIrradianceYear.Select(x => x.PowerData).ToList();
powerIrradianceYearChart.IrradianceDatas = powerIrradianceYear.Select(x => x.IrradianceData).ToList();
powerIrradianceYearChart.TemperatureDatas = powerIrradianceYear.Select(x => x.TemperatureData).ToList();
chartUptoDate.ChartYear = powerIrradianceYearChart;
apiResult.Code = "0000";

View File

@ -7,6 +7,7 @@ using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using SolarPower.Models;
using SolarPower.Models.PowerStation;
using SolarPower.Models.Role;
using SolarPower.Repository.Interface;
using System;
using System.Collections.Generic;
@ -49,7 +50,7 @@ namespace SolarPower.Controllers
}
else
{
powerStations = await powerStationRepository.GetPowerStationsByCompanyIdWithfilter(myUser.CompanyId,filter);
powerStations = await powerStationRepository.GetPowerStationsByCompanyIdWithfilter(myUser,filter);
}
var siteDBNamePowerStationId = new Dictionary<string, List<PowerStationIdAndCity>>();

View File

@ -428,12 +428,12 @@ INSERT INTO `auth_page` (`AuthCode`, `MainName`, `SubName`, `TagName`, `ControlN
('L', '交叉分析', '合併電站', NULL, 'AnalysisStationCombine'),
('M', '交叉分析', '電站交叉分析', NULL, 'AnalysisStationInfo'),
('N', '交叉分析', '逆變器交叉分析', NULL, 'AnalysisInverter'),
('P', '報表查詢', '電站報表', NULL, 'CCC'),
('P', '報表查詢', '電站報表', NULL, 'StationReport'),
('Q', '報表查詢', '電廠發電效能統計', NULL, 'HHH'),
('R', '報表查詢', '輸入台電售電紀錄', NULL, 'JJJ'),
('R', '報表查詢', '輸入台電售電紀錄', NULL, 'ElectricitySoldRecord'),
('S', '報表查詢', '報告發送設定', NULL, 'JJJ'),
('T', '即時告警', '異常事件查詢', NULL, 'KKK'),
('U', '運維管理', '電站管理', NULL, 'PowerStationManager'),
('U', '運維管理', '電站管理', NULL, 'PowerStation'),
('V', '運維管理', '定期計畫建立', NULL, 'Operation'),
('W', '運維管理', '運維作業記錄', NULL, 'OperationRecord'),
('X', '系統管理', '公司管理', NULL, 'Company'),
@ -1262,7 +1262,7 @@ CREATE TABLE IF NOT EXISTS `weather_description` (
`WeatherValue` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '分類代碼',
`WeatherKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'icon代號',
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=355 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='天氣描述分類';
) ENGINE=InnoDB AUTO_INCREMENT=355 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='天氣描述分類';
-- 正在傾印表格 solar_power_test.weather_description 的資料:~0 rows (近似值)
DELETE FROM `weather_description`;
@ -1636,7 +1636,7 @@ CREATE TABLE IF NOT EXISTS `weather_forecast` (
`CreatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Id`),
KEY `IDX_01` (`LocationName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='天氣預報';
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='天氣預報';
@ -1648,7 +1648,7 @@ CREATE TABLE IF NOT EXISTS `weather_observation` (
`Temp` double DEFAULT NULL COMMENT '溫度',
PRIMARY KEY (`Id`),
KEY `IDX_01` (`PowerStationId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='天氣觀測';
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='天氣觀測';

View File

@ -27,6 +27,7 @@ namespace SolarPower.Models
public class Chartoutput
{
public double Irradiance { get; set; }
public double Temperature { get; set; }
public double KWH { get; set; }
public string Time { get; set; }
}

View File

@ -16,6 +16,7 @@ namespace SolarPower.Models
public string Attachment { get; set; }
public byte IsDelivery { get; set; }
public string DeliveryAt { get; set; }
public string Reason { get; set; }
}
public class OperationPersonnel

View File

@ -77,6 +77,7 @@ namespace SolarPower.Models
public string Label { get; set; }
public double PowerData { get; set; }
public double IrradianceData { get; set; }
public double TemperatureData { get; set; }
}
public class PowerIrradianceChart
@ -84,6 +85,7 @@ namespace SolarPower.Models
public List<string> Labels { get; set; }
public List<double> PowerDatas { get; set; }
public List<double> IrradianceDatas { get; set; }
public List<double> TemperatureDatas { get; set; }
}
public class ExceptionSent

View File

@ -194,7 +194,7 @@ namespace SolarPower.Quartz.Jobs
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的日照計設備資訊】", powerStation.Code, dateTime);
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的日照計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(deviceInfos));
if (deviceInfos != null)
if (deviceInfos != null && deviceInfos.Count() > 0)
{
//2. 計算該電站所有日照計設的每小時的平均在依照日照計數量平均
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的日照計的日照度】", powerStation.Code, dateTime);
@ -216,7 +216,7 @@ namespace SolarPower.Quartz.Jobs
var tempdeviceInfos = await powerStationRepository.GetListTempByPowerStationId(powerStation.Id, powerStation.SiteDB);
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的溫度計設備資訊】", powerStation.Code, dateTime);
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的溫度計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(tempdeviceInfos));
if (tempdeviceInfos != null)
if (tempdeviceInfos != null && tempdeviceInfos.Count() > 0)
{
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的溫度計的平均溫度】", powerStation.Code, dateTime);
var tempHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, tempdeviceInfos, 1);
@ -244,7 +244,7 @@ namespace SolarPower.Quartz.Jobs
var full_inverter_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, inverter_table_name);
var exist_inverter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, inverter_table_name);
if (!string.IsNullOrEmpty(exist_inverter_table))
if (!string.IsNullOrEmpty(exist_inverter_table) && inverterIds !=null && inverterIds.Count() > 0)
{
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
inverterHistories = await powerStationRepository.CalcInverterHisyortHourData(dateTime, powerStation.SiteDB, full_inverter_table_name, inverterIds);
@ -322,10 +322,11 @@ namespace SolarPower.Quartz.Jobs
{
if (Location.StationId == powerStation.WeathersStationId)
{
calcPowerStation.TodayWeatherTemp = Convert.ToDouble(Location.WeatherElement[0].ElementValue);
weatherObservation.PowerStationId = powerStation.Id;
weatherObservation.Temp = Convert.ToDouble(Location.WeatherElement[0].ElementValue);
weatherObservation.ObsTime = Location.Time.ObsTime.ToString();
weatherObservation.ObsTime = Convert.ToInt32(Location.Time.ObsTime.Substring(0, 4)) < 1970? null : Location.Time.ObsTime;
calcPowerStation.WeathersStationId = powerStation.WeathersStationId;
break;
}

View File

@ -55,7 +55,7 @@ namespace SolarPower.Quartz.Jobs
var result = Send(recipientEmails, notice.Subject, notice.Content, attachments);
if(result)
if (result.CompareTo("成功") == 0)
{
NoticeSchedule noticeSchedule = new NoticeSchedule();
noticeSchedule.Id = notice.Id;
@ -64,6 +64,16 @@ namespace SolarPower.Quartz.Jobs
updateNoticeSchedules.Add(noticeSchedule);
}
else
{
NoticeSchedule noticeSchedule = new NoticeSchedule();
noticeSchedule.Id = notice.Id;
noticeSchedule.IsDelivery = 2;
noticeSchedule.DeliveryAt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
noticeSchedule.Reason = result;
updateNoticeSchedules.Add(noticeSchedule);
}
List<string> properties = new List<string>()
{
@ -83,8 +93,10 @@ namespace SolarPower.Quartz.Jobs
}
}
private bool Send(List<string> recipientEmails, string subject, string content, List<string> attachments)
private string Send(List<string> recipientEmails, string subject, string content, List<string> attachments)
{
var reason = string.Empty;
var CanDoSend = true;
MailMessage MyMail = new MailMessage();
MyMail.SubjectEncoding = System.Text.Encoding.UTF8;//郵件標題編碼
@ -100,16 +112,27 @@ namespace SolarPower.Quartz.Jobs
MyMail.Subject = subject; //主題
MyMail.Body = content; //設定信件內容
foreach(var attachment in attachments)
foreach (var attachment in attachments)
{
var directoryBase = Directory.GetCurrentDirectory();
var filePath = @$"{directoryBase}\wwwroot{attachment}";
if (File.Exists(filePath))
{
var data = new Attachment(filePath);
MyMail.Attachments.Add(data);
}
else
{
CanDoSend = false;
reason = "失敗 - 檔案遺失";
break;
}
}
//讀取 SMTP Config
if (CanDoSend)
{
SmtpClient MySMTP = new SmtpClient(smtp.Host, smtp.Port);
MySMTP.EnableSsl = smtp.EnableSsl;
MySMTP.Credentials = new System.Net.NetworkCredential(smtp.UserName, smtp.Password);
@ -119,7 +142,7 @@ namespace SolarPower.Quartz.Jobs
MySMTP.Dispose();
MyMail.Dispose(); //釋放資源
return true;
return "成功";
}
catch (Exception ex)
{
@ -128,7 +151,12 @@ namespace SolarPower.Quartz.Jobs
logger.LogError("【SendEmailJob】 - Emails:" + json);
logger.LogError("【SendEmailJob】 - Exception:" + ex.Message);
return false;
return "失敗 - " + ex.Message;
}
}
else
{
return reason;
}
}

View File

@ -159,7 +159,10 @@ namespace SolarPower.Repository.Implement
switch (post.SeacrhType)
{
case 0:
sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%h %p') AS `Time`,SUM(ps.KWH) AS KWH,SUM(sh.Irradiance) AS Irradiance
sql = $@"SELECT DATE_FORMAT(ps.TIMESTAMP,'%h %p') AS `Time`,
SUM(ps.KWH) AS KWH,
SUM(sh.Irradiance) AS Irradiance,
AVG(sh.Temperature) AS Temperature
FROM power_station_history_hour ps
LEFT JOIN sensor_history_hour sh
ON sh.TIMESTAMP = ps.TIMESTAMP AND sh.PowerStationId = ps.PowerStationId
@ -171,7 +174,8 @@ namespace SolarPower.Repository.Implement
sql = $@"SELECT
DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d') AS `Time`,
SUM(ps.TODAYKWH) AS KWH,
SUM(sh.Irradiance) AS Irradiance
SUM(sh.Irradiance) AS Irradiance,
AVG(sh.Temperature) AS Temperature
FROM power_station_history_day ps
LEFT JOIN sensor_history_day sh
ON sh.TIMESTAMP = ps.TIMESTAMP
@ -182,7 +186,8 @@ namespace SolarPower.Repository.Implement
sql = $@"SELECT
DATE_FORMAT(ps.TIMESTAMP,'%Y-%m-%d') AS `Time`,
SUM(ps.TODAYKWH) AS KWH,
SUM(sh.Irradiance) AS Irradiance
SUM(sh.Irradiance) AS Irradiance,
AVG(sh.Temperature) AS Temperature
FROM power_station_history_day ps
LEFT JOIN sensor_history_day sh
ON sh.TIMESTAMP = ps.TIMESTAMP
@ -193,7 +198,8 @@ namespace SolarPower.Repository.Implement
sql = $@"SELECT
DATE_FORMAT(ps.TIMESTAMP,'%Y-%m') AS `Time`,
SUM(ps.MONTHKWH) AS KWH,
SUM(sh.Irradiance) AS Irradiance
SUM(sh.Irradiance) AS Irradiance,
AVG(sh.Temperature) AS Temperature
FROM power_station_history_month ps
LEFT JOIN sensor_history_month sh
ON sh.TIMESTAMP = ps.TIMESTAMP

View File

@ -110,11 +110,16 @@ namespace SolarPower.Repository.Implement
var dateNow = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
var sql = @$"SELECT
w.Wx,
wf.Wx,
ps.*
FROM power_station ps
LEFT JOIN city c ON ps.CityId = c.Id
LEFT JOIN weather_forecast w ON c.Name = w.LocationName AND w.StartTime < @DateNow AND w.EndTime > @DateNow
LEFT JOIN (SELECT * FROM (
SELECT MAX(w.Id) AS aa FROM weather_forecast w
WHERE w.StartTime < @DateNow AND w.EndTime > @DateNow
GROUP BY w.LocationName
) A
LEFT JOIN weather_forecast B ON A.aa = B.Id) wf ON c.Name = wf.LocationName
WHERE ps.Id IN @PowerStationIds
";
@ -206,7 +211,7 @@ namespace SolarPower.Repository.Implement
{
try
{
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp,'%H %p') AS Label, ps.KWH AS PowerData, pyr.Irradiance AS IrradianceData
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp,'%H %p') AS Label, ps.KWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData
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')
WHERE ps.PowerStationId = @PowerStationId
@ -231,7 +236,7 @@ namespace SolarPower.Repository.Implement
{
var startDay = Convert.ToDateTime(nowDay).AddDays(-7).ToString("yyyy-MM-dd");
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData
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(pyr.timestamp, '%Y-%m-%d')
WHERE ps.PowerStationId = @PowerStationId
@ -256,7 +261,7 @@ namespace SolarPower.Repository.Implement
{
var startDay = Convert.ToDateTime(nowDay).ToString("yyyy-MM-01");
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m-%d') AS Label, ps.TODAYKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData
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(pyr.timestamp, '%Y-%m-%d')
WHERE ps.PowerStationId = @PowerStationId
@ -282,7 +287,7 @@ namespace SolarPower.Repository.Implement
{
var startyear = Convert.ToDateTime(nowDay).ToString("yyyy");
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData
var sql_power = @$"SELECT DATE_FORMAT(ps.timestamp, '%Y-%m') AS Label, ps.MONTHKWH AS PowerData, pyr.Irradiance AS IrradianceData, pyr.Temperature AS TemperatureData
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(pyr.timestamp, '%Y-%m')
WHERE ps.PowerStationId = @PowerStationId

View File

@ -3287,7 +3287,7 @@ namespace SolarPower.Repository.Implement
FROM city c
LEFT JOIN weather_forecast wf ON wf.LocationName = c.`Name`
LEFT JOIN weather_description wd ON wd.WeatherName = wf.Wx
WHERE c.Priority = {CityId} AND '{now}' BETWEEN wf.StartTime AND wf.EndTime ORDER BY wf.CreatedAt desc";
WHERE c.Id = {CityId} AND '{now}' BETWEEN wf.StartTime AND wf.EndTime ORDER BY wf.CreatedAt desc";
result = await conn.QueryFirstOrDefaultAsync<NowWeather>(sql);
}
@ -3754,7 +3754,7 @@ namespace SolarPower.Repository.Implement
FROM power_station ps
LEFT JOIN `city` c ON ps.CityId = c.Id
LEFT JOIN {powerStationDic.Key}.controller con ON ps.Id = con.PowerStationId
LEFT JOIN {powerStationDic.Key}.inverter inv ON con.Id = inv.ControllerId
LEFT JOIN {powerStationDic.Key}.inverter inv ON con.Id = inv.ControllerId AND inv.Enabled = 1 AND inv.status != 0
WHERE ps.Deleted = 0
AND ps.Id IN ({powerStationIds})";
if (!string.IsNullOrEmpty(filter))
@ -4010,7 +4010,7 @@ namespace SolarPower.Repository.Implement
}
public async Task<List<PowerStationIdAndCity>> GetPowerStationsByCompanyIdWithfilter(int companyId, string filter)
public async Task<List<PowerStationIdAndCity>> GetPowerStationsByCompanyIdWithfilter(MyUser myUser, string filter)
{
List<PowerStationIdAndCity> result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
@ -4018,14 +4018,23 @@ namespace SolarPower.Repository.Implement
try
{
var sql = $@"SELECT ps.Id AS PowerStationId , ps.`Name` AS PowerStationName,city.Name AS CityName FROM {tableName} ps
LEFT JOIN city ON city.Id = ps.CityId WHERE ps.Deleted = 0 AND ps.CompanyId = @CompanyId ";
LEFT JOIN city ON city.Id = ps.CityId";
if (myUser.Role.Layer == 2)
{
sql += " WHERE ps.Deleted = 0 AND ps.CompanyId = @CompanyId ";
}
else
{
sql += @" LEFT JOIN power_station_operation_personnel op ON ps.Id = op.PowerStationId
WHERE ps.Deleted = 0 AND op.Deleted = 0 AND op.UserId = @UserId ";
}
if (!string.IsNullOrEmpty(filter))
{
sql += @" AND ps.Name LIKE CONCAT('%', @Filter, '%')";
}
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = companyId, Filter = filter })).ToList();
result = (await conn.QueryAsync<PowerStationIdAndCity>(sql, new { CompanyId = myUser.CompanyId, UserId = myUser.Id, Filter = filter })).ToList();
}
catch (Exception exception)
{

View File

@ -552,7 +552,7 @@ namespace SolarPower.Repository.Interface
Task<List<InverterHistory>> GetInverterHistoryRowData(string nowDay, List<StationCodeWithInverterIds> entities);
Task<List<InverterHistory>> GetInverterHistoryByDate(string startDay, string endDay, List<StationIdWithInverterIds> entities);
Task<List<InverterHistory>> GetInverterHistoryByYear(string year, List<StationIdWithInverterIds> entities);
Task<List<PowerStationIdAndCity>> GetPowerStationsByCompanyIdWithfilter(int companyId, string filter);
Task<List<PowerStationIdAndCity>> GetPowerStationsByCompanyIdWithfilter(MyUser myUser, string filter);
Task<List<PowerStationIdAndCity>> GetPowerStationsAllWithfilter(string filter);
Task<List<Device>> GetDeviceByPowerStationIdAndDeviceIds(string db_name, int powerStationId, List<string> deviceIds);
Task<dynamic> GetSensorAvgByDevices(string date, byte searchType, List<Device> devices);

View File

@ -429,7 +429,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.data.msg);
toast_error(rel.msg);
return;
}

View File

@ -6,24 +6,46 @@
@using SolarPower.Models.Role
@model RoleLayerEnum
<ol class="breadcrumb page-breadcrumb">
<div class="container-fluid">
<div class="row flex-nowrap wrapper">
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100">
<div class="list-group border-0 card text-center text-md-left" id="sidebar">
<div class="border bg-light rounded-top">
<div class="form-group p-2 m-0 rounded-top">
<input type="text" class="form-control form-control-lg shadow-inset-2 m-0" id="js_list_accordion_filter" placeholder="">
</div>
<div id="js_list_accordion" class="accordion accordion-hover accordion-clean js-list-filter">
</div>
<span class="filter-message js-filter-message"></span>
</div>
</div>
</div>
<div class="col-auto px-0">
<a href="javascript:;" data-target=".sidebar" data-toggle="collapse" class="btn btn-default btn-xs btn-icon waves-effect waves-themed" style="border-radius: 0;"><i onclick="myfunc(this)" class="fal fa-angle-right fa-lg py-3" id="collapse"></i></a>
</div>
<main class="col px-5 pl-md-2 main">
<ol class="breadcrumb page-breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">交叉分析</a></li>
<li class="breadcrumb-item active">合併電站</li>
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
</ol>
<div class="subheader">
</ol>
<div class="subheader">
<h1 class="subheader-title">
<i class='subheader-icon fal fa-globe'></i> 合併電站
</h1>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-xl-12">
<div id="panel-5" class="panel">
<div class="panel-container show">
<div class="panel-content">
<div class="row mb-3 d-flex align-items-center px-3">
@*<div class="row mb-3 d-flex align-items-center px-3">
<div class="pr-3">
<button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="Allcity()">全部縣市</button>
</div>
@ -49,7 +71,7 @@
</div>
</div>
</div>
</div>*@
<div class="row mb-5 d-flex align-items-top px-3">
<div class="pr-3">
@ -69,7 +91,7 @@
<div class="btn-group" id="js-demo-nesting" role="group" aria-label="Button group with nested dropdown">
<input type="date" class="form-control" id="DateGet" />
</div>
<div class="btn-group" id="DateGettextdiv" role="group" aria-label="Button group with nested dropdown" >
<div class="btn-group" id="DateGettextdiv" role="group" aria-label="Button group with nested dropdown">
<input type="text" class="form-control" id="DateGettext" />
</div>
</div>
@ -82,7 +104,7 @@
<div class="card">
<div class="card-header bg-fusion-25 pr-3 d-flex align-items-center flex-wrap">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 發電量</h4>
<div class="ml-auto">kwh</div>
<div class="ml-auto">kW h</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
@ -114,15 +136,16 @@
<div class="card">
<div class="card-header bg-fusion-25 pr-3 d-flex align-items-center flex-wrap">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-sun mr-1"></span> kWh / kWp</h4>
<h4 class="mb-0 font-weight-bold"><span class="fal fa-sun mr-1"></span>有效日照時數</h4>
<div class="ml-auto">hr</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>平均 kWh / kWp</p>
<p>平均有效日照時數</p>
<p><span class="color-info-700" id="total_kwhkwp">140.39</span></p>
</div>
<div class="d-flex justify-content-between">
<p>今日 kWh / kWp </p>
<p>今日有效日照時數 </p>
<p><span class="color-info-700" id="today_kwhkwp">4.53</span></p>
</div>
</div>
@ -130,6 +153,7 @@
<div class="card">
<div class="card-header bg-fusion-25 pr-3 d-flex align-items-center flex-wrap">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> PR值</h4>
<div class="ml-auto">%</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
@ -193,9 +217,15 @@
</div>
</div>
</div>
</div>
</main>
</div>
</div>
@section Scripts{
<script>
var ids = new Array(0);//當前選擇縣市
@ -206,6 +236,8 @@
var datepicker;
var timerange;//選取時間
$(function () {
$('#collapse').trigger("click");
//#region 預設初始值
$('#DateGet').val(new Date().toISOString().substring(0, 10));
document.getElementById("DateGettextdiv").style.display = "none";//隱藏
@ -224,167 +256,13 @@
//#endregion
//#region 預設載入該使用者可以選擇的電站
var Nurl = "/PowerStation/GetSolarCitySummary";
$.post(Nurl, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
for (var i = 0; i < rel.data.length; i++) {
$('#city').append("<button type='button' class='btn btn-success waves-effect waves-themed ml-2' id='" + 'cityID_' + rel.data[i].cityId + "'>" +
rel.data[i].city +
"<span class= 'badge bg-success-700 ml-2' >" + rel.data[i].amount + "</span >" +
"</button >");
ids.push(String(rel.data[i].cityId));
Allids.push(String(rel.data[i].cityId));
}
var send_data = {
cityid: ids
}
ids.sort();
var Nurl = "/PowerStation/GetSolarByCity";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
$('#CheckPowerStation').empty();
$.each(rel.data, function (index, val) {
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' ></div>");
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "' checked>");
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
powerids.push(String(val.id));
Allpowerids.push(String(val.id));
});
GetStationsCard();//5張卡片值
photoshow();//輪播圖片
})
})
//#region 載入左邊選單列表
GetPowerStationCollapse("");
//#endregion
})
//#region 選擇電站checkbox
$('#CheckPowerStation').on("click", "input", function () {
var clickid = $(this).attr('id');
var classid = clickid.split("_");
var job = document.getElementById(clickid);
if (job.checked == true) {
powerids.push(classid[1]);
}
else {
powerids.remove(classid[1]);
}
GetStationsCard();
})
//#endregion
//#region 縣市全選
function Allcity() {
var Newpowerids = new Array(0);
ids = [];
$.each(Allids, function (index, val) {
var cityid = 'cityID_' + val;
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(val);
});
var send_data = {
cityid: ids
}
var Nurl = "/PowerStation/GetSolarByCity";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
$('#CheckPowerStation').empty();
Allpowerids = [];
$.each(rel.data, function (index, val) {
if (powerids.includes(String(val.id))) {
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "' checked>");
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
Newpowerids.push(String(val.id));
}
else {
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "'>");
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
}
Allpowerids.push(String(val.id));
});
powerids = [];
powerids = Newpowerids;
})
GetStationsCard();
}
//#endregion
//#region 電站全選
function Allpowerstation() {
powerids = [];
$.each(Allpowerids, function (index, val) {
$('#check_' + val).prop("checked", true);
powerids.push(val);
})
GetStationsCard();
}
//#endregion
//#region 選擇縣市
$('#city').on("click", "button", function () {
var clickid = $(this).attr('id');
var classid = clickid.split("_");
var Newpowerids = new Array(0);
var value = document.getElementById(clickid).className;
ids.sort(function (a, b) {
return a - b;
});
var send_data = {
cityid: ids
}
if (value == 'btn btn-outline-success waves-effect waves-themed ml-2') { //選擇
document.getElementById(clickid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(classid[1]);
}
else { //取消
document.getElementById(clickid).setAttribute("class", 'btn btn-outline-success waves-effect waves-themed ml-2');
ids.remove(classid[1]);
}
ids.sort();
var Nurl = "/PowerStation/GetSolarByCity";
$.post(Nurl, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
$('#CheckPowerStation').empty();
Allpowerids = [];
$.each(rel.data, function (index, val) {
if (powerids.includes(String(val.id))) {
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "' checked>");
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
Newpowerids.push(String(val.id));
}
else {
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "'>");
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
}
Allpowerids.push(String(val.id));
});
powerids = [];
powerids = Newpowerids;
})
GetStationsCard();
})
//#endregion
//#region 更換搜尋條件(日,日區間,月,年)
function changeType(type, e) {
searchType = type;
@ -461,10 +339,8 @@
//#endregion
//#region 快速填入條件(EX.今昨天)
function quickSearch(day)
{
switch (searchType)
{
function quickSearch(day) {
switch (searchType) {
case 0:
if (day == 0) {
var today = new Date().toISOString().substring(0, 10);
@ -534,8 +410,7 @@
//#endregion
//#region 5張卡片值
function GetStationsCard()
{
function GetStationsCard() {
var send_data = {
stationIds: powerids,
timerange: timerange,
@ -567,8 +442,7 @@
//#endregion
//#region 圖片輪播
function photoshow()
{
function photoshow() {
var url_image = "/PowerStation/GetAllPowerStationsALLImage";
var send_data = {
powerStationId: powerids
@ -612,6 +486,7 @@
}
var listmonth = new Array(0);
var listirradiance = new Array(0);
var listtemperature = new Array(0);
var listkwh = new Array(0);
var Nurl = "/AnalysisStationCombine/GetChart";
@ -622,8 +497,9 @@
}
$.each(rel.data, function (index, val) {
listmonth.push(val.time);
listirradiance.push(val.irradiance);
listkwh.push(val.kwh);
listirradiance.push(val.irradiance.toFixed(2));
listkwh.push(val.kwh.toFixed(2));
listtemperature.push(val.temperature.toFixed(2));
})
$('#station-convas-div').empty();
$('#station-convas-div').append('<canvas id="station-convas"></canvas>');
@ -634,6 +510,16 @@
data: {
labels: listmonth,
datasets: [{
type: 'line',
label: '模組溫度(℃)',
borderColor: 'rgb(255, 192, 0)',
pointBackgroundColor: 'rgb(255, 192, 0)',
pointBorderColor: 'rgb(255, 192, 0)',
pointRadius: 4,
yAxisID: 'C',
fill: false,
data: listtemperature
},{
type: 'line',
label: '日照度(kWh/㎡)',
borderColor: 'rgb(190, 45, 45)',
@ -684,6 +570,17 @@
display: true,
labelString: 'kWh/㎡'
}
}, {
id: 'C',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '℃'
}
}]
}
}
@ -693,5 +590,109 @@
}
//#endregion
//#region 左邊的搜索欄位
function myfunc(div) {
var className = div.getAttribute("class");
if (className == "fal fa-angle-left fa-lg py-3") {
div.className = "fal fa-angle-right fa-lg py-3";
}
else {
div.className = "fal fa-angle-left fa-lg py-3";
}
}
$("#js_list_accordion_filter").change(function (e) {
GetPowerStationCollapse($(this).val());
});
$('#js_list_accordion').on("change", 'input[name="selectedPowerStationLayer2[]"]', function (event) {
if (this.checked) {
powerids.push(this.value);
} else {
powerids.splice($.inArray(this.value, powerids), 1);
}
GetStationsCard();//5張卡片值
photoshow();//輪播圖片
});
function GetPowerStationCollapse(filter) {
var url = "/StationReport/GetPowerStationNameList"
var send_data = {
Filter: filter
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
var powerStationCollapse = rel.data;
$('#js_list_accordion').empty();
var xxx = Object.keys(powerStationCollapse).length
if (Object.keys(powerStationCollapse).length <= 0) {
$('#js_list_accordion').append("<div>查無結果</div>");
}
var str = "";
Object.keys(powerStationCollapse).map(function (key, index) {
str += '<div class="card border-top-left-radius-0 border-top-right-radius-0" id="templateCard">' +
'<div class="card-header">' +
'<a href="javascript:void(0);" class="card-title collapsed" data-toggle="collapse" data-target="#js_list_accordion-' + index + '" aria-expanded="false" data-filter-tags="settings">' +
'<i class="fal fa-globe width-2 fs-xl"></i>' +
'<span class="city-name">' + key + '</span>' +
'<span class="ml-auto">' +
'<span class="collapsed-reveal"><i class="fal fa-chevron-up fs-xl"></i></span>' +
'<span class="collapsed-hidden"><i class="fal fa-chevron-down fs-xl"></i></span>' +
'</span>' +
'</a>' +
'</div>' +
'<div id="js_list_accordion-' + index + '" class="collapse" data-parent="#js_list_accordion-' + index + '" style="">' +
'<div class="card-body">' +
'<ul class="list-group list-group-flush">';
$.each(powerStationCollapse[key], function (index, powerStation) {
str += '<li class="list-group-item">' +
'<div class="d-flex justify-content-between">' +
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + powerStation.powerStationName + '</h4>' +
'<div class="">' +
'<input type="checkbox" class="" name="selectedPowerStationLayer2[]" value="' + powerStation.powerStationId + '" valueName ="' + powerStation.powerStationName + '">' +
'</div>' +
'</div>' +
'</li>';
});
str += '</ul>';
str += '</div>';
str += '</div>';
});
$('#js_list_accordion').append(str);
$('#js_list_accordion').find('.card').first().addClass(" border-top-left-radius-0 border-top-right-radius-0");
if (powerids.length <= 0) {
$('input[name="selectedPowerStationLayer2[]"]').trigger("click");
}
$('input[name="selectedPowerStationLayer2[]"]').each(function () {
if ($.inArray(this.value, powerids) > -1) {
$(this).prop('checked', true);
}
});
$("#js_list_accordion .collapse").collapse('show');
}, 'json');
}
//#endregion
</script>
}

View File

@ -967,7 +967,22 @@
$("#power_station_operation_personnel").select2();
var ps_company_text = $("#select_power_station_company").find(':selected').text();
@if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
{
<text>
Swal.fire(
{
title: "",
text: "你確定是否要將該電站加入至【" + ps_company_text + "】?",
type: "question",
icon: 'question',
showCancelButton: true,
confirmButtonText: "是",
cancelButtonText: "否"
}).then(function (result) {
if (result.value) {
var url = "/PowerStation/SavePowerStationInfo";
var send_data = {
@ -1016,6 +1031,64 @@
}
}, 'json');
}
});
</text>
}
else
{
<text>
var url = "/PowerStation/SavePowerStationInfo";
var send_data = {
Id: stationId,
CityId: $("#select_city").val(),
AreaId: $("#select_area").val(),
Address: $("#address_detail").val(),
Name: $("#power_station_name").val(),
IsEscrow: $('#check_escrow').is(':checked') ? 1 : 0,
ElectricityMeterAt: $("#electricity_meter_at").val(),
EstimatedRecoveryTime: $("#estimated_recovery_time").val(),
GeneratingCapacity: $("#generating_capacity").val(),
EscrowName: $('#check_escrow').is(':checked') ? $("#escrow_name").val() : "",
PowerRate: $("#power_rate").val(),
Coordinate: $("#coordinate").val(),
OperationPersonnelIds: $("#power_station_operation_personnel").val(),
InverterBrand: $("#inverter_brand").val(),
InverterProductModel: $("#inverter_product_model").val(),
InverterAmount: $("#inverter_amount").val(),
PhotovoltaicPanelBrand: $("#photovoltaic_panel_brand").val(),
PhotovoltaicPanelSpecification: $("#photovoltaic_panel_specification").val(),
PhotovoltaicPanelAmount: $("#photovoltaic_panel_amount").val(),
PhotovoltaicPanelProductModel: $("#photovoltaic_panel_product_model").val(),
SolarType: $("#select_solar_tpye").val(),
line_token: $("#line_token").val(),
Estimate_kwh: $("#estimate_kwh").val(),
EstimateEfficacy: $("#estimate_efficacy").val(),
CompanyId: $("#select_power_station_company").val(),
}
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
toast_ok(rel.msg);
if (stationId == "new") {
window.location = "/PowerStation/Edit?stationId=" + rel.data.id
} else {
//回填資料
powerStationData = rel.data;
SetStationInfo();
ChangeMode("station_info", "view");
}
}, 'json');
</text>
}
}
//#endregion
//#region 儲存能源局台電資料資訊

View File

@ -1252,8 +1252,8 @@
</div>
<!--Base JS-->
<script src="~/js/vendors.bundle.js"></script>
<script src="~/js/app.bundle.js"></script>
<script src="~/js/vendors.bundle.js" asp-append-version="true"></script>
<script src="~/js/app.bundle.js" asp-append-version="true"></script>
<!-- JQuery Validate -->
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation/dist/localization/messages_zh_TW.js"></script>

View File

@ -398,6 +398,7 @@
default:
console.log(`Sorry, we are out of ${val.solarType}.`);
}
$('#card_' + val.id).find('#editSolarUrl').find('#Solarimg').attr('src', val.mainDisplay);
$('#card_' + val.id).find('#stationtype').html(type);
var time = new Date(val.createdAt);
$('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id);

View File

@ -303,7 +303,7 @@
label: '輸出功率',
yAxisID: 'A',
backgroundColor: 'rgb(103, 180, 172)',
order: 2,
order: 3,
data: chartToday.powerDatas
}, {
type: 'line',
@ -317,8 +317,22 @@
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
order: 1,
order: 2,
data: chartToday.irradianceDatas,
}, {
type: 'line',
label: '模組溫度',
yAxisID: 'C',
borderColor: 'rgb(255, 192, 0)',
pointBackgroundColor: 'rgb(255, 192, 0)',
pointBorderColor: 'rgb(255, 192, 0)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
order: 1,
data: chartToday.temperatureDatas,
}]
},
options: {
@ -353,6 +367,17 @@
display: true,
labelString: 'W/㎡'
}
}, {
id: 'C',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '℃'
}
}]
}
}
@ -370,7 +395,7 @@
label: '輸出功率',
yAxisID: 'A',
backgroundColor: 'rgb(103, 180, 172)',
order: 2,
order: 3,
data: chart7day.powerDatas
}, {
type: 'line',
@ -383,9 +408,23 @@
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
order: 1,
order: 2,
fill: false,
data: chart7day.irradianceDatas,
}, {
type: 'line',
label: '模組溫度',
yAxisID: 'C',
borderColor: 'rgb(255, 192, 0)',
pointBackgroundColor: 'rgb(255, 192, 0)',
pointBorderColor: 'rgb(255, 192, 0)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
order: 1,
data: chart7day.temperatureDatas,
}]
},
options: {
@ -420,6 +459,17 @@
display: true,
labelString: 'W/㎡'
}
}, {
id: 'C',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '℃'
}
}]
}
}
@ -437,7 +487,7 @@
label: '輸出功率',
yAxisID: 'A',
backgroundColor: 'rgb(103, 180, 172)',
order: 2,
order: 3,
data: chartMonth.powerDatas
}, {
type: 'line',
@ -450,9 +500,23 @@
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
order: 1,
order: 2,
fill: false,
data: chartMonth.irradianceDatas,
}, {
type: 'line',
label: '模組溫度',
yAxisID: 'C',
borderColor: 'rgb(255, 192, 0)',
pointBackgroundColor: 'rgb(255, 192, 0)',
pointBorderColor: 'rgb(255, 192, 0)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
order: 1,
data: chartMonth.temperatureDatas,
}]
},
options: {
@ -487,6 +551,17 @@
display: true,
labelString: 'W/㎡'
}
}, {
id: 'C',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '℃'
}
}]
}
}
@ -520,6 +595,20 @@
order: 1,
fill: false,
data: chartYear.irradianceDatas,
}, {
type: 'line',
label: '模組溫度',
yAxisID: 'C',
borderColor: 'rgb(255, 192, 0)',
pointBackgroundColor: 'rgb(255, 192, 0)',
pointBorderColor: 'rgb(255, 192, 0)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
order: 1,
data: chartYear.temperatureDatas,
}]
},
options: {
@ -554,6 +643,17 @@
display: true,
labelString: 'W/㎡'
}
}, {
id: 'C',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '℃'
}
}]
}
}
@ -2216,6 +2316,9 @@
var listcolor = new Array(0);
var listcolor2 = new Array(0);
var listirradiance = new Array(0);
var listtemperature = new Array(0);
var listsolarhour = new Array(0);
var listpr = new Array(0);
var color = rgba(1);
var color2 = rgba(2);
$.each(rel.data, function (index, val) {
@ -2241,10 +2344,13 @@
'<td>' + val.temp.toFixed(2) + '</td>' +
'</tr>');
listmonth.push(val.timestamp);
listkwh.push(val.kwh);
listkwh.push(val.kwh.toFixed(2));
listcolor.push(color);
listcolor2.push(color2);
listirradiance.push(val.irradiance);
listirradiance.push(val.irradiance.toFixed(2));
listtemperature.push(val.temp.toFixed(2));
listsolarhour.push(val.solarhour.toFixed(2));
listpr.push(val.pr.toFixed(2));
}
else
{
@ -2259,10 +2365,13 @@
'<td>' + val.temp.toFixed(2) + '</td>' +
'</tr>');
listmonth.push(val.timestamp);
listkwh.push(val.kwh);
listkwh.push(val.kwh.toFixed(2));
listcolor.push(color);
listcolor2.push(color2);
listirradiance.push(val.irradiance);
listirradiance.push(val.irradiance.toFixed(2));
listtemperature.push(val.temp.toFixed(2));
listsolarhour.push(val.solarhour.toFixed(2));
listpr.push(val.pr.toFixed(2));
}
@ -2280,12 +2389,57 @@
type: 'bar',
data: {
labels: listmonth,
datasets: [{
datasets: [
{
type: 'line',
label: '溫度(℃)',
yAxisID: 'E',
borderColor: 'rgb(255, 192, 0)',
pointBackgroundColor: 'rgb(255, 192, 0)',
pointBorderColor: 'rgb(255, 192, 0)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
data: listtemperature
},{
type: 'line',
label: 'PR(%)',
yAxisID: 'D',
borderColor: 'rgba(68, 114, 196)',
pointBackgroundColor: 'rgb(68, 114, 196)',
pointBorderColor: 'rgb(68, 114, 196)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
data: listpr
},{
type: 'line',
label: '發電小時',
yAxisID: 'C',
borderColor: 'rgba(165, 165, 165)',
pointBackgroundColor: 'rgb(165, 165, 165)',
pointBorderColor: 'rgb(165, 165, 165)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
data: listsolarhour
},{
type: 'line',
label: '日照度(kWh/㎡)',
borderColor: 'rgba(190, 45, 45,1)',
pointRadius: 4,
yAxisID: 'B',
borderColor: 'rgba(190, 45, 45,1)',
pointBackgroundColor: 'rgb(190, 45, 45,1)',
pointBorderColor: 'rgb(190, 45, 45,1)',
pointBorderWidth: 1,
borderWidth: 2,
pointRadius: 4,
pointHoverRadius: 5,
fill: false,
data: listirradiance
}, {
@ -2329,6 +2483,39 @@
display: true,
labelString: 'kWh/㎡'
}
}, {
id: 'C',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: 'hr'
}
}, {
id: 'D',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: 'PR(%)'
}
}, {
id: 'E',
type: 'linear',
position: 'right',
ticks: {
min: 0
},
scaleLabel: {
display: true,
labelString: '℃'
}
}]
}
}

View File

@ -557,7 +557,7 @@
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
toast_error(rel.data.msg);
toast_error(rel.msg);
return;
}

View File

@ -7,26 +7,26 @@
}
},
"LoginExpireMinute": 60, //()
//"DBConfig": {
// "Server": "MVgHWzR3rGDgD57TUoFunA==",
// "port": "r4AoXMUDodcQjIzofGNCcg==",
// "Database": "z8TVtiXZ6MwgWbUEAOXA/fiHzd7c0iUhFqn1mHzxhKo=",
// "Root": "mWlR2HshQNhRRE34jg4kdg==",
// "Password": "y4uPqlH9ncTgR/I07qpwaA=="
//},
"DBConfig": {
"Server": "AVXfxd+IRlLtJ0MCi9HU1g==",
"port": "CrEmevYrUsSo7Mkb7Gxn8A==",
"Database": "CEyYZnO8B5+yTXQcFSsiBA==",
"Root": "Aph7AzoiwAmmBHCfS1rqeQ==",
"Password": "8WMHBEWuT0XoAB4kzduQHA=="
"Server": "MVgHWzR3rGDgD57TUoFunA==",
"port": "r4AoXMUDodcQjIzofGNCcg==",
"Database": "z8TVtiXZ6MwgWbUEAOXA/fiHzd7c0iUhFqn1mHzxhKo=",
"Root": "mWlR2HshQNhRRE34jg4kdg==",
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
},
//"DBConfig": {
// "Server": "AVXfxd+IRlLtJ0MCi9HU1g==",
// "port": "CrEmevYrUsSo7Mkb7Gxn8A==",
// "Database": "CEyYZnO8B5+yTXQcFSsiBA==",
// "Root": "Aph7AzoiwAmmBHCfS1rqeQ==",
// "Password": "8WMHBEWuT0XoAB4kzduQHA=="
//},
"BackgroundServiceCron": {
"CalcPowerStationJob": "0 5 * * * ?",
"CalcAvgPowerStationJob": "0 0 2 * * ?",
"OperationScheduleJob": "0 0 2 * * ?",
"CalcInverter15minJob": "0 2/15 * * * ?",
"SendEmailJob": "0/10 * * * * ?"
"SendEmailJob": "0 15 2 * * ?"
},
"SMTPConfig": {
"Host": "smtp.gmail.com",

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB