This commit is contained in:
桂任 林 2021-06-17 23:16:52 +08:00
commit 8036c92564
21 changed files with 3299 additions and 395 deletions

View File

@ -9,6 +9,7 @@ using SolarPower.Repository.Interface;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@ -18,6 +19,8 @@ namespace SolarPower.Controllers
{
private readonly IUserRepository userRepository;
private readonly IPowerStationRepository powerStationRepository;
private string boeFilePath = "/upload/power_station/boe_file/";
private string powerSationSaveAsPath = "";
public PowerStationController(
IUserRepository userRepository,
@ -25,6 +28,8 @@ namespace SolarPower.Controllers
{
this.userRepository = userRepository;
this.powerStationRepository = powerStationRepository;
powerSationSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "power_station");
}
public IActionResult Index()
{
@ -67,6 +72,76 @@ namespace SolarPower.Controllers
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
/// <summary>
/// 取裝置類型下拉選單
/// </summary>
/// <returns></returns>
public async Task<ApiResult<List<UserSelectItemList>>> GetDeviceTypeSelectOptionList()
{
ApiResult<List<UserSelectItemList>> apiResult = new ApiResult<List<UserSelectItemList>>();
try
{
var userSelectItemLists = await powerStationRepository.DeviceType();
apiResult.Code = "0000";
apiResult.Data = userSelectItemLists;
}
catch (Exception exception)
{
apiResult.Code = "9999";
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
/// <summary>
/// 取得縣市選單
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<ApiResult<List<CitySelectItemList>>> GetCitySelectOptionList()
{
ApiResult<List<CitySelectItemList>> apiResult = new ApiResult<List<CitySelectItemList>>();
try
{
var citySelectItemLists = await powerStationRepository.GetCitySelectOptionListAsync();
apiResult.Code = "0000";
apiResult.Data = citySelectItemLists;
}
catch (Exception exception)
{
apiResult.Code = "9999";
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
/// <summary>
/// 取得縣市選單
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<ApiResult<List<AreaSelectItemList>>> GetAreaSelectOptionList(int cityId)
{
ApiResult<List<AreaSelectItemList>> apiResult = new ApiResult<List<AreaSelectItemList>>();
try
{
var areaSelectItemLists = await powerStationRepository.GetAreaSelectOptionListAsync(cityId);
apiResult.Code = "0000";
apiResult.Data = areaSelectItemLists;
}
catch (Exception exception)
{
apiResult.Code = "9999";
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
/// <summary>
/// 取得單一電站基本資料
@ -90,13 +165,19 @@ namespace SolarPower.Controllers
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
else if (powerStation.Id != myUser.CompanyId)
else if (powerStation.CompanyId != myUser.CompanyId)
{
apiResult.Code = "9993";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
//替能源局換檔案路徑
if (!string.IsNullOrEmpty(powerStation.BoEFile))
{
powerStation.BoEFile = boeFilePath + powerStation.BoEFile;
}
apiResult.Code = "0000";
apiResult.Data = powerStation;
@ -117,9 +198,9 @@ namespace SolarPower.Controllers
/// </summary>
/// <param name="post"></param>
/// <returns></returns>
public async Task<ApiResult<string>> SavePowerStationInfo(PostPowerStationInfo post)
public async Task<ApiResult<PowerStation>> SavePowerStationInfo(PostPowerStationInfo post)
{
ApiResult<string> apiResult = new ApiResult<string>();
ApiResult<PowerStation> apiResult = new ApiResult<PowerStation>();
PowerStation powerStation = null;
@ -137,12 +218,32 @@ namespace SolarPower.Controllers
}
#region
powerStation = new PowerStation() {
//取得電站該縣市的Zipcode
var zipcode = await powerStationRepository.GetCityAreaZipcodeAsync(post.AreaId);
//取得電站該縣市地區最後流水號
var lastSerialNumber = await powerStationRepository.GetLastSerialNumberByCityAreaIdAsync(post.CityId, post.AreaId);
var tempSerialNumber = 0;
if (!string.IsNullOrEmpty(lastSerialNumber))
{
tempSerialNumber = Convert.ToInt32(lastSerialNumber) + 1;
}
else
{
tempSerialNumber = 1;
}
var codeFormat = "{0}-{1}-{2}";
powerStation = new PowerStation()
{
CompanyId = myUser.CompanyId,
CityId = post.CityId,
AreaId = post.AreaId,
Address = post.Address,
Name = post.Name,
Code = String.Format(codeFormat, zipcode.City, zipcode.Area, tempSerialNumber.ToString().PadLeft(4, '0')),
SerialNumber = tempSerialNumber.ToString().PadLeft(4, '0'),
IsEscrow = post.IsEscrow,
EscrowName = post.EscrowName,
ElectricityMeterAt = post.ElectricityMeterAt,
@ -167,6 +268,8 @@ namespace SolarPower.Controllers
"AreaId",
"Address",
"Name",
"Code",
"SerialNumber",
"IsEscrow",
"EscrowName",
"ElectricityMeterAt",
@ -181,12 +284,35 @@ namespace SolarPower.Controllers
"PhotovoltaicPanelProductModel",
"PhotovoltaicPanelSpecification",
"PhotovoltaicPanelAmount",
"CreatedBy",
"CreatedBy"
};
var id = await powerStationRepository.AddOneAsync(powerStation, properties);
apiResult.Data = id.ToString();
#region
var city = await powerStationRepository.GetOneCityByIdAsync(post.CityId);
var area = await powerStationRepository.GetOneAreaByIdAsync(post.AreaId);
LandBuilding landBuilding = new LandBuilding()
{
Address = city.Name + area.Name + post.Address,
PowerStationId = id,
CreatedBy = myUser.Id
};
List<string> landBuildingProperties = new List<string>()
{
"Address",
"PowerStationId",
"CreatedBy",
"CreatedBy"
};
await powerStationRepository.AddOneLandBuildingInfo(landBuilding, landBuildingProperties);
#endregion
apiResult.Code = "0000";
apiResult.Msg = "儲存成功";
apiResult.Data = await powerStationRepository.GetOneAsync(id);
#endregion
}
else
@ -198,13 +324,175 @@ namespace SolarPower.Controllers
return apiResult;
}
#region
UpdatePowerStationInfo update = new UpdatePowerStationInfo()
{
Id = post.Id,
CityId = post.CityId,
AreaId = post.AreaId,
Address = post.Address,
Name = post.Name,
IsEscrow = post.IsEscrow,
EscrowName = post.EscrowName,
ElectricityMeterAt = post.ElectricityMeterAt,
EstimatedRecoveryTime = post.EstimatedRecoveryTime,
GeneratingCapacity = post.GeneratingCapacity,
PowerRate = post.PowerRate,
Coordinate = post.Coordinate,
InverterBrand = post.InverterBrand,
InverterProductModel = post.InverterProductModel,
InverterAmount = post.InverterAmount,
PhotovoltaicPanelBrand = post.PhotovoltaicPanelBrand,
PhotovoltaicPanelProductModel = post.PhotovoltaicPanelProductModel,
PhotovoltaicPanelSpecification = post.PhotovoltaicPanelSpecification,
PhotovoltaicPanelAmount = post.PhotovoltaicPanelAmount,
UpdatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"Id",
"CityId",
"AreaId",
"Address",
"Name",
"IsEscrow",
"EscrowName",
"ElectricityMeterAt",
"EstimatedRecoveryTime",
"GeneratingCapacity",
"PowerRate",
"Coordinate",
"InverterBrand",
"InverterProductModel",
"InverterAmount",
"PhotovoltaicPanelBrand",
"PhotovoltaicPanelProductModel",
"PhotovoltaicPanelSpecification",
"PhotovoltaicPanelAmount",
"UpdatedBy",
};
await powerStationRepository.UpdatePowerStationInfo(update, properties);
apiResult.Code = "0000";
apiResult.Msg = "儲存成功";
apiResult.Data = await powerStationRepository.GetOneAsync(powerStation.Id);
#endregion
}
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = errorCode.GetString(apiResult.Code);
string json = System.Text.Json.JsonSerializer.Serialize(post);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + json);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
/// <summary>
/// 新增 / 修改 能源局與台電資料
/// </summary>
/// <param name="post"></param>
/// <returns></returns>
[HttpPost]
public async Task<ApiResult<PowerStation>> SaveBoETPCInfo([FromForm] PostBoETPCInfo post)
{
ApiResult<PowerStation> apiResult = new ApiResult<PowerStation>();
PowerStation powerStation = null;
try
{
powerStation = await powerStationRepository.GetOneAsync(post.Id);
if (powerStation == null)
{
if (post.Id != 0)
{
apiResult.Code = "9992";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
}
else
{
if (powerStation.CompanyId != myUser.CompanyId)
{
apiResult.Code = "9993";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
#region
//處理檔案
var boeFileName = "";
if (post.BoEFile != null)
{
var split = post.BoEFile.FileName.Split(".");
boeFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + "." + split[split.Length - 1];
var fullPath = Path.Combine(powerSationSaveAsPath, "boe_file", boeFileName);
using (var stream = new FileStream(fullPath, FileMode.Create))
{
post.BoEFile.CopyTo(stream);
}
}
UpdateBoETPCInfo update = new UpdateBoETPCInfo()
{
Id = post.Id,
BoEFileName = post.BoEFile != null ? post.BoEFile.FileName : null, //原本檔名
BoEFile = boeFileName, //自訂檔名
BoEDiscountRate = post.BoEDiscountRate,
BoEDeviceRegisterNumber = post.BoEDeviceRegisterNumber,
BoERentRatio = post.BoERentRatio,
TPCContractNumber = post.TPCContractNumber,
TPCContractAt = post.TPCContractAt,
TPCSellDeadline = post.TPCSellDeadline,
TPCMeterReading = post.TPCMeterReading,
TPCPurchaseElectricityAt = post.TPCPurchaseElectricityAt,
TPCSellElectricityAt = post.TPCSellElectricityAt,
UpdatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"Id",
"BoEFileName",
"BoEFile",
"BoEDiscountRate",
"BoEDeviceRegisterNumber",
"BoERentRatio",
"TPCContractNumber",
"TPCContractAt",
"TPCSellDeadline",
"TPCMeterReading",
"TPCPurchaseElectricityAt",
"TPCSellElectricityAt",
"UpdatedBy",
};
await powerStationRepository.UpdateBoETPCInfo(update, properties);
#endregion
}
powerStation = await powerStationRepository.GetOneAsync(powerStation.Id);
//替能源局換檔案路徑
if (!string.IsNullOrEmpty(powerStation.BoEFile))
{
powerStation.BoEFile = boeFilePath + powerStation.BoEFile;
}
apiResult.Code = "0000";
apiResult.Msg = "修改成功";
apiResult.Data = powerStation;
}
catch (Exception exception)
{
@ -216,5 +504,479 @@ namespace SolarPower.Controllers
return apiResult;
}
/// <summary>
/// 新增 / 修改 土地與房屋資料
/// </summary>
/// <param name="post"></param>
/// <returns></returns>
public async Task<ApiResult<PowerStation>> SaveLandBuildingInfo(PostLandBuildingInfo post)
{
ApiResult<PowerStation> apiResult = new ApiResult<PowerStation>();
PowerStation powerStation = null;
LandBuilding landBuilding = null;
try
{
powerStation = await powerStationRepository.GetOneAsync(post.PowerStationId);
if (powerStation == null)
{
if (post.PowerStationId != 0)
{
apiResult.Code = "9992";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
}
else
{
if (powerStation.CompanyId != myUser.CompanyId)
{
apiResult.Code = "9993";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
landBuilding = await powerStationRepository.GetOneLandBuildingInfo(post.Id);
if (landBuilding == null)
{
if (post.Id != 0)
{
apiResult.Code = "9991";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
#region
//取得公司在該縣市區域當前電站的流水編碼
landBuilding = new LandBuilding()
{
PowerStationId = powerStation.Id,
Address = post.Address,
LeaseNotarizationAt = post.LeaseNotarizationAt,
Landowner = post.Landowner,
Purpose = post.Purpose,
LeaseRate = post.LeaseRate,
Coordinate = post.Coordinate,
Phone = post.Phone,
CreatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"PowerStationId",
"Address",
"LeaseNotarizationAt",
"Landowner",
"Purpose",
"LeaseRate",
"Coordinate",
"Phone",
"CreatedBy"
};
var id = await powerStationRepository.AddOneLandBuildingInfo(landBuilding, properties);
apiResult.Code = "0000";
apiResult.Msg = "儲存成功";
apiResult.Data = await powerStationRepository.GetOneAsync(powerStation.Id);
#endregion
}
else
{
#region
UpdateLandBuilding update = new UpdateLandBuilding()
{
Id = post.Id,
Address = post.Address,
LeaseNotarizationAt = post.LeaseNotarizationAt,
Landowner = post.Landowner,
Purpose = post.Purpose,
LeaseRate = post.LeaseRate,
Coordinate = post.Coordinate,
Phone = post.Phone,
UpdatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"Id",
"Address",
"LeaseNotarizationAt",
"Landowner",
"Purpose",
"LeaseRate",
"Coordinate",
"Phone",
"UpdatedBy",
};
await powerStationRepository.UpdateLandBuildingInfo(update, properties);
apiResult.Code = "0000";
apiResult.Msg = "修改成功";
apiResult.Data = await powerStationRepository.GetOneAsync(powerStation.Id);
#endregion
}
}
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = errorCode.GetString(apiResult.Code);
string json = System.Text.Json.JsonSerializer.Serialize(post);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + json);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
/// <summary>
/// 新增/修改 運維資料
/// </summary>
/// <param name="post"></param>
/// <returns></returns>
public async Task<ApiResult<string>> SaveOperation(OperationInfo post)
{
ApiResult<string> apiResult = new ApiResult<string>();
try
{
if (post.Id == 0)
{
OperationInfo operation = new OperationInfo()
{
Id = post.Id,
Email = post.Email,
Name = post.Name,
Phone = post.Phone,
CreatedBy = myUser.Id,
ContactPerson = post.ContactPerson,
PowerStationId = post.PowerStationId,
Type = post.Type
};
List<string> properties = new List<string>()
{
"Id",
"Email",
"Name",
"Phone",
"CreatedBy",
"ContactPerson",
"PowerStationId",
"Type"
};
await powerStationRepository.AddOperation(operation, properties);
apiResult.Code = "0000";
apiResult.Msg = "新增成功";
}
else
{
OperationInfo operation = new OperationInfo()
{
Id = post.Id,
Email = post.Email,
Name = post.Name,
Phone = post.Phone,
CreatedBy = myUser.Id,
ContactPerson = post.ContactPerson,
PowerStationId = post.PowerStationId,
Type = post.Type
};
List<string> properties = new List<string>()
{
"Id",
"Email",
"Name",
"Phone",
"CreatedBy",
"ContactPerson",
"PowerStationId",
"Type"
};
await powerStationRepository.UpdateOperation(operation, properties);
apiResult.Code = "0000";
apiResult.Msg = "儲存成功";
}
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = exception.ToString();
}
return apiResult;
}
/// <summary>
/// 運維資料DataTable
/// </summary>
/// <param name="stationId"></param>
/// <returns></returns>
public async Task<ActionResult> OperationTable(int stationId)
{
List<OperationTable> operationTable = new List<OperationTable>();
ApiResult<List<OperationTable>> apiResult = new ApiResult<List<OperationTable>>();
try
{
apiResult.Code = "0000";
operationTable = await powerStationRepository.OperationTable(stationId);
foreach(OperationTable a in operationTable)
{
a.Function = @"
<button type='button' class='btn btn-primary btn-pills waves-effect waves-themed edit-btn'></button>
<button type='button' class='btn btn-danger btn-pills waves-effect waves-themed del-btn'></button>";
if (a.Type == 0)
{
a.TypeName = "施工";
}
else if(a.Type == 1)
{
a.TypeName = "清洗";
}
else if (a.Type == 2)
{
a.TypeName = "運維";
}
}
apiResult.Data = operationTable;
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = exception.ToString();
}
var result = Json(new
{
data = apiResult
});
return result;
}
/// <summary>
/// 取得一筆 運維 資料
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<ApiResult<OperationInfo>> GetOneOperation(int id)
{
OperationInfo operation = new OperationInfo();
ApiResult<OperationInfo> apiResult = new ApiResult<OperationInfo>();
try
{
apiResult.Code = "0000";
operation = await powerStationRepository.OneOperationInfo(id);
apiResult.Data = operation;
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = exception.ToString();
}
return apiResult;
}
/// <summary>
/// 刪除 運維 資料
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<ApiResult<string>> DeleteOneOperation(int id)
{
ApiResult<string> apiResult = new ApiResult<string>();
OperationInfo operation = new OperationInfo();
try
{
operation = await powerStationRepository.OneOperationInfo(id);
if (operation == null)
{
apiResult.Code = "9996";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
await powerStationRepository.DeleteOneOtherTable(operation.Id, "operation_firm");
apiResult.Code = "0000";
apiResult.Msg = "刪除成功";
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = errorCode.GetString(apiResult.Code);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + "Id=" + id);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
/// <summary>
/// 新增 / 修改 裝置資料
/// </summary>
/// <param name="Device"></param>
/// <returns></returns>
public async Task<ApiResult<string>> SaveDevice(DeviceInfo Device)
{
ApiResult<string> apiResult = new ApiResult<string>();
try
{
if (Device.Id == 0)
{
Device DeviceInfo = new Device()
{
Brand = Device.Brand,
ColName = Device.ColName,
PowerStationId = Device.PowerStationId,
DBName = Device.DBName,
Id = Device.Id,
Name = Device.Name,
ProductModel = Device.ProductModel,
Remark = Device.Remark,
TableName = Device.TableName,
Type = Device.Type,
UID = Device.PowerStationId + "-" + Device.Type,
CreatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"Brand",
"ColName",
"PowerStationId",
"DBName",
"Id",
"Name",
"ProductModel",
"Remark",
"TableName",
"Type",
"UID",
"CreatedBy"
};
await powerStationRepository.AddDevice(DeviceInfo,properties);
apiResult.Code = "0000";
apiResult.Msg = "新增成功";
}
else
{
Device DeviceInfo = new Device()
{
Brand = Device.Brand,
ColName = Device.ColName,
PowerStationId = Device.PowerStationId,
DBName = Device.DBName,
Id = Device.Id,
Name = Device.Name,
ProductModel = Device.ProductModel,
Remark = Device.Remark,
TableName = Device.TableName,
Type = Device.Type,
UID = Device.PowerStationId + "-" + Device.Type,
CreatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"Brand",
"ColName",
"PowerStationId",
"DBName",
"Id",
"Name",
"ProductModel",
"Remark",
"TableName",
"Type",
"UID",
"CreatedBy"
};
await powerStationRepository.UpdateDevice(DeviceInfo, properties);
apiResult.Code = "0000";
apiResult.Msg = "儲存成功";
}
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = exception.ToString();
}
return apiResult;
}
public async Task<ActionResult> DeviceTable(int stationId)
{
List<DeviceTable> deviceTables = new List<DeviceTable>();
ApiResult<List<DeviceTable>> apiResult = new ApiResult<List<DeviceTable>>();
try
{
apiResult.Code = "0000";
deviceTables = await powerStationRepository.DeviceTable(stationId);
foreach (DeviceTable a in deviceTables)
{
a.Function = @"
<button type='button' class='btn btn-primary btn-pills waves-effect waves-themed edit-btn'></button>
<button type='button' class='btn btn-danger btn-pills waves-effect waves-themed del-btn'></button>";
}
apiResult.Data = deviceTables;
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = exception.ToString();
}
var result = Json(new
{
data = apiResult
});
return result;
}
/// <summary>
/// 軟刪除單一土地房屋資訊
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
public async Task<ApiResult<PowerStation>> DeleteLandBuildingInfo(int id)
{
ApiResult<PowerStation> apiResult = new ApiResult<PowerStation>();
LandBuilding landBuilding;
try
{
landBuilding = await powerStationRepository.GetOneLandBuildingInfo(id);
if (landBuilding == null)
{
apiResult.Code = "9996";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
await powerStationRepository.DeleteOneLandBuildingInfo(landBuilding.Id);
apiResult.Code = "0000";
apiResult.Msg = "刪除成功";
apiResult.Data = await powerStationRepository.GetOneAsync(landBuilding.PowerStationId);
}
catch (Exception exception)
{
apiResult.Code = "9999";
apiResult.Msg = errorCode.GetString(apiResult.Code);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + "Id=" + id);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
}
}

View File

@ -17,6 +17,7 @@ namespace SolarPower.Models
{
{ "0000", "OK" },
{ "0001", "傳入參數錯誤。" },
{ "9991", "查無該土地房屋資訊"},
{ "9992", "查無該電站資訊"},
{ "9993", "無此權限操作"},
{ "9994", "查無該公司角色"},

View File

@ -1,4 +1,5 @@
using System;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -7,16 +8,33 @@ 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 Code { get; set; } //電站代碼
public string SerialNumber { get; set; } //四碼流水號
public byte IsEscrow { get; set; } //是否被代管
public string EscrowName { get; set; } //被代管公司
public string ElectricityMeterAt { 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; } //授電費率
@ -28,30 +46,91 @@ namespace SolarPower.Models.PowerStation
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; 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 string TPCPurchaseElectricityAt { get; set; } //台電正式購電日
public string TPCSellElectricityAt { 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; 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; } //創建者名稱
}
@ -78,4 +157,179 @@ namespace SolarPower.Models.PowerStation
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; }
}
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 class Device : DeviceInfo
{
public string UID { get; set; }//設備編號
public int CreatedBy { get; set; }//建立者
}
public class DeviceTable : DeviceInfo
{
public string UID { get; set; }//設備編號
public string Function { get; set; }//功能
}
}

View File

@ -186,101 +186,58 @@ namespace SolarPower.Models
/// 回傳結果
/// </summary>
/// <typeparam name="T">資料型別</typeparam>
public class ApiResult<S1>
public class ApiResult<T>
{
public string Code { get; set; }
public string Msg { get; set; }
public S1 Data { get; set; }
public T Data { get; set; }
}
public class DapperConnection
/// <summary>
/// 資料夾
/// </summary>
public class FolderFunction
{
/// <summary>
/// 新增SQL字串
/// 創建資料夾
/// </summary>
/// <param name="TableName">Table名稱</param>
/// <param name="TableValue">Add新增欄位名稱</param>
/// <returns></returns>
//public string InsertQueryTxt(string TableName, List<string> TableValue)
//{
// var sqlId = "";
// var sqlValue = "";
/// <param name="folderPath"></param>
/// <param name="tempType">0:找到資料夾也不刪除 1:找到資料夾並且刪除</param>
public void CreateFolder(string folderPath, int type)
{
DirectoryInfo dInfo = new DirectoryInfo(folderPath);
// foreach (var value in TableValue)
// {
// sqlId += value + ",";
// sqlValue += "@" + value + ",";
// }
if (dInfo.Exists) //找到
{
if (type == 1)
{
dInfo.Delete(true); //如果資料夾裡面有檔案給bool參數就可以直接刪除沒給bool參數會報錯誤
}
// var connTxt = "INSERT INTO " + TableName + "(" + sqlId.Substring(0, sqlId.Length - 1) + ") VALUES" + "(" + sqlValue.Substring(0, sqlValue.Length - 1) + ");";
// return connTxt;
//}
dInfo.Create();
}
else //沒找到
{
dInfo.Create(); //建立新的資料夾
}
}
/// <summary>
/// 修改SQL字串
/// 刪除檔案
/// </summary>
/// <param name="TableName">Table名稱</param>
/// <param name="TableValue">Update變動欄位名稱</param>
/// <param name="sWhere">where條件</param>
/// <returns></returns>
//public string UpdateQueryTxt(string TableName, List<string> TableValue, string sWhere = "")
//{
// var sqlTxt = "";
// foreach (var value in TableValue)
// {
// sqlTxt += value + "=@" + value + ",";
// }
// var connTxt = "UPDATE " + TableName + " SET " + sqlTxt.Substring(0, sqlTxt.Length - 1);
// if (sWhere != "")
// {
// connTxt += " WHERE " + sWhere;
// }
// return connTxt;
//}
//private string GenerateInsertQuery()
//{
// var insertQuery = new StringBuilder($"INSERT INTO {_tableName} ");
// insertQuery.Append("(");
// var properties = GenerateListOfProperties(GetProperties);
// properties.ForEach(prop => { insertQuery.Append($"[{prop}],"); });
// insertQuery
// .Remove(insertQuery.Length - 1, 1)
// .Append(") VALUES (");
// properties.ForEach(prop => { insertQuery.Append($"@{prop},"); });
// insertQuery
// .Remove(insertQuery.Length - 1, 1)
// .Append(")");
// return insertQuery.ToString();
//}
//private string GenerateUpdateQuery()
//{
// var updateQuery = new StringBuilder($"UPDATE {_tableName} SET ");
// var properties = GenerateListOfProperties(GetProperties);
// properties.ForEach(property =>
// {
// if (!property.Equals("Id"))
// {
// updateQuery.Append($"{property}=@{property},");
// }
// });
// updateQuery.Remove(updateQuery.Length - 1, 1); //remove last comma
// updateQuery.Append(" WHERE Id=@Id");
// return updateQuery.ToString();
//}
/// <param name="filePath"></param>
public void DeleteFile(string filePath)
{
System.IO.FileInfo file = new System.IO.FileInfo(filePath);
if (File.Exists(filePath)) //找到
{
//do something
file.Delete();
}
else //沒找到
{
//do something
}
}
}
}

View File

@ -1,12 +1,15 @@
using Dapper;
using SolarPower.Helper;
using SolarPower.Models.PowerStation;
using SolarPower.Models.User;
using SolarPower.Repository.Interface;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
namespace SolarPower.Repository.Implement
{
@ -17,6 +20,159 @@ namespace SolarPower.Repository.Implement
tableName = "power_station";
}
/// <summary>
/// 查詢縣市列表
/// </summary>
/// <returns></returns>
public async Task<List<CitySelectItemList>> GetCitySelectOptionListAsync()
{
List<CitySelectItemList> result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = $"SELECT Id AS Value, Name AS Text FROM city";
result = (await conn.QueryAsync<CitySelectItemList>(sql)).ToList();
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 查詢縣市列表
/// </summary>
/// <param name="cityId"></param>
/// <returns></returns>
public async Task<List<AreaSelectItemList>> GetAreaSelectOptionListAsync(int cityId)
{
List<AreaSelectItemList> result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = $"SELECT Id AS Value, Name AS Text FROM Area WHERE CityId = @CityId";
result = (await conn.QueryAsync<AreaSelectItemList>(sql, new { CityId = cityId })).ToList();
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 透過編號取得,縣市資訊
/// </summary>
/// <param name="cityId"></param>
/// <returns></returns>
public async Task<City> GetOneCityByIdAsync(int cityId)
{
City result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = @$"SELECT * FROM city WHERE Id=@Id";
result = await conn.QueryFirstOrDefaultAsync<City>(sql, new { Id = cityId });
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 透過編號取得,地區資訊
/// </summary>
/// <param name="areaId"></param>
/// <returns></returns>
public async Task<Area> GetOneAreaByIdAsync(int areaId)
{
Area result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = @$"SELECT * FROM area WHERE Id=@Id";
result = await conn.QueryFirstOrDefaultAsync<Area>(sql, new { Id = areaId });
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 取得縣市地區代碼
/// </summary>
/// <param name="areaId"></param>
/// <returns></returns>
public async Task<Zipcode> GetCityAreaZipcodeAsync(int areaId)
{
Zipcode result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = @$"SELECT a.ZipCode AS Area, c.ZipCode AS City FROM area a
LEFT JOIN city c ON a.cityId = c.Id
WHERE a.Id = @AreaId";
result = await conn.QueryFirstOrDefaultAsync<Zipcode>(sql, new { AreaId = areaId });
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 透過縣市地區編號,取得該縣市地區最後的流水號
/// </summary>
/// <param name="cityId"></param>
/// <param name="areaId"></param>
/// <returns></returns>
public async Task<string> GetLastSerialNumberByCityAreaIdAsync(int cityId, int areaId)
{
string result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
try
{
var sql = @$"SELECT SerialNumber FROM {tableName}
WHERE CityId = @CityId && AreaId = @AreaId ORDER BY SerialNumber DESC";
result = await conn.QueryFirstOrDefaultAsync<string>(sql, new { CityId = cityId, AreaId = areaId });
}
catch (Exception exception)
{
throw exception;
}
return result;
}
}
/// <summary>
/// 透過電站編號,取得單一電站資訊(覆寫)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public override async Task<PowerStation> GetOneAsync(int id)
{
//base.GetOneAsync(id);
@ -27,13 +183,17 @@ namespace SolarPower.Repository.Implement
conn.Open();
try
{
var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0 AND Id = @Id";
var sql = @$"SELECT ps.*, u.Name AS CreatorName FROM {tableName} ps
LEFT JOIN user u ON ps.CreatedBy = u.Id
WHERE ps.Deleted = 0 AND ps.Id = @Id";
result = await conn.QueryFirstOrDefaultAsync<PowerStation>(sql, new { Id = id});
if(result!= null)
{
var sql_land_building = @"SELECT * FROM land_building WHERE Deleted = 0 AND PowerStationId = @PowerStationId";
var sql_land_building = @$"SELECT lb.*, u.Name AS CreatorName FROM land_building lb
LEFT JOIN user u ON lb.CreatedBy = u.Id
WHERE lb.Deleted = 0 AND PowerStationId = @PowerStationId";
result.LandBuildings = (await conn.QueryAsync<LandBuilding>(sql_land_building, new { PowerStationId = result.Id })).ToList();
}
}
@ -48,5 +208,438 @@ namespace SolarPower.Repository.Implement
return result;
}
}
/// <summary>
/// 修改電站基本資訊
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public async Task UpdatePowerStationInfo(UpdatePowerStationInfo entity, List<string> properties)
{
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
conn.Open();
using (var trans = conn.BeginTransaction())
{
try
{
var sql = GenerateUpdateQuery(properties);
await conn.ExecuteAsync(sql, entity, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
}
}
/// <summary>
/// 修改能源局與台電資訊
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public async Task UpdateBoETPCInfo(UpdateBoETPCInfo entity, List<string> properties)
{
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
conn.Open();
using (var trans = conn.BeginTransaction())
{
try
{
var sql = GenerateUpdateQuery(properties);
await conn.ExecuteAsync(sql, entity, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
}
}
/// <summary>
/// 新增 土地房屋資訊
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<LandBuilding> GetOneLandBuildingInfo(int id)
{
LandBuilding result;
using (IDbConnection conn = _databaseHelper.GetConnection())
{
conn.Open();
try
{
var sql = @"SELECT * FROM land_building WHERE Deleted =0 AND Id = @Id";
result = await conn.QueryFirstOrDefaultAsync<LandBuilding>(sql, new { Id = id });
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return result;
}
}
/// <summary>
/// 新增 土地房屋資訊
/// </summary>
/// <param name="entity"></param>
/// <param name="properties"></param>
/// <returns></returns>
public async Task<int> AddOneLandBuildingInfo(LandBuilding entity, List<string> properties)
{
int id;
using (IDbConnection conn = _databaseHelper.GetConnection())
{
conn.Open();
try
{
string sql = GenerateInsertQueryWithCustomTable(properties, "land_building");
sql += "SELECT LAST_INSERT_ID();";
id = (await conn.QueryAsync<int>(sql, entity)).Single();
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return id;
}
}
/// <summary>
/// 更新 土地房屋資訊
/// </summary>
/// <param name="entity"></param>
/// <param name="properties"></param>
/// <returns></returns>
public async Task UpdateLandBuildingInfo(UpdateLandBuilding entity, List<string> properties)
{
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
conn.Open();
using (var trans = conn.BeginTransaction())
{
try
{
var sql = GenerateUpdateQueryWithCustomTable(properties, "land_building");
await conn.ExecuteAsync(sql, entity, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
}
}
/// <summary>
/// 軟刪除土地房屋資訊
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task DeleteOneLandBuildingInfo(int id)
{
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
conn.Open();
using (var trans = conn.BeginTransaction())
{
try
{
var sql = $"UPDATE land_building SET deleted = 1 WHERE id = @Id";
await conn.ExecuteAsync(sql, new { Id = id }, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
}
}
public async Task<int> AddOperation(OperationInfo operation, List<string> properties)
{
using (IDbConnection conn = _databaseHelper.GetConnection())
{
int count;
conn.Open();
try
{
string sql = GenerateInsertQueryWithCustomTable(properties, "operation_firm");
count = await conn.ExecuteAsync(sql, operation);
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return count;
}
}
/// <summary>
/// 運維DataTable
/// </summary>
/// <param name="stationId"></param>
/// <returns></returns>
public async Task<List<OperationTable>> OperationTable (int stationId)
{
using (IDbConnection conn = _databaseHelper.GetConnection())
{
List<OperationTable> operation = new List<OperationTable>();
conn.Open();
try
{
string sql = @$"SELECT operation_firm.Name,
operation_firm.PowerStationId,
operation_firm.Id,operation_firm.ContactPerson,operation_firm.Phone,operation_firm.Email,user.Name AS CreatedName,operation_firm.CreatedAt,operation_firm.Type
FROM operation_firm LEFT JOIN user ON operation_firm.CreatedBy = user.id WHERE operation_firm.Deleted = 0 AND operation_firm.PowerStationId = @StationId";
operation = (await conn.QueryAsync<OperationTable>(sql, new { StationId = stationId })).ToList();
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return operation;
}
}
/// <summary>
/// 選取單一運維
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<OperationInfo> OneOperationInfo (int id)
{
using (IDbConnection conn = _databaseHelper.GetConnection())
{
OperationInfo operation;
conn.Open();
try
{
string sql = @$"SELECT * FROM operation_firm WHERE Id = @Id";
operation = await conn.QueryFirstOrDefaultAsync<OperationInfo>(sql, new { Id = id });
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return operation;
}
}
public async Task UpdateOperation(OperationInfo operation , List<string> properties)
{
using IDbConnection conn = _databaseHelper.GetConnection();
conn.Open();
var trans = conn.BeginTransaction();
try
{
var updateQuery = new StringBuilder($"UPDATE operation_firm SET ");
properties.ForEach(property =>
{
if (!property.Equals("Id"))
{
updateQuery.Append($"{property}=@{property},");
}
});
updateQuery.Remove(updateQuery.Length - 1, 1); //remove last comma
updateQuery.Append(" WHERE id = @Id");
await conn.ExecuteAsync(updateQuery.ToString(), operation, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
/// <summary>
/// 裝置類型下拉選單
/// </summary>
/// <returns></returns>
public async Task<List<UserSelectItemList>> DeviceType()
{
List<UserSelectItemList> result = new List<UserSelectItemList>();
using IDbConnection conn = _databaseHelper.GetConnection();
conn.Open();
var trans = conn.BeginTransaction();
try
{
string sql = @$"SELECT * FROM variable WHERE name = @name";
var json = await conn.QueryFirstOrDefaultAsync<Variable>(sql, new { name = "Type" });
Root jsonfor = JsonSerializer.Deserialize<Root>(json.value);
foreach(Models.PowerStation.Type a in jsonfor.Type)
{
UserSelectItemList KeyValue = new UserSelectItemList
{
Value = a.EName,
Text = a.Name
};
result.Add(KeyValue);
}
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
return result;
}
/// <summary>
/// 新增裝置資料
/// </summary>
/// <param name="DeviceInfo"></param>
/// <param name="properties"></param>
/// <returns></returns>
public async Task AddDevice(Device DeviceInfo, List<string> properties)
{
using IDbConnection conn = _databaseHelper.GetConnection();
conn.Open();
try
{
string sql = GenerateInsertQueryWithCustomTable(properties, "device");
await conn.ExecuteAsync(sql, DeviceInfo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
}
/// <summary>
/// 修改裝置資料
/// </summary>
/// <param name="DeviceInfo"></param>
/// <param name="properties"></param>
/// <returns></returns>
public async Task UpdateDevice(Device DeviceInfo, List<string> properties)
{
using IDbConnection conn = _databaseHelper.GetConnection();
conn.Open();
var trans = conn.BeginTransaction();
try
{
var updateQuery = GenerateUpdateQueryWithCustomTable(properties, "device");
await conn.ExecuteAsync(updateQuery.ToString(), DeviceInfo, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
/// <summary>
/// 裝置dataTable
/// </summary>
/// <param name="stationId"></param>
/// <returns></returns>
public async Task<List<DeviceTable>> DeviceTable(int stationId)
{
using IDbConnection conn = _databaseHelper.GetConnection();
conn.Open();
List<DeviceTable> Device = new List<DeviceTable>();
try
{
string sql = @$"SELECT * FROM device WHERE Deleted = 0 AND PowerStationId = @StationId";
Device = (await conn.QueryAsync<DeviceTable>(sql, new { StationId = stationId })).ToList();
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return Device;
}
}
}

View File

@ -88,6 +88,7 @@ namespace SolarPower.Repository.Implement
}
}
/// <summary>
/// 透過Id軟刪除單一筆資料
/// </summary>
@ -121,6 +122,40 @@ namespace SolarPower.Repository.Implement
}
}
}
/// <summary>
/// 透過Id軟刪除單一筆資料(不同資料表)
/// </summary>
/// <param name="id"></param>
/// <param name="tablename"></param>
/// <returns></returns>
public virtual async Task DeleteOneOtherTable(int id,string table_name)
{
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
conn.Open();
using (var trans = conn.BeginTransaction())
{
try
{
var sql = $"UPDATE {table_name} SET deleted = 1 WHERE id = @Id";
await conn.ExecuteAsync(sql, new { Id = id }, trans);
trans.Commit();
}
catch (Exception exception)
{
trans.Rollback();
throw exception;
}
finally
{
conn.Close();
}
}
}
}
/// <summary>
/// 取得所有資料
@ -282,7 +317,7 @@ namespace SolarPower.Repository.Implement
insertQuery
.Remove(insertQuery.Length - 1, 1)
.Append(")");
.Append(");");
return insertQuery.ToString();
}
@ -309,5 +344,29 @@ namespace SolarPower.Repository.Implement
return updateQuery.ToString();
}
/// <summary>
/// 產生Update語句可選擇自己要加入資料表
/// </summary>
/// <param name="properties"></param>
/// <param name="table_name">欲新增至目標資料表</param>
/// <returns></returns>
protected string GenerateUpdateQueryWithCustomTable(List<string> properties, string table_name)
{
var updateQuery = new StringBuilder($"UPDATE {table_name} SET ");
properties.ForEach(property =>
{
if (!property.Equals("Id"))
{
updateQuery.Append($"{property}=@{property},");
}
});
updateQuery.Remove(updateQuery.Length - 1, 1); //remove last comma
updateQuery.Append(" WHERE id = @Id");
return updateQuery.ToString();
}
}
}

View File

@ -1,4 +1,5 @@
using SolarPower.Models.PowerStation;
using SolarPower.Models.User;
using System;
using System.Collections.Generic;
using System.Linq;
@ -8,5 +9,127 @@ namespace SolarPower.Repository.Interface
{
public interface IPowerStationRepository : IRepositoryBase<PowerStation>
{
/// <summary>
/// 查詢縣市列表
/// </summary>
/// <param name="CompanyId"></param>
/// <returns></returns>
Task<List<CitySelectItemList>> GetCitySelectOptionListAsync();
/// <summary>
/// 查詢地區列表
/// </summary>
/// <param name="CompanyId"></param>
/// <returns></returns>
Task<List<AreaSelectItemList>> GetAreaSelectOptionListAsync(int cityId);
/// <summary>
/// 透過編號取得,縣市資訊
/// </summary>
/// <param name="cityId"></param>
/// <returns></returns>
Task<City> GetOneCityByIdAsync(int cityId);
/// <summary>
/// 透過編號取得,地區資訊
/// </summary>
/// <param name="areaId"></param>
/// <returns></returns>
Task<Area> GetOneAreaByIdAsync(int areaId);
/// <summary>
/// 取得縣市地區代碼
/// </summary>
/// <param name="areaId"></param>
/// <returns></returns>
Task<Zipcode> GetCityAreaZipcodeAsync(int areaId);
/// <summary>
/// 透過縣市地區編號,取得該縣市地區最後的流水號
/// </summary>
/// <param name="cityId"></param>
/// <param name="areaId"></param>
/// <returns></returns>
Task<string> GetLastSerialNumberByCityAreaIdAsync(int cityId, int areaId);
/// <summary>
/// 修改電站基本資訊
/// </summary>
/// <param name="entity"></param>
/// <param name="properties"></param>
/// <returns></returns>
Task UpdatePowerStationInfo(UpdatePowerStationInfo entity, List<string> properties);
/// <summary>
/// 修改能源局與台電資訊
/// </summary>
/// <param name="entity"></param>
/// <param name="properties"></param>
/// <returns></returns>
Task UpdateBoETPCInfo(UpdateBoETPCInfo entity, List<string> properties);
/// <summary>
/// 取得 土地房屋資訊
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<LandBuilding> GetOneLandBuildingInfo(int id);
/// <summary>
/// 新增 土地房屋資訊
/// </summary>
/// <param name="entity"></param>
/// <param name="properties"></param>
/// <returns></returns>
Task<int> AddOneLandBuildingInfo(LandBuilding entity, List<string> properties);
/// <summary>
/// 更新 土地房屋資訊
/// </summary>
/// <param name="entity"></param>
/// <param name="properties"></param>
/// <returns></returns>
Task UpdateLandBuildingInfo(UpdateLandBuilding entity, List<string> properties);
/// <summary>
/// 軟刪除土地房屋資訊
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task DeleteOneLandBuildingInfo(int id);
Task<int> AddOperation(OperationInfo operation, List<string> properties);
/// <summary>
/// 運維dataTable
/// </summary>
/// <param name="stationId"></param>
/// <returns></returns>
Task<List<OperationTable>> OperationTable (int stationId);
Task<OperationInfo> OneOperationInfo (int stationId);
Task UpdateOperation(OperationInfo operation, List<string> properties);
/// <summary>
/// 裝置類型下拉式選單
/// </summary>
/// <returns></returns>
Task<List<UserSelectItemList>> DeviceType();
/// <summary>
/// 新增 裝置
/// </summary>
/// <param name=""></param>
/// <returns></returns>
Task AddDevice(Device DeviceInfo, List<string> properties);
/// <summary>
/// 修改 裝置
/// </summary>
/// <param name="DeviceInfo"></param>
/// <param name="properties"></param>
/// <returns></returns>
Task UpdateDevice(Device DeviceInfo, List<string> properties);
/// <summary>
/// 設備datatable
/// </summary>
/// <param name="stationId"></param>
/// <returns></returns>
Task<List<DeviceTable>> DeviceTable(int stationId);
}
}

View File

@ -58,5 +58,13 @@ namespace SolarPower.Repository.Interface
/// <param name="Id"></param>
/// <returns></returns>
Task PurgeOneAsync(int id);
/// <summary>
/// 透過Id軟刪除單一筆資料(不同資料表)
/// </summary>
/// <param name="id"></param>
/// <param name="tablename"></param>
/// <returns></returns>
Task DeleteOneOtherTable(int id, string tablename);
}
}

View File

@ -18,6 +18,145 @@
<ItemGroup>
<Folder Include="Logs\" />
<Folder Include="wwwroot\upload\company_logo\" />
<Folder Include="wwwroot\upload\power_station\boe_file\" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\css\adminlte.min.css.map" />
<None Include="wwwroot\css\app.bundle.css.map_" />
<None Include="wwwroot\css\datagrid\datatables\datatables.bundle.css.map_" />
<None Include="wwwroot\css\fa-brands.css.map_" />
<None Include="wwwroot\css\fa-duotone.css.map_" />
<None Include="wwwroot\css\fa-light.css.map_" />
<None Include="wwwroot\css\fa-regular.css.map_" />
<None Include="wwwroot\css\fa-solid.css.map_" />
<None Include="wwwroot\css\formplugins\bootstrap-colorpicker\bootstrap-colorpicker.css.map" />
<None Include="wwwroot\css\formplugins\bootstrap-datepicker\bootstrap-datepicker.css.map" />
<None Include="wwwroot\css\formplugins\bootstrap-daterangepicker\bootstrap-daterangepicker.css.map" />
<None Include="wwwroot\css\formplugins\bootstrap-markdown\bootstrap-markdown.css.map" />
<None Include="wwwroot\css\formplugins\cropperjs\cropper.css.map" />
<None Include="wwwroot\css\formplugins\dropzone\dropzone.css.map" />
<None Include="wwwroot\css\formplugins\ion-rangeslider\ion-rangeslider.css.map" />
<None Include="wwwroot\css\formplugins\nouislider\nouislider.css.map" />
<None Include="wwwroot\css\formplugins\select2\select2.bundle.css.map" />
<None Include="wwwroot\css\formplugins\smartwizard\smartwizard.css.map" />
<None Include="wwwroot\css\formplugins\summernote\summernote.css.map" />
<None Include="wwwroot\css\json-path-picker\json-path-picker.css.map" />
<None Include="wwwroot\css\miscellaneous\fullcalendar\fullcalendar.bundle.css.map" />
<None Include="wwwroot\css\miscellaneous\jqvmap\jqvmap.bundle.css.map" />
<None Include="wwwroot\css\miscellaneous\lightgallery\lightgallery.bundle.css.map" />
<None Include="wwwroot\css\miscellaneous\nestable\nestable.css.map" />
<None Include="wwwroot\css\miscellaneous\reactions\reactions.css.map" />
<None Include="wwwroot\css\miscellaneous\treeview\treeview.css.map" />
<None Include="wwwroot\css\notifications\sweetalert2\sweetalert2.bundle.css.map" />
<None Include="wwwroot\css\notifications\toastr\toastr.css.map" />
<None Include="wwwroot\css\page-invoice.css.map_" />
<None Include="wwwroot\css\page-login-alt.css.map_" />
<None Include="wwwroot\css\skins\skin-master.css.map_" />
<None Include="wwwroot\css\statistics\c3\c3.css.map" />
<None Include="wwwroot\css\statistics\chartist\chartist.css.map" />
<None Include="wwwroot\css\statistics\chartjs\chartjs.css.map" />
<None Include="wwwroot\css\statistics\dygraph\dygraph.css.map" />
<None Include="wwwroot\css\theme-demo.css.map_" />
<None Include="wwwroot\css\themes\cust-theme-1.css.map" />
<None Include="wwwroot\css\themes\cust-theme-10.css.map" />
<None Include="wwwroot\css\themes\cust-theme-11.css.map" />
<None Include="wwwroot\css\themes\cust-theme-12.css.map" />
<None Include="wwwroot\css\themes\cust-theme-13.css.map" />
<None Include="wwwroot\css\themes\cust-theme-14.css.map" />
<None Include="wwwroot\css\themes\cust-theme-15.css.map" />
<None Include="wwwroot\css\themes\cust-theme-15.css.map_" />
<None Include="wwwroot\css\themes\cust-theme-2.css.map" />
<None Include="wwwroot\css\themes\cust-theme-3.css.map" />
<None Include="wwwroot\css\themes\cust-theme-4.css.map" />
<None Include="wwwroot\css\themes\cust-theme-5.css.map" />
<None Include="wwwroot\css\themes\cust-theme-6.css.map" />
<None Include="wwwroot\css\themes\cust-theme-7.css.map" />
<None Include="wwwroot\css\themes\cust-theme-8.css.map" />
<None Include="wwwroot\css\themes\cust-theme-9.css.map" />
<None Include="wwwroot\css\vendors.bundle.css.map_" />
<None Include="wwwroot\img\favicon\safari-pinned-tab.svg" />
<None Include="wwwroot\img\favicon\site.webmanifest" />
<None Include="wwwroot\img\logo-flat.svg" />
<None Include="wwwroot\img\logo-gradient.svg" />
<None Include="wwwroot\img\logo.svg" />
<None Include="wwwroot\img\svg\pattern-1.svg" />
<None Include="wwwroot\img\svg\pattern-2.svg" />
<None Include="wwwroot\img\svg\pattern-3.svg" />
<None Include="wwwroot\img\svg\pattern-4.svg" />
<None Include="wwwroot\js\app.bundle.js" />
<None Include="wwwroot\js\datagrid\datatables\datatables.bundle.js" />
<None Include="wwwroot\js\datagrid\datatables\datatables.export.js" />
<None Include="wwwroot\js\dependency\moment\moment.js" />
<None Include="wwwroot\js\formplugins\bootstrap-colorpicker\bootstrap-colorpicker.js" />
<None Include="wwwroot\js\formplugins\bootstrap-datepicker\bootstrap-datepicker.js" />
<None Include="wwwroot\js\formplugins\bootstrap-daterangepicker\bootstrap-daterangepicker.js" />
<None Include="wwwroot\js\formplugins\bootstrap-markdown\bootstrap-markdown.js" />
<None Include="wwwroot\js\formplugins\cropperjs\cropper.js" />
<None Include="wwwroot\js\formplugins\dropzone\dropzone.js" />
<None Include="wwwroot\js\formplugins\inputmask\inputmask.bundle.js" />
<None Include="wwwroot\js\formplugins\ion-rangeslider\ion-rangeslider.js" />
<None Include="wwwroot\js\formplugins\nouislider\nouislider.js" />
<None Include="wwwroot\js\formplugins\select2\select2.bundle.js" />
<None Include="wwwroot\js\formplugins\smartwizard\smartwizard.js" />
<None Include="wwwroot\js\formplugins\summernote\summernote.js" />
<None Include="wwwroot\js\i18n\i18n.js" />
<None Include="wwwroot\js\json-path-picker\json-path-picker.js" />
<None Include="wwwroot\js\miscellaneous\fullcalendar\fullcalendar.bundle.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\jqvmap.bundle.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.algeria.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.argentina.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.brazil.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.canada.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.europe.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.france.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.germany.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.greece.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.iran.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.iraq.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.russia.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.tunisia.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.turkey.js" />
<None Include="wwwroot\js\miscellaneous\jqvmap\maps\jquery.vmap.usa.js" />
<None Include="wwwroot\js\miscellaneous\lightgallery\lightgallery.bundle.js" />
<None Include="wwwroot\js\miscellaneous\lightgallery\smartvoice.bundle.js" />
<None Include="wwwroot\js\miscellaneous\nestable\nestable.js" />
<None Include="wwwroot\js\miscellaneous\treeview\treeview.js" />
<None Include="wwwroot\js\notifications\sweetalert2\sweetalert2.bundle.js" />
<None Include="wwwroot\js\notifications\toastr\toastr.js" />
<None Include="wwwroot\js\site.js" />
<None Include="wwwroot\js\statistics\c3\c3.js" />
<None Include="wwwroot\js\statistics\chartist\chartist.js" />
<None Include="wwwroot\js\statistics\chartjs\chartjs.bundle.js" />
<None Include="wwwroot\js\statistics\d3\d3.js" />
<None Include="wwwroot\js\statistics\demo-data\demo-c3.js" />
<None Include="wwwroot\js\statistics\demo-data\demo-data-dygraph.js" />
<None Include="wwwroot\js\statistics\dygraph\dygraph.js" />
<None Include="wwwroot\js\statistics\easypiechart\easypiechart.bundle.js" />
<None Include="wwwroot\js\statistics\flot\flot.bundle.js" />
<None Include="wwwroot\js\statistics\peity\peity.bundle.js" />
<None Include="wwwroot\js\statistics\sparkline\sparkline.bundle.js" />
<None Include="wwwroot\js\toast.js" />
<None Include="wwwroot\js\vendors.bundle.js" />
<None Include="wwwroot\media\sound\bigbox.ogg" />
<None Include="wwwroot\media\sound\messagebox.ogg" />
<None Include="wwwroot\media\sound\smallbox.ogg" />
<None Include="wwwroot\media\sound\voice_alert.ogg" />
<None Include="wwwroot\media\sound\voice_off.ogg" />
<None Include="wwwroot\media\sound\voice_on.ogg" />
<None Include="wwwroot\webfonts\fa-brands-400.svg" />
<None Include="wwwroot\webfonts\fa-brands-400.woff2" />
<None Include="wwwroot\webfonts\fa-duotone-900.svg" />
<None Include="wwwroot\webfonts\fa-duotone-900.woff2" />
<None Include="wwwroot\webfonts\fa-light-300.svg" />
<None Include="wwwroot\webfonts\fa-light-300.woff2" />
<None Include="wwwroot\webfonts\fa-regular-400.svg" />
<None Include="wwwroot\webfonts\fa-regular-400.woff2" />
<None Include="wwwroot\webfonts\fa-solid-900.svg" />
<None Include="wwwroot\webfonts\fa-solid-900.woff2" />
<None Include="wwwroot\webfonts\nextgen-icons.svg" />
<None Include="wwwroot\webfonts\nextgen-icons.woff2" />
<None Include="wwwroot\webfonts\summernote.woff2" />
</ItemGroup>
</Project>

View File

@ -12,7 +12,7 @@
<!-- base css -->
<link id="vendorsbundle" rel="stylesheet" media="screen, print" href="~/css/vendors.bundle.css">
<link id="appbundle" rel="stylesheet" media="screen, print" href="~/css/app.bundle.css">
<link id="mytheme" rel="stylesheet" media="screen, print" href="#">
<link id="mytheme" rel="stylesheet" media="screen, print" href="~/css/themes/cust-theme-15.css">
<link id="myskin" rel="stylesheet" media="screen, print" href="~/css/skins/skin-master.css">
<!-- Place favicon.ico in the root directory -->
<link rel="apple-touch-icon" sizes="180x180" href="~/img/favicon/apple-touch-icon.png">

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,12 @@
<div class="row mb-5">
<div class="col-6"><h3>裝置設定</h3></div>
<div class="col-6 text-right">
<button type="button" class="btn btn-success waves-effect waves-themed mb-3">
<span class="fal fa-plus mr-1"></span>
新增
</button>
<a href="javascript:;" class="btn btn-success waves-effect waves-themed mb-3" id="addDevice-btn" onclick="AddDevice()">
<span class="fal fa-plus mr-1"></span>新增
</a>
</div>
<div class="w-100">
<table class="table table-bordered table-hover m-0 text-center">
<table id="Device_table" class="table table-bordered table-hover m-0 text-center">
<thead class="thead-themed">
<tr>
<th>設備ID</th>
@ -70,3 +69,70 @@
</table>
</div>
</div>
<div class="modal fade" id="Device-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">
裝置資料 - 新增
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="fal fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<form class="Device-form" id="Device-form">
<div class="row">
<div class="form-group col-lg-6">
<label class="form-label" for="Device_Name_modal"><span class="text-danger">*</span>裝置名稱</label>
<input type="text" id="Device_Name_modal" name="Device_Name_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Device_Type_modal"><span class="text-danger">*</span>裝置類型</label>
<select class="form-control" id="Device_Type_modal">
</select>
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Device_Brand_modal"><span class="text-danger">*</span>廠牌</label>
<input type="text" id="Device_Brand_modal" name="Device_Brand_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Device_ProductModel_modal"><span class="text-danger">*</span>型號</label>
<input type="text" id="Device_ProductModel_modal" name="Device_ProductModel_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<div style="margin-bottom: 0.3rem">
<label class="form-label" for="Device_DBName_modal"><span class="text-danger">*</span>DBName</label>
<input type="text" id="Device_DBName_modal" name="Device_DBName_modal" class="form-control">
</div>
</div>
<div class="form-group col-lg-6">
<div style="margin-bottom: 0.3rem">
<label class="form-label" for="Device_TableName_modal"><span class="text-danger">*</span>tableName</label>
<input type="text" id="Device_TableName_modal" name="Device_TableName_modal" class="form-control">
</div>
</div>
<div class="form-group col-lg-6">
<div style="margin-bottom: 0.3rem">
<label class="form-label" for="Device_ColName_modal"><span class="text-danger">*</span>columnName</label>
<input type="text" id="Device_ColName_modal" name="Device_ColName_modal" class="form-control">
</div>
</div>
<div class="form-group col-lg-6">
<div style="margin-bottom: 0.3rem">
<label class="form-label" for="Device_Remark_modal"><span class="text-danger">*</span>備註</label>
<input type="text" id="Device_Remark_modal" name="Device_Remark_modal" class="form-control">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" onclick="SaveDevice()">確定</button>
</div>
</div>
</div>
</div>

View File

@ -1,64 +1,78 @@
<div class="row mb-5">
<div class="col-6"><h3>運維資料</h3></div>
<div class="col-6 text-right">
<button type="button" class="btn btn-success waves-effect waves-themed mb-3">
<span class="fal fa-plus mr-1"></span>
新增
</button>
<a href="javascript:;" class="btn btn-success waves-effect waves-themed mb-3" id="addOperation-btn" onclick="AddOperation()">
<span class="fal fa-plus mr-1"></span>新增
</a>
</div>
<div class="w-100">
<table class="table table-bordered table-hover m-0 text-center">
<table id="Operation_table" class="table table-bordered table-hover m-0 text-center">
<thead class="thead-themed">
<tr>
<th>廠商類別</th>
<th>廠商</th>
<th>聯絡人</th>
<th>電話</th>
<th>email</th>
<th>Email</th>
<th>建立日期</th>
<th>建立人</th>
<th>功能</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">施工</th>
<td>台達電</td>
<td>林先生</td>
<td>0928-123456</td>
<td>lin@tdd.com.tw</td>
<td>2021/06/02</td>
<td>周杰倫</td>
<td>
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
</td>
</tr>
<tr>
<th scope="row">清洗</th>
<td>潔寶</td>
<td>暴風女</td>
<td>0928-654321</td>
<td>storm@mavel.com</td>
<td>2021/06/03</td>
<td>周杰倫</td>
<td>
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
</td>
</tr>
<tr>
<th scope="row">維運</th>
<td>華碩</td>
<td>雷神索爾</td>
<td>0937-123123</td>
<td>thor@asus.com</td>
<td>2021/06/04</td>
<td>周杰倫</td>
<td>
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
</td>
</tr>
</tbody>
</table >
</div>
</div>
<div class="modal fade" id="Operation-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">
運維廠商資料 - 新增
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="fal fa-times"></i></span>
</button>
</div>
<div class="modal-body">
<form class="Operation-form" id="Operation-form">
<div class="row">
<div class="form-group col-lg-6">
<label class="form-label" for="Operation_role_modal"><span class="text-danger">*</span>廠商類別</label>
<select class="form-control" id="Operation_role_modal">
<option value="0">施工</option>
<option value="1">清洗</option>
<option value="2">維運</option>
</select>
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Operation_factory_modal"><span class="text-danger">*</span>廠商</label>
<input type="text" id="Operation_factory_modal" name="Operation_factory_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Operation_name_modal"><span class="text-danger">*</span>聯絡人</label>
<input type="text" id="Operation_name_modal" name="Operation_name_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<label class="form-label" for="Operation_phone_modal"><span class="text-danger">*</span>電話</label>
<input type="text" id="Operation_phone_modal" name="Operation_phone_modal" class="form-control">
</div>
<div class="form-group col-lg-6">
<div style="margin-bottom: 0.3rem">
<label class="form-label" for="Operation_email_modal"><span class="text-danger">*</span>Email</label>
<input type="text" id="Operation_email_modal" name="Operation_email_modal" class="form-control">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" onclick="SaveOperation()">確定</button>
</div>
</div>
</div>
</div>

View File

@ -19,7 +19,7 @@
<div class="card-body">
<div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="city_label">縣市</label>
<label class="col-xl-4 form-label" id="city_label">縣市</label>
<div class="col-xl-8">
<select class="form-control" id="select_city">
<option value="0" selected>全部</option>
@ -27,15 +27,16 @@
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="area_label">地區</label>
<label class="col-xl-4 form-label" id="area_label">地區</label>
<div class="col-xl-8">
<select class="form-control" id="select_area">
<option value="0" selected>全部</option>
</select>
</div>
</div>
<div class="col-xl-6 row">
<div class="col-xl-6 row align-items-center">
<div class="col-12">
<label id="address_detail_text" class="color-info-600"></label>
<input type="text" id="address_detail" name="address_detail" class="form-control">
</div>
</div>
@ -43,21 +44,21 @@
<div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="power_station_code_label" for="power_station_code">電站編號</label>
<label class="col-xl-4 form-label" id="power_station_code_label" for="power_station_code">電站編號</label>
<div class="col-xl-8">
<p id="power_station_code_text">PEP-NTP001</p>
<label id="power_station_code_text" class="color-info-600"></label>
@*<input type="text" id="power_station_code" name="power_station_code" disabled="disabled" class="form-control">*@
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="power_station_name_label" for="power_station_name">電站名稱</label>
<label class="col-xl-4 form-label" id="power_station_name_label" for="power_station_name">電站名稱</label>
<div class="col-xl-8">
<p id="power_station_name_text">薪族鋸成</p>
<label id="power_station_name_text" class="color-info-600"></label>
<input type="text" id="power_station_name" name="power_station_name" class="form-control">
</div>
</div>
<div class="col-xl-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">
<p class="color-info-600">
<div class="custom-control custom-switch">
@ -68,69 +69,70 @@
</div>
</div>
<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="escrow_name_lable" for="escrow_name">被代管公司</label>
<div class="col-xl-8">
<p id="electricity_meter_at_text">2021-02-29</p>
<input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control">
<label id="escrow_name_text" class="color-info-600"></label>
<input type="text" id="escrow_name" name="escrow_name" class="form-control" disabled="disabled">
</div>
</div>
</div>
<div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">預計回收年限:</label>
<label class="col-xl-4 form-label" id="electricity_meter_at_label" for="electricity_meter_at">台電掛錶日</label>
<div class="col-xl-8">
<p id="estimated_recovery_time_text">20</p>
<label id="electricity_meter_at_text" class="color-info-600"></label>
<input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control">
</div>
</div>
<div class="col-xl-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>
<input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">預計回收年限</label>
<div class="col-xl-8">
<label id="estimated_recovery_time_text" class="color-info-600"></label>
<input type="text" id="estimated_recovery_time" name="estimated_recovery_time" class="form-control">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="generating_capacity_label" for="generating_capacity">電廠發電容量(kW)</label>
<div class="col-xl-8">
<p id="generating_capacity_text">123123</p>
<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 class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="escrow_name_lable" for="escrow_name">被代管公司:</label>
<div class="col-xl-8">
<p id="escrow_name_text">台電電</p>
<input type="text" id="escrow_name" name="escrow_name" class="form-control" disabled="disabled">
</div>
</div>
<div class="row mb-5 d-flex justify-content-between ">
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="power_station_operation_personnel_label">運維人員:</label>
<label class="col-xl-4 form-label" id="power_station_operation_personnel_label">運維人員</label>
<div class="col-xl-8">
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple">
</select>
</div>
</div>
</div>
<div class="row mb-5 d-flex justify-content-between ">
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="power_rate_label" for="power_rate">授電費率</label>
<div class="col-xl-8">
<p id="power_rate_text">123123</p>
<input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">座標</label>
<div class="col-xl-8">
<p id="coordinate_text">座標:</p>
<label id="coordinate_text" class="color-info-600"></label>
<input type="text" id="coordinate" name="coordinate" class="form-control">
</div>
</div>
<div class="col-xl-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">
<p id="created_by_text">野員新之助</p>
<label id="created_by_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">建立時間</label>
<label class="col-xl-4 form-label">建立時間</label>
<div class="col-xl-8">
<p id="created_at_text">YYYY-MM-DD</p>
<label id="created_at_text" class="color-info-600"></label>
</div>
</div>
</div>
@ -139,55 +141,67 @@
<div class="col-xl-6">
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">逆變器</h5>
<div class="row d-flex justify-content-between px-5">
<div class="col-xl-4">
<label class="form-label" id="inverter_brand_label" for="inverter_brand">廠牌</label>
<p id="inverter_brand_text" class="color-info-600">AUO</p>
<div class="col-xl-4 row">
<label class="col-xl-4 form-label" id="inverter_brand_label" for="inverter_brand">廠牌</label>
<div class="col-xl-8">
<label id="inverter_brand_text" class="color-info-600"></label>
<input type="text" id="inverter_brand" name="inverter_brand" class="form-control">
</div>
<div class="col-xl-4">
<label class="form-label" id="inverter_product_model_label" for="inverter_product_model">型號</label>
<p id="inverter_product_model_text" class="color-info-600">PM060MW2_305</p>
</div>
<div class="col-xl-4 row">
<label class="col-xl-4 form-label" id="inverter_product_model_label" for="inverter_product_model">型號</label>
<div class="col-xl-8">
<label id="inverter_product_model_text" class="color-info-600"></label>
<input type="text" id="inverter_product_model" name="inverter_product_model" class="form-control">
</div>
<div class="col-xl-4">
<label class="form-label" id="inverter_amount_label" for="inverter_amount">數量</label>
<p id="inverter_amount_text" class="color-info-600">400</p>
</div>
<div class="col-xl-4 row">
<label class="col-xl-4 form-label" id="inverter_amount_label" for="inverter_amount">數量</label>
<div class="col-xl-8">
<label id="inverter_amount_text" class="color-info-600"></label>
<input type="text" id="inverter_amount" name="inverter_amount" class="form-control">
</div>
</div>
</div>
</div>
<div class="col-xl-6">
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">光電板</h5>
<div class="row d-flex justify-content-between px-5">
<div class="col-xl-4">
<label class="form-label" id="photovoltaic_panel_brand_label" for="photovoltaic_panel_brand">廠牌</label>
<p id="photovoltaic_panel_brand_text" class="color-info-600">ABLYTEK</p>
<div class="col-xl-4 mb-3 row">
<label class="col-xl-4 form-label" id="photovoltaic_panel_brand_label" for="photovoltaic_panel_brand">廠牌</label>
<div class="col-xl-8">
<label id="photovoltaic_panel_brand_text" class="color-info-600"></label>
<input type="text" id="photovoltaic_panel_brand" name="photovoltaic_panel_brand" class="form-control">
</div>
<div class="col-xl-4">
<label class="form-label" id="photovoltaic_panel_specification_label" for="photovoltaic_panel_specification">規格</label>
<p id="photovoltaic_panel_specification_text" class="color-info-600">1640×992×40</p>
</div>
<div class="col-xl-4 mb-3 row">
<label class="col-xl-4 form-label" id="photovoltaic_panel_specification_label" for="photovoltaic_panel_specification">規格</label>
<div class="col-xl-8">
<label id="photovoltaic_panel_specification_text" class="color-info-600"></label>
<input type="text" id="photovoltaic_panel_specification" name="photovoltaic_panel_specification" class="form-control">
</div>
<div class="col-xl-4">
<label class="form-label" id="photovoltaic_panel_amount_label" for="photovoltaic_panel_amount">數量</label>
<p id="photovoltaic_panel_amount_text" class="color-info-600">1116</p>
</div>
<div class="col-xl-4 mb-3 row">
<label class="col-xl-4 form-label" id="photovoltaic_panel_amount_label" for="photovoltaic_panel_amount">數量</label>
<div class="col-xl-8">
<label id="photovoltaic_panel_amount_text" class="color-info-600"></label>
<input type="text" id="photovoltaic_panel_amount" name="photovoltaic_panel_amount" class="form-control">
</div>
<div class="col-xl-4">
<label class="form-label" id="photovoltaic_panel_product_model_label" for="photovoltaic_panel_product_model">型號</label>
<p id="photovoltaic_panel_product_model_text" class="color-info-600">6MN6A295</p>
</div>
<div class="col-xl-4 mb-3 row">
<label class="col-xl-4 form-label" id="photovoltaic_panel_product_model_label" for="photovoltaic_panel_product_model">型號</label>
<div class="col-xl-8">
<label id="photovoltaic_panel_product_model_text" class="color-info-600"></label>
<input type="text" id="photovoltaic_panel_product_model" name="photovoltaic_panel_product_model" class="form-control">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-5" id="BoEPart">
<div class="card border mb-g w-100">
<!-- notice the additions of utility paddings and display properties on .card-header -->
@ -212,31 +226,31 @@
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">經濟部能源局</h5>
<div class="row d-flex justify-content-between px-5">
<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">
<a id="link-boe-file" class="color-info-600" href="link/to/your/download/file" download>Download link</a>
<input type="file" id="BoE_file" name="BoE_file" class="form-control">
</div>
</div>
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label">折扣率</label>
<label class="col-xl-4 form-label">折扣率</label>
<div class="col-xl-8">
<p id="BoE_discount_rate_text" class="color-info-600">123123</p>
<label id="BoE_discount_rate_text" class="color-info-600"></label>
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control">
</div>
</div>
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" for="BoE_device_register_number">能源局設備登記編號</label>
<label class="col-xl-4 form-label" for="BoE_device_register_number">能源局設備登記編號</label>
<div class="col-xl-8">
<p id="BoE_device_register_number_text" class="color-info-600">123123</p>
<label id="BoE_device_register_number_text" class="color-info-600"></label>
<input type="text" id="BoE_device_register_number" name="BoE_device_register_number" class="form-control">
</div>
</div>
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label">租金比例 (%)</label>
<label class="col-xl-4 form-label">租金比例(%)</label>
<div class="col-xl-8">
<p id="BoE_discount_rate_text" class="color-info-600">123123</p>
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control">
<label id="BoE_rent_ratio_text" class="color-info-600"></label>
<input type="number" step="1" id="BoE_rent_ratio" name="BoE_rent_ratio" class="form-control">
</div>
</div>
</div>
@ -245,56 +259,56 @@
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">台電資訊</h5>
<div class="row d-flex justify-content-between px-5">
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" for="TPC_contract_number">契約編號</label>
<label class="col-xl-4 form-label" for="TPC_contract_number">契約編號</label>
<div class="col-xl-8">
<p id="TPC_contract_number_text" class="color-info-600">123123</p>
<label id="TPC_contract_number_text" class="color-info-600"></label>
<input type="text" id="TPC_contract_number" name="TPC_contract_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" for="TPC_contract_at">簽約日期</label>
<label class="col-xl-4 form-label" for="TPC_contract_at">簽約日期</label>
<div class="col-xl-8">
<p id="TPC_contract_at_text" class="color-info-600">123123</p>
<label id="TPC_contract_at_text" class="color-info-600"></label>
<input type="date" id="TPC_contract_at" name="TPC_contract_at" class="form-control">
</div>
</div>
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" for="TPC_sell_deadline">售電期限(年)</label>
<label class="col-xl-4 form-label" for="TPC_sell_deadline">售電期限(年)</label>
<div class="col-xl-8">
<p id="TPC_sell_deadline_text" class="color-info-600">123123</p>
<input type="text" id="TPC_sell_deadline" name="TPC_sell_deadline" class="form-control">
<label id="TPC_sell_deadline_text" class="color-info-600"></label>
<input type="number" step="1" id="TPC_sell_deadline" name="TPC_sell_deadline" class="form-control">
</div>
</div>
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日</label>
<label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日</label>
<div class="col-xl-8">
<p id="TPC_meter_reading_text" class="color-info-600">123123</p>
<input type="text" id="TPC_meter_reading" name="TPC_meter_reading" class="form-control">
<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>
<label class="col-xl-4 form-label" for="TPC_purchase_electricity_at">正式購電日</label>
<div class="col-xl-8">
<p id="TPC_purchase_electricity_at_text" class="color-info-600">123123</p>
<label id="TPC_purchase_electricity_at_text" class="color-info-600"></label>
<input type="date" id="TPC_purchase_electricity_at" name="TPC_purchase_electricity_at" class="form-control">
</div>
</div>
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" for="TPC_sell_electricity_at">正式售電日</label>
<label class="col-xl-4 form-label" for="TPC_sell_electricity_at">正式售電日</label>
<div class="col-xl-8">
<p id="TPC_sell_electricity_at_text" class="color-info-600">123123</p>
<label id="TPC_sell_electricity_at_text" class="color-info-600"></label>
<input type="date" id="TPC_sell_electricity_at" name="TPC_sell_electricity_at" class="form-control">
</div>
</div>
</div>
<div class="row d-flex justify-content-end px-5">
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-12 text-right">資料建立<span id="BOE_TPC_created_by_text" class="color-info-600">123123</span></label>
<div class="col-xl-6 mb-3 row justify-content-end align-items-center">
<label class="col-xl-12 text-right">資料建立 <span id="BOE_TPC_created_by_text" class="ml-3 color-info-600"></span></label>
</div>
</div>
<div class="row d-flex justify-content-end px-5">
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-12 text-right">建立時間<span id="BOE_TPC_created_at_text" class="color-info-600">123123</span></label>
<div class="col-xl-6 mb-3 row justify-content-end align-items-center">
<label class="col-xl-12 text-right">建立時間 <span id="BOE_TPC_created_at_text" class="ml-3 color-info-600"></span></label>
</div>
</div>
</div>
@ -305,11 +319,11 @@
</div>
<div class="row mb-5" id="land_buildingPart">
<div class="card border mb-g w-100">
<!--<div class="card border mb-g w-100">-->
<!-- notice the additions of utility paddings and display properties on .card-header -->
<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-50 pr-3 d-flex align-items-center flex-wrap justify-content-between">-->
<!-- we wrap header title inside a div tag with utility padding -->
<div class="card-title font-weight-bold">土地房屋資料</div>
<!--<div class="card-title font-weight-bold">土地房屋資料</div>
<div class="text-right">
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed">
<span class="fal fa-plus mr-1"></span> 新增
@ -320,25 +334,79 @@
</div>
</div>
<div class="card-body">
<div class="row d-flex justify-content-between">
<div class="row d-flex justify-content-between card-land-building" data-id="xxx">
<div class="col-xl">
<p>地址 <span class="color-info-600">台北市內湖區中山路一段1001號</span></p>
<p>經緯度 <span class="color-info-600">25.0726625,121.5725953</span></p>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_address">地址</label>
<div class="col-xl-8">
<p id="land_building_address_text" class="color-info-600">台北市內湖區中山路一段1001號</p>
<input type="text" id="land_building_address" name="land_building_address" class="form-control">
</div>
</div>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_coordinate">經緯度</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">台北市內湖區中山路一段1001號</p>
<input type="text" id="land_building_coordinate" name="land_building_coordinate" class="form-control">
</div>
</div>
</div>
<div class="col-xl">
<p>租約公證日期 <span class="color-info-600">新竹巨城站</span></p>
<p>租金比例 (%) <span class="color-info-600">10</span></p>
<div class="row">
<label class="col-xl-4 form-label" for="lease_notarization_at">租約公證日期</label>
<div class="col-xl-8">
<p id="lease_notarization_at_text" class="color-info-600">2021-12-01</p>
<input type="text" id="lease_notarization_at" name="lease_notarization_at" class="form-control">
</div>
</div>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_lease_Rate">租金比例 (%)</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">台北市內湖區中山路一段1001號</p>
<input type="text" id="land_building_lease_Rate" name="land_building_coordinate" class="form-control">
</div>
</div>
</div>
<div class="col-xl">
<p>地主姓名 <span class="color-info-600">鋼鐵人</span></p>
<p>電話 <span class="color-info-600">0828-123456</span></p>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_lease_Rate">地主姓名</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">鋼鐵人</p>
<input type="text" id="land_building_landowner" name="land_building_coordinate" class="form-control">
</div>
</div>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_lease_Rate">電話</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">0828-123456</p>
<input type="text" id="land_building_lease_Rate" name="land_building_coordinate" class="form-control">
</div>
</div>
</div>
<div class="col-xl">
<p>房屋用途 <span class="color-info-600">工廠</span></p>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_lease_Rate">房屋用途</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">0828-123456</p>
<input type="text" id="land_building_lease_Rate" name="land_building_coordinate" class="form-control">
</div>
</div>
</div>
<div class="col-xl">
<p>資料建立 <span class="color-info-600">蜘蛛人</span></p>
<p>建立時間 <span class="color-info-600">2018-10-01 12:00</span></p>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_lease_Rate">資料建立</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">蜘蛛人</p>
<input type="text" id="land_building_lease_Rate" name="land_building_coordinate" class="form-control">
</div>
</div>
<div class="row">
<label class="col-xl-4 form-label" for="land_building_lease_Rate">建立時間</label>
<div class="col-xl-8">
<p id="land_building_coordinate_text" class="color-info-600">2018-10-01 12:00</p>
<input type="text" id="land_building_lease_Rate" name="land_building_coordinate" class="form-control">
</div>
</div>
</div>
</div>
</div>
@ -377,7 +445,7 @@
</div>
</div>
</div>
</div>-->
</div>

View File

@ -14,7 +14,7 @@
<!-- base css -->
<link id="vendorsbundle" rel="stylesheet" media="screen, print" href="~/css/vendors.bundle.css">
<link id="appbundle" rel="stylesheet" media="screen, print" href="~/css/app.bundle.css">
<link id="mytheme" rel="stylesheet" media="screen, print" href="#">
<link id="mytheme" rel="stylesheet" media="screen, print" href="~/css/themes/cust-theme-15.css">
<link id="myskin" rel="stylesheet" media="screen, print" href="~/css/skins/skin-master.css">
<!-- Place favicon.ico in the root directory -->
@ -41,10 +41,8 @@
<!-- BEGIN Left Aside -->
<aside class="page-sidebar">
<div class="page-logo">
<a href="#" class="page-logo-link press-scale-down d-flex align-items-center position-relative" data-toggle="modal" data-target="#modal-shortcut">
<img src="~/img/logo.png" alt="SmartAdmin WebApp" aria-roledescription="logo">
<span class="page-logo-text mr-1"></span>
<span class="position-absolute text-white opacity-50 small pos-top pos-right mr-2 mt-n2"></span>
<a href="#" class="page-logo-link press-scale-down" data-toggle="modal" data-target="#modal-shortcut">
<img src="~/img/logo.png" alt="SmartAdmin WebApp" aria-roledescription="logo"> <span class="page-logo-text mr-1"></span> <span class="position-absolute text-white opacity-50 small pos-top pos-right mr-2 mt-n2"></span>
<!--<i class="fal fa-angle-down d-inline-block ml-1 fs-lg color-primary-300"></i>-->
</a>
</div>
@ -90,23 +88,6 @@
<span class="nav-link-text" data-i18n="nav.category">總覽</span>
</a>
<ul>
<li>
<a href="javascript:void(0);" title="Menu child" data-filter-tags="utilities menu child">
<span class="nav-link-text" data-i18n="nav.utilities_menu_child">地圖總覽</span>
</a>
<ul>
<li>
<a href="javascript:void(0);" title="Sublevel Item" data-filter-tags="utilities menu child sublevel item">
<span class="nav-link-text" data-i18n="nav.utilities_menu_child_sublevel_item">電站總覽</span>
</a>
</li>
<li>
<a href="javascript:void(0);" title="Another Item" data-filter-tags="utilities menu child another item">
<span class="nav-link-text" data-i18n="nav.utilities_menu_child_another_item">運維總覽</span>
</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:void(0);" title="地圖總覽" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">地圖總覽</span>
@ -117,23 +98,18 @@
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站總覽</span>
</a>
</li>
<li class="">
<a href="javascript:void(0);" title="運維總覽" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">運維總覽</span>
</a>
</li>
</ul>
</li>
<!-- Example of open and active states -->
<li class="">
<a href="#" title="Category" data-filter-tags="category">
<i class="fal fa-alien"></i>
<span class="nav-link-text" data-i18n="nav.category">即時告警</span>
<i class="fal fa-file"></i>
<span class="nav-link-text" data-i18n="nav.category">電站資訊</span>
</a>
<ul>
<li class="">
<a href="javascript:void(0);" title="即時告警管理" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">即時告警管理</span>
<li class="@(ViewData["MainNum"] == "6" && ViewData["SubNum"] == "1" ? "active" : "")">
<a asp-controller="PowerStation" asp-action="Index" title="電站管理" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站管理</span>
</a>
</li>
</ul>
@ -145,18 +121,18 @@
</a>
<ul>
<li class="">
<a href="javascript:void(0);" title="逆變器熱圖" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">逆變器熱圖</span>
<a href="javascript:void(0);" title="合併電站" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">合併電站</span>
</a>
</li>
<li class="">
<a href="javascript:void(0);" title="電站運轉效率" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站運轉效率</span>
<a href="javascript:void(0);" title="電站交叉分析" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站交叉分析</span>
</a>
</li>
<li class="">
<a href="javascript:void(0);" title="逆變器效率" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">逆變器效率</span>
<a href="javascript:void(0);" title="逆變器交叉分析" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">逆變器交叉分析</span>
</a>
</li>
</ul>
@ -184,6 +160,21 @@
</li>
</ul>
</li>
<li class="">
<a href="#" title="Category" data-filter-tags="category">
<i class="fal fa-alien"></i>
<span class="nav-link-text" data-i18n="nav.category">即時告警</span>
</a>
<ul>
<li class="">
<a href="javascript:void(0);" title="即時告警管理" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">即時告警管理</span>
</a>
</li>
</ul>
</li>
<li class="">
<a href="#" title="Category" data-filter-tags="category">
<i class="fal fa-alien"></i>
@ -191,18 +182,13 @@
</a>
<ul>
<li class="">
<a href="javascript:void(0);" title="異常事件查詢" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">異常事件查詢</span>
<a href="javascript:void(0);" title="定期計劃建立" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">定期計劃建立</span>
</a>
</li>
<li class="">
<a href="javascript:void(0);" title="異常派工處理" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">異常派工處理</span>
</a>
</li>
<li class="">
<a href="javascript:void(0);" title="日常檢查記錄" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">日常檢查記錄</span>
<a href="javascript:void(0);" title="運維作業記錄" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">運維作業記錄</span>
</a>
</li>
</ul>
@ -213,11 +199,6 @@
<span class="nav-link-text" data-i18n="nav.category">系統管理</span>
</a>
<ul>
<li class="@(ViewData["MainNum"] == "6" && ViewData["SubNum"] == "1" ? "active" : "")">
<a asp-controller="PowerStation" asp-action="Index" title="電站資料管理" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站資料管理</span>
</a>
</li>
<li class="@(ViewData["MainNum"] == "6" && ViewData["SubNum"] == "2" ? "active" : "")">
<a asp-controller="Company" asp-action="Index" title="公司管理" data-filter-tags="utilities disabled item">
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">公司管理</span>

View File

@ -612,14 +612,14 @@
});
//#endregion
//#region 編輯系統管理員
//#region 編輯使用者管理員
$('#user_table').on("click", "button.edit-btn", function () {
$("#user-modal .modal-title").html("人員基本資料 - 編輯");
selected_id = $(this).parents('tr').attr('data-id');
//取得單一系統管理員
//取得單一使用者管理員
var url = "/User/GetOneUser/";
var send_data = {

View File

@ -1815,6 +1815,12 @@ code {
.color-danger-900 {
color: #6c1919; }
.bg-fusion-25 {
background-color: #C3C3C3;
color: #4a4a4a; }
.bg-fusion-25:hover {
color: #4a4a4a; }
.bg-fusion-50 {
background-color: #818181;
color: white; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB