修正報表錯誤

This commit is contained in:
b110212000 2021-08-10 10:03:37 +08:00
parent 09d355ae98
commit d04ce71a37
3 changed files with 25 additions and 7 deletions

View File

@ -132,11 +132,23 @@ namespace SolarPower.Controllers
{
ApiResult<dynamic> apiResult = new ApiResult<dynamic>();
try
{
var checkinv = stationReportRepository.Findhaveinv(post);
var getinvsql = checkinv.Result[0] as IDictionary<string, object>;
if (getinvsql["mySelect"] == null)
{
apiResult.Code = "9985";
apiResult.Msg = errorCode.GetString(apiResult.Code);
}
else
{
var a = await stationReportRepository.Gettablebody(post);
apiResult.Code = "0000";
apiResult.Data = a;
}
}
catch (Exception exception)
{
apiResult.Code = "9999";
@ -741,7 +753,8 @@ namespace SolarPower.Controllers
Userid = postObject.Userid
};
var k = stationReportRepository.Findhaveinv(select_Table);
if(k.Result[0].values == null)
var getinvsql = k.Result[0] as IDictionary<string, object>;
if (getinvsql["mySelect"] == null)
{
return "";
}

View File

@ -20,6 +20,7 @@ namespace SolarPower.Models
{ "0002","請先刪除相關逆變器"},
{ "0003","請先刪除相關設備"},
{ "0004","請先移除相關逆變器綁定"},
{ "9985","該電站尚無逆變器資料"},
{ "9986", "該帳號已被註冊,請重新輸入"},
{ "9987", "查無該運維作業記錄檔案"},
{ "9988", "查無該資料紀錄"},

View File

@ -742,14 +742,19 @@
var url = "/StationReport/GetForm";
$.post(url, send_data, function (rel) {
if (rel.code != "0000") {
if (rel.code == "9985") {
toast_warning(rel.msg);
} else {
toast_error(rel.msg);
}
$('#TableBody').empty();
$('#totbody').empty();
return;
}
var sta = "";
$('#TableBody').empty();
$('#totbody').empty();
$('#tothead').empty();
if (form == 0) {//日報表
var thour = 0;
var tpr = 0;
@ -934,7 +939,6 @@
haveinvertName = [];
}
$('.overflow-auto').show();
nowform = form;
}, 'json');
}