This commit is contained in:
b110212000 2021-08-25 11:39:54 +08:00
commit 79cacfe612
24 changed files with 932 additions and 550 deletions

View File

@ -543,6 +543,7 @@ namespace SolarPower.Controllers
cell.CellStyle = style0; cell.CellStyle = style0;
cell = row.CreateCell(5); cell = row.CreateCell(5);
cell.SetCellValue(bill.Result.TPCMeterNumber);
region = new CellRangeAddress(18, 18, 5, 6); region = new CellRangeAddress(18, 18, 5, 6);
sheet.AddMergedRegion(region); sheet.AddMergedRegion(region);
cell.CellStyle = style14body; cell.CellStyle = style14body;

View File

@ -347,10 +347,8 @@ namespace SolarPower.Controllers
SerialNumber = tempSerialNumber, SerialNumber = tempSerialNumber,
IsEscrow = post.IsEscrow, IsEscrow = post.IsEscrow,
EscrowName = post.EscrowName, EscrowName = post.EscrowName,
ElectricityMeterAt = post.ElectricityMeterAt,
EstimatedRecoveryTime = post.EstimatedRecoveryTime, EstimatedRecoveryTime = post.EstimatedRecoveryTime,
GeneratingCapacity = post.GeneratingCapacity, GeneratingCapacity = post.GeneratingCapacity,
PowerRate = post.PowerRate,
Coordinate = post.Coordinate, Coordinate = post.Coordinate,
InverterBrand = post.InverterBrand, InverterBrand = post.InverterBrand,
InverterProductModel = post.InverterProductModel, InverterProductModel = post.InverterProductModel,
@ -378,10 +376,8 @@ namespace SolarPower.Controllers
"SerialNumber", "SerialNumber",
"IsEscrow", "IsEscrow",
"EscrowName", "EscrowName",
"ElectricityMeterAt",
"EstimatedRecoveryTime", "EstimatedRecoveryTime",
"GeneratingCapacity", "GeneratingCapacity",
"PowerRate",
"Coordinate", "Coordinate",
"InverterBrand", "InverterBrand",
"InverterProductModel", "InverterProductModel",
@ -486,10 +482,8 @@ namespace SolarPower.Controllers
Name = post.Name, Name = post.Name,
IsEscrow = post.IsEscrow, IsEscrow = post.IsEscrow,
EscrowName = post.EscrowName, EscrowName = post.EscrowName,
ElectricityMeterAt = post.ElectricityMeterAt,
EstimatedRecoveryTime = post.EstimatedRecoveryTime, EstimatedRecoveryTime = post.EstimatedRecoveryTime,
GeneratingCapacity = post.GeneratingCapacity, GeneratingCapacity = post.GeneratingCapacity,
PowerRate = post.PowerRate,
Coordinate = post.Coordinate, Coordinate = post.Coordinate,
InverterBrand = post.InverterBrand, InverterBrand = post.InverterBrand,
InverterProductModel = post.InverterProductModel, InverterProductModel = post.InverterProductModel,
@ -514,10 +508,8 @@ namespace SolarPower.Controllers
"Name", "Name",
"IsEscrow", "IsEscrow",
"EscrowName", "EscrowName",
"ElectricityMeterAt",
"EstimatedRecoveryTime", "EstimatedRecoveryTime",
"GeneratingCapacity", "GeneratingCapacity",
"PowerRate",
"Coordinate", "Coordinate",
"InverterBrand", "InverterBrand",
"InverterProductModel", "InverterProductModel",
@ -649,7 +641,11 @@ namespace SolarPower.Controllers
var split = post.BoEFile.FileName.Split("."); var split = post.BoEFile.FileName.Split(".");
boeFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + "." + split[split.Length - 1]; 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)) using (var stream = new FileStream(fullPath, FileMode.Create))
{ {
@ -664,13 +660,20 @@ namespace SolarPower.Controllers
BoEFile = boeFileName, //自訂檔名 BoEFile = boeFileName, //自訂檔名
BoEDiscountRate = post.BoEDiscountRate, BoEDiscountRate = post.BoEDiscountRate,
BoEDeviceRegisterNumber = post.BoEDeviceRegisterNumber, BoEDeviceRegisterNumber = post.BoEDeviceRegisterNumber,
BoERegisterPostAt = post.BoERegisterPostAt,
BoERentRatio = post.BoERentRatio, BoERentRatio = post.BoERentRatio,
TPCContractNumber = post.TPCContractNumber, TPCContractNumber = post.TPCContractNumber,
TPCContractAt = post.TPCContractAt, TPCContractAt = post.TPCContractAt,
TPCSellDeadline = post.TPCSellDeadline, TPCSellDeadline = post.TPCSellDeadline,
ElectricityMeterAt = post.ElectricityMeterAt,
PowerRate = post.PowerRate,
TPCMeterReading = post.TPCMeterReading, TPCMeterReading = post.TPCMeterReading,
TPCPurchaseElectricityAt = post.TPCPurchaseElectricityAt, TPCPurchaseElectricityAt = post.TPCPurchaseElectricityAt,
TPCSellElectricityAt = post.TPCSellElectricityAt, TPCSellElectricityAt = post.TPCSellElectricityAt,
TPCInvoiceBuyer = post.TPCInvoiceBuyer,
GUINumber = post.GUINumber,
TPCInvoiceAddress = post.TPCInvoiceAddress,
TPCMeterNumber = post.TPCMeterNumber,
UpdatedBy = myUser.Id UpdatedBy = myUser.Id
}; };
@ -681,13 +684,20 @@ namespace SolarPower.Controllers
"BoEFile", "BoEFile",
"BoEDiscountRate", "BoEDiscountRate",
"BoEDeviceRegisterNumber", "BoEDeviceRegisterNumber",
"BoERegisterPostAt",
"BoERentRatio", "BoERentRatio",
"TPCContractNumber", "TPCContractNumber",
"TPCContractAt", "TPCContractAt",
"TPCSellDeadline", "TPCSellDeadline",
"ElectricityMeterAt",
"PowerRate",
"TPCMeterReading", "TPCMeterReading",
"TPCPurchaseElectricityAt", "TPCPurchaseElectricityAt",
"TPCSellElectricityAt", "TPCSellElectricityAt",
"TPCInvoiceBuyer",
"GUINumber",
"TPCInvoiceAddress",
"TPCMeterNumber",
"UpdatedBy", "UpdatedBy",
}; };

View File

@ -2119,6 +2119,38 @@ ALTER TABLE `power_station`
ADD COLUMN `TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票買受人' AFTER `TPCContractNumber`, ADD COLUMN `TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票買受人' AFTER `TPCContractNumber`,
ADD COLUMN `TPCInvoiceAddress` VARCHAR(100) NULL DEFAULT NULL COMMENT '台電發票地址' AFTER `TPCInvoiceBuyer`; 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 -- 新增逆變器及設備保固日期 20210824
ALTER TABLE `inverter` ALTER TABLE `inverter`
ADD COLUMN `WarrantyDate` TIMESTAMP NULL DEFAULT NULL COMMENT '保固日期' AFTER `Pyrheliometer`; ADD COLUMN `WarrantyDate` TIMESTAMP NULL DEFAULT NULL COMMENT '保固日期' AFTER `Pyrheliometer`;

View File

