|
@@ -1252,7 +1252,7 @@ class SpApiRequest:
|
|
|
client = get_client(host='3.93.43.158', port=8123, username='root',
|
|
|
password='6f0eyLuiVn3slzbGWpzI')
|
|
|
tmp_df = client.query_df(
|
|
|
- """select date from ams.performance where seller_id='%s' and country_code='%s' and date='%s' and isFeedback=1""" % (
|
|
|
+ """select * from ams.performance where seller_id='%s' and country_code='%s' and date='%s' and isFeedback=1""" % (
|
|
|
seller_id, country_code, shopReportday))
|
|
|
if len(tmp_df) > 0:
|
|
|
print("数据已存在")
|
|
@@ -1323,6 +1323,14 @@ class SpApiRequest:
|
|
|
return pd.DataFrame()
|
|
|
if len(decom_df) == 0:
|
|
|
return reportid
|
|
|
+ client = get_client(host='3.93.43.158', port=8123, username='root',
|
|
|
+ password='6f0eyLuiVn3slzbGWpzI')
|
|
|
+ tmp_df = client.query_df(
|
|
|
+ """select * from ams.performance where seller_id='%s' and country_code='%s' and date='%s' and isFeedback=0""" % (
|
|
|
+ seller_id, country_code, shopReportday))
|
|
|
+ if len(tmp_df) > 0:
|
|
|
+ print("数据已存在")
|
|
|
+ return 'Done'
|
|
|
# print("2"*100)
|
|
|
decom_df[decom_df.select_dtypes(float).columns] = decom_df[decom_df.select_dtypes(float).columns].applymap(
|
|
|
lambda x: str(x) if not pd.isna(x) else '')
|
|
@@ -1348,8 +1356,7 @@ class SpApiRequest:
|
|
|
df_fbaR['comment'].fillna("", inplace=True)
|
|
|
# df_fbaR[['order_id','sku','asin','fnsku','detailed_disposition','product_name','isFeedback','date']]
|
|
|
|
|
|
- client = get_client(host='3.93.43.158', port=8123, username='root',
|
|
|
- password='6f0eyLuiVn3slzbGWpzI')
|
|
|
+
|
|
|
try:
|
|
|
client.insert_df(table='ams.performance', df=df_fbaR[
|
|
|
['order_id', 'sku', 'asin', 'fnsku', 'detailed_disposition', 'product_name', 'isFeedback', 'date',
|
|
@@ -1373,7 +1380,7 @@ class SpApiRequest:
|
|
|
shopReportday_E = (datetime.now() + timedelta(days=days)).strftime("%Y-%m-%d")
|
|
|
client = get_client(host='3.93.43.158', port=8123, username='root',
|
|
|
password='6f0eyLuiVn3slzbGWpzI')
|
|
|
- tmp_df = client.query_df("""select date from ams.performance where seller_id='%s' and country_code='%s' and date='%s' and isFeedback=0""" % (seller_id,country_code,shopReportday))
|
|
|
+ tmp_df = client.query_df("""select * from ams.return_record where seller_id='%s' and country_code='%s' and ReportDate='%s'""" % (seller_id,country_code,shopReportday))
|
|
|
if len(tmp_df)>0:
|
|
|
print("数据已存在")
|
|
|
return 'Done'
|