日月報含金額權限
This commit is contained in:
parent
9e1b6c7a2a
commit
27f5559c4e
@ -385,6 +385,10 @@ namespace SolarPower.Controllers
|
||||
{
|
||||
a.Function = @$"<a href='javascript:;' class='waves-effect waves-themed mb-3 mr-2 edit-btn'>{a.FormId}</a>";
|
||||
}
|
||||
if (a.NormalTime == "1970-01-01 08:00:00")
|
||||
{
|
||||
a.NormalTime = "";
|
||||
}
|
||||
}
|
||||
|
||||
apiResult.Code = "0000";
|
||||
@ -430,6 +434,10 @@ namespace SolarPower.Controllers
|
||||
{
|
||||
a.Function = @$"<a href='javascript:;' class='waves-effect waves-themed mb-3 mr-2 edit-btn'>{a.FormId}</a>";
|
||||
}
|
||||
if(a.NormalTime == "1970-01-01 08:00:00")
|
||||
{
|
||||
a.NormalTime = "";
|
||||
}
|
||||
}
|
||||
|
||||
apiResult.Code = "0000";
|
||||
|
||||
@ -75,10 +75,10 @@ namespace SolarPower.Controllers
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
public async Task<ApiResult<List<string>>> GetTableHead(Select_table post)
|
||||
public async Task<ApiResult<InvAndMoney>> GetTableHead(Select_table post)
|
||||
{
|
||||
ApiResult<List<string>> apiResult = new ApiResult<List<string>>();
|
||||
List<string> inverter = new List<string>();
|
||||
ApiResult<InvAndMoney> apiResult = new ApiResult<InvAndMoney>();
|
||||
InvAndMoney inverter = new InvAndMoney();
|
||||
try
|
||||
{
|
||||
var powerStation = await powerStationRepository.GetOneAsync(post.PowerStation);
|
||||
@ -88,10 +88,17 @@ namespace SolarPower.Controllers
|
||||
apiResult.Msg = "需加入查詢電站";
|
||||
return apiResult;
|
||||
}
|
||||
inverter = await stationReportRepository.GetInverterId(powerStation.SiteDB,post);
|
||||
for (int i = 0;i<inverter.Count;i++)
|
||||
inverter.Inv = await stationReportRepository.GetInverterId(powerStation.SiteDB,post);
|
||||
for (int i = 0;i<inverter.Inv.Count;i++)
|
||||
{
|
||||
inverter[i] = "inv_" + inverter[i].Substring(inverter[i].Length - 4, 4);
|
||||
inverter.Inv[i] = "inv_" + inverter.Inv[i].Substring(inverter.Inv[i].Length - 4, 4);
|
||||
}
|
||||
if (myUser.Role.Auths.Contains("ShowMoney"))
|
||||
{
|
||||
inverter.ShowMoney = 1;
|
||||
}else
|
||||
{
|
||||
inverter.ShowMoney = 0;
|
||||
}
|
||||
apiResult.Code = "0000";
|
||||
apiResult.Data = inverter;
|
||||
@ -194,7 +201,7 @@ namespace SolarPower.Controllers
|
||||
sheet.SetColumnWidth(index, 4 * 160 * 8);
|
||||
index++;
|
||||
|
||||
foreach (var head in Formhead.Result.Data)
|
||||
foreach (var head in Formhead.Result.Data.Inv)
|
||||
{
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(head);
|
||||
@ -203,14 +210,19 @@ namespace SolarPower.Controllers
|
||||
index++;
|
||||
}
|
||||
|
||||
string[] lasthead =
|
||||
List<string> lasthead = new List<string>()
|
||||
{
|
||||
"小時發電量(kWh)",
|
||||
"小時發電量百分比(%)",
|
||||
"小時平均日照度(W/㎡)",
|
||||
"小時平均模組溫度(°C)",
|
||||
"小時售電金額(NTD)",
|
||||
"小時平均模組溫度(°C)"
|
||||
};
|
||||
if(Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
lasthead.Add("小時售電金額(NTD)");
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (var head in lasthead)
|
||||
{
|
||||
@ -248,20 +260,23 @@ namespace SolarPower.Controllers
|
||||
cell.SetCellValue(b);
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
foreach (var head in Formhead.Result.Data)
|
||||
foreach (var head in Formhead.Result.Data.Inv)
|
||||
{
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(dbody[head] == null ? "0" : dbody[head].ToString());
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
}
|
||||
string[] bodynames = {
|
||||
List<string> bodynames = new List<string>(){
|
||||
"hourKWH",
|
||||
"hourKWHp",
|
||||
"irradiance",
|
||||
"temperature",
|
||||
"hourmoney",
|
||||
"temperature"
|
||||
};
|
||||
if (Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
bodynames.Add("hourmoney");
|
||||
}
|
||||
foreach (var bodyname in bodynames)
|
||||
{
|
||||
cell = row.CreateCell(index);
|
||||
@ -313,6 +328,7 @@ namespace SolarPower.Controllers
|
||||
cell.CellStyle = styleLine12;
|
||||
RowPosition++;
|
||||
|
||||
|
||||
index = 0;
|
||||
row = sheet.CreateRow(RowPosition);
|
||||
cell = row.CreateCell(index);
|
||||
@ -323,24 +339,30 @@ namespace SolarPower.Controllers
|
||||
cell.CellStyle = styleLine12;
|
||||
RowPosition++;
|
||||
|
||||
index = 0;
|
||||
row = sheet.CreateRow(RowPosition);
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("日售電金額(NTD):");
|
||||
cell.CellStyle = styleLine12;
|
||||
cell = row.CreateCell(1);
|
||||
cell.SetCellValue(ntd);
|
||||
cell.CellStyle = styleLine12;
|
||||
RowPosition++;
|
||||
|
||||
index = 0;
|
||||
row = sheet.CreateRow(RowPosition);
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("日售電單價(NTD):");
|
||||
cell.CellStyle = styleLine12;
|
||||
cell = row.CreateCell(1);
|
||||
cell.SetCellValue(ntdone);
|
||||
cell.CellStyle = styleLine12;
|
||||
if (Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
index = 0;
|
||||
row = sheet.CreateRow(RowPosition);
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("日售電金額(NTD):");
|
||||
cell.CellStyle = styleLine12;
|
||||
cell = row.CreateCell(1);
|
||||
cell.SetCellValue(ntd);
|
||||
cell.CellStyle = styleLine12;
|
||||
RowPosition++;
|
||||
|
||||
index = 0;
|
||||
row = sheet.CreateRow(RowPosition);
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("日售電單價(NTD):");
|
||||
cell.CellStyle = styleLine12;
|
||||
cell = row.CreateCell(1);
|
||||
cell.SetCellValue(ntdone);
|
||||
cell.CellStyle = styleLine12;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
break;
|
||||
@ -354,7 +376,7 @@ namespace SolarPower.Controllers
|
||||
sheet.SetColumnWidth(index2, 4 * 160 * 8);
|
||||
index2++;
|
||||
|
||||
foreach (var head in Formhead.Result.Data)
|
||||
foreach (var head in Formhead.Result.Data.Inv)
|
||||
{
|
||||
cell2 = row2.CreateCell(index2);
|
||||
cell2.SetCellValue(head);
|
||||
@ -363,7 +385,7 @@ namespace SolarPower.Controllers
|
||||
index2++;
|
||||
}
|
||||
|
||||
string[] lasthead2 =
|
||||
List<string> lasthead2 = new List<string>()
|
||||
{
|
||||
"日發電量(kWh)",
|
||||
"日發電量百分比(%)",
|
||||
@ -371,10 +393,13 @@ namespace SolarPower.Controllers
|
||||
"kWH/kWP",
|
||||
"PR%",
|
||||
"日平均日照度(W/㎡)",
|
||||
"日平均模組溫度(°C)",
|
||||
"日售電金額(NTD)"
|
||||
"日平均模組溫度(°C)"
|
||||
|
||||
};
|
||||
|
||||
if (Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
lasthead2.Add("日售電金額(NTD)");
|
||||
}
|
||||
foreach (var head in lasthead2)
|
||||
{
|
||||
cell2 = row2.CreateCell(index2);
|
||||
@ -401,7 +426,7 @@ namespace SolarPower.Controllers
|
||||
monthKWH = dbody["monthKWH"] == null ? "0": dbody["monthKWH"].ToString();
|
||||
monthmoney = dbody["monthmoney"] == null ? "0" : dbody["monthmoney"].ToString();
|
||||
monthmoneyone = (Convert.ToDouble(dbody["monthmoneyone"].ToString()) + Convert.ToDouble(monthmoneyone)).ToString();
|
||||
if (dbody["SolarType"].ToString() == "1")//檢驗是否為租用
|
||||
if (dbody["SolarType"].ToString() == "1" && Formhead.Result.Data.ShowMoney == 1)//檢驗是否為租用
|
||||
{
|
||||
check_hire = true;
|
||||
sitedb = dbody["SiteDB"].ToString();
|
||||
@ -413,23 +438,26 @@ namespace SolarPower.Controllers
|
||||
cell2.SetCellValue(b);
|
||||
cell2.CellStyle = styleLine12;
|
||||
index2++;
|
||||
foreach (var head in Formhead.Result.Data)
|
||||
foreach (var head in Formhead.Result.Data.Inv)
|
||||
{
|
||||
cell2 = row2.CreateCell(index2);
|
||||
cell2.SetCellValue(dbody[head] == null ? "0": dbody[head].ToString());
|
||||
cell2.CellStyle = styleLine12;
|
||||
index2++;
|
||||
}
|
||||
string[] bodynames = {
|
||||
List<string> bodynames = new List<string>(){
|
||||
"dayKWH",
|
||||
"dayKWHp",
|
||||
"tothour",
|
||||
"KWHKWP",
|
||||
"PR",
|
||||
"irradiance",
|
||||
"temperature",
|
||||
"soldmoney"
|
||||
"temperature"
|
||||
};
|
||||
if (Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
bodynames.Add("soldmoney");
|
||||
}
|
||||
foreach (var bodyname in bodynames)
|
||||
{
|
||||
cell2 = row2.CreateCell(index2);
|
||||
@ -471,14 +499,17 @@ namespace SolarPower.Controllers
|
||||
cell.SetCellValue("月發電量(kWh)");
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("月售電金額(NTD)");
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("月售電單價(NTD)");
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
if (Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("月售電金額(NTD)");
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("月售電單價(NTD)");
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
}
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue("月售電天數");
|
||||
cell.CellStyle = styleLine12;
|
||||
@ -505,14 +536,17 @@ namespace SolarPower.Controllers
|
||||
cell.SetCellValue(monthKWH);
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(monthmoney);
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoneyone) / Useday,2));
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
if (Formhead.Result.Data.ShowMoney == 1)
|
||||
{
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(monthmoney);
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(Math.Round(Convert.ToDouble(monthmoneyone) / Useday, 2));
|
||||
cell.CellStyle = styleLine12;
|
||||
index++;
|
||||
}
|
||||
cell = row.CreateCell(index);
|
||||
cell.SetCellValue(Useday);
|
||||
cell.CellStyle = styleLine12;
|
||||
@ -581,8 +615,15 @@ namespace SolarPower.Controllers
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var name = "";
|
||||
if(postObject.FormType == 0)
|
||||
{
|
||||
name = "日";
|
||||
}
|
||||
else
|
||||
{
|
||||
name = "月";
|
||||
}
|
||||
|
||||
|
||||
var ms = new NpoiMemoryStream
|
||||
@ -592,7 +633,7 @@ namespace SolarPower.Controllers
|
||||
workbook.Write(ms);
|
||||
ms.Flush();
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
return File(ms, "application/vnd.ms-excel", "text.xlsx");
|
||||
return File(ms, "application/vnd.ms-excel", name+"報表.xlsx");
|
||||
}
|
||||
|
||||
public string Checknull(string a)
|
||||
|
||||
@ -597,5 +597,29 @@ namespace SolarPower.Controllers
|
||||
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ApiResult<string>> DeleteOneGetEmail(IdAndTypeByEmail post)
|
||||
{
|
||||
ApiResult<string> apiResult = new ApiResult<string>();
|
||||
|
||||
try
|
||||
{
|
||||
await userRepository.DeleteOneGetEmail(post);
|
||||
apiResult.Code = "0000";
|
||||
apiResult.Msg = "更改成功";
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
apiResult.Code = "9999";
|
||||
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||
}
|
||||
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1984,11 +1984,11 @@ 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`;
|
||||
ALTER TABLE `power_station_operation_personnel`
|
||||
ADD COLUMN `EmailDayReport` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '接收Email日報 0:不接收 1:接收' AFTER `UserId`,
|
||||
ADD COLUMN `EmailMonthReport` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '接收Email月報 0:不接收 1:接收' AFTER `EmailDayReport`,
|
||||
ADD COLUMN `EmailComplexReport` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '接收Email綜合報告 0:不接收 1:接收' AFTER `EmailMonthReport`,
|
||||
ADD COLUMN `EmailException` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '接收Email異常通知 0:不接收 1:接收' AFTER `EmailComplexReport`;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -18,6 +18,12 @@ namespace SolarPower.Models
|
||||
public string PowerStationName { get; set; }
|
||||
}
|
||||
|
||||
public class InvAndMoney
|
||||
{
|
||||
public List<string> Inv { get; set; }
|
||||
public int ShowMoney { get; set; }
|
||||
}
|
||||
|
||||
public class Select_table
|
||||
{
|
||||
public int SearchType { get; set; }
|
||||
|
||||
@ -153,4 +153,10 @@ namespace SolarPower.Models.User
|
||||
public int PowerStationId { get; set; }
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
public class IdAndTypeByEmail
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Type { get; set; }
|
||||
public int Check { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ namespace SolarPower.Quartz.Jobs
|
||||
#region 氣象觀測(取資料)
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得氣象觀測】");
|
||||
var client = new HttpClient();
|
||||
var UVUri = "https://opendata.cwb.gov.tw/api/v1/rest/datastore/O-A0003-001?Authorization=CWB-EA24220B-DDCC-4188-84E5-AD37A0E03F80";
|
||||
var UVUri = "https://opendata.cwb.gov.tw/api/v1/rest/datastore/O-A0003-001?Authorization=CWB-EA24220B-DDCC-4188-84E5-AD37A0E03F80&elementName=TIME,TEMP";
|
||||
HttpResponseMessage response = client.GetAsync(UVUri).Result;
|
||||
String jsonUVs = response.Content.ReadAsStringAsync().Result.ToString();
|
||||
Root2 observation = JsonConvert.DeserializeObject<Root2>(jsonUVs);
|
||||
|
||||
@ -330,10 +330,10 @@ namespace SolarPower.Repository.Implement
|
||||
op.Id,
|
||||
ps.Code,
|
||||
ps.Name AS PowerStationName,
|
||||
us.EmailDayReport,
|
||||
us.EmailMonthReport,
|
||||
us.EmailComplexReport,
|
||||
us.EmailException,
|
||||
op.EmailDayReport,
|
||||
op.EmailMonthReport,
|
||||
op.EmailComplexReport,
|
||||
op.EmailException,
|
||||
CASE ps.IsEscrow WHEN 1 THEN CONCAT(ps.EscrowName, '(代管)')
|
||||
WHEN 0 THEN c.Name
|
||||
END AS EscrowName
|
||||
@ -447,5 +447,49 @@ namespace SolarPower.Repository.Implement
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteOneGetEmail(IdAndTypeByEmail post)
|
||||
{
|
||||
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
using (var trans = conn.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
var changetype = "";
|
||||
switch (post.Type)
|
||||
{
|
||||
case 0:
|
||||
changetype = "EmailDayReport";
|
||||
break;
|
||||
case 1:
|
||||
changetype = "EmailMonthReport";
|
||||
break;
|
||||
case 2:
|
||||
changetype = "EmailComplexReport";
|
||||
break;
|
||||
case 3:
|
||||
changetype = "EmailException";
|
||||
break;
|
||||
}
|
||||
var sql = @$"UPDATE power_station_operation_personnel SET {changetype} = {post.Check} WHERE Id = @Id";
|
||||
|
||||
await conn.ExecuteAsync(sql, new { Id = post.Id }, trans);
|
||||
|
||||
trans.Commit();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
trans.Rollback();
|
||||
throw exception;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,5 +102,7 @@ namespace SolarPower.Repository.Interface
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<UserPowerStation>> GetCompanyPowerStationAsync(int companyId, int userId);
|
||||
|
||||
Task DeleteOneGetEmail(IdAndTypeByEmail post);
|
||||
}
|
||||
}
|
||||
|
||||
@ -642,7 +642,7 @@
|
||||
$('#TableHead').empty();
|
||||
var str = "<tr>";
|
||||
str += "<th>Date</th>";
|
||||
$.each(rel.data, function (index, inverter) {
|
||||
$.each(rel.data.inv, function (index, inverter) {
|
||||
haveinvertName.push(inverter);
|
||||
str += "<th>" + inverter + "</th>";
|
||||
})
|
||||
@ -653,7 +653,9 @@
|
||||
str += "<th>小時<br />發電量<br />百分比<br />(%)</th>";
|
||||
str += "<th>小時<br />平均<br />日照度<br />(W/㎡)</th>";
|
||||
str += "<th>小時<br />平均<br />模組<br />溫度<br />(°C)</th>";
|
||||
str += "<th>小時<br />售電<br />金額<br />(NTD)</th>";
|
||||
if (rel.data.showMoney == 1) {
|
||||
str += "<th>小時<br />售電<br />金額<br />(NTD)</th>";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
str += "<th>日<br />發電量<br />(kWh)</th>";
|
||||
@ -663,13 +665,15 @@
|
||||
str += "<th>PR%</th>";
|
||||
str += "<th>日<br />平均<br />日照度<br />(W/㎡)</th>";
|
||||
str += "<th>日<br />平均<br />模組溫度<br />(°C)</th>";
|
||||
str += "<th>日<br />售電金額<br />(NTD)</th>";
|
||||
if (rel.data.showMoney == 1) {
|
||||
str += "<th>日<br />售電金額<br />(NTD)</th>";
|
||||
}
|
||||
break;
|
||||
}
|
||||
str += "</tr>";
|
||||
$('#TableHead').append(str);
|
||||
|
||||
tablebody(form);
|
||||
tablebody(form, rel.data.showMoney);
|
||||
|
||||
|
||||
}, 'json');
|
||||
@ -680,7 +684,7 @@
|
||||
tablehand(form);
|
||||
}
|
||||
|
||||
function tablebody(form)
|
||||
function tablebody(form,showmoney)
|
||||
{
|
||||
var send_data =
|
||||
{
|
||||
@ -722,7 +726,9 @@
|
||||
sta += "<td>" + Number(inverter.hourKWHp) + "</td>";
|
||||
sta += "<td>" + Number(inverter.irradiance) + "</td>";
|
||||
sta += "<td>" + Number(inverter.temperature) + "</td>";
|
||||
sta += "<td>" + Number(inverter.hourmoney) + "</td>";
|
||||
if (showmoney == 1) {
|
||||
sta += "<td>" + Number(inverter.hourmoney) + "</td>";
|
||||
}
|
||||
sta += "</tr>";
|
||||
thour = inverter.tothour ? inverter.tothour.toFixed(2) : 0;
|
||||
tpr = inverter.pr ? inverter.pr.toFixed(2) : 0;
|
||||
@ -736,8 +742,10 @@
|
||||
stc += "<th>" + 'kWH/kWP' + "</th>";
|
||||
stc += "<th>" + 'PR%' + "</th>";
|
||||
stc += "<th>" + '日發電量(kWh)' + "</th>";
|
||||
stc += "<th>" + '日售電金額(NTD)' + "</th>";
|
||||
stc += "<th>" + '日售電單價(NTD)' + "</th>";
|
||||
if (showmoney == 1) {
|
||||
stc += "<th>" + '日售電金額(NTD)' + "</th>";
|
||||
stc += "<th>" + '日售電單價(NTD)' + "</th>";
|
||||
}
|
||||
stc += "</tr>";
|
||||
|
||||
|
||||
@ -746,8 +754,10 @@
|
||||
stb += "<td>" + kWhkwp + "</td>";
|
||||
stb += "<td>" + tpr + "</td>";
|
||||
stb += "<td>" + tkwh + "</td>";
|
||||
stb += "<td>" + ntd + "</td>";
|
||||
stb += "<td>" + ntdone + "</td>";
|
||||
if (showmoney == 1) {
|
||||
stb += "<td>" + ntd + "</td>";
|
||||
stb += "<td>" + ntdone + "</td>";
|
||||
}
|
||||
stb += "</tr>";
|
||||
|
||||
|
||||
@ -784,7 +794,9 @@
|
||||
sta += "<td>" + inverter.PR + "</td>";
|
||||
sta += "<td>" + inverter.irradiance + "</td>";
|
||||
sta += "<td>" + inverter.temperature + "</td>";
|
||||
sta += "<td>" + inverter.soldmoney + "</td>";
|
||||
if (showmoney == 1) {
|
||||
sta += "<td>" + inverter.soldmoney + "</td>";
|
||||
}
|
||||
sta += "</tr>";
|
||||
avghour += inverter.tothour ? inverter.tothour : 0;
|
||||
avgKWHKWP += inverter.KWHKWP ? inverter.KWHKWP : 0;
|
||||
@ -808,8 +820,10 @@
|
||||
stc += "<th>" + '日kWH/kWP平均' + "</th>";
|
||||
stc += "<th>" + '日發電量平均(kWh)' + "</th>";
|
||||
stc += "<th>" + '月發電量(kWh)' + "</th>";
|
||||
stc += "<th>" + '月售電金額(NTD)' + "</th>";
|
||||
stc += "<th>" + '月售電單價(NTD)' + "</th>";
|
||||
if (showmoney == 1) {
|
||||
stc += "<th>" + '月售電金額(NTD)' + "</th>";
|
||||
stc += "<th>" + '月售電單價(NTD)' + "</th>";
|
||||
}
|
||||
stc += "<th>" + '月售電天數' + "</th>";
|
||||
stc += "</tr>";
|
||||
|
||||
@ -830,13 +844,15 @@
|
||||
stb += "<td>" + (avgKWHKWP / monthday).toFixed(2) + "</td>";
|
||||
stb += "<td>" + (avgdayKWH / monthday).toFixed(2) + "</td>";
|
||||
stb += "<td>" + monthKWH + "</td>";
|
||||
stb += "<td>" + monthmoney + "</td>";
|
||||
stb += "<td>" + (monthmoneyone / monthday).toFixed(2) + "</td>";
|
||||
if (showmoney == 1) {
|
||||
stb += "<td>" + monthmoney + "</td>";
|
||||
stb += "<td>" + (monthmoneyone / monthday).toFixed(2) + "</td>";
|
||||
}
|
||||
stb += "<td>" + monthday + "</td>";
|
||||
stb += "</tr>";
|
||||
}
|
||||
var std = "";
|
||||
if (check_hire == true)
|
||||
if (check_hire == true && showmoney == 1)
|
||||
{
|
||||
var dataTosent =
|
||||
{
|
||||
|
||||
@ -764,6 +764,44 @@
|
||||
|
||||
//#endregion
|
||||
|
||||
$("#user-power-station-table").on("click", "input.custom-control-input", function () {
|
||||
selected_id = $(this).attr('data-id');
|
||||
var clicktype = $(this).attr('id');
|
||||
var usetypename = clicktype.split("-");
|
||||
var usetype = 0;
|
||||
var check = 0;
|
||||
switch (usetypename[1])
|
||||
{
|
||||
case "emailDayReport": usetype = 0; break;
|
||||
case "emailMonthReport": usetype = 1; break;
|
||||
case "emailComplexReport": usetype = 2; break;
|
||||
case "emailException": usetype = 3; break;
|
||||
}
|
||||
if (this.checked) {
|
||||
check = 1;
|
||||
}
|
||||
else {
|
||||
check = 0;
|
||||
}
|
||||
|
||||
|
||||
var url = "/User/DeleteOneGetEmail/";
|
||||
var send_data = {
|
||||
Id: selected_id,
|
||||
Type: usetype,
|
||||
Check: check
|
||||
}
|
||||
$.post(url, send_data, function (rel) {
|
||||
if (rel.code != "0000") {
|
||||
toast_error(rel.msg);
|
||||
return;
|
||||
}
|
||||
toast_ok(rel.msg);
|
||||
|
||||
}, 'json');
|
||||
})
|
||||
|
||||
|
||||
//#region 新增使用者管理電站
|
||||
function AddUserPowerStation(e) {
|
||||
|
||||
@ -850,29 +888,29 @@
|
||||
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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
str += "<td>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input'data-id='" + value.id + "' 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>" + "<div class='custom-control custom-checkbox'><input type ='checkbox' class='custom-control-input' data-id='" + value.id + "' 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>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user