Merge branch 'master' into Willy
This commit is contained in:
commit
85858ff7c0
@ -331,7 +331,7 @@ namespace SolarPower.Controllers
|
||||
await roleRepository.AddAsync(role, roleProperties);
|
||||
#endregion
|
||||
|
||||
#region 新增公司DB及Table,公司DB編號規則 solar_com_(公司編號共四碼),ex:solar_com_0001
|
||||
#region 新增公司DB及Table,公司DB編號規則 solar_com_(公司編號共四碼),ex:solar_com0001
|
||||
|
||||
var siteDBFormat = "solar_com{0}_test";
|
||||
|
||||
|
||||
@ -276,6 +276,7 @@ namespace SolarPower.Controllers
|
||||
PhotovoltaicPanelSpecification = post.PhotovoltaicPanelSpecification,
|
||||
PhotovoltaicPanelAmount = post.PhotovoltaicPanelAmount,
|
||||
SiteDB = company.SiteDB,
|
||||
SolarType = post.SolarType,
|
||||
CreatedBy = myUser.Id
|
||||
};
|
||||
|
||||
@ -303,6 +304,7 @@ namespace SolarPower.Controllers
|
||||
"PhotovoltaicPanelSpecification",
|
||||
"PhotovoltaicPanelAmount",
|
||||
"SiteDB",
|
||||
"SolarType",
|
||||
"CreatedBy"
|
||||
};
|
||||
|
||||
@ -392,6 +394,7 @@ namespace SolarPower.Controllers
|
||||
PhotovoltaicPanelProductModel = post.PhotovoltaicPanelProductModel,
|
||||
PhotovoltaicPanelSpecification = post.PhotovoltaicPanelSpecification,
|
||||
PhotovoltaicPanelAmount = post.PhotovoltaicPanelAmount,
|
||||
SolarType = post.SolarType,
|
||||
UpdatedBy = myUser.Id
|
||||
};
|
||||
|
||||
@ -416,6 +419,7 @@ namespace SolarPower.Controllers
|
||||
"PhotovoltaicPanelProductModel",
|
||||
"PhotovoltaicPanelSpecification",
|
||||
"PhotovoltaicPanelAmount",
|
||||
"SolarType",
|
||||
"UpdatedBy",
|
||||
};
|
||||
|
||||
|
||||
@ -177,6 +177,7 @@ namespace SolarPower.Models.PowerStation
|
||||
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
|
||||
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
|
||||
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
|
||||
public byte SolarType { get; set; } //電站類型
|
||||
}
|
||||
|
||||
public class UpdatePowerStationInfo : Updated
|
||||
@ -199,6 +200,7 @@ namespace SolarPower.Models.PowerStation
|
||||
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
|
||||
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
|
||||
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
|
||||
public byte SolarType { get; set; } //電站類型
|
||||
}
|
||||
|
||||
public class PostBoETPCInfo
|
||||
|
||||
@ -90,7 +90,11 @@ namespace SolarPower.Repository.Implement
|
||||
{
|
||||
try
|
||||
{
|
||||
var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0";
|
||||
var sql = @$"SELECT *, psc.SPStationAmount FROM {tableName} c
|
||||
LEFT JOIN (SELECT ps.CompanyId, COUNT(*) AS SPStationAmount
|
||||
FROM power_station ps
|
||||
WHERE ps.Deleted = 0 GROUP BY ps.CompanyId) psc ON psc.CompanyId = c.Id
|
||||
WHERE c.Deleted = 0";
|
||||
|
||||
if (filter.SelectedCompanyId > 0)
|
||||
{
|
||||
|
||||
@ -36,6 +36,10 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="card p-4 border-top-left-radius-0 border-top-right-radius-0">
|
||||
@if (ViewBag.ErrMsg != null && ViewBag.ErrMsg != "")
|
||||
{
|
||||
<p class="alert alert-danger">@ViewBag.ErrMsg</p>
|
||||
}
|
||||
<form id="login-form" asp-action="Index" method="post">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="username">帳號</label>
|
||||
|
||||
@ -327,8 +327,8 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a href="javascript:CardDisplay();" class="btn btn-secondary btn-icon waves-effect waves-themed"><span class="fal fa-list mr-1"></span></a>
|
||||
<a href="javascript:TableDisplay();" class="btn btn-secondary btn-icon waves-effect waves-themed"><span class="fal fa-grip-horizontal mr-1"></span></a>
|
||||
<a href="javascript:TableDisplay();" class="btn btn-secondary btn-icon waves-effect waves-themed"><span class="fal fa-list mr-1"></span></a>
|
||||
<a href="javascript:CardDisplay();" class="btn btn-secondary btn-icon waves-effect waves-themed"><span class="fal fa-grip-horizontal mr-1"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -343,24 +343,24 @@
|
||||
<th>裝置容量(kWp)</th>
|
||||
<th>逆變器數量</th>
|
||||
<th>台電掛表日</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@*<tr>
|
||||
<th scope="row">PEP-NTP001-PYR-01</th>
|
||||
<td>日照計01</td>
|
||||
<td>日照計</td>
|
||||
<td>ADTEK</td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>*@
|
||||
<th scope="row">PEP-NTP001-PYR-01</th>
|
||||
<td>日照計01</td>
|
||||
<td>日照計</td>
|
||||
<td>ADTEK</td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td>CS1</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-pills waves-effect waves-themed">修改</button>
|
||||
</td>
|
||||
</tr>*@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -410,10 +410,6 @@
|
||||
$(function () {
|
||||
|
||||
var localurl = this.location.href;
|
||||
|
||||
//#region 電站區域Tab
|
||||
//#endregion
|
||||
|
||||
var url = "/PowerStation/GetSolarCitySummary";
|
||||
var ids = new Array(0)
|
||||
$.post(url, function (rel) {
|
||||
@ -435,12 +431,14 @@
|
||||
$('#AreaTab' + val.cityId).find('#solarCount').html(val.amount)
|
||||
//alert(val.cityId+val.city + val.amount);
|
||||
//電站區域內容
|
||||
$('#templateArea').find('.tab-pane').attr('id', 'tab-'+val.cityId).clone().appendTo($('#area'));
|
||||
$('#templateArea').find('.tab-pane').attr('id', 'tab-' + val.cityId).clone().appendTo($('#area'));
|
||||
$('#tab-' + val.cityId).attr('aria-labelledby', val.cityId)
|
||||
$('#tab-' + val.cityId).find('#solarCard').attr('id', 'solarCard' + val.cityId);
|
||||
$('#tab-' + val.cityId).find('#solarTable').attr('id', 'solarTable' + val.cityId);
|
||||
});
|
||||
addPowerStationCard(ids);
|
||||
|
||||
$("#areaTab").find(".nav-item > a").first().click();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -462,34 +460,30 @@
|
||||
else {
|
||||
$.each(rel.data, function (index, val) {
|
||||
//電站卡片
|
||||
$('#templateCard').find('.col-xl-2').attr('id', 'card'+val.id).clone().appendTo($('#solarCard' + val.cityId));
|
||||
$('#card' + val.id).find('#editSolarUrl').attr('href', localurl + '/edit?stationId=' +val.id);
|
||||
$('#templateCard').find('.col-xl-2').attr('id', 'card' + val.id).clone().appendTo($('#solarCard' + val.cityId));
|
||||
$('#card' + val.id).find('#editSolarUrl').attr('href', localurl + '/edit?stationId=' + val.id);
|
||||
$('#card' + val.id).find('#editSolarUrl').find('#Solarimg').attr('src', val.mainDisplay);
|
||||
$('#card' + val.id).find('#solarName').text(val.name);
|
||||
$('#card' + val.id).find('#today_kwh').text(val.kwh);
|
||||
$('#card' + val.id).find('#kwhkwp').text(val.inverterAmount);
|
||||
$('#card' + val.id).find('#PR').text(val.electricityMeterAt);
|
||||
|
||||
$('#solarTable' + val.id).find('tbody').append('<tr>' +
|
||||
'<td>'+val.id+'</td>' +
|
||||
'<td>' + val.name+'</td>' +
|
||||
'<td>' + val.kwh+'</td>' +
|
||||
'<td>' + val.inverterAmount+'</td>' +
|
||||
'<td>' + val.electricityMeterAt+'</td>' +
|
||||
'<td><button type="button" class="btn btn-primary btn-pills waves-effect waves-themed" onclick="location.href=\'' + localurl + '/edit?stationId=' + val.id+ '\'">選擇</button></td>' +
|
||||
$('#solarTable' + val.cityId).find('tbody').append('<tr>' +
|
||||
'<td>' + val.id + '</td>' +
|
||||
'<td>' + val.name + '</td>' +
|
||||
'<td>' + val.kwh + '</td>' +
|
||||
'<td>' + val.inverterAmount + '</td>' +
|
||||
'<td>' + val.electricityMeterAt + '</td>' +
|
||||
'<td><button type="button" class="btn btn-primary btn-pills waves-effect waves-themed" onclick="location.href=\'' + localurl + '/edit?stationId=' + val.id + '\'">選擇</button></td>' +
|
||||
|
||||
'</tr>');
|
||||
});
|
||||
$('.nav-tabs a[href="#' + tablocation + '"]').tab('show');
|
||||
|
||||
$('.TableArea').hide();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}, 'json');
|
||||
|
||||
|
||||
}
|
||||
//電站區域
|
||||
//$('#templateAreaTab').find('li').attr('id', 'AreaTabnewtaipei').clone().appendTo($('#areaTab'));
|
||||
@ -503,13 +497,13 @@
|
||||
//$('#AreaTabHsinchu').find('a').attr('class', 'nav-link fs-lg px-4');
|
||||
//$('#AreaTabHsinchu').find('#areaName').html('新竹市')
|
||||
//$('#AreaTabHsinchu').find('#solarCount').html('3')
|
||||
|
||||
|
||||
//$('#templateAreaTab').find('li').attr('id', 'AreaTabPingtung').clone().appendTo($('#areaTab'));
|
||||
//$('#AreaTabPingtung').find('a').attr('href', '#tab-Pingtung');
|
||||
//$('#AreaTabPingtung').find('a').attr('class', 'nav-link fs-lg px-4');
|
||||
//$('#AreaTabPingtung').find('#areaName').html('屏東縣')
|
||||
//$('#AreaTabPingtung').find('#solarCount').html('1')
|
||||
|
||||
|
||||
//電站區域內容
|
||||
//$('#templateArea').find('.tab-pane').attr('id', 'tab-newtaipei').clone().appendTo($('#area'));
|
||||
//$('#tab-newtaipei').attr('aria-labelledby', 'tab-newtaipei')
|
||||
@ -527,14 +521,14 @@
|
||||
//$('#tab-Pingtung').find('#solarTable').attr('id', 'solarTablePingtung');
|
||||
|
||||
//電站卡片
|
||||
|
||||
|
||||
|
||||
$('.nav-tabs a[href="#tab-newtaipei"]').tab('show');
|
||||
|
||||
$('.TableArea').hide();
|
||||
|
||||
TableDisplay();
|
||||
});
|
||||
function CardDisplay() {
|
||||
$('.TableArea').hide();
|
||||
$('.TableArea').hide();
|
||||
$('.solarCard').show();
|
||||
|
||||
}
|
||||
|
||||
@ -129,6 +129,8 @@
|
||||
$("#canecl-station-info-btn").hide();
|
||||
$("#check_escrow").attr('disabled', false);
|
||||
|
||||
$("#select_solar_tpye").attr('disabled', false);
|
||||
|
||||
$(".city-name").hide();
|
||||
$(".power-station-name").html("新增電站");
|
||||
|
||||
@ -864,7 +866,8 @@
|
||||
PhotovoltaicPanelBrand: $("#photovoltaic_panel_brand").val(),
|
||||
PhotovoltaicPanelSpecification: $("#photovoltaic_panel_specification").val(),
|
||||
PhotovoltaicPanelAmount: $("#photovoltaic_panel_amount").val(),
|
||||
PhotovoltaicPanelProductModel: $("#photovoltaic_panel_product_model").val()
|
||||
PhotovoltaicPanelProductModel: $("#photovoltaic_panel_product_model").val(),
|
||||
SolarType: $("#select_solar_tpye").val()
|
||||
}
|
||||
|
||||
$.post(url, send_data, function (rel) {
|
||||
@ -1006,6 +1009,8 @@
|
||||
$("#electricity_meter_at").hide();
|
||||
$("#estimated_recovery_time").hide();
|
||||
|
||||
$("#select_solar_tpye").attr("disabled", true);
|
||||
|
||||
$("#generating_capacity").hide();
|
||||
$("#escrow_name").hide();
|
||||
$("#power_rate").hide();
|
||||
@ -1066,6 +1071,8 @@
|
||||
$("#electricity_meter_at").show();
|
||||
$("#estimated_recovery_time").show();
|
||||
|
||||
$("#select_solar_tpye").attr("disabled", false);
|
||||
|
||||
$("#generating_capacity").show();
|
||||
$("#escrow_name").show();
|
||||
$("#power_rate").show();
|
||||
@ -1244,6 +1251,7 @@
|
||||
|
||||
$("#select_city").val(powerStationData.cityId).trigger("change");
|
||||
$("#select_area").val(powerStationData.areaId);
|
||||
$("#select_solar_tpye").val(powerStationData.solarType);
|
||||
|
||||
//#region 電站基本資料 文字
|
||||
$("#address_detail_text").html(powerStationData.address);
|
||||
@ -2227,7 +2235,7 @@
|
||||
|
||||
//#region 創建電站圖片box
|
||||
function CreatePowerStationImageBox(dom, value) {
|
||||
var str = '<div class="col-xl">' +
|
||||
var str = '<div class="col-xl" style="max-width: 20%;">' +
|
||||
'<div class="card border m-auto m-lg-0" style="padding: 9.5px;">' +
|
||||
'<img src="' + value.image + '" class="card-img-top img-zoom" alt="...">' +
|
||||
'<a href="javascript:void(0);" class="btn btn-danger btn-lg btn-icon rounded-circle waves-effect waves-themed position-absolute pos-top pos-right del-power-station-image-btn" data-id="' + value.id + '">' +
|
||||
@ -2369,7 +2377,7 @@
|
||||
|
||||
//#region 創建單線圖box
|
||||
function CreatePowerStationSingleLineBox(dom, value) {
|
||||
var str = '<div class="col-xl">' +
|
||||
var str = '<div class="col-xl" style="max-width: 20%;">' +
|
||||
'<div class="card border m-auto m-lg-0" style="padding: 9.5px;">' +
|
||||
'<img src="' + value.image + '" class="card-img-top img-zoom" alt="...">' +
|
||||
'<a href="javascript:void(0);" class="btn btn-danger btn-lg btn-icon rounded-circle waves-effect waves-themed position-absolute pos-top pos-right del-power-station-single-line-btn" data-id="' + value.id + '">' +
|
||||
|
||||
@ -34,12 +34,22 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-6 row align-items-center">
|
||||
<div class="col-xl-3 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>
|
||||
<div class="col-xl-3 row justify-content-center align-items-center">
|
||||
<label class="col-xl-4 form-label" id="solar_tpye_label">電站類型</label>
|
||||
<div class="col-xl-8">
|
||||
<select class="form-control" id="select_solar_tpye">
|
||||
<option value="0" selected>自建躉售</option>
|
||||
<option value="1" selected>租建躉售</option>
|
||||
<option value="2" selected>自建自用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3 d-flex justify-content-between">
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" id="power-station-image-card">
|
||||
<div class="row d-flex justify-content-between img-zoom-div">
|
||||
<div class="row d-flex justify-content-start img-zoom-div">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" id="power-station-single-line-card">
|
||||
<div class="row d-flex justify-content-between img-zoom-div">
|
||||
<div class="row d-flex justify-content-start img-zoom-div">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user