@ -41,6 +41,7 @@ namespace SolarPower.Models
public string GUINumber { get; set; } public string GUINumber { get; set; }
public string TPCInvoiceBuyer { get; set; } public string TPCInvoiceBuyer { get; set; }
public string TPCInvoiceAddress { get; set; } public string TPCInvoiceAddress { get; set; }
public string TPCMeterNumber { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Logo { get; set; } public string Logo { get; set; }
private string startAt; private string startAt;

View File

@ -12,9 +12,21 @@ namespace SolarPower.Models.PowerStation
HireSold = 1, //租建躉售 HireSold = 1, //租建躉售
SelfUse = 2 //自建自用 SelfUse = 2 //自建自用
} }
public enum SensorTypeEnum
{
PYR = 1, //日照計
MTR = 2, //模組溫度計
ETR = 3, //環境溫度計
EMM = 4, //環境濕度計
VAN = 5, //風速計
FOM = 6, //落塵計
PWR = 7 //電錶
}
public class PowerStation : Created public class PowerStation : Created
{ {
private string electricityMeterAt = "", tpcContractAt = "", tpcPurchaseElectricityAt = "", tpcSellElectricityAt = ""; private string electricityMeterAt = "", tpcContractAt = "", tpcPurchaseElectricityAt = "", tpcSellElectricityAt = "", boeRegisterPostAt = "";
public int Id { get; set; } public int Id { get; set; }
public byte HealthStatus { get; set; } //狀態 public byte HealthStatus { get; set; } //狀態
@ -62,6 +74,21 @@ namespace SolarPower.Models.PowerStation
public int BoEDiscountRate { get; set; } //能源局折扣率 public int BoEDiscountRate { get; set; } //能源局折扣率
public string BoEDeviceRegisterNumber { get; set; } //能源局設備登記編號 public string BoEDeviceRegisterNumber { get; set; } //能源局設備登記編號
public int BoERentRatio { 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 TPCContractNumber { get; set; } //台電契約編號
public string TPCContractAt //台電簽約日期 public string TPCContractAt //台電簽約日期
{ {
@ -110,6 +137,10 @@ namespace SolarPower.Models.PowerStation
} }
set { tpcPurchaseElectricityAt = value; } 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 List<LandBuilding> LandBuildings { get; set; } //土地房屋資料
public byte SolarType { get; set; } //電站類型 public byte SolarType { get; set; } //電站類型
public double kwh { get; set; } // public double kwh { get; set; } //
@ -162,7 +193,7 @@ namespace SolarPower.Models.PowerStation
} }
public string Landowner { get; set; } //地主姓名 public string Landowner { get; set; } //地主姓名
public string Purpose { get; set; } //房屋用途 public string Purpose { get; set; } //房屋用途
public int LeaseRate { get; set; } //租金比例 public double LeaseRate { get; set; } //租金比例
public string Coordinate { get; set; } //經緯度 public string Coordinate { get; set; } //經緯度
public string Phone { get; set; } //電話 public string Phone { get; set; } //電話
public string CreatorName { get; set; } //創建者名稱 public string CreatorName { get; set; } //創建者名稱
@ -185,10 +216,10 @@ namespace SolarPower.Models.PowerStation
//public string Code { get; set; } //public string Code { get; set; }
public byte IsEscrow { get; set; } //是否被代管 public byte IsEscrow { get; set; } //是否被代管
public string EscrowName { get; set; } //被代管公司 public string EscrowName { get; set; } //被代管公司
public string ElectricityMeterAt { get; set; } //台電掛錶日 //public string ElectricityMeterAt { get; set; } //台電掛錶日
public int EstimatedRecoveryTime { get; set; } //預計回收年限 public int EstimatedRecoveryTime { get; set; } //預計回收年限
public double GeneratingCapacity { get; set; } //發電容量 public double GeneratingCapacity { get; set; } //發電容量
public double PowerRate { get; set; } //授電費率 //public double PowerRate { get; set; } //授電費率
public string Coordinate { get; set; } //座標 public string Coordinate { get; set; } //座標
public List<int> OperationPersonnelIds { get; set; } //運維人員編號 public List<int> OperationPersonnelIds { get; set; } //運維人員編號
public string InverterBrand { get; set; } //逆變器廠牌 public string InverterBrand { get; set; } //逆變器廠牌
@ -213,10 +244,10 @@ namespace SolarPower.Models.PowerStation
public string Name { get; set; } //名稱 public string Name { get; set; } //名稱
public byte IsEscrow { get; set; } //是否被代管 public byte IsEscrow { get; set; } //是否被代管
public string EscrowName { get; set; } //被代管公司 public string EscrowName { get; set; } //被代管公司
public string ElectricityMeterAt { get; set; } //台電掛錶日 //public string ElectricityMeterAt { get; set; } //台電掛錶日
public int EstimatedRecoveryTime { get; set; } //預計回收年限 public int EstimatedRecoveryTime { get; set; } //預計回收年限
public double GeneratingCapacity { get; set; } //發電容量 public double GeneratingCapacity { get; set; } //發電容量
public double PowerRate { get; set; } //授電費率 //public double PowerRate { get; set; } //授電費率
public string Coordinate { get; set; } //座標 public string Coordinate { get; set; } //座標
public string InverterBrand { get; set; } //逆變器廠牌 public string InverterBrand { get; set; } //逆變器廠牌
public string InverterProductModel { get; set; } //逆變器型號 public string InverterProductModel { get; set; } //逆變器型號
@ -237,13 +268,20 @@ namespace SolarPower.Models.PowerStation
public IFormFile BoEFile { get; set; } public IFormFile BoEFile { get; set; }
public int BoEDiscountRate { get; set; } public int BoEDiscountRate { get; set; }
public string BoEDeviceRegisterNumber { get; set; } public string BoEDeviceRegisterNumber { get; set; }
public string BoERegisterPostAt { get; set; }
public int BoERentRatio { get; set; } public int BoERentRatio { get; set; }
public string TPCContractNumber { get; set; } public string TPCContractNumber { get; set; }
public string TPCContractAt { get; set; } public string TPCContractAt { get; set; }
public int TPCSellDeadline { get; set; } public int TPCSellDeadline { get; set; }
public string ElectricityMeterAt { get; set; }
public double PowerRate { get; set; }
public int TPCMeterReading { get; set; } public int TPCMeterReading { get; set; }
public string TPCPurchaseElectricityAt { get; set; } public string TPCPurchaseElectricityAt { get; set; }
public string TPCSellElectricityAt { 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 public class UpdateBoETPCInfo : Updated
@ -252,13 +290,20 @@ namespace SolarPower.Models.PowerStation
public string BoEFile { get; set; } public string BoEFile { get; set; }
public int BoEDiscountRate { get; set; } public int BoEDiscountRate { get; set; }
public string BoEDeviceRegisterNumber { get; set; } public string BoEDeviceRegisterNumber { get; set; }
public string BoERegisterPostAt { get; set; }
public int BoERentRatio { get; set; } public int BoERentRatio { get; set; }
public string TPCContractNumber { get; set; } public string TPCContractNumber { get; set; }
public string TPCContractAt { get; set; } public string TPCContractAt { get; set; }
public int TPCSellDeadline { get; set; } public int TPCSellDeadline { get; set; }
public string ElectricityMeterAt { get; set; }
public double PowerRate { get; set; }
public int TPCMeterReading { get; set; } public int TPCMeterReading { get; set; }
public string TPCPurchaseElectricityAt { get; set; } public string TPCPurchaseElectricityAt { get; set; }
public string TPCSellElectricityAt { 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 public class PostLandBuildingInfo
@ -269,7 +314,7 @@ namespace SolarPower.Models.PowerStation
public string LeaseNotarizationAt { get; set; } public string LeaseNotarizationAt { get; set; }
public string Landowner { get; set; } public string Landowner { get; set; }
public string Purpose { get; set; } public string Purpose { get; set; }
public int LeaseRate { get; set; } public double LeaseRate { get; set; }
public string Coordinate { get; set; } public string Coordinate { get; set; }
public string Phone { get; set; } public string Phone { get; set; }
} }
@ -280,7 +325,7 @@ namespace SolarPower.Models.PowerStation
public string LeaseNotarizationAt { get; set; } public string LeaseNotarizationAt { get; set; }
public string Landowner { get; set; } public string Landowner { get; set; }
public string Purpose { get; set; } public string Purpose { get; set; }
public int LeaseRate { get; set; } public double LeaseRate { get; set; }
public string Coordinate { get; set; } public string Coordinate { get; set; }
public string Phone { get; set; } public string Phone { get; set; }
} }

View File

