歸檔日期改為上個月 addMonth(-1)

This commit is contained in:
jiahao 2023-12-05 23:52:21 +08:00
parent df2654fb57
commit a07d080198
3 changed files with 6 additions and 7 deletions

View File

@ -43,8 +43,8 @@ namespace solarApp.Service
// string yyyymm = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM"); // string yyyymm = System.DateTime.Now.AddMonths(-2).ToString("yyyy-MM");
_siteID = siteID; _siteID = siteID;
//搬移的月份 //搬移的月份
// move_month = System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM")+ "-01"; 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.ToString("yyyy-MM") + "-01"; //這個月
//_date1 = date1; //_date1 = date1;
get_siteInfo(); get_siteInfo();

View File

@ -87,7 +87,7 @@ namespace solarApp.Service
/// <returns></returns> /// <returns></returns>
public List<raw_station_day> get_station_rawAvg(string date1, string date2, string siteDB, string siteID) public List<raw_station_day> get_station_rawAvg(string date1, string date2, string siteDB, string siteID)
{ {
List<raw_station_day> ds; List<raw_station_day> ds = null;
using (MySqlConnection conn = new MySqlConnection(Connection1)) using (MySqlConnection conn = new MySqlConnection(Connection1))
{ {
conn.Open(); conn.Open();

View File

@ -319,7 +319,7 @@ namespace solarApp.Service
logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器hour補償", _siteID, _date1); logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器hour補償", _siteID, _date1);
logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器hour補償 - [Exception]{2}", _siteID, _date1, ex.ToString()); 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; // throw ex;
} }
@ -372,7 +372,6 @@ namespace solarApp.Service
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
cmd.Parameters.Clear(); cmd.Parameters.Clear();
cmd.Dispose(); cmd.Dispose();
logger.Information("【ProcInvSvc】執行完成[{0}]在{1}逆變器day補償", _siteID, _date1); 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補償", _siteID, _date1);
logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器day補償 - [Exception]{2}", _siteID, _date1, ex.ToString()); logger.Error("【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", "", 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 #endregion day
@ -443,7 +442,7 @@ namespace solarApp.Service
logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償", _siteID, _date1); logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償", _siteID, _date1);
logger.Error("【ProcInvSvc】執行失敗[{0}]在{1}逆變器month補償 - [Exception]{2}", _siteID, _date1, ex.ToString()); 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; // throw ex;
} }