368 lines
13 KiB
C#
368 lines
13 KiB
C#
using Microsoft.AspNetCore.Http;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SolarPower.Models.PowerStation
|
|
{
|
|
public class PowerStation : Created
|
|
{
|
|
private string electricityMeterAt = "", tpcContractAt = "", tpcPurchaseElectricityAt = "", tpcSellElectricityAt = "";
|
|
|
|
public int Id { get; set; }
|
|
public int CompanyId { get; set; }
|
|
public int CityId { get; set; } //縣市
|
|
public int AreaId { get; set; } //地區
|
|
public string Address { get; set; } //地址
|
|
public string Name { get; set; } //名稱
|
|
public string Code { get; set; } //電站代碼
|
|
public string SerialNumber { get; set; } //四碼流水號
|
|
public byte IsEscrow { get; set; } //是否被代管
|
|
public string EscrowName { get; set; } //被代管公司
|
|
public string ElectricityMeterAt //台電掛錶日
|
|
{
|
|
get
|
|
{
|
|
if (!string.IsNullOrEmpty(electricityMeterAt))
|
|
{
|
|
return Convert.ToDateTime(electricityMeterAt).ToString("yyyy-MM-dd");
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
set { electricityMeterAt = value; }
|
|
}
|
|
public int EstimatedRecoveryTime { get; set; } //預計回收年限
|
|
public double GeneratingCapacity { get; set; } //發電容量
|
|
public double PowerRate { get; set; } //授電費率
|
|
public string Coordinate { get; set; } //座標
|
|
public string InverterBrand { get; set; } //逆變器廠牌
|
|
public string InverterProductModel { get; set; } //逆變器型號
|
|
public int InverterAmount { get; set; } //逆變器數量
|
|
public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
|
|
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
|
|
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
|
|
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
|
|
public string BoEFileName { get; set; } //能源局原檔案名
|
|
public string BoEFile { get; set; } //能源局檔案
|
|
public int BoEDiscountRate { get; set; } //能源局折扣率
|
|
public string BoEDeviceRegisterNumber { get; set; } //能源局設備登記編號
|
|
public int BoERentRatio { get; set; } //能源局租金比例
|
|
public string TPCContractNumber { get; set; } //台電契約編號
|
|
public string TPCContractAt //台電簽約日期
|
|
{
|
|
get
|
|
{
|
|
if (!string.IsNullOrEmpty(tpcContractAt))
|
|
{
|
|
return Convert.ToDateTime(tpcContractAt).ToString("yyyy-MM-dd");
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
set { tpcContractAt = value; }
|
|
}
|
|
public int TPCSellDeadline { get; set; } //台電售電期限(年)
|
|
public int TPCMeterReading { get; set; } //台電每期抄錶日
|
|
public string TPCPurchaseElectricityAt //台電正式購電日
|
|
{
|
|
get
|
|
{
|
|
if (!string.IsNullOrEmpty(tpcPurchaseElectricityAt))
|
|
{
|
|
return Convert.ToDateTime(tpcPurchaseElectricityAt).ToString("yyyy-MM-dd");
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
set { tpcPurchaseElectricityAt = value; }
|
|
}
|
|
public string TPCSellElectricityAt //台電正式售電日
|
|
{
|
|
get
|
|
{
|
|
if (!string.IsNullOrEmpty(tpcPurchaseElectricityAt))
|
|
{
|
|
return Convert.ToDateTime(tpcPurchaseElectricityAt).ToString("yyyy-MM-dd");
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
set { tpcPurchaseElectricityAt = value; }
|
|
}
|
|
public List<LandBuilding> LandBuildings { get; set; } //土地房屋資料
|
|
public string CreatorName { get; set; } //創建者名稱
|
|
}
|
|
|
|
public class LandBuilding : Created
|
|
{
|
|
private string leaseNotarizationAt;
|
|
|
|
public int Id { get; set; }
|
|
public int PowerStationId { get; set; }
|
|
public string Address { get; set; }
|
|
public string LeaseNotarizationAt //租約公證日期
|
|
{
|
|
get
|
|
{
|
|
if (!string.IsNullOrEmpty(leaseNotarizationAt))
|
|
{
|
|
return Convert.ToDateTime(leaseNotarizationAt).ToString("yyyy-MM-dd");
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
set { leaseNotarizationAt = value; }
|
|
}
|
|
public string Landowner { get; set; } //地主姓名
|
|
public string Purpose { get; set; } //房屋用途
|
|
public int LeaseRate { get; set; } //租金比例
|
|
public string Coordinate { get; set; } //經緯度
|
|
public string Phone { get; set; } //電話
|
|
public string CreatorName { get; set; } //創建者名稱
|
|
|
|
}
|
|
|
|
public class PostPowerStationInfo
|
|
{
|
|
public int Id { get; set; }
|
|
public int CityId { get; set; } //縣市
|
|
public int AreaId { get; set; } //地區
|
|
public string Address { get; set; } //地址
|
|
public string Name { get; set; } //名稱
|
|
//public string Code { get; set; }
|
|
public byte IsEscrow { get; set; } //是否被代管
|
|
public string EscrowName { get; set; } //被代管公司
|
|
public string ElectricityMeterAt { get; set; } //台電掛錶日
|
|
public int EstimatedRecoveryTime { get; set; } //預計回收年限
|
|
public double GeneratingCapacity { get; set; } //發電容量
|
|
public double PowerRate { get; set; } //授電費率
|
|
public string Coordinate { get; set; } //座標
|
|
public string InverterBrand { get; set; } //逆變器廠牌
|
|
public string InverterProductModel { get; set; } //逆變器型號
|
|
public int InverterAmount { get; set; } //逆變器數量
|
|
public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
|
|
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
|
|
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
|
|
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
|
|
}
|
|
|
|
public class UpdatePowerStationInfo : Updated
|
|
{
|
|
public int CityId { get; set; } //縣市
|
|
public int AreaId { get; set; } //地區
|
|
public string Address { get; set; } //地址
|
|
public string Name { get; set; } //名稱
|
|
public byte IsEscrow { get; set; } //是否被代管
|
|
public string EscrowName { get; set; } //被代管公司
|
|
public string ElectricityMeterAt { get; set; } //台電掛錶日
|
|
public int EstimatedRecoveryTime { get; set; } //預計回收年限
|
|
public double GeneratingCapacity { get; set; } //發電容量
|
|
public double PowerRate { get; set; } //授電費率
|
|
public string Coordinate { get; set; } //座標
|
|
public string InverterBrand { get; set; } //逆變器廠牌
|
|
public string InverterProductModel { get; set; } //逆變器型號
|
|
public int InverterAmount { get; set; } //逆變器數量
|
|
public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
|
|
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
|
|
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
|
|
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
|
|
}
|
|
|
|
public class PostBoETPCInfo
|
|
{
|
|
public int Id { get; set; }
|
|
public IFormFile BoEFile { get; set; }
|
|
public int BoEDiscountRate { get; set; }
|
|
public string BoEDeviceRegisterNumber { get; set; }
|
|
public int BoERentRatio { get; set; }
|
|
public string TPCContractNumber { get; set; }
|
|
public string TPCContractAt { get; set; }
|
|
public int TPCSellDeadline { get; set; }
|
|
public int TPCMeterReading { get; set; }
|
|
public string TPCPurchaseElectricityAt { get; set; }
|
|
public string TPCSellElectricityAt { get; set; }
|
|
}
|
|
|
|
public class UpdateBoETPCInfo : Updated
|
|
{
|
|
public string BoEFileName { get; set; }
|
|
public string BoEFile { get; set; }
|
|
public int BoEDiscountRate { get; set; }
|
|
public string BoEDeviceRegisterNumber { get; set; }
|
|
public int BoERentRatio { get; set; }
|
|
public string TPCContractNumber { get; set; }
|
|
public string TPCContractAt { get; set; }
|
|
public int TPCSellDeadline { get; set; }
|
|
public int TPCMeterReading { get; set; }
|
|
public string TPCPurchaseElectricityAt { get; set; }
|
|
public string TPCSellElectricityAt { get; set; }
|
|
}
|
|
|
|
public class PostLandBuildingInfo
|
|
{
|
|
public int Id { get; set; }
|
|
public int PowerStationId { get; set; }
|
|
public string Address { get; set; }
|
|
public string LeaseNotarizationAt { get; set; }
|
|
public string Landowner { get; set; }
|
|
public string Purpose { get; set; }
|
|
public int LeaseRate { get; set; }
|
|
public string Coordinate { get; set; }
|
|
public string Phone { get; set; }
|
|
}
|
|
|
|
public class UpdateLandBuilding : Updated
|
|
{
|
|
public string Address { get; set; }
|
|
public string LeaseNotarizationAt { get; set; }
|
|
public string Landowner { get; set; }
|
|
public string Purpose { get; set; }
|
|
public int LeaseRate { get; set; }
|
|
public string Coordinate { get; set; }
|
|
public string Phone { get; set; }
|
|
}
|
|
|
|
public class CitySelectItemList
|
|
{
|
|
public string Text { get; set; }
|
|
public string Value { get; set; }
|
|
}
|
|
|
|
public class AreaSelectItemList
|
|
{
|
|
public string Text { get; set; }
|
|
public string Value { get; set; }
|
|
}
|
|
|
|
public class Zipcode
|
|
{
|
|
public string City { get; set; }
|
|
public string Area { get; set; }
|
|
}
|
|
|
|
public class City
|
|
{
|
|
public int Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string ZipCode { get; set; }
|
|
public int Priority { get; set; }
|
|
}
|
|
|
|
public class Area
|
|
{
|
|
public int Id { get; set; }
|
|
public int CityId { get; set; }
|
|
public string Name { get; set; }
|
|
public string ZipCode { get; set; }
|
|
}
|
|
|
|
|
|
public class OperationInfo : Created
|
|
{
|
|
public int Id { get; set; }
|
|
public int PowerStationId { get; set; }//電廠id
|
|
public int Type { get; set; }//廠商類別
|
|
public string Name { get; set; }//名稱
|
|
public string ContactPerson { get; set; }//聯絡人
|
|
public string Phone { get; set; }//電話
|
|
public string Email { get; set; }//Email
|
|
}
|
|
public class OperationStationId
|
|
{
|
|
public int stationId { get; set; }
|
|
}
|
|
public class OperationTable : OperationInfo
|
|
{
|
|
public string CreatedName { get; set; }//建立者名稱
|
|
public string Function { get; set; }//功能
|
|
public string TypeName { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 設備裝置下拉選單
|
|
/// </summary>
|
|
public class Type
|
|
{
|
|
public string Name { get; set; }
|
|
public string EName { get; set; }
|
|
}
|
|
public class Root
|
|
{
|
|
public List<Type> Type { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 表Variable 取來解析
|
|
/// </summary>
|
|
public class Variable
|
|
{
|
|
public string name { get; set; }
|
|
public string value { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 設備
|
|
/// </summary>
|
|
public class DeviceInfo
|
|
{
|
|
public int Id { get; set; }
|
|
public int PowerStationId { get; set; }//所屬電站編號
|
|
public string Name { get; set; }//名稱
|
|
public string Type { get; set; }//類型
|
|
public string Brand { get; set; }//廠牌
|
|
public string ProductModel { get; set; }//型號
|
|
public string DBName { get; set; }
|
|
public string TableName { get; set; }
|
|
public string ColName { get; set; }
|
|
public string Remark { get; set; }
|
|
public string TypeName { get; set; }//類型名稱
|
|
}
|
|
public class Device : DeviceInfo
|
|
{
|
|
public string UID { get; set; }//設備編號
|
|
public int CreatedBy { get; set; }//建立者
|
|
public string SerialNumber { get; set; }
|
|
}
|
|
/// <summary>
|
|
///設備dataTable
|
|
/// </summary>
|
|
public class DeviceTable : DeviceInfo
|
|
{
|
|
public string UID { get; set; }//設備編號
|
|
public string Function { get; set; }//功能
|
|
}
|
|
/// <summary>
|
|
/// 異常modal
|
|
/// </summary>
|
|
public class ExceptionModal : Created
|
|
{
|
|
public int Id { get; set; }
|
|
public int PowerStationId { get; set; }
|
|
public byte Type { get; set; }
|
|
public decimal UpperLimit { get; set; }
|
|
public decimal LowerLimit { get; set; }
|
|
public byte Alarm { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 異常設定Table
|
|
/// </summary>
|
|
public class ExceptionTable : ExceptionModal
|
|
{
|
|
public string PowerStationName { get; set; }
|
|
public string PowerStationCode { get; set; }
|
|
public string Function { get; set; }//功能
|
|
public string TypeName { get; set; }
|
|
public string AlarmName { get; set; }
|
|
}
|
|
|
|
}
|