From a07d080198f277829e955478b6ab70aa57058bfd Mon Sep 17 00:00:00 2001 From: jiahao Date: Tue, 5 Dec 2023 23:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=B8=E6=AA=94=E6=97=A5=E6=9C=9F=E6=94=B9?= =?UTF-8?q?=E7=82=BA=E4=B8=8A=E5=80=8B=E6=9C=88=20addMonth(-1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solarApp/Service/archiveLowData.cs | 4 ++-- solarApp/Service/getStationSvc.cs | 2 +- solarApp/Service/procInvSvc.cs | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/solarApp/Service/archiveLowData.cs b/solarApp/Service/archiveLowData.cs index a8afd6c..24302cb 100644 --- a/solarApp/Service/archiveLowData.cs +++ b/solarApp/Service/archiveLowData.cs @@ -43,8 +43,8 @@ namespace solarApp.Service // string yyyymm = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM"); _siteID = siteID; //搬移的月份 - // move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM")+ "-01"; - move_month = System.DateTime.Now.ToString("yyyy-MM") + "-01"; //這個月 + move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM")+ "-01"; + // move_month = System.DateTime.Now.ToString("yyyy-MM") + "-01"; //這個月 //_date1 = date1; get_siteInfo(); diff --git a/solarApp/Service/getStationSvc.cs b/solarApp/Service/getStationSvc.cs index 62873e5..ff681ba 100644 --- a/solarApp/Service/getStationSvc.cs +++ b/solarApp/Service/getStationSvc.cs @@ -87,7 +87,7 @@ namespace solarApp.Service /// public List get_station_rawAvg(string date1, string date2, string siteDB, string siteID) { - List ds; + List ds = null; using (MySqlConnection conn = new MySqlConnection(Connection1)) { conn.Open(); diff --git a/solarApp/Service/procInvSvc.cs b/solarApp/Service/procInvSvc.cs index 80ef61a..dae1b17 100644 --- a/solarApp/Service/procInvSvc.cs +++ b/solarApp/Service/procInvSvc.cs @@ -319,7 +319,7 @@ namespace solarApp.Service logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器hour補償", _siteID, _date1); logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器hour補償 - [Exception]:{2}", _siteID, _date1, ex.ToString()); - arclog.insert_log(_powerStationID, "inverter_history_hour step1 " + _date1, 0, "inverter_history_hour", "insert inverter_history_hour error", "0", "", "", conn, cmd); + // arclog.insert_log(_powerStationID, "inverter_history_hour step1 " + _date1, 0, "inverter_history_hour", "insert inverter_history_hour error", "0", "", "", conn, cmd); // throw ex; } @@ -372,7 +372,6 @@ namespace solarApp.Service cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); cmd.Dispose(); - logger.Information("【ProcInvSvc】執行完成[{0}]在{1}逆變器day補償", _siteID, _date1); } @@ -382,7 +381,7 @@ namespace solarApp.Service logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器day補償", _siteID, _date1); logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器day補償 - [Exception]:{2}", _siteID, _date1, ex.ToString()); //throw ex; - arclog.insert_log(_powerStationID, "inverter_history_day step1 ", 0, "inverter_history_day", "insert inverter_history_day error", "0", "", ex.Message, 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 @@ -443,7 +442,7 @@ namespace solarApp.Service logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償", _siteID, _date1); logger.Error("【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", "", ex.Message, 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; }