暫時關閉誇月查詢
This commit is contained in:
parent
2a89454628
commit
34635571a9
@ -75,7 +75,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
apiResult.Code = "9999";
|
apiResult.Code = "9999";
|
||||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。" + exception.Message;
|
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||||
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
apiResult.Code = "9999";
|
apiResult.Code = "9999";
|
||||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。" + exception.Message;
|
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||||
if (exception.Message.Contains($" for key 'PRIMARY'"))
|
if (exception.Message.Contains($" for key 'PRIMARY'"))
|
||||||
{
|
{
|
||||||
apiResult.Msg = "已有相同使用者。";
|
apiResult.Msg = "已有相同使用者。";
|
||||||
@ -140,7 +140,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
apiResult.Code = "9999";
|
apiResult.Code = "9999";
|
||||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。" + exception.Message;
|
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||||
if (exception.Message.Contains($"a foreign key constraint"))
|
if (exception.Message.Contains($"a foreign key constraint"))
|
||||||
{
|
{
|
||||||
apiResult.Msg = "水電報表仍有該用戶,無法修改名稱。";
|
apiResult.Msg = "水電報表仍有該用戶,無法修改名稱。";
|
||||||
@ -167,7 +167,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
apiResult.Code = "9999";
|
apiResult.Code = "9999";
|
||||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。" + exception.Message;
|
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||||
if (exception.Message.Contains($"a foreign key constraint"))
|
if (exception.Message.Contains($"a foreign key constraint"))
|
||||||
{
|
{
|
||||||
apiResult.Msg = "水電報表仍有該用戶,無法刪除。";
|
apiResult.Msg = "水電報表仍有該用戶,無法刪除。";
|
||||||
@ -222,7 +222,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
apiResult.Code = "9999";
|
apiResult.Code = "9999";
|
||||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。" + exception.Message;
|
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||||
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,27 +273,29 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sqlString =
|
//sqlString =
|
||||||
$"UPDATE {TenantBilltable} " +
|
// $"UPDATE {TenantBilltable} " +
|
||||||
$"set tenant_name = (SELECT tenant_name from archive_electric_meter_tenant_list WHERE tenant_guid = '{tb.tenant_guid}'), start_timestamp = '{start_timestamp}',end_timestamp = '{end_timestamp}' , " +
|
// $"set tenant_name = (SELECT tenant_name from archive_electric_meter_tenant_list WHERE tenant_guid = '{tb.tenant_guid}'), start_timestamp = '{start_timestamp}',end_timestamp = '{end_timestamp}' , " +
|
||||||
$"result= " +
|
// $"result= " +
|
||||||
$"(SELECT sum(sub_result) " +
|
// $"(SELECT sum(sub_result) " +
|
||||||
$"FROM ( " +
|
// $"FROM ( " +
|
||||||
$" SELECT start_timestamp,device_number, sub_result " +
|
// $" SELECT start_timestamp,device_number, sub_result " +
|
||||||
$" FROM archive_electric_water_meter_day_{startMonth} " +
|
// $" FROM archive_electric_water_meter_day_{startMonth} " +
|
||||||
$" WHERE device_number = '{tb.device_number}' " +
|
// $" WHERE device_number = '{tb.device_number}' " +
|
||||||
$" UNION ALL " +
|
// $" UNION ALL " +
|
||||||
$" SELECT start_timestamp,device_number, sub_result " +
|
// $" SELECT start_timestamp,device_number, sub_result " +
|
||||||
$" FROM archive_electric_water_meter_day_{endMonth} " +
|
// $" FROM archive_electric_water_meter_day_{endMonth} " +
|
||||||
$" WHERE device_number = '{tb.device_number}' " +
|
// $" WHERE device_number = '{tb.device_number}' " +
|
||||||
$") combined_result " +
|
// $") combined_result " +
|
||||||
$"WHERE start_timestamp BETWEEN '{start_timestamp}' and '{end_timestamp}' " +
|
// $"WHERE start_timestamp BETWEEN '{start_timestamp}' and '{end_timestamp}' " +
|
||||||
$"GROUP BY device_number) ," +
|
// $"GROUP BY device_number) ," +
|
||||||
$"bill = " +
|
// $"bill = " +
|
||||||
$"ROUND(result *(SELECT {bill_per} from {TenantListtable} WHERE tenant_guid = '{tb.tenant_guid}') ), " +
|
// $"ROUND(result *(SELECT {bill_per} from {TenantListtable} WHERE tenant_guid = '{tb.tenant_guid}') ), " +
|
||||||
$"updated_at = '{updated_at}', " +
|
// $"updated_at = '{updated_at}', " +
|
||||||
$"tenant_guid = '{tb.tenant_guid}' " +
|
// $"tenant_guid = '{tb.tenant_guid}' " +
|
||||||
$"WHERE device_number = '{tb.device_number}'";
|
// $"WHERE device_number = '{tb.device_number}'";
|
||||||
|
apiResult.Code = "9999";
|
||||||
|
apiResult.Msg = "請選擇同一個月份";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +309,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
apiResult.Code = "9999";
|
apiResult.Code = "9999";
|
||||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。" + exception.Message;
|
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||||
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,7 +350,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
_logger.LogError(exception.ToString());
|
//Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||||
}
|
}
|
||||||
return new FileContentResult(new byte[0], "application/pdf")
|
return new FileContentResult(new byte[0], "application/pdf")
|
||||||
{
|
{
|
||||||
@ -431,7 +433,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
{
|
{
|
||||||
string path = Configuration.GetValue<string>("FilePath:OutputFormTemplate");
|
string path = Configuration.GetValue<string>("FilePath:OutputFormTemplate");
|
||||||
//string path = _webHostEnvironment.ContentRootPath + "\\StaticFiles\\import.html";
|
//string path = _webHostEnvironment.ContentRootPath + "\\StaticFiles\\import.html";
|
||||||
if (!File.Exists(path))
|
if (!System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -445,7 +447,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
{
|
{
|
||||||
bill += $" <div class=\"container a4-page\"> " +
|
bill += $" <div class=\"container a4-page\"> " +
|
||||||
$" <div class=\"header\"> " +
|
$" <div class=\"header\"> " +
|
||||||
$" <img src=\"/img/dome.png\" alt=\"Taipei Dome Logo\" width=\"200\"> " +
|
$" <img src=\"C:\\jay.chang\\ibms\\FrontendWebApi\\wwwroot\\img\\dome.png\" alt=\"Taipei Dome Logo\" width=\"200\"> " +
|
||||||
$" <h2>水電費用明細</h2> " +
|
$" <h2>水電費用明細</h2> " +
|
||||||
$" </div> " +
|
$" </div> " +
|
||||||
$" <div class=\"statistics\"> " +
|
$" <div class=\"statistics\"> " +
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
"JwtLifeSeconds": 3600
|
"JwtLifeSeconds": 3600
|
||||||
},
|
},
|
||||||
"FilePath": {
|
"FilePath": {
|
||||||
"OutputForm": "D:\\jay.chang\\FrontendWebApi\\wwwroot\\upload\\OutputForm\\", //水電報表 檔案儲存位置
|
"OutputForm": "C:\\jay.chang\\ibms\\FrontendWebApi\\wwwroot\\upload\\OutputForm\\", //水電報表 檔案儲存位置
|
||||||
"OutputFormTemplate": "D:\\jay.chang\\FrontendWebApi\\wwwroot\\upload\\OutputFormTemplate\\import.html" // 水電報表範本檔位置
|
"OutputFormTemplate": "C:\\jay.chang\\ibms\\FrontendWebApi\\wwwroot\\upload\\OutputFormTemplate\\import.html" // 水電報表範本檔位置
|
||||||
},
|
},
|
||||||
"DBConfig": {
|
"DBConfig": {
|
||||||
"MySqlDBConfig": {
|
"MySqlDBConfig": {
|
||||||
|
Loading…
Reference in New Issue
Block a user