逆變器計算---逾時

This commit is contained in:
b110212000 2021-10-01 17:05:05 +08:00
parent b1a62fde79
commit 7193826d63
4 changed files with 15 additions and 7 deletions

View File

@ -914,7 +914,14 @@ namespace SolarPower.Controllers
}
catch (Exception exception)
{
apiResult.Code = "9999";
if(exception.Message == "Fatal error encountered during command execution.")
{
apiResult.Code = "9984";
}
else
{
apiResult.Code = "9999";
}
Logger.LogError("【" + controllerName + "/" + actionName + "】");
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}

View File

@ -17,10 +17,11 @@ namespace SolarPower.Models
{
{ "0000", "OK" },
{ "0001", "傳入參數錯誤。" },
{ "0002","請先刪除相關逆變器"},
{ "0003","請先刪除相關設備"},
{ "0004","請先移除相關逆變器綁定"},
{ "9985","該電站尚無逆變器資料"},
{ "0002", "請先刪除相關逆變器"},
{ "0003", "請先刪除相關設備"},
{ "0004", "請先移除相關逆變器綁定"},
{ "9984", "連線逾時"},
{ "9985", "該電站尚無逆變器資料"},
{ "9986", "該帳號已被註冊,請重新輸入"},
{ "9987", "查無該運維作業記錄檔案"},
{ "9988", "查無該資料紀錄"},

View File

@ -4475,7 +4475,7 @@ namespace SolarPower.Repository.Implement
}
sql = "SELECT * FROM (" + string.Join(" UNION ", sql_perSiteDB) + ") a ORDER BY a.TIMESTAMP ASC";
result = (await conn.QueryAsync<InverterHistory>(sql, new { NowDay = nowDay })).ToList();
result = (await conn.QueryAsync<InverterHistory>(sql, new { NowDay = nowDay }, commandTimeout: 300)).ToList();
}
catch (Exception exception)
{

View File

@ -243,7 +243,7 @@ namespace SolarPower.Repository.Implement
break;
}
a = await conn.QueryAsync<dynamic>(sql,commandTimeout: 300);
a = await conn.QueryAsync<dynamic>(sql, commandTimeout: 300);
}
catch (Exception exception)
{