@ -40,8 +40,6 @@ namespace SolarPower.Quartz.Jobs
var DateTimeNow = DateTime.Now; var DateTimeNow = DateTime.Now;
var dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH"); var dateTime = DateTimeNow.AddHours(-1).ToString("yyyy-MM-dd HH");
var hasException = false;
Root2 observation = null; Root2 observation = null;
if (this.environment.IsDevelopment()) if (this.environment.IsDevelopment())
@ -226,223 +224,331 @@ namespace SolarPower.Quartz.Jobs
sensorHistory.PowerStationId = powerStation.Id; sensorHistory.PowerStationId = powerStation.Id;
sensorHistory.Timestamp = Convert.ToDateTime(dateTime + ":00:00").ToString("yyyy-MM-dd HH:mm:ss"); sensorHistory.Timestamp = Convert.ToDateTime(dateTime + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
//1. 計算該電站sensor平均值 - 日照計(PYR)
//1. 找出該電站所有日照計設備(包含共享 try
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)
{ {
//2. 計算該電站所有日照計設的每小時的平均在依照日照計數量平均 logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的日照計設備資訊】", powerStation.Code, dateTime);
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的日照計的日照度】", powerStation.Code, dateTime); var deviceInfos = await powerStationRepository.GetListPyrheliometerByPowerStationId(powerStation.Id, powerStation.SiteDB);
var pyrheliometerHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, deviceInfos, 0); 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"); sensorHistory.Irradiance = pyrheliometerHistory.Irradiance;
pyrheliometerHistory.PowerStationId = powerStation.Id;
pyrheliometerHistoriesHour.Add(pyrheliometerHistory);
}
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的日照計的日照度】", powerStation.Code, dateTime);
}
//2. 計算該電站所有模組溫度計設的每小時的平均在依照溫度計數量平均 //pyrheliometerHistory.Timestamp = Convert.ToDateTime(pyrheliometerHistory.Timestamp + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
// 找出該電站所有模組溫度計設備(包含共享 //pyrheliometerHistory.PowerStationId = powerStation.Id;
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的模組溫度計設備資訊】", powerStation.Code, dateTime); //pyrheliometerHistoriesHour.Add(pyrheliometerHistory);
var tempdeviceInfos = await powerStationRepository.GetListTempByPowerStationId(powerStation.Id, powerStation.SiteDB); }
logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的模組溫度計設備資訊】", powerStation.Code, dateTime); 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);
} }
} }
catch (Exception ex)
{
logger.LogError("【CalcPowerStationJob】【計算失敗電站[{0}]在{1}的日照計的平均值】", powerStation.Code, dateTime);
logger.LogError("【CalcPowerStationJob】【失敗原因】- {0}", ex.Message);
}
//3. 計算該電站 - 環境溫度計(ETR) //2. 計算該電站sensor平均值 - 模組溫度計(MTR)
//logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的環境溫度計設備資訊】", powerStation.Code, dateTime); try
//var ETRdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, "ETR", powerStation.SiteDB); {
//logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的環境溫度計設備資訊】", powerStation.Code, dateTime); logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的模組溫度計設備資訊】", powerStation.Code, dateTime);
//logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的環境溫度計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(tempdeviceInfos)); var tempdeviceInfos = await powerStationRepository.GetDeviceListByPowerStationIdAndType(powerStation.Id, "MTR", powerStation.SiteDB);
//if (ETRdeviceInfos != null && ETRdeviceInfos.Count() > 0) logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的模組溫度計設備資訊】", powerStation.Code, dateTime);
//{ logger.LogInformation("【CalcPowerStationJob】【電站[{0}]在{1}的模組溫度計設備資訊】 - {2}", powerStation.Code, dateTime, System.Text.Json.JsonSerializer.Serialize(tempdeviceInfos));
// logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的環境溫度計的平均溫度】", powerStation.Code, dateTime); if (tempdeviceInfos != null && tempdeviceInfos.Count() > 0)
// var ETRHistory = await powerStationRepository.GetPyrheliometerHistoryPerHour(dateTime, tempdeviceInfos, 1); {
// if (ETRHistory != null) logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的模組溫度計的平均值】", powerStation.Code, dateTime);
// { var tempHistory = await powerStationRepository.CalcSensorHistoryPerHour(dateTime, tempdeviceInfos, Convert.ToInt32(SensorTypeEnum.MTR));
// sensorHistory.EnvTemperature = ETRHistory.EnvTemperature; if (tempHistory != null)
// logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的環境溫度計的平均溫度】", powerStation.Code, dateTime); {
// } //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) //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); calcPowerStations.Add(calcPowerStation);
#endregion #endregion
#region step2-3. #region step2-3.
logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime); try
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)
{ {
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime); logger.LogInformation("【CalcPowerStationJob】【開始取得電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime);
var inverterHistories = await powerStationRepository.CalcInverterHisyortHourData(dateTime, powerStation.SiteDB, full_inverter_table_name, inverterIds); var controllers = await powerStationRepository.GetAllDeviceControllerId(powerStation.Id, powerStation.SiteDB);
//取得日照計要找的欄位資訊 var inverters = await powerStationRepository.InverterTable(controllers, powerStation.SiteDB);
var pyrheliometer = await powerStationRepository.GetFirstPyrheliometerInfo(powerStation.Id, powerStation.SiteDB); var inverterIds = inverters.Where(x => x.Enabled == 1 && x.Status != 0).Select(x => x.InverterId).ToList();
var pyrheliometerValue = await powerStationRepository.GetFirstPyrheliometerValue(dateTime, pyrheliometer.DBName, pyrheliometer.TableName, pyrheliometer.ColName); logger.LogInformation("【CalcPowerStationJob】【取得成功電站[{0}]在{1}的逆變器設備資訊】", powerStation.Code, dateTime);
foreach (var inverterHistory in inverterHistories) 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; logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的逆變器的資訊】", powerStation.Code, dateTime);
inverterHistory.DC1KW = inverterHistory.DC1W / 1000; var inverterHistories = await powerStationRepository.CalcInverterHisyortHourData(dateTime, powerStation.SiteDB, full_inverter_table_name, inverterIds);
inverterHistory.DC2KW = inverterHistory.DC2W / 1000; //取得日照計要找的欄位資訊
inverterHistory.DC3KW = inverterHistory.DC3W / 1000; var pyrheliometer = await powerStationRepository.GetFirstPyrheliometerInfo(powerStation.Id, powerStation.SiteDB);
inverterHistory.DC4KW = inverterHistory.DC4W / 1000; var pyrheliometerValue = await powerStationRepository.GetFirstPyrheliometerValue(dateTime, pyrheliometer.DBName, pyrheliometer.TableName, pyrheliometer.ColName);
inverterHistory.DC5KW = inverterHistory.DC5W / 1000; 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.DCKW = (inverterHistory.DC1W + inverterHistory.DC2W + inverterHistory.DC3W + inverterHistory.DC4W + inverterHistory.DC5W) / 1000;
inverterHistory.ACKW = (inverterHistory.AC1W + inverterHistory.AC2W + inverterHistory.AC3W) / 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.TIMESTAMP = Convert.ToDateTime(inverterHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss");
inverterHistory.PowerStationId = powerStation.Id; 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 #endregion
#region step2-4. sensoravg #region step2-4. sensoravg
var seneoravg_table_name = String.Format("s{0}01_sensoravg", powerStation.Code); try
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))
{ {
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; logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的sensor avg的資訊】", powerStation.Code, dateTime);
sensorAvgHistory.TIMESTAMP = Convert.ToDateTime(sensorAvgHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss"); 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 #endregion
#region step2-5. meter #region step2-5. meter
var meter_table_name = String.Format("s{0}01_meter", powerStation.Code); try
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))
{ {
logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime); var meter_table_name = String.Format("s{0}01_meter", powerStation.Code);
var meterHistory = await powerStationRepository.CalcMeterHistory(dateTime, full_meter_table_name); var full_meter_table_name = String.Format("`{0}`.`{1}`", powerStation.SiteDB, meter_table_name);
logger.LogInformation("【CalcPowerStationJob】【計算完成電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime); var exist_meter_table = await powerStationRepository.ExistTable(powerStation.SiteDB, meter_table_name);
if (!string.IsNullOrEmpty(exist_meter_table))
if (meterHistory != null)
{ {
meterHistory.PowerStationId = powerStation.Id; logger.LogInformation("【CalcPowerStationJob】【開始計算電站[{0}]在{1}的meter的資訊】", powerStation.Code, dateTime);
meterHistory.TIMESTAMP = Convert.ToDateTime(meterHistory.TIMESTAMP + ":00:00").ToString("yyyy-MM-dd HH:mm:ss"); 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 #endregion
#region () #region ()
if (powerStation.WeathersStationId == null) try
{ {
var weatherStationId = ""; if (powerStation.WeathersStationId == null)
double shortLocation = 9999;
foreach (var Location in observation.Records.Location)
{ {
var weatherStationId = "";
if (powerStation.Coordinate != null) 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 (powerStation.Coordinate != null)
if (nowLocation < shortLocation)
{ {
shortLocation = nowLocation; var powerLocation = powerStation.Coordinate.Split(',');
weatherStationId = Location.StationId; 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));
calcPowerStation.TodayWeatherTemp = Convert.ToDouble(Location.WeatherElement[0].ElementValue); 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 #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) catch (Exception exception)
{ {
@ -478,24 +584,29 @@ namespace SolarPower.Quartz.Jobs
await powerStationRepository.AddPowerStationHistory(powerStationHistoriesHour, history_properties); await powerStationRepository.AddPowerStationHistory(powerStationHistoriesHour, history_properties);
#endregion #endregion
#region step4. Pyrheliometer History INSERT sensor_history_hour #region step4. sensor History INSERT sensor_history_hour
List<string> pyrheliometer_history_properties = new List<string>() List<string> sensor_history_properties = new List<string>()
{ {
"PowerStationId", "PowerStationId",
"TIMESTAMP", "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>() //List<string> Temp_history_properties = new List<string>()
{ //{
"PowerStationId", // "PowerStationId",
"TIMESTAMP", // "TIMESTAMP",
"Temperature" // "Temperature"
}; //};
await powerStationRepository.AddTempHistory(TempHistoriesHour, Temp_history_properties); //await powerStationRepository.AddTempHistory(TempHistoriesHour, Temp_history_properties);
#endregion #endregion
#region step5. calcPowerStations UPDATE power_station #region step5. calcPowerStations UPDATE power_station

View File

@ -540,72 +540,74 @@ namespace SolarPower.Repository.Implement
-- power_station -- power_station
CREATE TABLE IF NOT EXISTS `power_station` ( CREATE TABLE IF NOT EXISTS `power_station` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:', `Deleted` TINYINT(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`CompanyId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `CompanyId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
`CityId` 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 '', `AreaId` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
`HealthStatus` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '1: 2: 3:', `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 '', `Address` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `Name` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`MainDisplay` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `MainDisplay` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '++', `Code` VARCHAR(50) NULL DEFAULT NULL COMMENT '++' COLLATE 'utf8mb4_unicode_ci',
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `SerialNumber` VARCHAR(4) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: 1:', `IsEscrow` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '0: 1:',
`EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `EscrowName` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '', `ElectricityMeterAt` TIMESTAMP NULL DEFAULT NULL COMMENT '',
`EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `EstimatedRecoveryTime` VARCHAR(10) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`GeneratingCapacity` decimal(10,1) NOT NULL DEFAULT '0.0' COMMENT '()', `GeneratingCapacity` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '()',
`PowerRate` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '', `PowerRate` DECIMAL(10,4) NOT NULL DEFAULT '0.0000' COMMENT '',
`Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `Coordinate` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`InverterBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `InverterBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`InverterProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `InverterProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`InverterAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `InverterAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
`PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `PhotovoltaicPanelBrand` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `PhotovoltaicPanelProductModel` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`PhotovoltaicPanelSpecification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `PhotovoltaicPanelSpecification` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `PhotovoltaicPanelAmount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
`BoEFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `BoEFileName` VARCHAR(255) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`BoEFile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `BoEFile` VARCHAR(255) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `BoEDiscountRate` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
`BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `BoEDeviceRegisterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '(%)', `BoERentRatio` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '(%)',
`GUINumber` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `BoERegisterPostAt` TIMESTAMP NULL DEFAULT NULL COMMENT '',
`TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `GUINumber` VARCHAR(16) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`TPCInvoiceBuyer` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `TPCContractNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`TPCInvoiceAddress` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `TPCInvoiceBuyer` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '', `TPCInvoiceAddress` VARCHAR(100) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '()', `TPCContractAt` TIMESTAMP NULL DEFAULT NULL COMMENT '',
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `TPCSellDeadline` INT(10) UNSIGNED NULL DEFAULT '0' COMMENT '()',
`TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '', `TPCMeterReading` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
`TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '', `TPCPurchaseElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '',
`SolarType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '', `TPCSellElectricityAt` TIMESTAMP NULL DEFAULT NULL COMMENT '',
`kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000', `TPCMeterNumber` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '', `SolarType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '',
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '', `kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000',
`today_kwhkwp` decimal(10,3) DEFAULT NULL COMMENT 'kwhkwp', `Today_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '',
`avg_kwhkwp` decimal(10,3) DEFAULT NULL COMMENT '30kwhkwp', `Total_kwh` DECIMAL(10,3) UNSIGNED NOT NULL DEFAULT '0.000' COMMENT '',
`today_money` decimal(10,2) DEFAULT NULL COMMENT '', `today_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT 'kwhkwp',
`total_money` decimal(10,2) DEFAULT NULL COMMENT '', `avg_kwhkwp` DECIMAL(10,3) NULL DEFAULT NULL COMMENT '30kwhkwp',
`today_PR` decimal(5,2) DEFAULT NULL COMMENT 'Pr值', `today_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '',
`avg_PR` decimal(5,2) DEFAULT NULL COMMENT 'Pr值', `total_money` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '',
`today_carbon` decimal(10,2) DEFAULT NULL COMMENT '', `today_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT 'Pr值',
`total_carbon` decimal(10,2) DEFAULT NULL COMMENT '', `avg_PR` DECIMAL(5,2) NULL DEFAULT NULL COMMENT 'Pr值',
`today_irradiance` decimal(5,2) DEFAULT NULL COMMENT '', `today_carbon` DECIMAL(10,2) NULL DEFAULT NULL COMMENT '',
`avg_irradiance` decimal(5,2) DEFAULT NULL COMMENT '', `total_carbon` DECIMAL(10,2) NOT NULL COMMENT '',
`SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '', `today_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '',
`SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' DB name: solar_com', `avg_irradiance` DECIMAL(5,2) NULL DEFAULT NULL COMMENT '',
`TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `SolarHour` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '',
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '', `SiteDB` VARCHAR(20) NULL DEFAULT NULL COMMENT ' DB name: solar_com' COLLATE 'utf8mb4_unicode_ci',
`WeathersStationId` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `TodayWeather` VARCHAR(20) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`RateOfRain` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `TodayWeatherTemp` DECIMAL(5,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '',
`line_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `WeathersStationId` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`Estimate_kwh` decimal(10,2) DEFAULT '0.00' COMMENT '', `RateOfRain` VARCHAR(50) NULL DEFAULT NULL COMMENT '' COLLATE 'utf8mb4_unicode_ci',
`EstimateEfficacy` decimal(10,2) DEFAULT '0.00' COMMENT '', `line_token` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
`CreatedBy` int(10) unsigned NOT NULL COMMENT '', `Estimate_kwh` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '',
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '', `EstimateEfficacy` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '',
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '', `CreatedBy` INT(10) UNSIGNED NOT NULL COMMENT '',
`UpdatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 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, PRIMARY KEY (`Id`) USING BTREE,
KEY `IDX_01` (`Deleted`) USING BTREE, KEY `IDX_01` (`Deleted`) USING BTREE,
KEY `IDX_02` (`CompanyId`) USING BTREE, KEY `IDX_02` (`CompanyId`) USING BTREE,

View File

@ -81,7 +81,7 @@ namespace SolarPower.Repository.Implement
BillInfo a = new BillInfo(); BillInfo a = new BillInfo();
try 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 es.StartAt,es.EndAt,es.Kwh,ps.PowerRate,ps.Name as PowerName
FROM electricity_sold_record es FROM electricity_sold_record es
LEFT JOIN power_station ps LEFT JOIN power_station ps

View File

@ -2315,15 +2315,17 @@ namespace SolarPower.Repository.Implement
{ {
try try
{ {
var sql = $@"SELECT * var sql = $@"SELECT temp.*
FROM {db_name}.device d FROM (SELECT *
WHERE d.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0 FROM {db_name}.device d
UNION WHERE d.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
SELECT d.* UNION
FROM {db_name}.sharedevice sd SELECT d.*
LEFT JOIN {db_name}.device d ON sd.DeviceId = d.Id FROM {db_name}.sharedevice sd
WHERE sd.PowerStationId = @PowerStationId AND d.`Type` = 'MTR' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0 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(); result = (await conn.QueryAsync<DeviceInfo>(sql, new { PowerStationId = powerStationId })).ToList();
} }
@ -2342,15 +2344,17 @@ namespace SolarPower.Repository.Implement
{ {
try try
{ {
var sql = $@"SELECT * var sql = $@"SELECT temp.*
FROM {db_name}.device d FROM (SELECT *
WHERE d.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0 FROM {db_name}.device d
UNION WHERE d.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0
SELECT d.* UNION
FROM {db_name}.sharedevice sd SELECT d.*
LEFT JOIN {db_name}.device d ON sd.DeviceId = d.Id FROM {db_name}.sharedevice sd
WHERE sd.PowerStationId = @PowerStationId AND d.`Type` = '{type}' AND d.Deleted = 0 AND d.Enabled = 1 AND d.Status != 0 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(); 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 = ""; var typename = "";
if (type == 1) switch (SensorTypeEnum)
{ {
typename = "Temperature";//1為溫度計 case SensorTypeEnum.PYR: //日照計
} typename = "Irradiance";
else if (type == 0) break;
{ case SensorTypeEnum.MTR: //模組溫度計
typename = "Irradiance";//0為日照計 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; PyrheliometerHistory result;
using (IDbConnection conn = this._databaseHelper.GetConnection()) 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; int count;
using (IDbConnection conn = _databaseHelper.GetConnection()) using (IDbConnection conn = _databaseHelper.GetConnection())
@ -2511,10 +2530,13 @@ namespace SolarPower.Repository.Implement
PowerStationId, PowerStationId,
DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') AS TIMESTAMP, DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') AS TIMESTAMP,
AVG(p.Irradiance) AS Irradiance, 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 FROM sensor_history_hour p
WHERE DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') = @NowDay WHERE DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') = @NowDay
AND p.Irradiance != 0
AND PowerStationId = @PowerStationId AND PowerStationId = @PowerStationId
GROUP BY DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d') GROUP BY DATE_FORMAT(p.TIMESTAMP, '%Y-%m-%d')
"; ";
@ -2575,10 +2597,13 @@ namespace SolarPower.Repository.Implement
PowerStationId, PowerStationId,
DATE_FORMAT(p.TIMESTAMP, '%Y-%m') AS TIMESTAMP, DATE_FORMAT(p.TIMESTAMP, '%Y-%m') AS TIMESTAMP,
AVG(p.Irradiance) AS Irradiance, 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 FROM sensor_history_hour p
WHERE DATE_FORMAT(p.TIMESTAMP, '%Y-%m') = @Month WHERE DATE_FORMAT(p.TIMESTAMP, '%Y-%m') = @Month
AND p.Irradiance != 0
AND PowerStationId = @PowerStationId AND PowerStationId = @PowerStationId
GROUP BY DATE_FORMAT(p.TIMESTAMP, '%Y-%m') GROUP BY DATE_FORMAT(p.TIMESTAMP, '%Y-%m')
"; ";

View File

@ -132,7 +132,7 @@ namespace SolarPower.Repository.Implement
if (!string.IsNullOrEmpty(filter.Name)) 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(); result = (await conn.QueryAsync<RoleDateTable>(sql, filter)).ToList();

View File

@ -267,7 +267,7 @@ namespace SolarPower.Repository.Implement
if (!string.IsNullOrEmpty(filter.Name)) if (!string.IsNullOrEmpty(filter.Name))
{ {
sql += @" AND Name LIKE CONCAT('%', @Name, '%')"; sql += @" AND u.Name LIKE CONCAT('%', @Name, '%')";
} }
if (filter.SelectedRoleId > 0) if (filter.SelectedRoleId > 0)

View File

@ -511,9 +511,9 @@ namespace SolarPower.Repository.Interface
Task<List<DeviceInfo>> GetListPyrheliometerByPowerStationId(int powerStationId, string db_name); Task<List<DeviceInfo>> GetListPyrheliometerByPowerStationId(int powerStationId, string db_name);
Task<List<DeviceInfo>> GetListTempByPowerStationId(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<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> 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<AvgPyrheliometerHistory> CalcAvgPyrheliometerHistory30day(string nowDay, int powerStationId);
Task<PyrheliometerHistory> CalcPyrheliometerHistoryDayDataByPowerStationId(string nowDay, int powerStationId); Task<PyrheliometerHistory> CalcPyrheliometerHistoryDayDataByPowerStationId(string nowDay, int powerStationId);
Task<int> AddPyrheliometerHistoryDayList(List<PyrheliometerHistory> entity, List<string> properties); Task<int> AddPyrheliometerHistoryDayList(List<PyrheliometerHistory> entity, List<string> properties);

View File

@ -398,7 +398,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }
@ -408,7 +408,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }

View File

@ -21,11 +21,11 @@
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>即時總發電量</p> <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>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>平均發電量</p> <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> </div>
</div> </div>
@ -37,11 +37,11 @@
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>即時平均日照度</p> <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>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>平均日照度(30天)</p> <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> </div>
</div> </div>
@ -53,11 +53,11 @@
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>即時平均 PR 值</p> <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>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>平均 PR 值(30天)</p> <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> </div>
</div> </div>
@ -69,11 +69,11 @@
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>即時平均有效日照時數</p> <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>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>平均有效日照時數 (30天)</p> <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> </div>
</div> </div>
@ -85,11 +85,11 @@
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>今日減碳量</p> <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>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<p>總減碳量</p> <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> </div>
</div> </div>
@ -119,7 +119,7 @@
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 電站總數</h4> <h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 電站總數</h4>
</div> </div>
<div class="card-body" style="min-height: 148px;"> <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> <p class="text-right mb-0">廠</p>
</div> </div>
</div> </div>
@ -131,7 +131,7 @@
<h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 總裝置容量</h4> <h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 總裝置容量</h4>
</div> </div>
<div class="card-body" style="min-height: 148px;"> <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> <p class="text-right mb-0">MWp</p>
</div> </div>
</div> </div>

View File

@ -502,7 +502,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }
@ -512,7 +512,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }

View File

@ -297,7 +297,7 @@
"info": true, "info": true,
"autoWidth": false, "autoWidth": false,
"responsive": true, "responsive": true,
"order": [[9, "desc"]], "order": [[8, "desc"]],
"columns": [{ "columns": [{
"data": "planId" "data": "planId"
}, { }, {

View File

@ -416,7 +416,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }
@ -426,7 +426,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }

View File

@ -474,7 +474,7 @@
$('#solarTable' + val.cityId).find('tbody').append('<tr>' + $('#solarTable' + val.cityId).find('tbody').append('<tr>' +
'<td>' + val.id + '</td>' + '<td>' + val.id + '</td>' +
'<td>' + val.name + '</td>' + '<td>' + val.name + '</td>' +
'<td>' + val.generatingCapacity + '</td>' + '<td>' + val.generatingCapacity.toFixed(2) + '</td>' +
'<td>' + val.inverterAmount + '</td>' + '<td>' + val.inverterAmount + '</td>' +
'<td>' + val.electricityMeterAt + '</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>' + '<td><button type="button" class="btn btn-primary btn-pills waves-effect waves-themed" onclick="location.href=\'' + localurl + '/edit?stationId=' + val.id + '\'">選擇</button></td>' +

View File

@ -128,24 +128,26 @@
if (stationId == 'new') { if (stationId == 'new') {
//#region 電站基本資料 //#region 電站基本資料
$("#address_detail_text").hide(); $("#address_detail_text").hide();
$("#select_solar_tpye").attr('disabled', false);
$("#power_station_code_text").hide(); $("#power_station_code_text").hide();
$("#power_station_name_text").hide(); $("#power_station_name_text").hide();
$("#electricity_meter_at_text").hide(); $("#check_escrow").attr('disabled', false);
$("#estimated_recovery_time_text").hide(); $("#escrow_name_text").hide();
$("#created_by_title").hide();
$("#created_by_text").hide();
$("#generating_capacity_text").hide(); $("#generating_capacity_text").hide();
$("#escrow_name_text").hide(); $("#estimate_efficacy_text").hide();
$("#power_rate_text").hide(); $("#estimate_kwh_text").hide();
$("#estimated_recovery_time_text").hide();
$("#coordinate_text").hide(); $("#coordinate_text").hide();
$("#line_token_text").hide();
$("#created_by_title").hide();
$("#created_by_text").hide();
$("#created_at_title").hide(); $("#created_at_title").hide();
$("#created_at_text").hide(); $("#created_at_text").hide();
$("#line_token_text").hide();
$("#estimate_kwh_text").hide();
$("#estimate_efficacy_text").hide();
//逆變器 //逆變器
$("#inverter_brand_text").hide(); $("#inverter_brand_text").hide();
@ -161,9 +163,7 @@
$("#edit-station-info-btn").hide(); $("#edit-station-info-btn").hide();
$("#canecl-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) @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
{ {
<text> <text>
@ -743,6 +743,9 @@
return data; return data;
} }
},
"error": function (xhr, error, thrown) {
console.log(xhr);
} }
}); });
@ -1037,18 +1040,18 @@
cancelButtonText: "否" cancelButtonText: "否"
}).then(function (result) { }).then(function (result) {
if (result.value) { if (result.value) {
PostPowerStationDate(); PostPowerStationData();
} }
}); });
} else { } else {
PostPowerStationDate(); PostPowerStationData();
} }
</text> </text>
} }
else else
{ {
<text> <text>
PostPowerStationDate(); PostPowerStationData();
</text> </text>
} }
@ -1056,7 +1059,7 @@
} }
//#endregion //#endregion
function PostPowerStationDate() { function PostPowerStationData() {
var url = "/PowerStation/SavePowerStationInfo"; var url = "/PowerStation/SavePowerStationInfo";
var send_data = { var send_data = {
@ -1066,7 +1069,6 @@
Address: $("#address_detail").val(), Address: $("#address_detail").val(),
Name: $("#power_station_name").val(), Name: $("#power_station_name").val(),
IsEscrow: $('#check_escrow').is(':checked') ? 1 : 0, IsEscrow: $('#check_escrow').is(':checked') ? 1 : 0,
ElectricityMeterAt: $("#electricity_meter_at").val(),
EstimatedRecoveryTime: $("#estimated_recovery_time").val(), EstimatedRecoveryTime: $("#estimated_recovery_time").val(),
GeneratingCapacity: $("#generating_capacity").val(), GeneratingCapacity: $("#generating_capacity").val(),
EscrowName: $('#check_escrow').is(':checked') ? $("#escrow_name").val() : "", EscrowName: $('#check_escrow').is(':checked') ? $("#escrow_name").val() : "",
@ -1119,13 +1121,20 @@
} }
formData.append("BoEDiscountRate", $("#BoE_discount_rate").val()); formData.append("BoEDiscountRate", $("#BoE_discount_rate").val());
formData.append("BoEDeviceRegisterNumber", $("#BoE_device_register_number").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("TPCContractNumber", $("#TPC_contract_number").val());
formData.append("TPCContractAt", $("#TPC_contract_at").val()); formData.append("TPCContractAt", $("#TPC_contract_at").val());
formData.append("TPCSellDeadline", $("#TPC_sell_deadline").val()); formData.append("TPCSellDeadline", $("#TPC_sell_deadline").val());
formData.append("TPCMeterReading", $("#TPC_meter_reading").val()); formData.append("ElectricityMeterAt", $("#electricity_meter_at").val());
formData.append("TPCPurchaseElectricityAt", $("#TPC_purchase_electricity_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("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({ $.ajax({
type: "POST", type: "POST",
@ -1192,24 +1201,24 @@
//#region 電站基本資料 文字 //#region 電站基本資料 文字
$("#address_detail_text").show(); $("#address_detail_text").show();
$("#power_station_code_text").show(); $("#power_station_code_text").show();
$("#power_station_name_text").show(); $("#power_station_name_text").show();
$("#electricity_meter_at_text").show(); $("#escrow_name_text").show();
$("#estimated_recovery_time_text").show();
$("#created_by_title").show();
$("#created_by_text").show();
$("#generating_capacity_text").show(); $("#generating_capacity_text").show();
$("#escrow_name_text").show(); $("#estimate_efficacy_text").show();
$("#power_rate_text").show(); $("#estimate_kwh_text").show();
$("#estimated_recovery_time_text").show();
$("#coordinate_text").show(); $("#coordinate_text").show();
$("#line_token_text").show();
$("#created_by_title").show();
$("#created_by_text").show();
$("#created_at_title").show(); $("#created_at_title").show();
$("#created_at_text").show(); $("#created_at_text").show();
$("#line_token_text").show();
$("#estimate_kwh_text").show();
$("#estimate_efficacy_text").show();
//逆變器 //逆變器
$("#inverter_brand_text").show(); $("#inverter_brand_text").show();
$("#inverter_product_model_text").show(); $("#inverter_product_model_text").show();
@ -1226,22 +1235,21 @@
$("#select_city").attr("disabled", true); $("#select_city").attr("disabled", true);
$("#select_area").attr("disabled", true); $("#select_area").attr("disabled", true);
$("#address_detail").hide(); $("#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); $("#select_solar_tpye").attr("disabled", true);
$("#generating_capacity").hide(); $("#power_station_name").hide();
$("#check_escrow").attr("disabled", true);
$("#escrow_name").hide(); $("#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_kwh").hide();
$("#estimate_efficacy").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) @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
{ {
@ -1282,6 +1290,7 @@
//#region 電站基本資料 文字 //#region 電站基本資料 文字
$("#address_detail_text").hide(); $("#address_detail_text").hide();
$("#power_station_name_text").hide(); $("#power_station_name_text").hide();
$("#electricity_meter_at_text").hide(); $("#electricity_meter_at_text").hide();
$("#estimated_recovery_time_text").hide(); $("#estimated_recovery_time_text").hide();
@ -1315,17 +1324,20 @@
$("#select_city").attr("disabled", true); $("#select_city").attr("disabled", true);
$("#select_area").attr("disabled", true); $("#select_area").attr("disabled", true);
$("#address_detail").show(); $("#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); $("#select_solar_tpye").attr("disabled", false);
$("#generating_capacity").show(); $("#power_station_name").show();
$("#check_escrow").attr("disabled", false);
$("#escrow_name").show(); $("#escrow_name").show();
$("#power_rate").show();
$("#generating_capacity").show();
$("#estimate_kwh").show();
$("#estimate_efficacy").show();
$("#estimated_recovery_time").show();
$("#coordinate").show(); $("#coordinate").show();
$("#line_token").show();
$("#power_station_operation_personnel").attr("disabled", false); $("#power_station_operation_personnel").attr("disabled", false);
$("#power_station_operation_personnel > option").each(function () { $("#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) @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
{ {
<text> <text>
@ -1407,16 +1414,23 @@
//觀看 //觀看
//#region 能源局與台電資料 文字 //#region 能源局與台電資料 文字
$("#link-boe-file").show(); $("#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_device_register_number_text").show();
$("#BoE_rent_ratio_text").show();
$("#TPC_contract_number_text").show(); $("#TPC_contract_number_text").show();
$("#TPC_contract_at_text").show(); $("#TPC_contract_at_text").show();
$("#TPC_sell_deadline_text").show(); $("#TPC_sell_deadline_text").show();
$("#TPC_meter_reading_text").show(); $("#electricity_meter_at_text").show();
$("#TPC_purchase_electricity_at_text").show(); $("#power_rate_text").show();
$("#TPC_sell_electricity_at_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_title").show();
$("#BOE_TPC_created_by_text").show(); $("#BOE_TPC_created_by_text").show();
@ -1426,16 +1440,23 @@
//#region 能源局與台電資料 input //#region 能源局與台電資料 input
$("#BoE_file").hide(); $("#BoE_file").hide();
$("#BoE_discount_rate").hide(); $("#BoE_register_post_at").hide();
$("#BoE_device_register_number").hide(); $("#BoE_device_register_number").hide();
$("#BoE_rent_ratio").hide(); @*$("#BoE_discount_rate").hide();*@
@*$("#BoE_rent_ratio").hide();*@
$("#TPC_contract_number").hide(); $("#TPC_contract_number").hide();
$("#TPC_contract_at").hide(); $("#TPC_contract_at").hide();
$("#TPC_sell_deadline").hide(); $("#TPC_sell_deadline").hide();
$("#TPC_meter_reading").hide(); $("#electricity_meter_at").hide();
$("#TPC_purchase_electricity_at").hide(); $("#power_rate").hide();
$("#TPC_sell_electricity_at").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 //#endregion
//#region 能源局與台電btn //#region 能源局與台電btn
@ -1447,16 +1468,21 @@
//修改 //修改
//#region 能源局與台電資料 文字 //#region 能源局與台電資料 文字
$("#link-boe-file").hide(); $("#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_device_register_number_text").hide();
$("#BoE_rent_ratio_text").hide(); @*$("#BoE_rent_ratio_text").hide();*@
$("#TPC_contract_number_text").hide(); $("#TPC_contract_number_text").hide();
$("#TPC_contract_at_text").hide(); $("#TPC_contract_at_text").hide();
$("#TPC_sell_deadline_text").hide(); $("#TPC_sell_deadline_text").hide();
$("#TPC_meter_reading_text").hide(); $("#electricity_meter_at_text").hide();
$("#TPC_purchase_electricity_at_text").hide(); $("#power_rate_text").hide();
$("#TPC_sell_electricity_at_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_title").hide();
$("#BOE_TPC_created_by_text").hide(); $("#BOE_TPC_created_by_text").hide();
@ -1466,16 +1492,21 @@
//#region 能源局與台電資料 input //#region 能源局與台電資料 input
$("#BoE_file").show(); $("#BoE_file").show();
$("#BoE_discount_rate").show(); @*$("#BoE_discount_rate").show();*@
$("#BoE_register_post_at").show();
$("#BoE_device_register_number").show(); $("#BoE_device_register_number").show();
$("#BoE_rent_ratio").show(); @*$("#BoE_rent_ratio").show();*@
$("#TPC_contract_number").show(); $("#TPC_contract_number").show();
$("#TPC_contract_at").show(); $("#TPC_contract_at").show();
$("#TPC_sell_deadline").show(); $("#TPC_sell_deadline").show();
$("#TPC_meter_reading").show(); $("#electricity_meter_at").show();
$("#TPC_purchase_electricity_at").show(); $("#power_rate").show();
$("#TPC_sell_electricity_at").show(); $("#TPC_sell_electricity_at").show();
$("#TPC_invoice_buyer").show();
$("#GUI_number").show();
$("#TPC_invoice_address").show();
$("#TPC_meter_number").show();
//#endregion //#endregion
//#region 能源局與台電btn //#region 能源局與台電btn
@ -1490,12 +1521,12 @@
//觀看 //觀看
//#region 土地房屋資料 文字 //#region 土地房屋資料 文字
$("#land_building_address_text_" + selectedLandBuildingId).show(); $("#land_building_address_text_" + selectedLandBuildingId).show();
$("#land_building_coordinate_text_" + selectedLandBuildingId).show(); @*$("#land_building_coordinate_text_" + selectedLandBuildingId).show();*@
$("#lease_notarization_at_text_" + selectedLandBuildingId).show(); $("#lease_notarization_at_text_" + selectedLandBuildingId).show();
$("#land_building_lease_Rate_text_" + selectedLandBuildingId).show(); $("#land_building_lease_Rate_text_" + selectedLandBuildingId).show();
$("#land_building_landowner_text_" + selectedLandBuildingId).show(); $("#land_building_landowner_text_" + selectedLandBuildingId).show();
$("#land_building_phone_text_" + selectedLandBuildingId).show(); @*$("#land_building_phone_text_" + selectedLandBuildingId).show();*@
$("#land_building_purpose_text_" + selectedLandBuildingId).show(); @*$("#land_building_purpose_text_" + selectedLandBuildingId).show();*@
$("#land_building_created_by_title_" + selectedLandBuildingId).show(); $("#land_building_created_by_title_" + selectedLandBuildingId).show();
$("#land_building_created_by_text_" + selectedLandBuildingId).show(); $("#land_building_created_by_text_" + selectedLandBuildingId).show();
$("#land_building_created_at_title_" + selectedLandBuildingId).show(); $("#land_building_created_at_title_" + selectedLandBuildingId).show();
@ -1504,12 +1535,12 @@
//#region 土地房屋資料 input //#region 土地房屋資料 input
$("#land_building_address_" + selectedLandBuildingId).hide(); $("#land_building_address_" + selectedLandBuildingId).hide();
$("#land_building_coordinate_" + selectedLandBuildingId).hide(); @*$("#land_building_coordinate_" + selectedLandBuildingId).hide();*@
$("#lease_notarization_at_" + selectedLandBuildingId).hide(); $("#lease_notarization_at_" + selectedLandBuildingId).hide();
$("#land_building_lease_Rate_" + selectedLandBuildingId).hide(); $("#land_building_lease_Rate_" + selectedLandBuildingId).hide();
$("#land_building_landowner_" + selectedLandBuildingId).hide(); $("#land_building_landowner_" + selectedLandBuildingId).hide();
$("#land_building_phone_" + selectedLandBuildingId).hide(); @*$("#land_building_phone_" + selectedLandBuildingId).hide();*@
$("#land_building_purpose_" + selectedLandBuildingId).hide(); @*$("#land_building_purpose_" + selectedLandBuildingId).hide();*@
//#endregion //#endregion
//#region 土地房屋資料 btn //#region 土地房屋資料 btn
@ -1522,12 +1553,12 @@
//修改 //修改
//#region 土地房屋資料 文字 //#region 土地房屋資料 文字
$("#land_building_address_text_" + selectedLandBuildingId).hide(); $("#land_building_address_text_" + selectedLandBuildingId).hide();
$("#land_building_coordinate_text_" + selectedLandBuildingId).hide(); @*$("#land_building_coordinate_text_" + selectedLandBuildingId).hide();*@
$("#lease_notarization_at_text_" + selectedLandBuildingId).hide(); $("#lease_notarization_at_text_" + selectedLandBuildingId).hide();
$("#land_building_lease_Rate_text_" + selectedLandBuildingId).hide(); $("#land_building_lease_Rate_text_" + selectedLandBuildingId).hide();
$("#land_building_landowner_text_" + selectedLandBuildingId).hide(); $("#land_building_landowner_text_" + selectedLandBuildingId).hide();
$("#land_building_phone_text_" + selectedLandBuildingId).hide(); @*$("#land_building_phone_text_" + selectedLandBuildingId).hide();*@
$("#land_building_purpose_text_" + selectedLandBuildingId).hide(); @*$("#land_building_purpose_text_" + selectedLandBuildingId).hide();*@
$("#land_building_created_by_title_" + selectedLandBuildingId).hide(); $("#land_building_created_by_title_" + selectedLandBuildingId).hide();
$("#land_building_created_by_text_" + selectedLandBuildingId).hide(); $("#land_building_created_by_text_" + selectedLandBuildingId).hide();
$("#land_building_created_at_title_" + selectedLandBuildingId).hide(); $("#land_building_created_at_title_" + selectedLandBuildingId).hide();
@ -1536,12 +1567,12 @@
//#region 土地房屋資料 input //#region 土地房屋資料 input
$("#land_building_address_" + selectedLandBuildingId).show(); $("#land_building_address_" + selectedLandBuildingId).show();
$("#land_building_coordinate_" + selectedLandBuildingId).show(); @*$("#land_building_coordinate_" + selectedLandBuildingId).show();*@
$("#lease_notarization_at_" + selectedLandBuildingId).show(); $("#lease_notarization_at_" + selectedLandBuildingId).show();
$("#land_building_lease_Rate_" + selectedLandBuildingId).show(); $("#land_building_lease_Rate_" + selectedLandBuildingId).show();
$("#land_building_landowner_" + selectedLandBuildingId).show(); $("#land_building_landowner_" + selectedLandBuildingId).show();
$("#land_building_phone_" + selectedLandBuildingId).show(); @*$("#land_building_phone_" + selectedLandBuildingId).show();*@
$("#land_building_purpose_" + selectedLandBuildingId).show(); @*$("#land_building_purpose_" + selectedLandBuildingId).show();*@
//#endregion //#endregion
//#region 土地房屋資料 btn //#region 土地房屋資料 btn
@ -1590,13 +1621,12 @@
$("#address_detail_text").html(powerStationData.address); $("#address_detail_text").html(powerStationData.address);
$("#power_station_code_text").html(powerStationData.code); $("#power_station_code_text").html(powerStationData.code);
$("#power_station_name_text").html(powerStationData.name); $("#power_station_name_text").html(powerStationData.name);
$("#electricity_meter_at_text").html(powerStationData.electricityMeterAt);
$("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime); $("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
$("#created_by_text").html(powerStationData.creatorName); $("#created_by_text").html(powerStationData.creatorName);
$("#generating_capacity_text").html(powerStationData.generatingCapacity); $("#generating_capacity_text").html(powerStationData.generatingCapacity);
$("#escrow_name_text").html(powerStationData.escrowName); $("#escrow_name_text").html(powerStationData.escrowName);
$("#power_rate_text").html(powerStationData.powerRate);
$("#coordinate_text").html(powerStationData.coordinate); $("#coordinate_text").html(powerStationData.coordinate);
$("#created_at_text").html(powerStationData.createdAt); $("#created_at_text").html(powerStationData.createdAt);
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds).trigger("change"); $("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds).trigger("change");
@ -1654,31 +1684,46 @@
function SetBoETPCInfo() { function SetBoETPCInfo() {
//#region 能源局與台電資料 文字 //#region 能源局與台電資料 文字
$("#link-boe-file").html(powerStationData.boEFileName).attr("href", powerStationData.boEFile); $("#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_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_number_text").html(powerStationData.tpcContractNumber);
$("#TPC_contract_at_text").html(powerStationData.tpcContractAt); $("#TPC_contract_at_text").html(powerStationData.tpcContractAt);
$("#TPC_sell_deadline_text").html(powerStationData.tpcSellDeadline); $("#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_meter_reading_text").html(powerStationData.tpcMeterReading);
$("#TPC_purchase_electricity_at_text").html(powerStationData.tpcPurchaseElectricityAt); $("#TPC_purchase_electricity_at_text").html(powerStationData.tpcPurchaseElectricityAt);
$("#TPC_sell_electricity_at_text").html(powerStationData.tpcSellElectricityAt); $("#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_by_text").html(powerStationData.creatorName);
$("#BOE_TPC_created_at_text").html(powerStationData.createdAt); $("#BOE_TPC_created_at_text").html(powerStationData.createdAt);
//#endregion //#endregion
//#region 能源局與台電資料 input //#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_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_number").val(powerStationData.tpcContractNumber);
$("#TPC_contract_at").val(powerStationData.tpcContractAt); $("#TPC_contract_at").val(powerStationData.tpcContractAt);
$("#TPC_sell_deadline").val(powerStationData.tpcSellDeadline); $("#TPC_sell_deadline").val(powerStationData.tpcSellDeadline);
$("#electricity_meter_at").val(powerStationData.electricityMeterAt);
$("#power_rate").val(powerStationData.powerRate);
$("#TPC_meter_reading").val(powerStationData.tpcMeterReading); $("#TPC_meter_reading").val(powerStationData.tpcMeterReading);
$("#TPC_purchase_electricity_at").val(powerStationData.tpcPurchaseElectricityAt); $("#TPC_purchase_electricity_at").val(powerStationData.tpcPurchaseElectricityAt);
$("#TPC_sell_electricity_at").val(powerStationData.tpcSellElectricityAt); $("#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
} }
//#endregion //#endregion
@ -1744,12 +1789,19 @@
'</div>' + '</div>' +
'</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_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>' + '<label class="col-xl-4 form-label">經緯度</label>' +
'<div class="col-xl-8">' + '<div class="col-xl-8">' +
'<label id="land_building_coordinate_text_' + value.id + '" class="color-info-600">' + value.coordinate + '</label>' + '<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 + '">' + '<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>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<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 + '">' + '<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>' + '</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>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<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">' + '<div class="col-xl-8">' +
'<label id="land_building_landowner_text_' + value.id + '" class="color-info-600">' + value.landowner + '</label>' + '<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 + '">' + '<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>' + '</div>' +
'<div class="row">' + @*'<div class="row">' +
'<label class="col-xl-4 form-label">電話</label>' + '<label class="col-xl-4 form-label">電話</label>' +
'<div class="col-xl-8">' + '<div class="col-xl-8">' +
'<label id="land_building_phone_text_' + value.id + '" class="color-info-600">' + value.phone + '</label>' + '<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 + '">' + '<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>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + @*'<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">' + '<div class="col-xl-8">' +
'<label id="land_building_purpose_text_' + value.id + '" class="color-info-600">' + value.purpose + '</label>' + '<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 + '">' + '<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>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<div class="row mb-3">' +
@ -1846,11 +1891,17 @@
'</div>' + '</div>' +
'</div>' + '</div>' +
'<div class="row">' + '<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>' + '<label class="col-xl-4 form-label">經緯度</label>' +
'<div class="col-xl-8">' + '<div class="col-xl-8">' +
'<input type="text" id="land_building_coordinate_0" name="land_building_coordinate_0" class="form-control">' + '<input type="text" id="land_building_coordinate_0" name="land_building_coordinate_0" class="form-control">' +
'</div>' + '</div>' +
'</div>' + '</div>' +*@
'</div>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<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">' + '<input type="date" id="lease_notarization_at_0" name="lease_notarization_at_0" class="form-control">' +
'</div>' + '</div>' +
'</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>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<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">' + '<div class="col-xl-8">' +
'<input type="text" id="land_building_landowner_0" name="land_building_landowner_0" class="form-control">' + '<input type="text" id="land_building_landowner_0" name="land_building_landowner_0" class="form-control">' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<div class="row">' + @*'<div class="row">' +
'<label class="col-xl-4 form-label">電話</label>' + '<label class="col-xl-4 form-label">電話</label>' +
'<div class="col-xl-8">' + '<div class="col-xl-8">' +
'<input type="text" id="land_building_phone_0" name="land_building_phone_0" class="form-control">' + '<input type="text" id="land_building_phone_0" name="land_building_phone_0" class="form-control">' +
'</div>' + '</div>' +
'</div>' + '</div>' +*@
'</div>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + @*'<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">' + '<div class="col-xl-8">' +
'<input type="text" id="land_building_purpose_0" name="land_building_purpose_0" class="form-control">' + '<input type="text" id="land_building_purpose_0" name="land_building_purpose_0" class="form-control">' +
'</div>' + '</div>' +
'</div>' + '</div>' +*@
'</div>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<div class="row mb-3">' +

View File

@ -90,37 +90,45 @@
<div class="row mb-3 d-flex justify-content-between"> <div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-3 row justify-content-center align-items-center"> <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"> <div class="col-xl-8">
<label id="electricity_meter_at_text" class="color-info-600"></label> <label id="generating_capacity_text" class="color-info-600"></label>
<input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control"> <input type="number" step="0.0001" id="generating_capacity" name="generating_capacity" class="form-control">
</div> </div>
</div> </div>
<div class="col-xl-3 row justify-content-center align-items-center"> <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"> <div class="col-xl-8">
<label id="power_rate_text" class="color-info-600"></label> <label id="estimate_efficacy_text" class="color-info-600"></label>
<input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control"> <input type="number" step="0.01" id="estimate_efficacy" name="estimate_efficacy" class="form-control">
</div> </div>
</div> </div>
<div class="col-xl-3 row justify-content-center align-items-center"> <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"> <div class="col-xl-8">
<label id="estimated_recovery_time_text" class="color-info-600"></label> <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"> <input type="number" step="1" id="estimated_recovery_time" name="estimated_recovery_time" class="form-control">
</div> </div>
</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>
<div class="row mb-5 d-flex justify-content-between "> <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> <label class="col-xl-4 form-label" id="power_station_operation_personnel_label">運維人員</label>
<div class="col-xl-8"> <div class="col-xl-8">
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple"> <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"> <input type="text" id="line_token" name="line_token" class="form-control">
</div> </div>
</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>
<div class="row mb-5 d-flex justify-content-between "> <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"> <div class="col-xl-6 row justify-content-center align-items-center">
預估發電效能
</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">
<label class="col-xl-4 form-label" id="select_power_station_company_title"> <label class="col-xl-4 form-label" id="select_power_station_company_title">
電站歸屬 電站歸屬
</label> </label>
@ -228,10 +220,13 @@
</div> </div>
<div class="col-xl-3 mb-3 row"> <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> <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> <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"> <input type="text" id="photovoltaic_panel_specification" name="photovoltaic_panel_specification" class="form-control">
</div> </div>
<div class="col-xl-2 p-0">
<span>mm</span>
</div>
</div> </div>
<div class="col-xl-3 mb-3 row"> <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> <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"> <input type="file" id="BoE_file" name="BoE_file" class="form-control">
</div> </div>
</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"> <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"> <div class="col-xl-8">
<label id="BoE_discount_rate_text" class="color-info-600"></label> <label id="BoE_register_post_at_text" class="color-info-600"></label>
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control"> <input type="date" id="BoE_register_post_at" name="BoE_register_post_at" class="form-control">
</div> </div>
</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">
@ -298,13 +300,13 @@
<input type="text" id="BoE_device_register_number" name="BoE_device_register_number" class="form-control"> <input type="text" id="BoE_device_register_number" name="BoE_device_register_number" class="form-control">
</div> </div>
</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> <label class="col-xl-4 form-label">租金比例(%)</label>
<div class="col-xl-8"> <div class="col-xl-8">
<label id="BoE_rent_ratio_text" class="color-info-600"></label> <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"> <input type="number" step="1" id="BoE_rent_ratio" name="BoE_rent_ratio" class="form-control">
</div> </div>
</div> </div>*@
</div> </div>
</div> </div>
<div class="col-xl-6"> <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"> <input type="number" step="1" id="TPC_sell_deadline" name="TPC_sell_deadline" class="form-control">
</div> </div>
</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"> <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"> <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>
<input type="number" step="1" id="TPC_meter_reading" name="TPC_meter_reading" class="form-control"> <input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control">
</div> </div>
</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" 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"> <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>
<input type="date" id="TPC_purchase_electricity_at" name="TPC_purchase_electricity_at" class="form-control"> <input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control">
</div> </div>
</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">
@ -352,6 +370,42 @@
<input type="date" id="TPC_sell_electricity_at" name="TPC_sell_electricity_at" class="form-control"> <input type="date" id="TPC_sell_electricity_at" name="TPC_sell_electricity_at" class="form-control">
</div> </div>
</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>
<div class="row d-flex justify-content-end px-5"> <div class="row d-flex justify-content-end px-5">
<div class="col-xl-6 mb-3 row justify-content-end align-items-center"> <div class="col-xl-6 mb-3 row justify-content-end align-items-center">

View File

@ -1731,17 +1731,16 @@
$("#city_name_text").html(powerStationData.cityName); $("#city_name_text").html(powerStationData.cityName);
$("#area_name_text").html(powerStationData.areaName); $("#area_name_text").html(powerStationData.areaName);
$("#address_detail_text").html(powerStationData.address); $("#address_detail_text").html(powerStationData.address);
$("#power_station_code_text").html(powerStationData.code); $("#power_station_code_text").html(powerStationData.code);
$("#power_station_name_text").html(powerStationData.name); $("#power_station_name_text").html(powerStationData.name);
$("#electricity_meter_at_text").html(powerStationData.electricityMeterAt); $("#escrow_name_text").html(powerStationData.escrowName);
$("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
$("#created_by_text").html(powerStationData.creatorName); $("#created_by_text").html(powerStationData.creatorName);
$("#generating_capacity_text").html(powerStationData.generatingCapacity); $("#generating_capacity_text").html(powerStationData.generatingCapacity);
$("#escrow_name_text").html(powerStationData.escrowName); $("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
$("#power_rate_text").html(powerStationData.powerRate);
$("#coordinate_text").html(powerStationData.coordinate); $("#coordinate_text").html(powerStationData.coordinate);
$("#created_at_text").html(powerStationData.createdAt);
$("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds).trigger("change"); $("#power_station_operation_personnel").val(powerStationData.operationPersonnelIds).trigger("change");
$("#power_station_operation_personnel").attr("disabled", true); $("#power_station_operation_personnel").attr("disabled", true);
@ -1749,6 +1748,7 @@
$("#estimate_kwh_text").html(powerStationData.estimate_kwh); $("#estimate_kwh_text").html(powerStationData.estimate_kwh);
$("#estimate_efficacy_text").html(powerStationData.estimateEfficacy); $("#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) @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
{ {
<text> <text>
@ -1785,16 +1785,23 @@
//#region 設定能源局與台電資料 //#region 設定能源局與台電資料
function SetBoETPCInfo() { function SetBoETPCInfo() {
$("#link-boe-file").html(powerStationData.boEFileName).attr("href", powerStationData.boEFile); $("#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_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_number_text").html(powerStationData.tpcContractNumber);
$("#TPC_contract_at_text").html(powerStationData.tpcContractAt); $("#TPC_contract_at_text").html(powerStationData.tpcContractAt);
$("#TPC_sell_deadline_text").html(powerStationData.tpcSellDeadline); $("#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_meter_reading_text").html(powerStationData.tpcMeterReading);
$("#TPC_purchase_electricity_at_text").html(powerStationData.tpcPurchaseElectricityAt); $("#TPC_purchase_electricity_at_text").html(powerStationData.tpcPurchaseElectricityAt);
$("#TPC_sell_electricity_at_text").html(powerStationData.tpcSellElectricityAt); $("#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_by_text").html(powerStationData.creatorName);
$("#BOE_TPC_created_at_text").html(powerStationData.createdAt); $("#BOE_TPC_created_at_text").html(powerStationData.createdAt);
} }
@ -1825,7 +1832,7 @@
var appendStr = ""; var appendStr = "";
appendStr += '<div class="card border mb-g w-100" data-land-building-id="' + value.id + '">' + 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 class="card-title font-weight-bold">土地房屋資料</div>' +
'</div>'; '</div>';
@ -1839,11 +1846,17 @@
'</div>' + '</div>' +
'</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_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>' + '<label class="col-xl-4 form-label">經緯度</label>' +
'<div class="col-xl-8">' + '<div class="col-xl-8">' +
'<label id="land_building_coordinate_text_' + value.id + '" class="color-info-600">' + value.coordinate + '</label>' + '<label id="land_building_coordinate_text_' + value.id + '" class="color-info-600">' + value.coordinate + '</label>' +
'</div>' + '</div>' +
'</div>' + '</div>' +*@
'</div>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<div class="row mb-3">' +
@ -1852,34 +1865,29 @@
'<label id="lease_notarization_at_text_' + value.id + '" class="color-info-600">' + value.leaseNotarizationAt + '</label>' + '<label id="lease_notarization_at_text_' + value.id + '" class="color-info-600">' + value.leaseNotarizationAt + '</label>' +
'</div>' + '</div>' +
'</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>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<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">' + '<div class="col-xl-8">' +
'<label id="land_building_landowner_text_' + value.id + '" class="color-info-600">' + value.landowner + '</label>' + '<label id="land_building_landowner_text_' + value.id + '" class="color-info-600">' + value.landowner + '</label>' +
'</div>' + '</div>' +
'</div>' + '</div>' +
'<div class="row">' + @*'<div class="row">' +
'<label class="col-xl-4 form-label">電話</label>' + '<label class="col-xl-4 form-label">電話</label>' +
'<div class="col-xl-8">' + '<div class="col-xl-8">' +
'<label id="land_building_phone_text_' + value.id + '" class="color-info-600">' + value.phone + '</label>' + '<label id="land_building_phone_text_' + value.id + '" class="color-info-600">' + value.phone + '</label>' +
'</div>' + '</div>' +
'</div>' + '</div>' +*@
'</div>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + @*'<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">' + '<div class="col-xl-8">' +
'<label id="land_building_purpose_text_' + value.id + '" class="color-info-600">' + value.purpose + '</label>' + '<label id="land_building_purpose_text_' + value.id + '" class="color-info-600">' + value.purpose + '</label>' +
'</div>' + '</div>' +
'</div>' + '</div>' +*@
'</div>' + '</div>' +
'<div class="col-xl">' + '<div class="col-xl">' +
'<div class="row mb-3">' + '<div class="row mb-3">' +

View File

@ -70,35 +70,43 @@
<div class="row mb-3 d-flex justify-content-between"> <div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-3 row justify-content-center align-items-center"> <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">
<div class="col-xl-8"> 裝置容量(kWp)
<label id="electricity_meter_at_text" class="color-info-600"></label> </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>
<div class="col-xl-8"> <div class="col-xl-8">
<label id="generating_capacity_text" class="color-info-600"></label> <label id="generating_capacity_text" class="color-info-600"></label>
</div> </div>
</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>
<div class="row mb-5 d-flex justify-content-between "> <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> <label class="col-xl-2 form-label" id="power_station_operation_personnel_label">運維人員</label>
<div class="col-xl-8"> <div class="col-xl-10">
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple"> <select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple">
</select> </select>
</div> </div>
@ -115,29 +123,14 @@
<label id="line_token_text" class="color-info-600"></label> <label id="line_token_text" class="color-info-600"></label>
</div> </div>
</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>
<div class="row mb-5 d-flex justify-content-between "> <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"> <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">
<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">
電站歸屬 電站歸屬
</label> </label>
<div class="col-xl-8"> <div class="col-xl-10">
<select class="form-control" id="select_power_station_company"> <select class="form-control" id="select_power_station_company">
</select> </select>
</div> </div>
@ -169,9 +162,12 @@
</div> </div>
<div class="col-xl-3 mb-3 row"> <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> <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> <label id="photovoltaic_panel_specification_text" class="color-info-600"></label>
</div> </div>
<div class="col-xl-2 p-0">
<span>mm</span>
</div>
</div> </div>
<div class="col-xl-3 mb-3 row"> <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> <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> <a id="link-boe-file" class="color-info-600" href="link/to/your/download/file" download>Download link</a>
</div> </div>
</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> <label class="col-xl-4 form-label">折扣率</label>
<div class="col-xl-8"> <div class="col-xl-8">
<label id="BoE_discount_rate_text" class="color-info-600"></label> <label id="BoE_discount_rate_text" class="color-info-600"></label>
</div> </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>
<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" for="BoE_device_register_number">能源局設備登記編號</label> <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> <label id="BoE_device_register_number_text" class="color-info-600"></label>
</div> </div>
</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> <label class="col-xl-4 form-label">租金比例(%)</label>
<div class="col-xl-8"> <div class="col-xl-8">
<label id="BoE_rent_ratio_text" class="color-info-600"></label> <label id="BoE_rent_ratio_text" class="color-info-600"></label>
</div> </div>
</div> </div>*@
</div> </div>
</div> </div>
<div class="col-xl-6"> <div class="col-xl-6">
@ -251,16 +253,30 @@
<label id="TPC_sell_deadline_text" class="color-info-600"></label> <label id="TPC_sell_deadline_text" class="color-info-600"></label>
</div> </div>
</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"> <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"> <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> </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" 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"> <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> </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">
@ -269,6 +285,38 @@
<label id="TPC_sell_electricity_at_text" class="color-info-600"></label> <label id="TPC_sell_electricity_at_text" class="color-info-600"></label>
</div> </div>
</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>
<div class="row d-flex justify-content-end px-5"> <div class="row d-flex justify-content-end px-5">
<div class="col-xl-6 mb-3 row justify-content-end align-items-center"> <div class="col-xl-6 mb-3 row justify-content-end align-items-center">

View File

@ -614,7 +614,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '" checked>' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }
@ -624,7 +624,7 @@
'<div class="mr-2">' + '<div class="mr-2">' +
'<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' + '<input type="checkbox" class="" name="selectedInverterLayer2[]" value="' + inverter.powerStationId + '" valueName ="' + inverter.powerStationName + '">' +
'</div>' + '</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>' + '</div>' +
'</li>'; '</li>';
} }