逆變器計算---逾時

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

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

View File

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

View File

@ -4475,7 +4475,7 @@ namespace SolarPower.Repository.Implement
} }
sql = "SELECT * FROM (" + string.Join(" UNION ", sql_perSiteDB) + ") a ORDER BY a.TIMESTAMP ASC"; 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) catch (Exception exception)
{ {