暫時git
This commit is contained in:
parent
9357117770
commit
9e1b6c7a2a
@ -1983,6 +1983,14 @@ ALTER TABLE `inverter_history_day`
|
||||
ALTER TABLE `inverter_history_month`
|
||||
ADD COLUMN `TOTALKWH` DOUBLE NULL DEFAULT NULL AFTER `TODAYKWH`;
|
||||
|
||||
-- 新增帳號是否接收通知權限 20210730
|
||||
ALTER TABLE `user`
|
||||
ADD COLUMN `EmailDayReport` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '接收Email日報 0:不接收 1:接收' AFTER `Email`,
|
||||
ADD COLUMN `EmailMonthReport` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '接收Email月報 0:不接收 1:接收' AFTER `EmailDayReport`,
|
||||
ADD COLUMN `EmailComplexReport` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '接收Email綜合報告 0:不接收 1:接收' AFTER `EmailMonthReport`,
|
||||
ADD COLUMN `EmailException` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '接收Email異常通知 0:不接收 1:接收' AFTER `EmailComplexReport`;
|
||||
|
||||
|
||||
|
||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
|
||||
|
||||
@ -142,6 +142,10 @@ namespace SolarPower.Models.User
|
||||
public string PowerStationName { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string EscrowName { get; set; }
|
||||
public byte EmailDayReport { get; set; }
|
||||
public byte EmailMonthReport { get; set; }
|
||||
public byte EmailComplexReport { get; set; }
|
||||
public byte EmailException { get; set; }
|
||||
}
|
||||
|
||||
public class PostUserPowerStation
|
||||
|
||||
@ -330,12 +330,17 @@ namespace SolarPower.Repository.Implement
|
||||
op.Id,
|
||||
ps.Code,
|
||||
ps.Name AS PowerStationName,
|
||||
us.EmailDayReport,
|
||||
us.EmailMonthReport,
|
||||
us.EmailComplexReport,
|
||||
us.EmailException,
|
||||
CASE ps.IsEscrow WHEN 1 THEN CONCAT(ps.EscrowName, '(代管)')
|
||||
WHEN 0 THEN c.Name
|
||||
END AS EscrowName
|
||||
FROM power_station_operation_personnel op
|
||||
LEFT JOIN power_station ps ON op.PowerStationId = ps.Id
|
||||
LEFT JOIN company c ON ps.CompanyId = c.Id
|
||||
LEFT JOIN user us ON us.Id = @UserId
|
||||
WHERE op.Deleted = 0 AND op.UserId = @UserId";
|
||||
|
||||
result = (await conn.QueryAsync<UserPowerStation>(sql, new { UserId = userId })).ToList();
|
||||
|
||||
@ -849,6 +849,32 @@
|
||||
str += "<td>" + value.code + "</td>";
|
||||
str += "<td>" + value.powerStationName + "</td>";
|
||||
str += "<td>" + value.escrowName + "</td>";
|
||||
if (value.emailDayReport == 0) {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailDayReport-" + value.code + "' ><label class='custom-control-label' for='select-emailDayReport-" + value.code +"'>接收</label></div>"+ "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailDayReport-" + value.code + "' checked><label class='custom-control-label' for='select-emailDayReport-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
if (value.emailMonthReport == 0) {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailMonthReport-" + value.code + "' ><label class='custom-control-label' for='select-emailMonthReport-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
else {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailMonthReport-" + value.code + "' checked><label class='custom-control-label' for='select-emailMonthReport-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
if (value.emailComplexReport == 0) {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailComplexReport-" + value.code + "' ><label class='custom-control-label' for='select-emailComplexReport-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
else {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailComplexReport-" + value.code + "' checked><label class='custom-control-label' for='select-emailComplexReport-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
if (value.emailException == 0) {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailException-" + value.code + "' ><label class='custom-control-label' for='select-emailException-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
else {
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' id = 'select-emailException-" + value.code + "' checked><label class='custom-control-label' for='select-emailException-" + value.code + "'>接收</label></div>" + "</td>";
|
||||
}
|
||||
|
||||
str += "<td>" + '<button type="button" class="btn btn-danger btn-pills waves-effect waves-themed del-user-power-station" data-id="' + value.id + '">刪除</button>' + "</td>";
|
||||
str += "</tr>";
|
||||
|
||||
|
||||
@ -137,6 +137,10 @@
|
||||
<th>電站代碼</th>
|
||||
<th>電站名稱</th>
|
||||
<th>公司</th>
|
||||
<th>收email日報</th>
|
||||
<th>收email月報</th>
|
||||
<th>收email綜合報告</th>
|
||||
<th>收email異常通知</th>
|
||||
<th>功能</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user