|
@@ -1301,7 +1301,8 @@ class CronComparedDataView(View):
|
|
order_list = PayPalService(PAYPAL_CRD['client_id'], PAYPAL_CRD['client_secret']).get_transactions(data)
|
|
order_list = PayPalService(PAYPAL_CRD['client_id'], PAYPAL_CRD['client_secret']).get_transactions(data)
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_paypal_order,
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_paypal_order,
|
|
args=(order_list['transaction_details'], end_date))
|
|
args=(order_list['transaction_details'], end_date))
|
|
- thread.start()
|
|
|
|
|
|
+ thread.start() # 启动线程
|
|
|
|
+ thread.join() # 主线程等待子线程结束
|
|
return response.json(0)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
LOGGER.info('CronComparedDataView.compared_paypal_order, errLine:{}, errMsg:{}'.format(
|
|
LOGGER.info('CronComparedDataView.compared_paypal_order, errLine:{}, errMsg:{}'.format(
|
|
@@ -1377,7 +1378,6 @@ class CronComparedDataView(View):
|
|
order_ids=order_ids, creat_time=now_time, upd_time=now_time)
|
|
order_ids=order_ids, creat_time=now_time, upd_time=now_time)
|
|
LOGGER.info('paypal每日对账结束时间:{}'.format(int(time.time())))
|
|
LOGGER.info('paypal每日对账结束时间:{}'.format(int(time.time())))
|
|
|
|
|
|
-
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def compared_wechat_order(response):
|
|
def compared_wechat_order(response):
|
|
today = datetime.datetime.today()
|
|
today = datetime.datetime.today()
|
|
@@ -1388,6 +1388,7 @@ class CronComparedDataView(View):
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_wechat_order,
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_wechat_order,
|
|
args=(order_list,))
|
|
args=(order_list,))
|
|
thread.start()
|
|
thread.start()
|
|
|
|
+ thread.join() # 主线程等待子线程结束
|
|
return response.json(0)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
LOGGER.info('CronComparedDataView.compared_wechat_order, errLine:{}, errMsg:{}'.format(
|
|
LOGGER.info('CronComparedDataView.compared_wechat_order, errLine:{}, errMsg:{}'.format(
|
|
@@ -1447,6 +1448,7 @@ class CronComparedDataView(View):
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_alipay_order,
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_alipay_order,
|
|
args=(order_list,))
|
|
args=(order_list,))
|
|
thread.start()
|
|
thread.start()
|
|
|
|
+ thread.join() # 主线程等待子线程结束
|
|
return response.json(0)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
LOGGER.info('CronComparedDataView.compared_alipay_order, errLine:{}, errMsg:{}'.format(
|
|
LOGGER.info('CronComparedDataView.compared_alipay_order, errLine:{}, errMsg:{}'.format(
|
|
@@ -1495,7 +1497,8 @@ class CronComparedDataView(View):
|
|
return response.json(0, list(order_qs))
|
|
return response.json(0, list(order_qs))
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_ansjer_order,
|
|
thread = threading.Thread(target=CronComparedDataView.thread_compared_ansjer_order,
|
|
args=(list(order_qs), start_date))
|
|
args=(list(order_qs), start_date))
|
|
- thread.start()
|
|
|
|
|
|
+ thread.start() # 启动线程
|
|
|
|
+ thread.join() # 主线程等待子线程结束
|
|
return response.json(0)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
LOGGER.info('CronComparedDataView.compared_ansjer_order, errLine:{}, errMsg:{}'.format(
|
|
LOGGER.info('CronComparedDataView.compared_ansjer_order, errLine:{}, errMsg:{}'.format(
|