This commit is contained in:
jiahao 2023-10-28 00:46:56 +08:00
parent 3718f3d182
commit f507a0d1b1
3 changed files with 16 additions and 12 deletions

View File

@ -405,7 +405,7 @@ namespace solarApp.Service
_logger.LogError("【ProcInvSvc】執行失敗[{0}]在{1}逆變器day補償 - [Exception]{2}", _siteID, _date1, ex.ToString()); _logger.LogError("【ProcInvSvc】執行失敗[{0}]在{1}逆變器day補償 - [Exception]{2}", _siteID, _date1, ex.ToString());
} }
//throw ex; //throw ex;
arclog.insert_log(_powerStationID, "inverter_history_day step1 ", 0, "inverter_history_day", "insert inverter_history_day error", "0", "", "", conn, cmd); arclog.insert_log(_powerStationID, "inverter_history_day step1 ", 0, "inverter_history_day", "insert inverter_history_day error", "0", "", ex.Message, conn, cmd);
} }
#endregion day #endregion day
@ -470,7 +470,7 @@ namespace solarApp.Service
_logger.LogError("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償", _siteID, _date1); _logger.LogError("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償", _siteID, _date1);
_logger.LogError("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償 - [Exception]{2}", _siteID, _date1, ex.ToString()); _logger.LogError("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償 - [Exception]{2}", _siteID, _date1, ex.ToString());
} }
arclog.insert_log(_powerStationID, "inverter_history_month step1 ", 0, "inverter_history_month", "insert inverter_history_month error", "0", "", "", conn, cmd); arclog.insert_log(_powerStationID, "inverter_history_month step1 ", 0, "inverter_history_month", "insert inverter_history_month error", "0", "", ex.Message, conn, cmd);
// throw ex; // throw ex;
} }

View File

@ -562,7 +562,7 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
arclog.insert_log(_powerStationID, "sensor step1 ", 0, "sensor_history_", "insert sensor error", "err", "", "", conn, cmd); arclog.insert_log(_powerStationID, "sensor step1 ", 0, "sensor_history_", "insert sensor error", "err", "", ex.Message, conn, cmd);
//throw ex; //throw ex;
} }
@ -628,7 +628,7 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
arclog.insert_log(_powerStationID, "sensor step1 irrDayHour", 0, "sensor_history_", "sensor_history_hour error", "err", "", "", conn, cmd); arclog.insert_log(_powerStationID, "sensor step1 irrDayHour", 0, "sensor_history_", "sensor_history_hour error", "err", "", ex.Message, conn, cmd);
//throw ex; //throw ex;
} }
conn.Close(); conn.Close();
@ -716,7 +716,7 @@ namespace solarApp.Service
catch (Exception ex) catch (Exception ex)
{ {
//throw ex; //throw ex;
arclog.insert_log(_powerStationID, "sensor step1 meter_hour", 0, "meter_history_hour", "meter_history_hour error", "err", "", "", conn, null); arclog.insert_log(_powerStationID, "sensor step1 meter_hour", 0, "meter_history_hour", "meter_history_hour error", "err", "", ex.Message, conn, null);
} }
conn.Close(); conn.Close();
} }
@ -762,7 +762,7 @@ namespace solarApp.Service
catch (Exception ex) catch (Exception ex)
{ {
//throw ex; //throw ex;
arclog.insert_log(_powerStationID, "sensor step1 meter_hour", 0, "meter_history_hour", "meter_history_hour error", "0", "", "", conn, null); arclog.insert_log(_powerStationID, "sensor step1 meter_hour", 0, "meter_history_hour", "meter_history_hour error", "0", "", ex.Message, conn, null);
} }
conn.Close(); conn.Close();
} }
@ -1086,7 +1086,7 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
arclog.insert_log(_powerStationID, "sensor step1 for irrDayHour", duration.TotalSeconds, "sensor_history_hour", "update sensor hour", "0", "", rowCT.ToString(), conn, cmd); arclog.insert_log(_powerStationID, "sensor step1 for irrDayHour", duration.TotalSeconds, "sensor_history_hour", "update sensor hour", "0", "", ex.Message, conn, cmd);
//throw ex; //throw ex;
} }

View File

@ -5,6 +5,7 @@ using MySql.Data.MySqlClient;
using Dapper; using Dapper;
using solarApp.Model; using solarApp.Model;
using System.Configuration; using System.Configuration;
//using Google.Protobuf.WellKnownTypes;
namespace solarApp.Service namespace solarApp.Service
{ {
@ -31,6 +32,7 @@ namespace solarApp.Service
//public string _date2 { get; set; } //public string _date2 { get; set; }
public string _powerStationID { get; set; } public string _powerStationID { get; set; }
procArchiveLog arclog = new procArchiveLog();
public bool clearData() public bool clearData()
{ {
@ -71,7 +73,8 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
throw ex; arclog.insert_log(_powerStationID, "clearData procStation", 0, "sensor_history_hour", "update sensor hour", "0", "", ex.Message, null, null);
// throw ex;
} }
return result; return result;
} }
@ -365,8 +368,8 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
throw ex; //throw ex;
arclog.insert_log(_powerStationID, "insert_station ", 0, "insert_station", "insert_station", "0", "", ex.Message, conn, cmd); arclog.insert_log(_powerStationID, "insert_station ", 0, "insert_station", "insert_station", "0", "", ex.Message, null, null);
} }
return result; return result;
} }
@ -389,7 +392,8 @@ namespace solarApp.Service
} }
catch (Exception ex) catch (Exception ex)
{ {
throw ex; arclog.insert_log(_powerStationID, "update_powerStationPerHour ", 0, table_name, "update_powerStationPerHour", "0", "", ex.Message, null, null);
} }
//result = await conn.QueryFirstOrDefaultAsync<PowerStationHistory>(sql, new { DateTime = dateTime }); //result = await conn.QueryFirstOrDefaultAsync<PowerStationHistory>(sql, new { DateTime = dateTime });