|
@@ -3,7 +3,7 @@
|
|
|
"""
|
|
|
Created on Mon May 18 13:13:00 2020
|
|
|
@author: chencong
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
"""
|
|
@@ -545,15 +545,22 @@ def mysql_insert_order(data):
|
|
|
cursor = db.cursor()
|
|
|
|
|
|
|
|
|
- sql = 'replace into quchen_text.order_daily (amount,channel,channel_id,date,from_novel,order_id,order_time,platform,reg_time,stage,user_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);'
|
|
|
-
|
|
|
+ sql1 = 'replace into quchen_text.order_daily (amount,channel,channel_id,date,from_novel,order_id,order_time,platform,reg_time,stage,user_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);'
|
|
|
+ sql2 = 'replace into quchen_text.order(amount,channel,channel_id,date,from_novel,order_id,order_time,platform,reg_time,stage,user_id) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s);'
|
|
|
+ try:
|
|
|
+ cursor.executemany(sql1,data)
|
|
|
+ db.commit()
|
|
|
+ print('access insert order_daily',len(data))
|
|
|
+ except:
|
|
|
+ db.rollback()
|
|
|
+ print('defeat order_daily')
|
|
|
try:
|
|
|
- cursor.executemany(sql,data)
|
|
|
+ cursor.executemany(sql2,data)
|
|
|
db.commit()
|
|
|
print('access insert order',len(data))
|
|
|
except:
|
|
|
db.rollback()
|
|
|
- print('defeat')
|
|
|
+ print('defeat order')
|
|
|
|
|
|
|
|
|
|
|
@@ -561,8 +568,8 @@ def start_all_job():
|
|
|
request_time_stamp = time.time()
|
|
|
st_unix = int((request_time_stamp+8*3600)//86400*86400-8*3600-86400)
|
|
|
et_unix = int((request_time_stamp+8*3600)//86400*86400-8*3600)
|
|
|
- st_dt = time.strftime("%Y-%m-%dT%H:%M:%S",time.localtime(st_unix))+'+08:00'
|
|
|
- et_dt = time.strftime("%Y-%m-%dT%H:%M:%S",time.localtime(et_unix))+'+08:00'
|
|
|
+ st_dt = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(st_unix)) + '+08:00'
|
|
|
+ et_dt = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(et_unix)) + '+08:00'
|
|
|
get_yuewen_order(st_unix,et_unix)
|
|
|
get_ysg_order(st_unix,et_unix)
|
|
|
get_zhangdu_order(st_unix,et_unix)
|
|
@@ -571,7 +578,7 @@ def start_all_job():
|
|
|
|
|
|
|
|
|
|
|
|
-start_job_time = '2020-09-26 03:05:00'
|
|
|
+start_job_time = '2020-09-27 03:05:00'
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
@@ -579,4 +586,3 @@ if __name__ == '__main__':
|
|
|
scheduler.add_job(start_all_job, 'interval',days=1,start_date=start_job_time)
|
|
|
scheduler.start()
|
|
|
|
|
|
-
|