|
@@ -29,8 +29,8 @@ start_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedel
|
|
end_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta(months=-1)).strftime("%Y%m")+"01"
|
|
end_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta(months=-1)).strftime("%Y%m")+"01"
|
|
# print(start_date_month,end_date_month)
|
|
# print(start_date_month,end_date_month)
|
|
|
|
|
|
-# start_date_month = "20220903"
|
|
|
|
-# end_date_month = "20230201"
|
|
|
|
|
|
+# start_date_month = "20230301"
|
|
|
|
+# end_date_month = "20230401"
|
|
def job():
|
|
def job():
|
|
if datetime.date.today().day != 4:
|
|
if datetime.date.today().day != 4:
|
|
print("%s 等待4号执行程序"%datetime_now())
|
|
print("%s 等待4号执行程序"%datetime_now())
|
|
@@ -38,6 +38,7 @@ def job():
|
|
# 连接mysql
|
|
# 连接mysql
|
|
MysqlUtil = MysqlUtils(**mysql)
|
|
MysqlUtil = MysqlUtils(**mysql)
|
|
|
|
|
|
|
|
+ days = get_day_1(start_date_month, end_date_month)
|
|
for date in days:
|
|
for date in days:
|
|
print("%s 开始导入%s的数据"%(datetime_now(),date))
|
|
print("%s 开始导入%s的数据"%(datetime_now(),date))
|
|
MysqlUtil.update_two(REPLACE_EQUIP_SQL%(date),DELETE_EQUIP_SQL%(date))
|
|
MysqlUtil.update_two(REPLACE_EQUIP_SQL%(date),DELETE_EQUIP_SQL%(date))
|
|
@@ -50,6 +51,5 @@ def job():
|
|
|
|
|
|
schedule.every().day.at("08:30").do(job)
|
|
schedule.every().day.at("08:30").do(job)
|
|
while True:
|
|
while True:
|
|
- days = get_day_1(start_date_month, end_date_month)
|
|
|
|
schedule.run_pending()
|
|
schedule.run_pending()
|
|
time.sleep(30)
|
|
time.sleep(30)
|