Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
79cacfe612
@ -543,6 +543,7 @@ namespace SolarPower.Controllers
|
||||
cell.CellStyle = style0;
|
||||
|
||||
cell = row.CreateCell(5);
|
||||
cell.SetCellValue(bill.Result.TPCMeterNumber);
|
||||
region = new CellRangeAddress(18, 18, 5, 6);
|
||||
sheet.AddMergedRegion(region);
|
||||
cell.CellStyle = style14body;
|
||||
|
||||
@ -347,10 +347,8 @@ namespace SolarPower.Controllers
|
||||
SerialNumber = tempSerialNumber,
|
||||
IsEscrow = post.IsEscrow,
|
||||
EscrowName = post.EscrowName,
|
||||
ElectricityMeterAt = post.ElectricityMeterAt,
|
||||
EstimatedRecoveryTime = post.EstimatedRecoveryTime,
|
||||
GeneratingCapacity = post.GeneratingCapacity,
|
||||
PowerRate = post.PowerRate,
|
||||
Coordinate = post.Coordinate,
|
||||
InverterBrand = post.InverterBrand,
|
||||
InverterProductModel = post.InverterProductModel,
|
||||
@ -378,10 +376,8 @@ namespace SolarPower.Controllers
|
||||
"SerialNumber",
|
||||
"IsEscrow",
|
||||
"EscrowName",
|
||||
"ElectricityMeterAt",
|
||||
"EstimatedRecoveryTime",
|
||||
"GeneratingCapacity",
|
||||
"PowerRate",
|
||||
"Coordinate",
|
||||
"InverterBrand",
|
||||
"InverterProductModel",
|
||||
@ -486,10 +482,8 @@ namespace SolarPower.Controllers
|
||||
Name = post.Name,
|
||||
IsEscrow = post.IsEscrow,
|
||||
EscrowName = post.EscrowName,
|
||||
ElectricityMeterAt = post.ElectricityMeterAt,
|
||||
EstimatedRecoveryTime = post.EstimatedRecoveryTime,
|
||||
GeneratingCapacity = post.GeneratingCapacity,
|
||||
PowerRate = post.PowerRate,
|
||||
Coordinate = post.Coordinate,
|
||||
InverterBrand = post.InverterBrand,
|
||||
InverterProductModel = post.InverterProductModel,
|
||||
@ -514,10 +508,8 @@ namespace SolarPower.Controllers
|
||||
"Name",
|
||||
"IsEscrow",
|
||||
"EscrowName",
|
||||
"ElectricityMeterAt",
|
||||
"EstimatedRecoveryTime",
|
||||
"GeneratingCapacity",
|
||||
"PowerRate",
|
||||
"Coordinate",
|
||||
"InverterBrand",
|
||||
"InverterProductModel",
|
||||
@ -649,7 +641,11 @@ namespace SolarPower.Controllers
|
||||
var split = post.BoEFile.FileName.Split(".");
|
||||
boeFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + "." + split[split.Length - 1];
|
||||
|
||||
var fullPath = Path.Combine(powerSationSaveAsPath, "boe_file", boeFileName);
|
||||
FolderFunction folderFunction = new FolderFunction();
|
||||
var fileSaveAsPath = Path.Combine(powerSationSaveAsPath, "boe_file");
|
||||
folderFunction.CreateFolder(fileSaveAsPath, 0);
|
||||
|
||||
var fullPath = Path.Combine(fileSaveAsPath, boeFileName);
|
||||
|
||||
using (var stream = new FileStream(fullPath, FileMode.Create))
|
||||
{
|
||||
@ -664,13 +660,20 @@ namespace SolarPower.Controllers
|
||||
BoEFile = boeFileName, //自訂檔名
|
||||
BoEDiscountRate = post.BoEDiscountRate,
|
||||
BoEDeviceRegisterNumber = post.BoEDeviceRegisterNumber,
|
||||
BoERegisterPostAt = post.BoERegisterPostAt,
|
||||
BoERentRatio = post.BoERentRatio,
|
||||
TPCContractNumber = post.TPCContractNumber,
|
||||
TPCContractAt = post.TPCContractAt,
|
||||
TPCSellDeadline = post.TPCSellDeadline,
|
||||
ElectricityMeterAt = post.ElectricityMeterAt,
|
||||
PowerRate = post.PowerRate,
|
||||
TPCMeterReading = post.TPCMeterReading,
|
||||
TPCPurchaseElectricityAt = post.TPCPurchaseElectricityAt,
|
||||
TPCSellElectricityAt = post.TPCSellElectricityAt,
|
||||
TPCInvoiceBuyer = post.TPCInvoiceBuyer,
|
||||
GUINumber = post.GUINumber,
|
||||
TPCInvoiceAddress = post.TPCInvoiceAddress,
|
||||
TPCMeterNumber = post.TPCMeterNumber,
|
||||
UpdatedBy = myUser.Id
|
||||
};
|
||||
|
||||
@ -681,13 +684,20 @@ namespace SolarPower.Controllers
|
||||
"BoEFile",
|
||||
"BoEDiscountRate",
|
||||
"BoEDeviceRegisterNumber",
|
||||
"BoERegisterPostAt",
|
||||
"BoERentRatio",
|
||||
"TPCContractNumber",
|
||||
"TPCContractAt",
|
||||
"TPCSellDeadline",
|
||||
"ElectricityMeterAt",
|
||||
"PowerRate",
|
||||
"TPCMeterReading",
|
||||
"TPCPurchaseElectricityAt",
|
||||
"TPCSellElectricityAt",
|
||||
"TPCInvoiceBuyer",
|
||||
"GUINumber",
|
||||
"TPCInvoiceAddress",
|
||||
"TPCMeterNumber",
|
||||
"UpdatedBy",
|
||||
};
|
||||
|
||||
|
||||
@ -2119,6 +2119,38 @@ ALTER TABLE `power_station`
|
||||
ADD COLUMN `TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票買受人' AFTER `TPCContractNumber`,
|
||||
ADD COLUMN `TPCInvoiceAddress` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票地址' AFTER `TPCInvoiceBuyer`;
|
||||
|
||||
-- 新增其他sensor歸檔hour 20210824
|
||||
ALTER TABLE `sensor_history_hour`
|
||||
ADD COLUMN `EnvTemperature` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '環境溫度計' AFTER `Temperature`,
|
||||
ADD COLUMN `Humidity` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '環境濕度計' AFTER `EnvTemperature`,
|
||||
ADD COLUMN `Vane` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '風速計' AFTER `Humidity`,
|
||||
ADD COLUMN `Dust` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '落塵計' AFTER `Vane`;
|
||||
|
||||
-- 新增其他sensor歸檔day 20210824
|
||||
ALTER TABLE `sensor_history_day`
|
||||
ADD COLUMN `EnvTemperature` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '環境溫度計' AFTER `Temperature`,
|
||||
ADD COLUMN `Humidity` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '環境濕度計' AFTER `EnvTemperature`,
|
||||
ADD COLUMN `Vane` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '風速計' AFTER `Humidity`,
|
||||
ADD COLUMN `Dust` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '落塵計' AFTER `Vane`;
|
||||
|
||||
-- 新增其他sensor歸檔month 20210824
|
||||
ALTER TABLE `sensor_history_month`
|
||||
ADD COLUMN `EnvTemperature` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '環境溫度計' AFTER `Temperature`,
|
||||
ADD COLUMN `Humidity` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '環境濕度計' AFTER `EnvTemperature`,
|
||||
ADD COLUMN `Vane` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '風速計' AFTER `Humidity`,
|
||||
ADD COLUMN `Dust` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '落塵計' AFTER `Vane`;
|
||||
|
||||
-- 修改裝置容量、受電費率,並新增登記發文日期、台電電號
|
||||
ALTER TABLE `power_station`
|
||||
CHANGE COLUMN `GeneratingCapacity` `GeneratingCapacity` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '電廠發電容量,單位(千瓦)' AFTER `EstimatedRecoveryTime`,
|
||||
CHANGE COLUMN `PowerRate` `PowerRate` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '受電費率' AFTER `GeneratingCapacity`,
|
||||
ADD COLUMN `BoERegisterPostAt` TIMESTAMP NULL DEFAULT NULL COMMENT '能源局登記發文日期' AFTER `BoERentRatio`,
|
||||
ADD COLUMN `TPCMeterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '台電電號' AFTER `TPCSellElectricityAt`;
|
||||
|
||||
-- 修改土地與房屋資訊的租金比例 20210824
|
||||
ALTER TABLE `land_building`
|
||||
CHANGE COLUMN `LeaseRate` `LeaseRate` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '租金比例(%)' AFTER `Purpose`;
|
||||
|
||||
-- 新增逆變器及設備保固日期 20210824
|
||||
ALTER TABLE `inverter`
|
||||
ADD COLUMN `WarrantyDate` TIMESTAMP NULL DEFAULT NULL COMMENT '保固日期' AFTER `Pyrheliometer`;
|
||||
|
||||
@ -41,6 +41,7 @@ namespace SolarPower.Models
|
||||
public string GUINumber { get; set; }
|
||||
public string TPCInvoiceBuyer { get; set; }
|
||||
public string TPCInvoiceAddress { get; set; }
|
||||
public string TPCMeterNumber { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Logo { get; set; }
|
||||
private string startAt;
|
||||
|
||||
@ -12,9 +12,21 @@ namespace SolarPower.Models.PowerStation
|
||||
HireSold = 1, //租建躉售
|
||||
SelfUse = 2 //自建自用
|
||||
}
|
||||
|
||||
public enum SensorTypeEnum
|
||||
{
|
||||
PYR = 1, //日照計
|
||||
MTR = 2, //模組溫度計
|
||||
ETR = 3, //環境溫度計
|
||||
EMM = 4, //環境濕度計
|
||||
VAN = 5, //風速計
|
||||
FOM = 6, //落塵計
|
||||
PWR = 7 //電錶
|
||||
}
|
||||
|
||||
public class PowerStation : Created
|
||||
{
|
||||
private string electricityMeterAt = "", tpcContractAt = "", tpcPurchaseElectricityAt = "", tpcSellElectricityAt = "";
|
||||
private string electricityMeterAt = "", tpcContractAt = "", tpcPurchaseElectricityAt = "", tpcSellElectricityAt = "", boeRegisterPostAt = "";
|
||||
|
||||
public int Id { get; set; }
|
||||
public byte HealthStatus { get; set; } //狀態
|
||||
@ -62,6 +74,21 @@ namespace SolarPower.Models.PowerStation
|
||||
public int BoEDiscountRate { get; set; } //能源局折扣率
|
||||
public string BoEDeviceRegisterNumber { get; set; } //能源局設備登記編號
|
||||
public int BoERentRatio { get; set; } //能源局租金比例
|
||||
public string BoERegisterPostAt //台電簽約日期
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(boeRegisterPostAt))
|
||||
{
|
||||
return Convert.ToDateTime(boeRegisterPostAt).ToString("yyyy-MM-dd");
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
set { boeRegisterPostAt = value; }
|
||||
}
|
||||
public string TPCContractNumber { get; set; } //台電契約編號
|
||||
public string TPCContractAt //台電簽約日期
|
||||
{
|
||||
@ -110,6 +137,10 @@ namespace SolarPower.Models.PowerStation
|
||||
}
|
||||
set { tpcPurchaseElectricityAt = value; }
|
||||
}
|
||||
public string TPCMeterNumber { get; set; } //台電電號
|
||||
public string GUINumber { get; set; }
|
||||
public string TPCInvoiceBuyer { get; set; }
|
||||
public string TPCInvoiceAddress { get; set; }
|
||||
public List<LandBuilding> LandBuildings { get; set; } //土地房屋資料
|
||||
public byte SolarType { get; set; } //電站類型
|
||||
public double kwh { get; set; } //
|
||||
@ -162,7 +193,7 @@ namespace SolarPower.Models.PowerStation
|
||||
}
|
||||
public string Landowner { get; set; } //地主姓名
|
||||
public string Purpose { get; set; } //房屋用途
|
||||
public int LeaseRate { get; set; } //租金比例
|
||||
public double LeaseRate { get; set; } //租金比例
|
||||
public string Coordinate { get; set; } //經緯度
|
||||
public string Phone { get; set; } //電話
|
||||
public string CreatorName { get; set; } //創建者名稱
|
||||
@ -185,10 +216,10 @@ namespace SolarPower.Models.PowerStation
|
||||
//public string Code { get; set; }
|
||||
public byte IsEscrow { get; set; } //是否被代管
|
||||
public string EscrowName { get; set; } //被代管公司
|
||||
public string ElectricityMeterAt { get; set; } //台電掛錶日
|
||||
//public string ElectricityMeterAt { get; set; } //台電掛錶日
|
||||
public int EstimatedRecoveryTime { get; set; } //預計回收年限
|
||||
public double GeneratingCapacity { get; set; } //發電容量
|
||||
public double PowerRate { get; set; } //授電費率
|
||||
//public double PowerRate { get; set; } //授電費率
|
||||
public string Coordinate { get; set; } //座標
|
||||
public List<int> OperationPersonnelIds { get; set; } //運維人員編號
|
||||
public string InverterBrand { get; set; } //逆變器廠牌
|
||||
@ -213,10 +244,10 @@ namespace SolarPower.Models.PowerStation
|
||||
public string Name { get; set; } //名稱
|
||||
public byte IsEscrow { get; set; } //是否被代管
|
||||
public string EscrowName { get; set; } //被代管公司
|
||||
public string ElectricityMeterAt { get; set; } //台電掛錶日
|
||||
//public string ElectricityMeterAt { get; set; } //台電掛錶日
|
||||
public int EstimatedRecoveryTime { get; set; } //預計回收年限
|
||||
public double GeneratingCapacity { get; set; } //發電容量
|
||||
public double PowerRate { get; set; } //授電費率
|
||||
//public double PowerRate { get; set; } //授電費率
|
||||
public string Coordinate { get; set; } //座標
|
||||
public string InverterBrand { get; set; } //逆變器廠牌
|
||||
public string InverterProductModel { get; set; } //逆變器型號
|
||||
@ -237,13 +268,20 @@ namespace SolarPower.Models.PowerStation
|
||||
public IFormFile BoEFile { get; set; }
|
||||
public int BoEDiscountRate { get; set; }
|
||||
public string BoEDeviceRegisterNumber { get; set; }
|
||||
public string BoERegisterPostAt { get; set; }
|
||||
public int BoERentRatio { get; set; }
|
||||
public string TPCContractNumber { get; set; }
|
||||
public string TPCContractAt { get; set; }
|
||||
public int TPCSellDeadline { get; set; }
|
||||
public string ElectricityMeterAt { get; set; }
|
||||
public double PowerRate { get; set; }
|
||||
public int TPCMeterReading { get; set; }
|
||||
public string TPCPurchaseElectricityAt { get; set; }
|
||||
public string TPCSellElectricityAt { get; set; }
|
||||
public string TPCInvoiceBuyer { get; set; }
|
||||
public string GUINumber { get; set; }
|
||||
public string TPCInvoiceAddress { get; set; }
|
||||
public string TPCMeterNumber { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateBoETPCInfo : Updated
|
||||
@ -252,13 +290,20 @@ namespace SolarPower.Models.PowerStation
|
||||
public string BoEFile { get; set; }
|
||||
public int BoEDiscountRate { get; set; }
|
||||
public string BoEDeviceRegisterNumber { get; set; }
|
||||
public string BoERegisterPostAt { get; set; }
|
||||
public int BoERentRatio { get; set; }
|
||||
public string TPCContractNumber { get; set; }
|
||||
public string TPCContractAt { get; set; }
|
||||
public int TPCSellDeadline { get; set; }
|
||||
public string ElectricityMeterAt { get; set; }
|
||||
public double PowerRate { get; set; }
|
||||
public int TPCMeterReading { get; set; }
|
||||
public string TPCPurchaseElectricityAt { get; set; }
|
||||
public string TPCSellElectricityAt { get; set; }
|
||||
public string TPCInvoiceBuyer { get; set; }
|
||||
public string GUINumber { get; set; }
|
||||
public string TPCInvoiceAddress { get; set; }
|
||||
public string TPCMeterNumber { get; set; }
|
||||
}
|
||||
|
||||
public class PostLandBuildingInfo
|
||||
@ -269,7 +314,7 @@ namespace SolarPower.Models.PowerStation
|
||||
public string LeaseNotarizationAt { get; set; }
|
||||
public string Landowner { get; set; }
|
||||
public string Purpose { get; set; }
|
||||
public int LeaseRate { get; set; }
|
||||
public double LeaseRate { get; set; }
|
||||
public string Coordinate { get; set; }
|
||||
public string Phone { get; set; }
|
||||
}
|
||||
@ -280,7 +325,7 @@ namespace SolarPower.Models.PowerStation
|
||||
public string LeaseNotarizationAt { get; set; }
|
||||
public string Landowner { get; set; }
|
||||
public string Purpose { get; set; }
|
||||
public int LeaseRate { get; set; }
|
||||
public double LeaseRate { get; set; }
|
||||
public string Coordinate { get; set; }
|
||||
public string Phone { get; set; }
|
||||
}
|
||||
|
||||
@ -40,8 +40,6 @@ namespace SolarPower.Quartz.Jobs
|
||||
var DateTimeNow = DateTime.Now;
|
||||
var dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH");
|
||||
|
||||
var hasException = false;
|
||||
|
||||
Root2 observation = null;
|
||||
|
||||
if (this.environment.IsDevelopment())
|
||||
@ -226,223 +224,331 @@ namespace SolarPower.Quartz.Jobs
|
||||
sensorHistory.PowerStationId = powerStation.Id;
|
||||
sensorHistory.Timestamp = Convert.ToDateTime(dateTime + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
//1. 找出該電站所有日照計設備(包含共享
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的日照計設備資訊】", powerStation.Code, dateTime);
|
||||
var deviceInfos = await powerStationRepository.GetListPyrheliometerByPowerStationId(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(deviceInfos));
|
||||
|
||||
if (deviceInfos != null && deviceInfos.Count() > 0)
|
||||
//1. 計算該電站sensor平均值 - 日照計(PYR)
|
||||
try
|
||||
{
|
||||
//2. 計算該電站所有日照計設的每小時的平均在依照日照計數量平均
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的日照計的日照度】", powerStation.Code, dateTime);
|
||||
var pyrheliometerHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, deviceInfos, 0);
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的日照計設備資訊】", powerStation.Code, dateTime);
|
||||
var deviceInfos = await powerStationRepository.GetListPyrheliometerByPowerStationId(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(deviceInfos));
|
||||
|
||||
if (pyrheliometerHistory != null)
|
||||
if (deviceInfos != null && deviceInfos.Count() > 0)
|
||||
{
|
||||
calcPowerStation.Today_irradiance = pyrheliometerHistory.Irradiance;
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的日照計的平均值】", powerStation.Code, dateTime);
|
||||
var pyrheliometerHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, deviceInfos, Convert.ToInt32(SensorTypeEnum.PYR));
|
||||
|
||||
sensorHistory.Irradiance = pyrheliometerHistory.Irradiance;
|
||||
if (pyrheliometerHistory != null)
|
||||
{
|
||||
calcPowerStation.Today_irradiance = pyrheliometerHistory.Irradiance;
|
||||
|
||||
pyrheliometerHistory.Timestamp = Convert.ToDateTime(pyrheliometerHistory.Timestamp + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
pyrheliometerHistory.PowerStationId = powerStation.Id;
|
||||
pyrheliometerHistoriesHour.Add(pyrheliometerHistory);
|
||||
}
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的日照計的日照度】", powerStation.Code, dateTime);
|
||||
}
|
||||
sensorHistory.Irradiance = pyrheliometerHistory.Irradiance;
|
||||
|
||||
//2. 計算該電站所有模組溫度計設的每小時的平均在依照溫度計數量平均
|
||||
// 找出該電站所有模組溫度計設備(包含共享
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的模組溫度計設備資訊】", powerStation.Code, dateTime);
|
||||
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 && tempdeviceInfos.Count() > 0)
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的模組溫度計的平均溫度】", powerStation.Code, dateTime);
|
||||
var tempHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, tempdeviceInfos, 1);
|
||||
if (tempHistory != null)
|
||||
{
|
||||
tempHistory.Timestamp = Convert.ToDateTime(tempHistory.Timestamp + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
tempHistory.PowerStationId = powerStation.Id;
|
||||
TempHistoriesHour.Add(tempHistory);
|
||||
|
||||
sensorHistory.Temperature = tempHistory.Temperature;
|
||||
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的模組溫度計的平均溫度】", powerStation.Code, dateTime);
|
||||
//pyrheliometerHistory.Timestamp = Convert.ToDateTime(pyrheliometerHistory.Timestamp + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
//pyrheliometerHistory.PowerStationId = powerStation.Id;
|
||||
//pyrheliometerHistoriesHour.Add(pyrheliometerHistory);
|
||||
}
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的日照計的平均值】", powerStation.Code, dateTime);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的日照計的平均值】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
|
||||
//3. 計算該電站 - 環境溫度計(ETR)
|
||||
//logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的環境溫度計設備資訊】", powerStation.Code, dateTime);
|
||||
//var ETRdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, "ETR", 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 (ETRdeviceInfos != null && ETRdeviceInfos.Count() > 0)
|
||||
//{
|
||||
// logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的環境溫度計的平均溫度】", powerStation.Code, dateTime);
|
||||
// var ETRHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, tempdeviceInfos, 1);
|
||||
// if (ETRHistory != null)
|
||||
// {
|
||||
// sensorHistory.EnvTemperature = ETRHistory.EnvTemperature;
|
||||
// logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的環境溫度計的平均溫度】", powerStation.Code, dateTime);
|
||||
// }
|
||||
//}
|
||||
//2. 計算該電站sensor平均值 - 模組溫度計(MTR)
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的模組溫度計設備資訊】", powerStation.Code, dateTime);
|
||||
var tempdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, "MTR", 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 && tempdeviceInfos.Count() > 0)
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的模組溫度計的平均值】", powerStation.Code, dateTime);
|
||||
var tempHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, tempdeviceInfos, Convert.ToInt32(SensorTypeEnum.MTR));
|
||||
if (tempHistory != null)
|
||||
{
|
||||
//tempHistory.Timestamp = Convert.ToDateTime(tempHistory.Timestamp + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
//tempHistory.PowerStationId = powerStation.Id;
|
||||
//TempHistoriesHour.Add(tempHistory);
|
||||
|
||||
sensorHistory.Temperature = tempHistory.Temperature;
|
||||
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的模組溫度計的平均值】", powerStation.Code, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的模組溫度計的平均值】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
|
||||
//3. 計算該電站sensor平均值 - 環境溫度計(ETR)
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的環境溫度計設備資訊】", powerStation.Code, dateTime);
|
||||
var ETRdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, SensorTypeEnum.ETR.ToString(), powerStation.SiteDB);
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的環境溫度計設備資訊】", powerStation.Code, dateTime);
|
||||
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的環境溫度計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(ETRdeviceInfos));
|
||||
if (ETRdeviceInfos != null && ETRdeviceInfos.Count() > 0)
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的環境溫度計的平均值】", powerStation.Code, dateTime);
|
||||
var ETRHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, ETRdeviceInfos, Convert.ToInt32(SensorTypeEnum.ETR));
|
||||
if (ETRHistory != null)
|
||||
{
|
||||
sensorHistory.EnvTemperature = ETRHistory.EnvTemperature;
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的環境溫度計的平均溫度】", powerStation.Code, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的環境溫度計的平均值】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
|
||||
//4. 計算該電站 - 環境濕度計(EMM)
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的環境濕度計設備資訊】", powerStation.Code, dateTime);
|
||||
var EMMdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, SensorTypeEnum.EMM.ToString(), powerStation.SiteDB);
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的環境濕度計設備資訊】", powerStation.Code, dateTime);
|
||||
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的環境濕度計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(EMMdeviceInfos));
|
||||
if (EMMdeviceInfos != null && EMMdeviceInfos.Count() > 0)
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的環境濕度計的平均值】", powerStation.Code, dateTime);
|
||||
var EMMHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, EMMdeviceInfos, Convert.ToInt32(SensorTypeEnum.EMM));
|
||||
if (EMMHistory != null)
|
||||
{
|
||||
sensorHistory.Humidity = EMMHistory.Humidity;
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的環境濕度計的平均值】", powerStation.Code, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的環境濕度計的平均值】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
|
||||
//5. 計算該電站 - 風速計(VAN)
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的風速計設備資訊】", powerStation.Code, dateTime);
|
||||
var VANdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, SensorTypeEnum.VAN.ToString(), powerStation.SiteDB);
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的風速計設備資訊】", powerStation.Code, dateTime);
|
||||
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的風速計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(VANdeviceInfos));
|
||||
if (VANdeviceInfos != null && VANdeviceInfos.Count() > 0)
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的風速計的平均值】", powerStation.Code, dateTime);
|
||||
var VANHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, VANdeviceInfos, Convert.ToInt32(SensorTypeEnum.VAN));
|
||||
if (VANHistory != null)
|
||||
{
|
||||
sensorHistory.Vane = VANHistory.Vane;
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的風速計的平均值】", powerStation.Code, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的風速計的平均值】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
|
||||
//4. 計算該電站 - 風速計(VAN)
|
||||
//logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的風速計設備資訊】", powerStation.Code, dateTime);
|
||||
//var VANdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, "ETR", 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 (VANdeviceInfos != null && VANdeviceInfos.Count() > 0)
|
||||
//{
|
||||
// logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的風速計的平均溫度】", powerStation.Code, dateTime);
|
||||
// var VANHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, tempdeviceInfos, 1);
|
||||
// if (VANHistory != null)
|
||||
// {
|
||||
// sensorHistory.EnvTemperature = VANHistory.Vane;
|
||||
// logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的環境溫度計的平均溫度】", powerStation.Code, dateTime);
|
||||
// }
|
||||
//}
|
||||
//5. 計算該電站 - 落塵計(FOM)
|
||||
//6. 計算該電站 - 環境濕度計(EMM)
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的落塵計設備資訊】", powerStation.Code, dateTime);
|
||||
var FOMdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, SensorTypeEnum.FOM.ToString(), powerStation.SiteDB);
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的落塵計設備資訊】", powerStation.Code, dateTime);
|
||||
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的落塵計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(FOMdeviceInfos));
|
||||
if (FOMdeviceInfos != null && FOMdeviceInfos.Count() > 0)
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的落塵計的平均%】", powerStation.Code, dateTime);
|
||||
var FOMHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, FOMdeviceInfos, Convert.ToInt32(SensorTypeEnum.FOM));
|
||||
if (FOMHistory != null)
|
||||
{
|
||||
sensorHistory.Dust = FOMHistory.Dust;
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的落塵計的平均值】", powerStation.Code, dateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的落塵計的平均值】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
|
||||
sensorHistoriesHour.Add(sensorHistory);
|
||||
calcPowerStations.Add(calcPowerStation);
|
||||
#endregion
|
||||
|
||||
#region step2-3. 計算該電站所有逆變器每小時值
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime);
|
||||
var controllers = await powerStationRepository.GetAllDeviceControllerId(powerStation.Id, powerStation.SiteDB);
|
||||
var inverters = await powerStationRepository.InverterTable(controllers, powerStation.SiteDB);
|
||||
var inverterIds = inverters.Where(x => x.Enabled == 1 && x.Status != 0).Select(x => x.InverterId).ToList();
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime);
|
||||
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的逆變器設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(inverterIds));
|
||||
|
||||
var inverter_table_name = String.Format("s{0}01_inv", powerStation.Code);
|
||||
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) && inverterIds != null && inverterIds.Count() > 0)
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
|
||||
var inverterHistories = await powerStationRepository.CalcInverterHisyortHourData(dateTime, powerStation.SiteDB, full_inverter_table_name, inverterIds);
|
||||
//取得日照計要找的欄位資訊
|
||||
var pyrheliometer = await powerStationRepository.GetFirstPyrheliometerInfo(powerStation.Id, powerStation.SiteDB);
|
||||
var pyrheliometerValue = await powerStationRepository.GetFirstPyrheliometerValue(dateTime, pyrheliometer.DBName, pyrheliometer.TableName, pyrheliometer.ColName);
|
||||
foreach (var inverterHistory in inverterHistories)
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime);
|
||||
var controllers = await powerStationRepository.GetAllDeviceControllerId(powerStation.Id, powerStation.SiteDB);
|
||||
var inverters = await powerStationRepository.InverterTable(controllers, powerStation.SiteDB);
|
||||
var inverterIds = inverters.Where(x => x.Enabled == 1 && x.Status != 0).Select(x => x.InverterId).ToList();
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime);
|
||||
logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的逆變器設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(inverterIds));
|
||||
|
||||
var inverter_table_name = String.Format("s{0}01_inv", powerStation.Code);
|
||||
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) && inverterIds != null && inverterIds.Count() > 0)
|
||||
{
|
||||
inverterHistory.Irradiance = pyrheliometerValue;
|
||||
inverterHistory.DC1KW = inverterHistory.DC1W / 1000;
|
||||
inverterHistory.DC2KW = inverterHistory.DC2W / 1000;
|
||||
inverterHistory.DC3KW = inverterHistory.DC3W / 1000;
|
||||
inverterHistory.DC4KW = inverterHistory.DC4W / 1000;
|
||||
inverterHistory.DC5KW = inverterHistory.DC5W / 1000;
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
|
||||
var inverterHistories = await powerStationRepository.CalcInverterHisyortHourData(dateTime, powerStation.SiteDB, full_inverter_table_name, inverterIds);
|
||||
//取得日照計要找的欄位資訊
|
||||
var pyrheliometer = await powerStationRepository.GetFirstPyrheliometerInfo(powerStation.Id, powerStation.SiteDB);
|
||||
var pyrheliometerValue = await powerStationRepository.GetFirstPyrheliometerValue(dateTime, pyrheliometer.DBName, pyrheliometer.TableName, pyrheliometer.ColName);
|
||||
foreach (var inverterHistory in inverterHistories)
|
||||
{
|
||||
inverterHistory.Irradiance = pyrheliometerValue;
|
||||
inverterHistory.DC1KW = inverterHistory.DC1W / 1000;
|
||||
inverterHistory.DC2KW = inverterHistory.DC2W / 1000;
|
||||
inverterHistory.DC3KW = inverterHistory.DC3W / 1000;
|
||||
inverterHistory.DC4KW = inverterHistory.DC4W / 1000;
|
||||
inverterHistory.DC5KW = inverterHistory.DC5W / 1000;
|
||||
|
||||
inverterHistory.DCKW = (inverterHistory.DC1W + inverterHistory.DC2W + inverterHistory.DC3W + inverterHistory.DC4W + inverterHistory.DC5W) / 1000;
|
||||
inverterHistory.ACKW = (inverterHistory.AC1W + inverterHistory.AC2W + inverterHistory.AC3W) / 1000;
|
||||
inverterHistory.DCKW = (inverterHistory.DC1W + inverterHistory.DC2W + inverterHistory.DC3W + inverterHistory.DC4W + inverterHistory.DC5W) / 1000;
|
||||
inverterHistory.ACKW = (inverterHistory.AC1W + inverterHistory.AC2W + inverterHistory.AC3W) / 1000;
|
||||
|
||||
inverterHistory.TIMESTAMP = Convert.ToDateTime(inverterHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
inverterHistory.PowerStationId = powerStation.Id;
|
||||
inverterHistory.TIMESTAMP = Convert.ToDateTime(inverterHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
inverterHistory.PowerStationId = powerStation.Id;
|
||||
|
||||
inverterHistoriesHour.Add(inverterHistory);
|
||||
inverterHistoriesHour.Add(inverterHistory);
|
||||
}
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
|
||||
}
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region step2-4. 計算該電站所有sensoravg
|
||||
var seneoravg_table_name = String.Format("s{0}01_sensoravg", powerStation.Code);
|
||||
var full_seneoravg_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, seneoravg_table_name);
|
||||
var exist_seneoravg_table = await powerStationRepository.ExistTable(powerStation.SiteDB, seneoravg_table_name);
|
||||
if (!string.IsNullOrEmpty(exist_seneoravg_table))
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的sensor avg的資訊】", powerStation.Code, dateTime);
|
||||
var sensorAvgHistory = await powerStationRepository.CalcSensorAvgHistory(dateTime, full_seneoravg_table_name);
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的sensor avg的資訊】", powerStation.Code, dateTime);
|
||||
|
||||
if (sensorAvgHistory != null)
|
||||
var seneoravg_table_name = String.Format("s{0}01_sensoravg", powerStation.Code);
|
||||
var full_seneoravg_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, seneoravg_table_name);
|
||||
var exist_seneoravg_table = await powerStationRepository.ExistTable(powerStation.SiteDB, seneoravg_table_name);
|
||||
if (!string.IsNullOrEmpty(exist_seneoravg_table))
|
||||
{
|
||||
sensorAvgHistory.PowerStationId = powerStation.Id;
|
||||
sensorAvgHistory.TIMESTAMP = Convert.ToDateTime(sensorAvgHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的sensor avg的資訊】", powerStation.Code, dateTime);
|
||||
var sensorAvgHistory = await powerStationRepository.CalcSensorAvgHistory(dateTime, full_seneoravg_table_name);
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的sensor avg的資訊】", powerStation.Code, dateTime);
|
||||
|
||||
sensorAvgHistoryHour.Add(sensorAvgHistory);
|
||||
if (sensorAvgHistory != null)
|
||||
{
|
||||
sensorAvgHistory.PowerStationId = powerStation.Id;
|
||||
sensorAvgHistory.TIMESTAMP = Convert.ToDateTime(sensorAvgHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
sensorAvgHistoryHour.Add(sensorAvgHistory);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的sensor avg的資訊】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region step2-5. 計算該電站meter
|
||||
var meter_table_name = String.Format("s{0}01_meter", powerStation.Code);
|
||||
var full_meter_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, meter_table_name);
|
||||
var exist_meter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, meter_table_name);
|
||||
if (!string.IsNullOrEmpty(exist_meter_table))
|
||||
try
|
||||
{
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
|
||||
var meterHistory = await powerStationRepository.CalcMeterHistory(dateTime, full_meter_table_name);
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
|
||||
|
||||
if (meterHistory != null)
|
||||
var meter_table_name = String.Format("s{0}01_meter", powerStation.Code);
|
||||
var full_meter_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, meter_table_name);
|
||||
var exist_meter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, meter_table_name);
|
||||
if (!string.IsNullOrEmpty(exist_meter_table))
|
||||
{
|
||||
meterHistory.PowerStationId = powerStation.Id;
|
||||
meterHistory.TIMESTAMP = Convert.ToDateTime(meterHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
|
||||
var meterHistory = await powerStationRepository.CalcMeterHistory(dateTime, full_meter_table_name);
|
||||
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
|
||||
|
||||
meterHistoriesHour.Add(meterHistory);
|
||||
if (meterHistory != null)
|
||||
{
|
||||
meterHistory.PowerStationId = powerStation.Id;
|
||||
meterHistory.TIMESTAMP = Convert.ToDateTime(meterHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
meterHistoriesHour.Add(meterHistory);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 確認是否有觀測站(沒有則新增)
|
||||
if (powerStation.WeathersStationId == null)
|
||||
try
|
||||
{
|
||||
var weatherStationId = "";
|
||||
double shortLocation = 9999;
|
||||
foreach (var Location in observation.Records.Location)
|
||||
if (powerStation.WeathersStationId == null)
|
||||
{
|
||||
|
||||
if (powerStation.Coordinate != null)
|
||||
var weatherStationId = "";
|
||||
double shortLocation = 9999;
|
||||
foreach (var Location in observation.Records.Location)
|
||||
{
|
||||
var powerLocation = powerStation.Coordinate.Split(',');
|
||||
var nowLocation = Math.Sqrt(Math.Pow(Convert.ToDouble(powerLocation[0]) - Convert.ToDouble(Location.Lat), 2) + Math.Pow(Convert.ToDouble(powerLocation[1]) - Convert.ToDouble(Location.Lon), 2));
|
||||
if (nowLocation < shortLocation)
|
||||
|
||||
if (powerStation.Coordinate != null)
|
||||
{
|
||||
shortLocation = nowLocation;
|
||||
weatherStationId = Location.StationId;
|
||||
calcPowerStation.TodayWeatherTemp = Convert.ToDouble(Location.WeatherElement[0].ElementValue);
|
||||
var powerLocation = powerStation.Coordinate.Split(',');
|
||||
var nowLocation = Math.Sqrt(Math.Pow(Convert.ToDouble(powerLocation[0]) - Convert.ToDouble(Location.Lat), 2) + Math.Pow(Convert.ToDouble(powerLocation[1]) - Convert.ToDouble(Location.Lon), 2));
|
||||
if (nowLocation < shortLocation)
|
||||
{
|
||||
shortLocation = nowLocation;
|
||||
weatherStationId = Location.StationId;
|
||||
calcPowerStation.TodayWeatherTemp = Convert.ToDouble(Location.WeatherElement[0].ElementValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
calcPowerStation.WeathersStationId = weatherStationId;
|
||||
}
|
||||
|
||||
calcPowerStation.WeathersStationId = weatherStationId;
|
||||
WeatherObservation weatherObservation = new WeatherObservation();
|
||||
if (powerStation.WeathersStationId != null && observation != null)
|
||||
{
|
||||
foreach (var Location in observation.Records.Location)
|
||||
{
|
||||
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 = !string.IsNullOrEmpty(Location.Time.ObsTime) ? Convert.ToInt32(Location.Time.ObsTime.Substring(0, 4)) >= 1971 ? Location.Time.ObsTime : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
calcPowerStation.WeathersStationId = powerStation.WeathersStationId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
weatherObservations.Add(weatherObservation);
|
||||
}
|
||||
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的天氣預報的資訊】", powerStation.Code, dateTime);
|
||||
var weather = await powerStationRepository.SelectNowWeather(powerStation.CityId);
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的天氣預報的資訊】", powerStation.Code, dateTime);
|
||||
if (weather != null)
|
||||
{
|
||||
calcPowerStation.TodayWeather = weather.WeatherKey;
|
||||
calcPowerStation.RateOfRain = weather.PoP;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError("【CalcPowerStationJob】【取得失敗電站[{0}]在{1}的天氣預報的資訊】", powerStation.Code, dateTime);
|
||||
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
|
||||
}
|
||||
#endregion
|
||||
|
||||
WeatherObservation weatherObservation = new WeatherObservation();
|
||||
if (powerStation.WeathersStationId != null && observation != null)
|
||||
{
|
||||
foreach (var Location in observation.Records.Location)
|
||||
{
|
||||
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 = !string.IsNullOrEmpty(Location.Time.ObsTime) ? Convert.ToInt32(Location.Time.ObsTime.Substring(0, 4)) >= 1971 ? Location.Time.ObsTime : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
calcPowerStation.WeathersStationId = powerStation.WeathersStationId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
weatherObservations.Add(weatherObservation);
|
||||
}
|
||||
|
||||
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的天氣預報的資訊】", powerStation.Code, dateTime);
|
||||
var weather = await powerStationRepository.SelectNowWeather(powerStation.CityId);
|
||||
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的天氣預報的資訊】", powerStation.Code, dateTime);
|
||||
if (weather != null)
|
||||
{
|
||||
calcPowerStation.TodayWeather = weather.WeatherKey;
|
||||
calcPowerStation.RateOfRain = weather.PoP;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@ -478,24 +584,29 @@ namespace SolarPower.Quartz.Jobs
|
||||
await powerStationRepository.AddPowerStationHistory(powerStationHistoriesHour, history_properties);
|
||||
#endregion
|
||||
|
||||
#region step4. 將Pyrheliometer History INSERT 到 sensor_history_hour 資料表
|
||||
List<string> pyrheliometer_history_properties = new List<string>()
|
||||
#region step4. 將sensor History INSERT 到 sensor_history_hour 資料表
|
||||
List<string> sensor_history_properties = new List<string>()
|
||||
{
|
||||
"PowerStationId",
|
||||
"TIMESTAMP",
|
||||
"Irradiance"
|
||||
"Irradiance",
|
||||
"Temperature",
|
||||
"EnvTemperature",
|
||||
"Humidity",
|
||||
"Vane",
|
||||
"Dust"
|
||||
};
|
||||
|
||||
await powerStationRepository.AddPyrheliometerHistory(pyrheliometerHistoriesHour, pyrheliometer_history_properties);
|
||||
await powerStationRepository.AddSensorHistoryHour(sensorHistoriesHour, sensor_history_properties);
|
||||
|
||||
List<string> Temp_history_properties = new List<string>()
|
||||
{
|
||||
"PowerStationId",
|
||||
"TIMESTAMP",
|
||||
"Temperature"
|
||||
};
|
||||
//List<string> Temp_history_properties = new List<string>()
|
||||
//{
|
||||
// "PowerStationId",
|
||||
// "TIMESTAMP",
|
||||
// "Temperature"
|
||||
//};
|
||||
|
||||
await powerStationRepository.AddTempHistory(TempHistoriesHour, Temp_history_properties);
|
||||
//await powerStationRepository.AddTempHistory(TempHistoriesHour, Temp_history_properties);
|
||||
#endregion
|
||||
|
||||
#region step5. calcPowerStations UPDATE 到 power_station 資料表
|
||||
|
||||
@ -540,72 +540,74 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
-- 傾印 資料表 power_station 結構
|
||||
CREATE TABLE IF NOT EXISTS `power_station` (
|
||||
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||
`CompanyId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公司編號',
|
||||
`CityId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站縣市',
|
||||
`AreaId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '電站區域',
|
||||
`HealthStatus` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '1:設備正常 2:設備斷線 3:設備異常',
|
||||
`Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站詳細地址',
|
||||
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名稱',
|
||||
`MainDisplay` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '主要顯示圖片',
|
||||
`Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站代碼,縣市+區域+四碼流水號',
|
||||
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '四碼流水號',
|
||||
`IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否為代管,0:否 1:是',
|
||||
`EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '代管名稱',
|
||||
`ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '台電掛錶日',
|
||||
`EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '預估回收時間',
|
||||
`GeneratingCapacity` decimal(10,1) NOT NULL DEFAULT '0.0' COMMENT '電廠發電容量,單位(千瓦)',
|
||||
`PowerRate` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '受電費率',
|
||||
`Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '座標',
|
||||
`InverterBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '逆變器廠牌',
|
||||
`InverterProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '逆變器型號',
|
||||
`InverterAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '逆變器數量',
|
||||
`PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板廠牌',
|
||||
`PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板型號',
|
||||
`PhotovoltaicPanelSpecification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '光電板規格',
|
||||
`PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '光電板數量',
|
||||
`BoEFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局原檔案名',
|
||||
`BoEFile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局檔案',
|
||||
`BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '能源局折扣率',
|
||||
`BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '能源局設備登記編號',
|
||||
`BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '能源局租金比率,單位(%)',
|
||||
`GUINumber` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '統一編號',
|
||||
`TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電契約編號',
|
||||
`TPCInvoiceBuyer` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電發票買受人',
|
||||
`TPCInvoiceAddress` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '台電發票地址',
|
||||
`TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '台電簽約日期',
|
||||
`TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '台電售電期限,單位(年)',
|
||||
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '台電每期抄錶日',
|
||||
`TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式購電日',
|
||||
`TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '台電正式售電日',
|
||||
`SolarType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '電站類型',
|
||||
`kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
|
||||
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '今日發電量',
|
||||
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '總發電量',
|
||||
`today_kwhkwp` decimal(10,3) DEFAULT NULL COMMENT '今日kwhkwp',
|
||||
`avg_kwhkwp` decimal(10,3) DEFAULT NULL COMMENT '30天平均kwhkwp',
|
||||
`today_money` decimal(10,2) DEFAULT NULL COMMENT '今日金額',
|
||||
`total_money` decimal(10,2) DEFAULT NULL COMMENT '總金額',
|
||||
`today_PR` decimal(5,2) DEFAULT NULL COMMENT '電站Pr值',
|
||||
`avg_PR` decimal(5,2) DEFAULT NULL COMMENT '平均Pr值',
|
||||
`today_carbon` decimal(10,2) DEFAULT NULL COMMENT '今日減碳量',
|
||||
`total_carbon` decimal(10,2) DEFAULT NULL COMMENT '總減碳量',
|
||||
`today_irradiance` decimal(5,2) DEFAULT NULL COMMENT '今日日照度',
|
||||
`avg_irradiance` decimal(5,2) DEFAULT NULL COMMENT '平均日照度',
|
||||
`SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '總運轉小時',
|
||||
`SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '電站 DB name: solar_com',
|
||||
`TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '今日天氣',
|
||||
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '今日溫度',
|
||||
`WeathersStationId` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '氣象站編號',
|
||||
`RateOfRain` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '今日降雨率',
|
||||
`line_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||
`Estimate_kwh` decimal(10,2) DEFAULT '0.00' COMMENT '預估發電度數',
|
||||
`EstimateEfficacy` decimal(10,2) DEFAULT '0.00' COMMENT '預估發電效能',
|
||||
`CreatedBy` int(10) unsigned NOT NULL COMMENT '建立者',
|
||||
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '修改者',
|
||||
`UpdatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||
`Id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`Deleted` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否刪除, 0:否 1:是',
|
||||
`CompanyId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '公司編號',
|
||||
`CityId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '電站縣市',
|
||||
`AreaId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '電站區域',
|
||||
`HealthStatus` TINYINT(4) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1:設備正常 2:設備斷線 3:設備異常',
|
||||
`Address` VARCHAR(100) NULL DEFAULT NULL COMMENT '電站詳細地址' COLLATE 'utf8mb4_unicode_ci',
|
||||
`Name` VARCHAR(50) NULL DEFAULT NULL COMMENT '名稱' COLLATE 'utf8mb4_unicode_ci',
|
||||
`MainDisplay` VARCHAR(50) NULL DEFAULT NULL COMMENT '主要顯示圖片' COLLATE 'utf8mb4_unicode_ci',
|
||||
`Code` VARCHAR(50) NULL DEFAULT NULL COMMENT '電站代碼,縣市+區域+四碼流水號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`SerialNumber` VARCHAR(4) NULL DEFAULT NULL COMMENT '四碼流水號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`IsEscrow` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否為代管,0:否 1:是',
|
||||
`EscrowName` VARCHAR(50) NULL DEFAULT NULL COMMENT '代管名稱' COLLATE 'utf8mb4_unicode_ci',
|
||||
`ElectricityMeterAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電掛錶日',
|
||||
`EstimatedRecoveryTime` VARCHAR(10) NULL DEFAULT NULL COMMENT '預估回收時間' COLLATE 'utf8mb4_unicode_ci',
|
||||
`GeneratingCapacity` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '電廠發電容量,單位(千瓦)',
|
||||
`PowerRate` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '受電費率',
|
||||
`Coordinate` VARCHAR(50) NULL DEFAULT NULL COMMENT '座標' COLLATE 'utf8mb4_unicode_ci',
|
||||
`InverterBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '逆變器廠牌' COLLATE 'utf8mb4_unicode_ci',
|
||||
`InverterProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '逆變器型號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`InverterAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '逆變器數量',
|
||||
`PhotovoltaicPanelBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '光電板廠牌' COLLATE 'utf8mb4_unicode_ci',
|
||||
`PhotovoltaicPanelProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '光電板型號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`PhotovoltaicPanelSpecification` VARCHAR(100) NULL DEFAULT NULL COMMENT '光電板規格' COLLATE 'utf8mb4_unicode_ci',
|
||||
`PhotovoltaicPanelAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '光電板數量',
|
||||
`BoEFileName` VARCHAR(255) NULL DEFAULT NULL COMMENT '能源局原檔案名' COLLATE 'utf8mb4_unicode_ci',
|
||||
`BoEFile` VARCHAR(255) NULL DEFAULT NULL COMMENT '能源局檔案' COLLATE 'utf8mb4_unicode_ci',
|
||||
`BoEDiscountRate` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '能源局折扣率',
|
||||
`BoEDeviceRegisterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '能源局設備登記編號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`BoERentRatio` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '能源局租金比率,單位(%)',
|
||||
`BoERegisterPostAt` TIMESTAMP NULL DEFAULT NULL COMMENT '能源局登記發文日期',
|
||||
`GUINumber` VARCHAR(16) NULL DEFAULT NULL COMMENT '統一編號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`TPCContractNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '台電契約編號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票買受人' COLLATE 'utf8mb4_unicode_ci',
|
||||
`TPCInvoiceAddress` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票地址' COLLATE 'utf8mb4_unicode_ci',
|
||||
`TPCContractAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電簽約日期',
|
||||
`TPCSellDeadline` INT(10) UNSIGNED NULL DEFAULT '0' COMMENT '台電售電期限,單位(年)',
|
||||
`TPCMeterReading` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '台電每期抄錶日',
|
||||
`TPCPurchaseElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電正式購電日',
|
||||
`TPCSellElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '台電正式售電日',
|
||||
`TPCMeterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '台電電號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`SolarType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '電站類型',
|
||||
`kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000',
|
||||
`Today_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '今日發電量',
|
||||
`Total_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '總發電量',
|
||||
`today_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '今日kwhkwp',
|
||||
`avg_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '30天平均kwhkwp',
|
||||
`today_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日金額',
|
||||
`total_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '總金額',
|
||||
`today_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '電站Pr值',
|
||||
`avg_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '平均Pr值',
|
||||
`today_carbon` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '今日減碳量',
|
||||
`total_carbon` DECIMAL(10,2) NOT NULL COMMENT '總減碳量',
|
||||
`today_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '今日日照度',
|
||||
`avg_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '平均日照度',
|
||||
`SolarHour` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '總運轉小時',
|
||||
`SiteDB` VARCHAR(20) NULL DEFAULT NULL COMMENT '電站 DB name: solar_com' COLLATE 'utf8mb4_unicode_ci',
|
||||
`TodayWeather` VARCHAR(20) NULL DEFAULT NULL COMMENT '今日天氣' COLLATE 'utf8mb4_unicode_ci',
|
||||
`TodayWeatherTemp` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '今日溫度',
|
||||
`WeathersStationId` VARCHAR(50) NULL DEFAULT NULL COMMENT '氣象站編號' COLLATE 'utf8mb4_unicode_ci',
|
||||
`RateOfRain` VARCHAR(50) NULL DEFAULT NULL COMMENT '今日降雨率' COLLATE 'utf8mb4_unicode_ci',
|
||||
`line_token` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
|
||||
`Estimate_kwh` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電度數',
|
||||
`EstimateEfficacy` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電效能',
|
||||
`CreatedBy` INT(10) UNSIGNED NOT NULL COMMENT '建立者',
|
||||
`CreatedAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '建立時間',
|
||||
`UpdatedBy` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT '修改者',
|
||||
`UpdatedAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改時間',
|
||||
PRIMARY KEY (`Id`) USING BTREE,
|
||||
KEY `IDX_01` (`Deleted`) USING BTREE,
|
||||
KEY `IDX_02` (`CompanyId`) USING BTREE,
|
||||
|
||||
@ -81,7 +81,7 @@ namespace SolarPower.Repository.Implement
|
||||
BillInfo a = new BillInfo();
|
||||
try
|
||||
{
|
||||
var sql = @$"SELECT es.Money,ps.GUINumber,ps.TPCInvoiceBuyer,ps.TPCInvoiceAddress,cp.Name,cp.Logo,ps.Id,
|
||||
var sql = @$"SELECT es.Money,ps.GUINumber,ps.TPCInvoiceBuyer,ps.TPCInvoiceAddress, ps.TPCMeterNumber,cp.Name,cp.Logo,ps.Id,
|
||||
es.StartAt,es.EndAt,es.Kwh,ps.PowerRate,ps.Name as PowerName
|
||||
FROM electricity_sold_record es
|
||||
LEFT JOIN power_station ps
|
||||
|
||||
@ -2315,15 +2315,17 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = $@"SELECT *
|
||||
FROM {db_name}.device d
|
||||
WHERE d.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
UNION
|
||||
SELECT d.*
|
||||
FROM {db_name}.sharedevice sd
|
||||
LEFT JOIN {db_name}.device d ON sd.DeviceId = d.Id
|
||||
WHERE sd.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
";
|
||||
var sql = $@"SELECT temp.*
|
||||
FROM (SELECT *
|
||||
FROM {db_name}.device d
|
||||
WHERE d.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
UNION
|
||||
SELECT d.*
|
||||
FROM {db_name}.sharedevice sd
|
||||
LEFT JOIN {db_name}.device d ON sd.DeviceId = d.Id
|
||||
WHERE sd.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
) temp
|
||||
ORDER BY temp.ColName";
|
||||
|
||||
result = (await conn.QueryAsync<DeviceInfo>(sql, new { PowerStationId = powerStationId })).ToList();
|
||||
}
|
||||
@ -2342,15 +2344,17 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = $@"SELECT *
|
||||
FROM {db_name}.device d
|
||||
WHERE d.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
UNION
|
||||
SELECT d.*
|
||||
FROM {db_name}.sharedevice sd
|
||||
LEFT JOIN {db_name}.device d ON sd.DeviceId = d.Id
|
||||
WHERE sd.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
";
|
||||
var sql = $@"SELECT temp.*
|
||||
FROM (SELECT *
|
||||
FROM {db_name}.device d
|
||||
WHERE d.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
UNION
|
||||
SELECT d.*
|
||||
FROM {db_name}.sharedevice sd
|
||||
LEFT JOIN {db_name}.device d ON sd.DeviceId = d.Id
|
||||
WHERE sd.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
|
||||
) temp
|
||||
ORDER BY temp.ColName";
|
||||
|
||||
result = (await conn.QueryAsync<DeviceInfo>(sql, new { PowerStationId = powerStationId })).ToList();
|
||||
}
|
||||
@ -2362,17 +2366,32 @@ namespace SolarPower.Repository.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<PyrheliometerHistory> GetPyrheliometerHistoryPerHour(string dateTime, List<DeviceInfo> deviceInfos, int type)
|
||||
public async Task<PyrheliometerHistory> CalcSensorHistoryPerHour(string dateTime, List<DeviceInfo> deviceInfos, int type)
|
||||
{
|
||||
SensorTypeEnum SensorTypeEnum = (SensorTypeEnum)type;
|
||||
var typename = "";
|
||||
if (type == 1)
|
||||
switch (SensorTypeEnum)
|
||||
{
|
||||
typename = "Temperature";//1為溫度計
|
||||
}
|
||||
else if (type == 0)
|
||||
{
|
||||
typename = "Irradiance";//0為日照計
|
||||
case SensorTypeEnum.PYR: //日照計
|
||||
typename = "Irradiance";
|
||||
break;
|
||||
case SensorTypeEnum.MTR: //模組溫度計
|
||||
typename = "Temperature";
|
||||
break;
|
||||
case SensorTypeEnum.ETR: //環境溫度計
|
||||
typename = "EnvTemperature";
|
||||
break;
|
||||
case SensorTypeEnum.EMM: //環境濕度計
|
||||
typename = "Humidity";
|
||||
break;
|
||||
case SensorTypeEnum.VAN: //風速計
|
||||
typename = "Vane";
|
||||
break;
|
||||
case SensorTypeEnum.FOM: //落塵計
|
||||
typename = "Dust";
|
||||
break;
|
||||
}
|
||||
|
||||
PyrheliometerHistory result;
|
||||
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||
{
|
||||
@ -2407,7 +2426,7 @@ namespace SolarPower.Repository.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> AddPyrheliometerHistory(List<PyrheliometerHistory> entity, List<string> properties)
|
||||
public async Task<int> AddSensorHistoryHour(List<PyrheliometerHistory> entity, List<string> properties)
|
||||
{
|
||||
int count;
|
||||
using (IDbConnection conn = _databaseHelper.GetConnection())
|
||||
@ -2511,10 +2530,13 @@ namespace SolarPower.Repository.Implement
|
||||
PowerStationId,
|
||||
DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') AS TIMESTAMP,
|
||||
AVG(p.Irradiance) AS Irradiance,
|
||||
AVG(p.Temperature) AS Temperature
|
||||
AVG(p.Temperature) AS Temperature,
|
||||
AVG(p.EnvTemperature) AS EnvTemperature,
|
||||
AVG(p.Humidity) AS Humidity,
|
||||
AVG(p.Vane) AS Vane,
|
||||
AVG(p.Dust) AS Dust
|
||||
FROM sensor_history_hour p
|
||||
WHERE DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') = @NowDay
|
||||
AND p.Irradiance != 0
|
||||
AND PowerStationId = @PowerStationId
|
||||
GROUP BY DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d')
|
||||
";
|
||||
@ -2575,10 +2597,13 @@ namespace SolarPower.Repository.Implement
|
||||
PowerStationId,
|
||||
DATE_FORMAT(p.TIMESTAMP, '%Y-%m') AS TIMESTAMP,
|
||||
AVG(p.Irradiance) AS Irradiance,
|
||||
AVG(p.Temperature) AS Temperature
|
||||
AVG(p.Temperature) AS Temperature,
|
||||
AVG(p.EnvTemperature) AS EnvTemperature,
|
||||
AVG(p.Humidity) AS Humidity,
|
||||
AVG(p.Vane) AS Vane,
|
||||
AVG(p.Dust) AS Dust
|
||||
FROM sensor_history_hour p
|
||||
WHERE DATE_FORMAT(p.TIMESTAMP, '%Y-%m') = @Month
|
||||
AND p.Irradiance != 0
|
||||
AND PowerStationId = @PowerStationId
|
||||
GROUP BY DATE_FORMAT(p.TIMESTAMP, '%Y-%m')
|
||||
";
|
||||
|
||||
@ -132,7 +132,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
if (!string.IsNullOrEmpty(filter.Name))
|
||||
{
|
||||
sql += @" AND Name LIKE CONCAT('%', @Name, '%')";
|
||||
sql += @" AND r.Name LIKE CONCAT('%', @Name, '%')";
|
||||
}
|
||||
|
||||
result = (await conn.QueryAsync<RoleDateTable>(sql, filter)).ToList();
|
||||
|
||||
@ -267,7 +267,7 @@ namespace SolarPower.Repository.Implement
|
||||
|
||||
if (!string.IsNullOrEmpty(filter.Name))
|
||||
{
|
||||
sql += @" AND Name LIKE CONCAT('%', @Name, '%')";
|
||||
sql += @" AND u.Name LIKE CONCAT('%', @Name, '%')";
|
||||
}
|
||||
|
||||
if (filter.SelectedRoleId > 0)
|
||||
|
||||
@ -511,9 +511,9 @@ namespace SolarPower.Repository.Interface
|
||||
Task<List<DeviceInfo>> GetListPyrheliometerByPowerStationId(int powerStationId, string db_name);
|
||||
Task<List<DeviceInfo>> GetListTempByPowerStationId(int powerStationId, string db_name);
|
||||
Task<List<DeviceInfo>> GetDeviceListByPowerStationIdAndType(int powerStationId, string type, string db_name);
|
||||
Task<PyrheliometerHistory> GetPyrheliometerHistoryPerHour(string dateTime, List<DeviceInfo> deviceInfos, int Type);
|
||||
Task<PyrheliometerHistory> CalcSensorHistoryPerHour(string dateTime, List<DeviceInfo> deviceInfos, int Type);
|
||||
Task<int> AddTempHistory(List<PyrheliometerHistory> entity, List<string> properties);
|
||||
Task<int> AddPyrheliometerHistory(List<PyrheliometerHistory> entity, List<string> properties);
|
||||
Task<int> AddSensorHistoryHour(List<PyrheliometerHistory> entity, List<string> properties);
|
||||
Task<AvgPyrheliometerHistory> CalcAvgPyrheliometerHistory30day(string nowDay, int powerStationId);
|
||||
Task<PyrheliometerHistory> CalcPyrheliometerHistoryDayDataByPowerStationId(string nowDay, int powerStationId);
|
||||
Task<int> AddPyrheliometerHistoryDayList(List<PyrheliometerHistory> entity, List<string> properties);
|
||||
|
||||
@ -398,7 +398,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
@ -408,7 +408,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
|
||||
@ -21,11 +21,11 @@
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>即時總發電量</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_kwh">126,161.72</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_kwh">0.00</span></p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>平均發電量</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="total_kwh">4,069.73</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="total_kwh">0.00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -37,11 +37,11 @@
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>即時平均日照度</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_irradiance">126,161.72</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_irradiance">0.00</span></p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>平均日照度(30天)</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="avg_irradiance">4,069.73</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="avg_irradiance">0.00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -53,11 +53,11 @@
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>即時平均 PR 值</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_PR">119.04</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_PR">0.00</span></p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>平均 PR 值(30天)</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="avg_PR">3.84</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="avg_PR">0.00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -69,11 +69,11 @@
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>即時平均有效日照時數</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_kwhkwp">140.39</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_kwhkwp">0.00</span></p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>平均有效日照時數 (30天)</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="avg_kwhkwp">4.53</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="avg_kwhkwp">0.00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -85,11 +85,11 @@
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>今日減碳量</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_carbon">6,091.78</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_carbon">0.00</span></p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<p>總減碳量</p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="total_carbon">985.98</span></p>
|
||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="total_carbon">0.00</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -119,7 +119,7 @@
|
||||
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 電站總數</h4>
|
||||
</div>
|
||||
<div class="card-body" style="min-height: 148px;">
|
||||
<p class="text-center display-3"><span class="color-info-700 font-weight-bold" id="total_power_station_count">52</span></p>
|
||||
<p class="text-center display-3"><span class="color-info-700 font-weight-bold" id="total_power_station_count">0</span></p>
|
||||
<p class="text-right mb-0">廠</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -131,7 +131,7 @@
|
||||
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 總裝置容量</h4>
|
||||
</div>
|
||||
<div class="card-body" style="min-height: 148px;">
|
||||
<p class="text-center display-3"><span class="color-info-700 font-weight-bold" id="total_capacity">1288.63</span></p>
|
||||
<p class="text-center display-3"><span class="color-info-700 font-weight-bold" id="total_capacity">0.00</span></p>
|
||||
<p class="text-right mb-0">MWp</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -502,7 +502,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
@ -512,7 +512,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@
|
||||
"info": true,
|
||||
"autoWidth": false,
|
||||
"responsive": true,
|
||||
"order": [[9, "desc"]],
|
||||
"order": [[8, "desc"]],
|
||||
"columns": [{
|
||||
"data": "planId"
|
||||
}, {
|
||||
|
||||
@ -416,7 +416,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
@ -426,7 +426,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@
|
||||
$('#solarTable' + val.cityId).find('tbody').append('<tr>' +
|
||||
'<td>' + val.id + '</td>' +
|
||||
'<td>' + val.name + '</td>' +
|
||||
'<td>' + val.generatingCapacity + '</td>' +
|
||||
'<td>' + val.generatingCapacity.toFixed(2) + '</td>' +
|
||||
'<td>' + val.inverterAmount + '</td>' +
|
||||
'<td>' + val.electricityMeterAt + '</td>' +
|
||||
'<td><button type="button" class="btn btn-primary btn-pills waves-effect waves-themed" onclick="location.href=\'' + localurl + '/edit?stationId=' + val.id + '\'">選擇</button></td>' +
|
||||
|
||||
@ -128,24 +128,26 @@
|
||||
if (stationId == 'new') {
|
||||
//#region 電站基本資料
|
||||
$("#address_detail_text").hide();
|
||||
$("#select_solar_tpye").attr('disabled', false);
|
||||
|
||||
$("#power_station_code_text").hide();
|
||||
$("#power_station_name_text").hide();
|
||||
$("#electricity_meter_at_text").hide();
|
||||
$("#estimated_recovery_time_text").hide();
|
||||
$("#created_by_title").hide();
|
||||
$("#created_by_text").hide();
|
||||
$("#check_escrow").attr('disabled', false);
|
||||
$("#escrow_name_text").hide();
|
||||
|
||||
$("#generating_capacity_text").hide();
|
||||
$("#escrow_name_text").hide();
|
||||
$("#power_rate_text").hide();
|
||||
$("#estimate_efficacy_text").hide();
|
||||
$("#estimate_kwh_text").hide();
|
||||
$("#estimated_recovery_time_text").hide();
|
||||
|
||||
$("#coordinate_text").hide();
|
||||
$("#line_token_text").hide();
|
||||
|
||||
$("#created_by_title").hide();
|
||||
$("#created_by_text").hide();
|
||||
$("#created_at_title").hide();
|
||||
$("#created_at_text").hide();
|
||||
|
||||
$("#line_token_text").hide();
|
||||
$("#estimate_kwh_text").hide();
|
||||
$("#estimate_efficacy_text").hide();
|
||||
|
||||
|
||||
//逆變器
|
||||
$("#inverter_brand_text").hide();
|
||||
@ -161,9 +163,7 @@
|
||||
|
||||
$("#edit-station-info-btn").hide();
|
||||
$("#canecl-station-info-btn").hide();
|
||||
$("#check_escrow").attr('disabled', false);
|
||||
|
||||
$("#select_solar_tpye").attr('disabled', false);
|
||||
@if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
|
||||
{
|
||||
<text>
|
||||
@ -743,6 +743,9 @@
|
||||
|
||||
return data;
|
||||
}
|
||||
},
|
||||
"error": function (xhr, error, thrown) {
|
||||
console.log(xhr);
|
||||
}
|
||||
|
||||
});
|
||||
@ -1037,18 +1040,18 @@
|
||||
cancelButtonText: "否"
|
||||
}).then(function (result) {
|
||||
if (result.value) {
|
||||
PostPowerStationDate();
|
||||
PostPowerStationData();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
PostPowerStationDate();
|
||||
PostPowerStationData();
|
||||
}
|
||||
</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>
|
||||
PostPowerStationDate();
|
||||
PostPowerStationData();
|
||||
</text>
|
||||
}
|
||||
|
||||
@ -1056,7 +1059,7 @@
|
||||
}
|
||||
//#endregion
|
||||
|
||||
function PostPowerStationDate() {
|
||||
function PostPowerStationData() {
|
||||
var url = "/PowerStation/SavePowerStationInfo";
|
||||
|
||||
var send_data = {
|
||||
@ -1066,7 +1069,6 @@
|
||||
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() : "",
|
||||
@ -1119,13 +1121,20 @@
|
||||
}
|
||||
formData.append("BoEDiscountRate", $("#BoE_discount_rate").val());
|
||||
formData.append("BoEDeviceRegisterNumber", $("#BoE_device_register_number").val());
|
||||
formData.append("BoERentRatio", $("#BoE_rent_ratio").val());
|
||||
formData.append("BoERegisterPostAt", $("#BoE_register_post_at").val());
|
||||
@*formData.append("BoERentRatio", $("#BoE_rent_ratio").val());*@
|
||||
formData.append("TPCContractNumber", $("#TPC_contract_number").val());
|
||||
formData.append("TPCContractAt", $("#TPC_contract_at").val());
|
||||
formData.append("TPCSellDeadline", $("#TPC_sell_deadline").val());
|
||||
formData.append("TPCMeterReading", $("#TPC_meter_reading").val());
|
||||
formData.append("TPCPurchaseElectricityAt", $("#TPC_purchase_electricity_at").val());
|
||||
formData.append("ElectricityMeterAt", $("#electricity_meter_at").val());
|
||||
formData.append("PowerRate", $("#power_rate").val());
|
||||
@*formData.append("TPCMeterReading", $("#TPC_meter_reading").val());*@
|
||||
@*formData.append("TPCPurchaseElectricityAt", $("#TPC_purchase_electricity_at").val());*@
|
||||
formData.append("TPCSellElectricityAt", $("#TPC_sell_electricity_at").val());
|
||||
formData.append("TPCInvoiceBuyer", $("#TPC_invoice_buyer").val());
|
||||
formData.append("GUINumber", $("#GUI_number").val());
|
||||
formData.append("TPCInvoiceAddress", $("#TPC_invoice_address").val());
|
||||
formData.append("TPCMeterNumber", $("#TPC_meter_number").val());
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@ -1192,24 +1201,24 @@
|
||||
|
||||
//#region 電站基本資料 文字
|
||||
$("#address_detail_text").show();
|
||||
|
||||
$("#power_station_code_text").show();
|
||||
$("#power_station_name_text").show();
|
||||
$("#electricity_meter_at_text").show();
|
||||
$("#estimated_recovery_time_text").show();
|
||||
$("#created_by_title").show();
|
||||
$("#created_by_text").show();
|
||||
$("#escrow_name_text").show();
|
||||
|
||||
$("#generating_capacity_text").show();
|
||||
$("#escrow_name_text").show();
|
||||
$("#power_rate_text").show();
|
||||
$("#estimate_efficacy_text").show();
|
||||
$("#estimate_kwh_text").show();
|
||||
$("#estimated_recovery_time_text").show();
|
||||
|
||||
$("#coordinate_text").show();
|
||||
$("#line_token_text").show();
|
||||
|
||||
$("#created_by_title").show();
|
||||
$("#created_by_text").show();
|
||||
$("#created_at_title").show();
|
||||
$("#created_at_text").show();
|
||||
|
||||
$("#line_token_text").show();
|
||||
$("#estimate_kwh_text").show();
|
||||
$("#estimate_efficacy_text").show();
|
||||
|
||||
//逆變器
|
||||
$("#inverter_brand_text").show();
|
||||
$("#inverter_product_model_text").show();
|
||||
@ -1226,22 +1235,21 @@
|
||||
$("#select_city").attr("disabled", true);
|
||||
$("#select_area").attr("disabled", true);
|
||||
$("#address_detail").hide();
|
||||
$("#power_station_name").hide();
|
||||
$("#check_escrow").attr("disabled", true);
|
||||
$("#electricity_meter_at").hide();
|
||||
$("#estimated_recovery_time").hide();
|
||||
|
||||
$("#select_solar_tpye").attr("disabled", true);
|
||||
|
||||
$("#generating_capacity").hide();
|
||||
$("#power_station_name").hide();
|
||||
$("#check_escrow").attr("disabled", true);
|
||||
$("#escrow_name").hide();
|
||||
$("#power_rate").hide();
|
||||
$("#coordinate").hide();
|
||||
$("#power_station_operation_personnel").attr("disabled", true);
|
||||
|
||||
$("#line_token").hide();
|
||||
$("#generating_capacity").hide();
|
||||
$("#estimate_kwh").hide();
|
||||
$("#estimate_efficacy").hide();
|
||||
$("#estimated_recovery_time").hide();
|
||||
|
||||
$("#power_station_operation_personnel").attr("disabled", true);
|
||||
|
||||
$("#coordinate").hide();
|
||||
$("#line_token").hide();
|
||||
|
||||
@if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
|
||||
{
|
||||
@ -1282,6 +1290,7 @@
|
||||
|
||||
//#region 電站基本資料 文字
|
||||
$("#address_detail_text").hide();
|
||||
|
||||
$("#power_station_name_text").hide();
|
||||
$("#electricity_meter_at_text").hide();
|
||||
$("#estimated_recovery_time_text").hide();
|
||||
@ -1315,17 +1324,20 @@
|
||||
$("#select_city").attr("disabled", true);
|
||||
$("#select_area").attr("disabled", true);
|
||||
$("#address_detail").show();
|
||||
$("#power_station_name").show();
|
||||
$("#check_escrow").attr("disabled", false);
|
||||
$("#electricity_meter_at").show();
|
||||
$("#estimated_recovery_time").show();
|
||||
|
||||
$("#select_solar_tpye").attr("disabled", false);
|
||||
|
||||
$("#generating_capacity").show();
|
||||
$("#power_station_name").show();
|
||||
$("#check_escrow").attr("disabled", false);
|
||||
$("#escrow_name").show();
|
||||
$("#power_rate").show();
|
||||
|
||||
$("#generating_capacity").show();
|
||||
$("#estimate_kwh").show();
|
||||
$("#estimate_efficacy").show();
|
||||
$("#estimated_recovery_time").show();
|
||||
|
||||
$("#coordinate").show();
|
||||
$("#line_token").show();
|
||||
|
||||
$("#power_station_operation_personnel").attr("disabled", false);
|
||||
|
||||
$("#power_station_operation_personnel > option").each(function () {
|
||||
@ -1361,11 +1373,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#line_token").show();
|
||||
$("#estimate_kwh").show();
|
||||
$("#estimate_efficacy").show();
|
||||
|
||||
@if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
|
||||
{
|
||||
<text>
|
||||
@ -1407,16 +1414,23 @@
|
||||
//觀看
|
||||
//#region 能源局與台電資料 文字
|
||||
$("#link-boe-file").show();
|
||||
$("#BoE_discount_rate_text").show();
|
||||
@*$("#BoE_discount_rate_text").show();*@
|
||||
@*$("#BoE_rent_ratio_text").show();*@
|
||||
$("#BoE_register_post_at_text").show();
|
||||
$("#BoE_device_register_number_text").show();
|
||||
$("#BoE_rent_ratio_text").show();
|
||||
|
||||
$("#TPC_contract_number_text").show();
|
||||
$("#TPC_contract_at_text").show();
|
||||
$("#TPC_sell_deadline_text").show();
|
||||
$("#TPC_meter_reading_text").show();
|
||||
$("#TPC_purchase_electricity_at_text").show();
|
||||
$("#electricity_meter_at_text").show();
|
||||
$("#power_rate_text").show();
|
||||
$("#TPC_sell_electricity_at_text").show();
|
||||
$("#TPC_invoice_buyer_text").show();
|
||||
$("#GUI_number_text").show();
|
||||
$("#TPC_invoice_address_text").show();
|
||||
$("#TPC_meter_number_text").show();
|
||||
@*$("#TPC_meter_reading_text").show();*@
|
||||
@*$("#TPC_purchase_electricity_at_text").show();*@
|
||||
|
||||
$("#BOE_TPC_created_by_title").show();
|
||||
$("#BOE_TPC_created_by_text").show();
|
||||
@ -1426,16 +1440,23 @@
|
||||
|
||||
//#region 能源局與台電資料 input
|
||||
$("#BoE_file").hide();
|
||||
$("#BoE_discount_rate").hide();
|
||||
$("#BoE_register_post_at").hide();
|
||||
$("#BoE_device_register_number").hide();
|
||||
$("#BoE_rent_ratio").hide();
|
||||
@*$("#BoE_discount_rate").hide();*@
|
||||
@*$("#BoE_rent_ratio").hide();*@
|
||||
|
||||
$("#TPC_contract_number").hide();
|
||||
$("#TPC_contract_at").hide();
|
||||
$("#TPC_sell_deadline").hide();
|
||||
$("#TPC_meter_reading").hide();
|
||||
$("#TPC_purchase_electricity_at").hide();
|
||||
$("#electricity_meter_at").hide();
|
||||
$("#power_rate").hide();
|
||||
$("#TPC_sell_electricity_at").hide();
|
||||
$("#TPC_invoice_buyer").hide();
|
||||
$("#GUI_number").hide();
|
||||
$("#TPC_invoice_address").hide();
|
||||
$("#TPC_meter_number").hide();
|
||||
@*$("#TPC_meter_reading").hide();*@
|
||||
@*$("#TPC_purchase_electricity_at").hide();*@
|
||||
//#endregion
|
||||
|
||||
//#region 能源局與台電btn
|
||||
@ -1447,16 +1468,21 @@
|
||||
//修改
|
||||
//#region 能源局與台電資料 文字
|
||||
$("#link-boe-file").hide();
|
||||
$("#BoE_discount_rate_text").hide();
|
||||
@*$("#BoE_discount_rate_text").hide();*@
|
||||
$("#BoE_register_post_at_text").hide();
|
||||
$("#BoE_device_register_number_text").hide();
|
||||
$("#BoE_rent_ratio_text").hide();
|
||||
@*$("#BoE_rent_ratio_text").hide();*@
|
||||
|
||||
$("#TPC_contract_number_text").hide();
|
||||
$("#TPC_contract_at_text").hide();
|
||||
$("#TPC_sell_deadline_text").hide();
|
||||
$("#TPC_meter_reading_text").hide();
|
||||
$("#TPC_purchase_electricity_at_text").hide();
|
||||
$("#electricity_meter_at_text").hide();
|
||||
$("#power_rate_text").hide();
|
||||
$("#TPC_sell_electricity_at_text").hide();
|
||||
$("#TPC_invoice_buyer_text").hide();
|
||||
$("#GUI_number_text").hide();
|
||||
$("#TPC_invoice_address_text").hide();
|
||||
$("#TPC_meter_number_text").hide();
|
||||
|
||||
$("#BOE_TPC_created_by_title").hide();
|
||||
$("#BOE_TPC_created_by_text").hide();
|
||||
@ -1466,16 +1492,21 @@
|
||||
|
||||
//#region 能源局與台電資料 input
|
||||
$("#BoE_file").show();
|
||||
$("#BoE_discount_rate").show();
|
||||
@*$("#BoE_discount_rate").show();*@
|
||||
$("#BoE_register_post_at").show();
|
||||
$("#BoE_device_register_number").show();
|
||||
$("#BoE_rent_ratio").show();
|
||||
@*$("#BoE_rent_ratio").show();*@
|
||||
|
||||
$("#TPC_contract_number").show();
|
||||
$("#TPC_contract_at").show();
|
||||
$("#TPC_sell_deadline").show();
|
||||
$("#TPC_meter_reading").show();
|
||||
$("#TPC_purchase_electricity_at").show();
|
||||
$("#electricity_meter_at").show();
|
||||
$("#power_rate").show();
|
||||
$("#TPC_sell_electricity_at").show();
|
||||
$("#TPC_invoice_buyer").show();
|
||||
$("#GUI_number").show();
|
||||
$("#TPC_invoice_address").show();
|
||||
$("#TPC_meter_number").show();
|
||||
//#endregion
|
||||
|
||||
//#region 能源局與台電btn
|
||||
@ -1490,12 +1521,12 @@
|
||||
//觀看
|
||||
//#region 土地房屋資料 文字
|
||||
$("#land_building_address_text_" + selectedLandBuildingId).show();
|
||||
$("#land_building_coordinate_text_" + selectedLandBuildingId).show();
|
||||
@*$("#land_building_coordinate_text_" + selectedLandBuildingId).show();*@
|
||||
$("#lease_notarization_at_text_" + selectedLandBuildingId).show();
|
||||
$("#land_building_lease_Rate_text_" + selectedLandBuildingId).show();
|
||||
$("#land_building_landowner_text_" + selectedLandBuildingId).show();
|
||||
$("#land_building_phone_text_" + selectedLandBuildingId).show();
|
||||
$("#land_building_purpose_text_" + selectedLandBuildingId).show();
|
||||
@*$("#land_building_phone_text_" + selectedLandBuildingId).show();*@
|
||||
@*$("#land_building_purpose_text_" + selectedLandBuildingId).show();*@
|
||||
$("#land_building_created_by_title_" + selectedLandBuildingId).show();
|
||||
$("#land_building_created_by_text_" + selectedLandBuildingId).show();
|
||||
$("#land_building_created_at_title_" + selectedLandBuildingId).show();
|
||||
@ -1504,12 +1535,12 @@
|
||||
|
||||
//#region 土地房屋資料 input
|
||||
$("#land_building_address_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_coordinate_" + selectedLandBuildingId).hide();
|
||||
@*$("#land_building_coordinate_" + selectedLandBuildingId).hide();*@
|
||||
$("#lease_notarization_at_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_lease_Rate_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_landowner_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_phone_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_purpose_" + selectedLandBuildingId).hide();
|
||||
@*$("#land_building_phone_" + selectedLandBuildingId).hide();*@
|
||||
@*$("#land_building_purpose_" + selectedLandBuildingId).hide();*@
|
||||
//#endregion
|
||||
|
||||
//#region 土地房屋資料 btn
|
||||
@ -1522,12 +1553,12 @@
|
||||
//修改
|
||||
//#region 土地房屋資料 文字
|
||||
$("#land_building_address_text_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_coordinate_text_" + selectedLandBuildingId).hide();
|
||||
@*$("#land_building_coordinate_text_" + selectedLandBuildingId).hide();*@
|
||||
$("#lease_notarization_at_text_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_lease_Rate_text_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_landowner_text_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_phone_text_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_purpose_text_" + selectedLandBuildingId).hide();
|
||||
@*$("#land_building_phone_text_" + selectedLandBuildingId).hide();*@
|
||||
@*$("#land_building_purpose_text_" + selectedLandBuildingId).hide();*@
|
||||
$("#land_building_created_by_title_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_created_by_text_" + selectedLandBuildingId).hide();
|
||||
$("#land_building_created_at_title_" + selectedLandBuildingId).hide();
|
||||
@ -1536,12 +1567,12 @@
|
||||
|
||||
//#region 土地房屋資料 input
|
||||
$("#land_building_address_" + selectedLandBuildingId).show();
|
||||
$("#land_building_coordinate_" + selectedLandBuildingId).show();
|
||||
@*$("#land_building_coordinate_" + selectedLandBuildingId).show();*@
|
||||
$("#lease_notarization_at_" + selectedLandBuildingId).show();
|
||||
$("#land_building_lease_Rate_" + selectedLandBuildingId).show();
|
||||
$("#land_building_landowner_" + selectedLandBuildingId).show();
|
||||
$("#land_building_phone_" + selectedLandBuildingId).show();
|
||||
$("#land_building_purpose_" + selectedLandBuildingId).show();
|
||||
@*$("#land_building_phone_" + selectedLandBuildingId).show();*@
|
||||
@*$("#land_building_purpose_" + selectedLandBuildingId).show();*@
|
||||
//#endregion
|
||||
|
||||
//#region 土地房屋資料 btn
|
||||
@ -1590,13 +1621,12 @@
|
||||
$("#address_detail_text").html(powerStationData.address);
|
||||
$("#power_station_code_text").html(powerStationData.code);
|
||||
$("#power_station_name_text").html(powerStationData.name);
|
||||
$("#electricity_meter_at_text").html(powerStationData.electricityMeterAt);
|
||||
|
||||
$("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
|
||||
$("#created_by_text").html(powerStationData.creatorName);
|
||||
|
||||
$("#generating_capacity_text").html(powerStationData.generatingCapacity);
|
||||
$("#escrow_name_text").html(powerStationData.escrowName);
|
||||
$("#power_rate_text").html(powerStationData.powerRate);
|
||||
$("#coordinate_text").html(powerStationData.coordinate);
|
||||
$("#created_at_text").html(powerStationData.createdAt);
|
||||
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds).trigger("change");
|
||||
@ -1654,31 +1684,46 @@
|
||||
function SetBoETPCInfo() {
|
||||
//#region 能源局與台電資料 文字
|
||||
$("#link-boe-file").html(powerStationData.boEFileName).attr("href", powerStationData.boEFile);
|
||||
$("#BoE_discount_rate_text").html(powerStationData.boEDiscountRate);
|
||||
@*$("#BoE_discount_rate_text").html(powerStationData.boEDiscountRate);*@
|
||||
$("#BoE_register_post_at_text").html(powerStationData.boERegisterPostAt);
|
||||
$("#BoE_device_register_number_text").html(powerStationData.boEDeviceRegisterNumber);
|
||||
$("#BoE_rent_ratio_text").html(powerStationData.boERentRatio);
|
||||
@*$("#BoE_rent_ratio_text").html(powerStationData.boERentRatio);*@
|
||||
|
||||
$("#TPC_contract_number_text").html(powerStationData.tpcContractNumber);
|
||||
$("#TPC_contract_at_text").html(powerStationData.tpcContractAt);
|
||||
$("#TPC_sell_deadline_text").html(powerStationData.tpcSellDeadline);
|
||||
$("#electricity_meter_at_text").html(powerStationData.electricityMeterAt);
|
||||
$("#power_rate_text").html(powerStationData.powerRate);
|
||||
$("#TPC_meter_reading_text").html(powerStationData.tpcMeterReading);
|
||||
$("#TPC_purchase_electricity_at_text").html(powerStationData.tpcPurchaseElectricityAt);
|
||||
$("#TPC_sell_electricity_at_text").html(powerStationData.tpcSellElectricityAt);
|
||||
$("#TPC_invoice_buyer_text").html(powerStationData.tpcInvoiceBuyer);
|
||||
$("#GUI_number_text").html(powerStationData.guiNumber);
|
||||
$("#TPC_invoice_address_text").html(powerStationData.tpcInvoiceAddress);
|
||||
$("#TPC_meter_number_text").html(powerStationData.tpcMeterNumber);
|
||||
|
||||
$("#BOE_TPC_created_by_text").html(powerStationData.creatorName);
|
||||
$("#BOE_TPC_created_at_text").html(powerStationData.createdAt);
|
||||
//#endregion
|
||||
|
||||
//#region 能源局與台電資料 input
|
||||
$("#BoE_discount_rate").val(powerStationData.boEDiscountRate);
|
||||
@*$("#BoE_discount_rate").val(powerStationData.boEDiscountRate);*@
|
||||
$("#BoE_register_post_at").val(powerStationData.boERegisterPostAt);
|
||||
$("#BoE_device_register_number").val(powerStationData.boEDeviceRegisterNumber);
|
||||
$("#BoE_rent_ratio").val(powerStationData.boERentRatio);
|
||||
@*$("#BoE_rent_ratio").val(powerStationData.boERentRatio);*@
|
||||
|
||||
$("#TPC_contract_number").val(powerStationData.tpcContractNumber);
|
||||
$("#TPC_contract_at").val(powerStationData.tpcContractAt);
|
||||
$("#TPC_sell_deadline").val(powerStationData.tpcSellDeadline);
|
||||
$("#electricity_meter_at").val(powerStationData.electricityMeterAt);
|
||||
$("#power_rate").val(powerStationData.powerRate);
|
||||
$("#TPC_meter_reading").val(powerStationData.tpcMeterReading);
|
||||
$("#TPC_purchase_electricity_at").val(powerStationData.tpcPurchaseElectricityAt);
|
||||
$("#TPC_sell_electricity_at").val(powerStationData.tpcSellElectricityAt);
|
||||
$("#TPC_invoice_buyer").val(powerStationData.tpcInvoiceBuyer);
|
||||
$("#GUI_number").val(powerStationData.guiNumber);
|
||||
$("#TPC_invoice_address").val(powerStationData.tpcInvoiceAddress);
|
||||
$("#TPC_meter_number").val(powerStationData.tpcMeterNumber);
|
||||
//#endregion
|
||||
}
|
||||
//#endregion
|
||||
@ -1744,12 +1789,19 @@
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">租金比例 (%)</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_lease_Rate_text_' + value.id + '" class="color-info-600">' + value.leaseRate + '</label>' +
|
||||
'<input type="number" step="0.1" style="display:none" id="land_building_lease_Rate_' + value.id + '" name="land_building_lease_Rate_' + value.id + '" class="form-control" value="' + value.leaseRate + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
@*'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">經緯度</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_coordinate_text_' + value.id + '" class="color-info-600">' + value.coordinate + '</label>' +
|
||||
'<input type="text" style="display:none" id="land_building_coordinate_' + value.id + '" name="land_building_coordinate_' + value.id + '" class="form-control" value="' + value.coordinate + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@ -1759,38 +1811,31 @@
|
||||
'<input type="date" style="display:none" id="lease_notarization_at_' + value.id + '" name="lease_notarization_at_' + value.id + '" class="form-control" value="' + value.leaseNotarizationAt + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">租金比例 (%)</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_lease_Rate_text_' + value.id + '" class="color-info-600">' + value.leaseRate + '</label>' +
|
||||
'<input type="number" style="display:none" id="land_building_lease_Rate_' + value.id + '" name="land_building_lease_Rate_' + value.id + '" class="form-control" value="' + value.leaseRate + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
'<label class="col-xl-4 form-label">地主姓名</label>' +
|
||||
'<label class="col-xl-4 form-label">出租人</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_landowner_text_' + value.id + '" class="color-info-600">' + value.landowner + '</label>' +
|
||||
'<input type="text" style="display:none" id="land_building_landowner_' + value.id + '" name="land_building_landowner_' + value.id + '" class="form-control" value="' + value.landowner + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
@*'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">電話</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_phone_text_' + value.id + '" class="color-info-600">' + value.phone + '</label>' +
|
||||
'<input type="text" style="display:none" id="land_building_phone_' + value.id + '" name="land_building_phone_' + value.id + '" class="form-control" value="' + value.phone + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@*'<div class="row mb-3">' +
|
||||
'<label class="col-xl-4 form-label">房屋用途</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_purpose_text_' + value.id + '" class="color-info-600">' + value.purpose + '</label>' +
|
||||
'<input type="text" style="display:none" id="land_building_purpose_' + value.id + '" name="land_building_purpose_' + value.id + '" class="form-control" value="' + value.purpose + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@ -1846,11 +1891,17 @@
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">租金比例 (%)</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<input type="text" step="0.01" id="land_building_lease_Rate_0" name="land_building_lease_Rate_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
@*'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">經緯度</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<input type="text" id="land_building_coordinate_0" name="land_building_coordinate_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@ -1859,34 +1910,28 @@
|
||||
'<input type="date" id="lease_notarization_at_0" name="lease_notarization_at_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">租金比例 (%)</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<input type="text" id="land_building_lease_Rate_0" name="land_building_lease_Rate_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
'<label class="col-xl-4 form-label">地主姓名</label>' +
|
||||
'<label class="col-xl-4 form-label">出租人</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<input type="text" id="land_building_landowner_0" name="land_building_landowner_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
@*'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">電話</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<input type="text" id="land_building_phone_0" name="land_building_phone_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@*'<div class="row mb-3">' +
|
||||
'<label class="col-xl-4 form-label">房屋用途</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<input type="text" id="land_building_purpose_0" name="land_building_purpose_0" class="form-control">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
|
||||
@ -90,37 +90,45 @@
|
||||
|
||||
<div class="row mb-3 d-flex justify-content-between">
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="electricity_meter_at_label" for="electricity_meter_at">台電掛錶日</label>
|
||||
<label class="col-xl-4 form-label" id="generating_capacity_label" for="generating_capacity">
|
||||
裝置容量(kWp)
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="electricity_meter_at_text" class="color-info-600"></label>
|
||||
<input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control">
|
||||
<label id="generating_capacity_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.0001" id="generating_capacity" name="generating_capacity" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="power_rate_label" for="power_rate">授電費率</label>
|
||||
<label class="col-xl-4 form-label" id="estimate_efficacy_label" for="estimate_efficacy">
|
||||
預估發電效能
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="power_rate_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control">
|
||||
<label id="estimate_efficacy_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.01" id="estimate_efficacy" name="estimate_efficacy" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">預計回收年限</label>
|
||||
<label class="col-xl-4 form-label" id="estimate_kwh_label" for="estimate_kwh">
|
||||
預估發電度數(kW/日)
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_kwh_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.01" id="estimate_kwh" name="estimate_kwh" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">
|
||||
預計回收年限
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimated_recovery_time_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="estimated_recovery_time" name="estimated_recovery_time" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="generating_capacity_label" for="generating_capacity">裝置容量(kWp)</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="generating_capacity_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.1" id="generating_capacity" name="generating_capacity" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-5 d-flex justify-content-between ">
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<div class="col-xl-6 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="power_station_operation_personnel_label">運維人員</label>
|
||||
<div class="col-xl-8">
|
||||
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple">
|
||||
@ -141,29 +149,13 @@
|
||||
<input type="text" id="line_token" name="line_token" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">
|
||||
預估發電度數(kW/日)
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_kwh_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.01" id="estimate_kwh" name="estimate_kwh" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mb-5 d-flex justify-content-between ">
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">
|
||||
預估發電效能
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_efficacy_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.01" id="estimate_efficacy" name="estimate_efficacy" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
|
||||
<div class="col-xl-6 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="select_power_station_company_title">
|
||||
電站歸屬
|
||||
</label>
|
||||
@ -228,10 +220,13 @@
|
||||
</div>
|
||||
<div class="col-xl-3 mb-3 row">
|
||||
<label class="col-xl-4 form-label" id="photovoltaic_panel_specification_label" for="photovoltaic_panel_specification">規格</label>
|
||||
<div class="col-xl-8">
|
||||
<div class="col-xl-6">
|
||||
<label id="photovoltaic_panel_specification_text" class="color-info-600"></label>
|
||||
<input type="text" id="photovoltaic_panel_specification" name="photovoltaic_panel_specification" class="form-control">
|
||||
</div>
|
||||
<div class="col-xl-2 p-0">
|
||||
<span>mm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 mb-3 row">
|
||||
<label class="col-xl-4 form-label" id="photovoltaic_panel_amount_label" for="photovoltaic_panel_amount">數量</label>
|
||||
@ -284,11 +279,18 @@
|
||||
<input type="file" id="BoE_file" name="BoE_file" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label">折扣率</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_discount_rate_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control">
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label">折扣率</label>
|
||||
<label class="col-xl-4 form-label" for="BoE_register_post_at">登記發文日期</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_discount_rate_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control">
|
||||
<label id="BoE_register_post_at_text" class="color-info-600"></label>
|
||||
<input type="date" id="BoE_register_post_at" name="BoE_register_post_at" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
@ -298,13 +300,13 @@
|
||||
<input type="text" id="BoE_device_register_number" name="BoE_device_register_number" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label">租金比例(%)</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_rent_ratio_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="BoE_rent_ratio" name="BoE_rent_ratio" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label">租金比例(%)</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_rent_ratio_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="BoE_rent_ratio" name="BoE_rent_ratio" class="form-control">
|
||||
</div>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
@ -331,18 +333,34 @@
|
||||
<input type="number" step="1" id="TPC_sell_deadline" name="TPC_sell_deadline" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_meter_reading_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="TPC_meter_reading" name="TPC_meter_reading" class="form-control">
|
||||
</div>
|
||||
</div>*@
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_purchase_electricity_at">正式購電日</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_purchase_electricity_at_text" class="color-info-600"></label>
|
||||
<input type="date" id="TPC_purchase_electricity_at" name="TPC_purchase_electricity_at" class="form-control">
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日</label>
|
||||
<label class="col-xl-4 form-label" id="electricity_meter_at_label" for="electricity_meter_at">
|
||||
台電掛錶日
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_meter_reading_text" class="color-info-600"></label>
|
||||
<input type="number" step="1" id="TPC_meter_reading" name="TPC_meter_reading" class="form-control">
|
||||
<label id="electricity_meter_at_text" class="color-info-600"></label>
|
||||
<input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_purchase_electricity_at">正式購電日</label>
|
||||
<label class="col-xl-4 form-label" id="power_rate_label" for="power_rate">授電費率</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_purchase_electricity_at_text" class="color-info-600"></label>
|
||||
<input type="date" id="TPC_purchase_electricity_at" name="TPC_purchase_electricity_at" class="form-control">
|
||||
<label id="power_rate_text" class="color-info-600"></label>
|
||||
<input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
@ -352,6 +370,42 @@
|
||||
<input type="date" id="TPC_sell_electricity_at" name="TPC_sell_electricity_at" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="TPC_invoice_buyer_label" for="TPC_invoice_buyer">
|
||||
買受人
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_invoice_buyer_text" class="color-info-600"></label>
|
||||
<input type="text" id="TPC_invoice_buyer" name="TPC_invoice_buyer" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="GUI_number_label" for="GUI_number">
|
||||
統一編號
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="GUI_number_text" class="color-info-600"></label>
|
||||
<input type="text" id="GUI_number" name="GUI_number" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="TPC_invoice_address_label" for="TPC_invoice_address">
|
||||
發票地址
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_invoice_address_text" class="color-info-600"></label>
|
||||
<input type="text" id="TPC_invoice_address" name="TPC_invoice_address" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="TPC_meter_number_label" for="TPC_meter_number">
|
||||
台電電號
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_meter_number_text" class="color-info-600"></label>
|
||||
<input type="text" id="TPC_meter_number" name="TPC_meter_number" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex justify-content-end px-5">
|
||||
<div class="col-xl-6 mb-3 row justify-content-end align-items-center">
|
||||
|
||||
@ -1731,17 +1731,16 @@
|
||||
$("#city_name_text").html(powerStationData.cityName);
|
||||
$("#area_name_text").html(powerStationData.areaName);
|
||||
$("#address_detail_text").html(powerStationData.address);
|
||||
|
||||
$("#power_station_code_text").html(powerStationData.code);
|
||||
$("#power_station_name_text").html(powerStationData.name);
|
||||
$("#electricity_meter_at_text").html(powerStationData.electricityMeterAt);
|
||||
$("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
|
||||
$("#created_by_text").html(powerStationData.creatorName);
|
||||
|
||||
$("#generating_capacity_text").html(powerStationData.generatingCapacity);
|
||||
$("#escrow_name_text").html(powerStationData.escrowName);
|
||||
$("#power_rate_text").html(powerStationData.powerRate);
|
||||
$("#created_by_text").html(powerStationData.creatorName);
|
||||
|
||||
$("#generating_capacity_text").html(powerStationData.generatingCapacity);
|
||||
$("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
|
||||
|
||||
$("#coordinate_text").html(powerStationData.coordinate);
|
||||
$("#created_at_text").html(powerStationData.createdAt);
|
||||
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds).trigger("change");
|
||||
$("#power_station_operation_personnel").attr("disabled", true);
|
||||
|
||||
@ -1749,6 +1748,7 @@
|
||||
$("#estimate_kwh_text").html(powerStationData.estimate_kwh);
|
||||
$("#estimate_efficacy_text").html(powerStationData.estimateEfficacy);
|
||||
|
||||
$("#created_at_text").html(powerStationData.createdAt);
|
||||
@if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
|
||||
{
|
||||
<text>
|
||||
@ -1785,16 +1785,23 @@
|
||||
//#region 設定能源局與台電資料
|
||||
function SetBoETPCInfo() {
|
||||
$("#link-boe-file").html(powerStationData.boEFileName).attr("href", powerStationData.boEFile);
|
||||
$("#BoE_discount_rate_text").html(powerStationData.boEDiscountRate);
|
||||
@*$("#BoE_discount_rate_text").html(powerStationData.boEDiscountRate);*@
|
||||
$("#BoE_register_post_at_text").html(powerStationData.boERegisterPostAt);
|
||||
$("#BoE_device_register_number_text").html(powerStationData.boEDeviceRegisterNumber);
|
||||
$("#BoE_rent_ratio_text").html(powerStationData.boERentRatio);
|
||||
@*$("#BoE_rent_ratio_text").html(powerStationData.boERentRatio);*@
|
||||
|
||||
$("#TPC_contract_number_text").html(powerStationData.tpcContractNumber);
|
||||
$("#TPC_contract_at_text").html(powerStationData.tpcContractAt);
|
||||
$("#TPC_sell_deadline_text").html(powerStationData.tpcSellDeadline);
|
||||
$("#electricity_meter_at_text").html(powerStationData.electricityMeterAt);
|
||||
$("#power_rate_text").html(powerStationData.powerRate);
|
||||
$("#TPC_meter_reading_text").html(powerStationData.tpcMeterReading);
|
||||
$("#TPC_purchase_electricity_at_text").html(powerStationData.tpcPurchaseElectricityAt);
|
||||
$("#TPC_sell_electricity_at_text").html(powerStationData.tpcSellElectricityAt);
|
||||
$("#TPC_invoice_buyer_text").html(powerStationData.tpcInvoiceBuyer);
|
||||
$("#GUI_number_text").html(powerStationData.guiNumber);
|
||||
$("#TPC_invoice_address_text").html(powerStationData.tpcInvoiceAddress);
|
||||
$("#TPC_meter_number_text").html(powerStationData.tpcMeterNumber);
|
||||
$("#BOE_TPC_created_by_text").html(powerStationData.creatorName);
|
||||
$("#BOE_TPC_created_at_text").html(powerStationData.createdAt);
|
||||
}
|
||||
@ -1825,7 +1832,7 @@
|
||||
|
||||
var appendStr = "";
|
||||
appendStr += '<div class="card border mb-g w-100" data-land-building-id="' + value.id + '">' +
|
||||
'<div class="card-header bg-fusion-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">' +
|
||||
'<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap justify-content-between">' +
|
||||
'<div class="card-title font-weight-bold">土地房屋資料</div>' +
|
||||
'</div>';
|
||||
|
||||
@ -1839,11 +1846,17 @@
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">租金比例 (%)</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_lease_Rate_text_' + value.id + '" class="color-info-600">' + value.leaseRate + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
@*'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">經緯度</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_coordinate_text_' + value.id + '" class="color-info-600">' + value.coordinate + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@ -1852,34 +1865,29 @@
|
||||
'<label id="lease_notarization_at_text_' + value.id + '" class="color-info-600">' + value.leaseNotarizationAt + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">租金比例 (%)</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_lease_Rate_text_' + value.id + '" class="color-info-600">' + value.leaseRate + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
'<label class="col-xl-4 form-label">地主姓名</label>' +
|
||||
'<label class="col-xl-4 form-label">出租人</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_landowner_text_' + value.id + '" class="color-info-600">' + value.landowner + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="row">' +
|
||||
@*'<div class="row">' +
|
||||
'<label class="col-xl-4 form-label">電話</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_phone_text_' + value.id + '" class="color-info-600">' + value.phone + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
@*'<div class="row mb-3">' +
|
||||
'<label class="col-xl-4 form-label">房屋用途</label>' +
|
||||
'<div class="col-xl-8">' +
|
||||
'<label id="land_building_purpose_text_' + value.id + '" class="color-info-600">' + value.purpose + '</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +*@
|
||||
'</div>' +
|
||||
'<div class="col-xl">' +
|
||||
'<div class="row mb-3">' +
|
||||
|
||||
@ -70,35 +70,43 @@
|
||||
|
||||
<div class="row mb-3 d-flex justify-content-between">
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="electricity_meter_at_label" for="electricity_meter_at">台電掛錶日</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="electricity_meter_at_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="power_rate_label" for="power_rate">授電費率</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="power_rate_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">預計回收年限</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimated_recovery_time_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="generating_capacity_label" for="generating_capacity">電廠發電容量(kW)</label>
|
||||
<label class="col-xl-4 form-label" id="generating_capacity_label" for="generating_capacity">
|
||||
裝置容量(kWp)
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="generating_capacity_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">
|
||||
預估發電效能
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_efficacy_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">
|
||||
預估發電度數(kW/日)
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_kwh_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">
|
||||
預計回收年限
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimated_recovery_time_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-5 d-flex justify-content-between ">
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="power_station_operation_personnel_label">運維人員</label>
|
||||
<div class="col-xl-8">
|
||||
<div class="col-xl-6 row justify-content-center align-items-center">
|
||||
<label class="col-xl-2 form-label" id="power_station_operation_personnel_label">運維人員</label>
|
||||
<div class="col-xl-10">
|
||||
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple">
|
||||
</select>
|
||||
</div>
|
||||
@ -115,29 +123,14 @@
|
||||
<label id="line_token_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">
|
||||
預估發電度數(kW/日)
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_kwh_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-5 d-flex justify-content-between ">
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">
|
||||
預估發電效能
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="estimate_efficacy_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="select_power_station_company_title">
|
||||
|
||||
<div class="col-xl-6 row justify-content-center align-items-center">
|
||||
<label class="col-xl-2 form-label" id="select_power_station_company_title">
|
||||
電站歸屬
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<div class="col-xl-10">
|
||||
<select class="form-control" id="select_power_station_company">
|
||||
</select>
|
||||
</div>
|
||||
@ -169,9 +162,12 @@
|
||||
</div>
|
||||
<div class="col-xl-3 mb-3 row">
|
||||
<label class="col-xl-4 form-label" id="photovoltaic_panel_specification_label" for="photovoltaic_panel_specification">規格</label>
|
||||
<div class="col-xl-8">
|
||||
<div class="col-xl-6">
|
||||
<label id="photovoltaic_panel_specification_text" class="color-info-600"></label>
|
||||
</div>
|
||||
<div class="col-xl-2 p-0">
|
||||
<span>mm</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 mb-3 row">
|
||||
<label class="col-xl-4 form-label" id="photovoltaic_panel_amount_label" for="photovoltaic_panel_amount">數量</label>
|
||||
@ -210,11 +206,17 @@
|
||||
<a id="link-boe-file" class="color-info-600" href="link/to/your/download/file" download>Download link</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label">折扣率</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_discount_rate_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="BoE_register_post_at">登記發文日期</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_register_post_at_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="BoE_device_register_number">能源局設備登記編號</label>
|
||||
@ -222,12 +224,12 @@
|
||||
<label id="BoE_device_register_number_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label">租金比例(%)</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="BoE_rent_ratio_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
@ -251,16 +253,30 @@
|
||||
<label id="TPC_sell_deadline_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_meter_reading_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_purchase_electricity_at">正式購電日</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_purchase_electricity_at_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日</label>
|
||||
<label class="col-xl-4 form-label" id="electricity_meter_at_label" for="electricity_meter_at">
|
||||
台電掛錶日
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_meter_reading_text" class="color-info-600"></label>
|
||||
<label id="electricity_meter_at_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" for="TPC_purchase_electricity_at">正式購電日</label>
|
||||
<label class="col-xl-4 form-label" id="power_rate_label" for="power_rate">授電費率</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_purchase_electricity_at_text" class="color-info-600"></label>
|
||||
<label id="power_rate_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
@ -269,6 +285,38 @@
|
||||
<label id="TPC_sell_electricity_at_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="TPC_invoice_buyer_label" for="TPC_invoice_buyer">
|
||||
買受人
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_invoice_buyer_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="GUI_number_label" for="GUI_number">
|
||||
統一編號
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="GUI_number_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="TPC_invoice_address_label" for="TPC_invoice_address">
|
||||
發票地址
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_invoice_address_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="TPC_meter_number_label" for="TPC_meter_number">
|
||||
台電電號
|
||||
</label>
|
||||
<div class="col-xl-8">
|
||||
<label id="TPC_meter_number_text" class="color-info-600"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-flex justify-content-end px-5">
|
||||
<div class="col-xl-6 mb-3 row justify-content-end align-items-center">
|
||||
|
||||
@ -614,7 +614,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
@ -624,7 +624,7 @@
|
||||
'<div class="mr-2">' +
|
||||
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
|
||||
'</div>' +
|
||||
'<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h4>' +
|
||||
'<h5 class="font-weight-bold"><i class="fal fa-charging-station"></i> ' + inverter.powerStationName + '</h5>' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
}
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user