1. google map 修改
2. 寄信人 修改
This commit is contained in:
parent
e60a82eaeb
commit
8f76245a13
@ -92,11 +92,22 @@ namespace SolarPower.Controllers
|
||||
var per_auch_arr = auth.Split(',');
|
||||
foreach (var x in per_auch_arr)
|
||||
{
|
||||
if (x.Contains("PowerStation"))
|
||||
{
|
||||
auth_arr.Add("PowerStation");
|
||||
}
|
||||
|
||||
auth_arr.Add(x);
|
||||
}
|
||||
}
|
||||
|
||||
if (myUser.Role.Layer != (int)RoleLayerEnum.PlatformAdmin && !auth_arr.Contains(controllerName))
|
||||
{
|
||||
if(auth_arr.Contains("StationOverview") && !auth_arr.Contains("PowerStation"))
|
||||
{
|
||||
//只有電站總覽 且未包含 電站管理
|
||||
}
|
||||
else
|
||||
{
|
||||
filterContext.Result = new RedirectToRouteResult(
|
||||
new RouteValueDictionary
|
||||
@ -106,6 +117,7 @@ namespace SolarPower.Controllers
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//取得當前使用者可以查看的電站
|
||||
|
||||
@ -210,7 +210,7 @@ namespace SolarPower.Controllers
|
||||
List<RoleAuth> roleAuths = new List<RoleAuth>();
|
||||
|
||||
RoleAuth roleAuth = new RoleAuth();
|
||||
roleAuth.Id = role.Id;
|
||||
roleAuth.Id = id;
|
||||
roleAuth.AuthCode = "A";
|
||||
roleAuth.CreatedBy = myUser.Id;
|
||||
|
||||
|
||||
@ -102,8 +102,8 @@ namespace SolarPower.Quartz.Jobs
|
||||
MyMail.SubjectEncoding = System.Text.Encoding.UTF8;//郵件標題編碼
|
||||
MyMail.BodyEncoding = System.Text.Encoding.UTF8; //郵件內容編碼
|
||||
MyMail.IsBodyHtml = true; //是否使用html格式
|
||||
|
||||
MyMail.From = new System.Net.Mail.MailAddress(smtp.UserName); //寄件人
|
||||
var kkk = $"FIC 太陽能電站管理系統通知 <{smtp.UserName}>";
|
||||
MyMail.From = new System.Net.Mail.MailAddress(kkk); //寄件人
|
||||
foreach (var email in recipientEmails)
|
||||
{
|
||||
MyMail.To.Add(email); //設定收件者Email
|
||||
|
||||
@ -463,7 +463,8 @@ namespace SolarPower.Repository.Implement
|
||||
inv.KWH
|
||||
FROM inverter_history_hour inv
|
||||
WHERE inv.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y-%m-%d') = @Day";
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y-%m-%d') = @Day
|
||||
ORDER BY inv.TIMESTAMP";
|
||||
|
||||
result = (await conn.QueryAsync<InverterHistory>(sql_power, new { PowerStationId = powerStationId, Day = day })).ToList();
|
||||
}
|
||||
@ -487,7 +488,8 @@ namespace SolarPower.Repository.Implement
|
||||
inv.KWH
|
||||
FROM inverter_history_day inv
|
||||
WHERE inv.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y-%m') = @Month";
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y-%m') = @Month
|
||||
ORDER BY inv.TIMESTAMP";
|
||||
|
||||
result = (await conn.QueryAsync<InverterHistory>(sql_power, new { PowerStationId = powerStationId, Month = month })).ToList();
|
||||
}
|
||||
@ -511,7 +513,8 @@ namespace SolarPower.Repository.Implement
|
||||
inv.KWH
|
||||
FROM inverter_history_month inv
|
||||
WHERE inv.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y-%m') BETWEEN @StartMonth AND @EndMonth";
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y-%m') BETWEEN @StartMonth AND @EndMonth
|
||||
ORDER BY inv.TIMESTAMP";
|
||||
|
||||
result = (await conn.QueryAsync<InverterHistory>(sql_power, new { PowerStationId = powerStationId, StartMonth = startMonth, EndMonth = endMonth })).ToList();
|
||||
}
|
||||
@ -535,7 +538,8 @@ namespace SolarPower.Repository.Implement
|
||||
inv.KWH
|
||||
FROM inverter_history_month inv
|
||||
WHERE inv.PowerStationId = @PowerStationId
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y') = @Year";
|
||||
AND DATE_FORMAT(inv.timestamp, '%Y') = @Year
|
||||
ORDER BY inv.TIMESTAMP";
|
||||
|
||||
result = (await conn.QueryAsync<InverterHistory>(sql_power, new { PowerStationId = powerStationId, Year = year })).ToList();
|
||||
}
|
||||
|
||||
@ -28,7 +28,9 @@ namespace SolarPower.Services
|
||||
MyMail.BodyEncoding = System.Text.Encoding.UTF8; //郵件內容編碼
|
||||
MyMail.IsBodyHtml = true; //是否使用html格式
|
||||
|
||||
MyMail.From = new System.Net.Mail.MailAddress(smtp.UserName); //寄件人
|
||||
var kkk = $"FIC 太陽能電站管理系統通知 <{smtp.UserName}>";
|
||||
|
||||
MyMail.From = new System.Net.Mail.MailAddress(kkk); //寄件人
|
||||
foreach(var email in recipientEmails)
|
||||
{
|
||||
MyMail.To.Add(email); //設定收件者Email
|
||||
|
||||
@ -260,7 +260,11 @@
|
||||
mapOverview.powerStations.forEach(function (item, index) {
|
||||
var contentString = '<div id="content">' +
|
||||
'<div id="siteNotice"></div>' +
|
||||
'<h1 id="firstHeading" class="firstHeading">' + item.name + '</h1>' +
|
||||
'<h1 id="firstHeading" class="firstHeading">' +
|
||||
'<a href="StationOverview/Info?stationId=' + item.id + '">' +
|
||||
item.name +
|
||||
'</a>' +
|
||||
'</h1>' +
|
||||
'<div id="bodyContent">' +
|
||||
'<div class="row">' +
|
||||
'<div class="col-12">' +
|
||||
@ -309,6 +313,12 @@
|
||||
google.maps.event.addListener(marker, 'click', (function (marker, i) {
|
||||
return function () {
|
||||
infowindow.setContent(location[1]);
|
||||
|
||||
google.maps.event.addListener(infowindow, 'domready', function () {
|
||||
$(document).find('#content').parent().css('overflow-x', 'hidden');
|
||||
|
||||
});
|
||||
|
||||
infowindow.open(map, marker);
|
||||
}
|
||||
})(marker, i));
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
//},
|
||||
"BackgroundServiceCron": {
|
||||
"CalcPowerStationJob": "0 5 * * * ?",
|
||||
"CalcAvgPowerStationJob": "0 0 2 * * ?",
|
||||
"CalcAvgPowerStationJob": "0/10 * * * * ?",
|
||||
"OperationScheduleJob": "0 0 2 * * ?",
|
||||
"CalcInverter15minJob": "0 2/15 * * * ?",
|
||||
"SendEmailJob": "0 15 2 * * ?",
|
||||
"SendEmailJob": "0/10 * * * * ?",
|
||||
"ExceptionSchedule": "0 0/5 * * * ?"
|
||||
},
|
||||
"SMTPConfig": {
|
||||
@ -35,5 +35,12 @@
|
||||
"UserName": "shanghohui@gmail.com",
|
||||
"Password": "wswgnluvoodfexrb",
|
||||
"EnableSsl": true
|
||||
}
|
||||
},
|
||||
//"SMTPConfig": {
|
||||
// "Host": "smtp.gmail.com",
|
||||
// "Port": 25,
|
||||
// "UserName": "ficgreen01@gmail.com",
|
||||
// "Password": "qwe2015qwe",
|
||||
// "EnableSsl": true
|
||||
//}
|
||||
}
|
||||
|
||||
@ -27,14 +27,14 @@
|
||||
"CalcAvgPowerStationJob": "0 0 2 * * ?",
|
||||
"OperationScheduleJob": "0 0 2 * * ?",
|
||||
"CalcInverter15minJob": "0 2/15 * * * ?",
|
||||
"SendEmailJob": "0 15 2 * * ?",
|
||||
"SendEmailJob": "0 0/5 * * * ?",
|
||||
"ExceptionSchedule": "0 0/5 * * * ?"
|
||||
},
|
||||
"SMTPConfig": {
|
||||
"Host": "smtp.gmail.com",
|
||||
"Port": 25,
|
||||
"UserName": "shanghohui@gmail.com",
|
||||
"Password": "wswgnluvoodfexrb",
|
||||
"UserName": "ficgreen01@gmail.com",
|
||||
"Password": "qwe2015qwe",
|
||||
"EnableSsl": true
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user