Переглянути джерело

Merge branch 'yifan' of ASJ_ADS/sync_amz_data into master

yifan_huang96 1 рік тому
батько
коміт
6ddfc837b4

+ 2 - 1
sync_amz_data/public/adjust_budget_bid.py

@@ -14,7 +14,8 @@ warnings.filterwarnings('ignore')
 
 class Automation_Bid_Budget:
     def __init__(self, campaign_id,
-                 time_period: Literal["1week", "2weeks", "4weeks", "6weeks", "8weeks", "12weeks"] = "8weeks"):
+                 time_period: Literal["1week", "2weeks", "4weeks", "6weeks", "8weeks", "12weeks"] = "8weeks"
+                 ):
         self.campaign_id = campaign_id
         self.time_period = time_period  # 默认初始化历史周期8周
 

+ 3 - 4
sync_amz_data/public/sp_api_client.py

@@ -389,11 +389,11 @@ class SpApiRequest:
                 temp = df_rel.query("""listing_id==@listing_id and asin==@asin and sku==@sku and quantity==@quantity and fulfillment_channel==@fulfillment_channel and price==@price and product_id==@product_id and country_code==@country_code and seller_id==@seller_id and title==@title and image_link==@imageurl""")
                 print("需要关注数据(是否异常):",len(temp),temp.to_numpy().tolist()) if len(temp)>1 else 1
                 if len(temp)>1:
-                    temp = temp.head(1).to_numpy().tolist()
+                    # temp = temp.head(1).to_numpy().tolist()
                     df_data = df_data.append(temp_df, ignore_index=True)
                     delete_list.append((seller_id, marketplace_id, sku, listing_id, product_id))
                 # print(len(temp))
-                if len(temp)==0:
+                elif len(temp)==0:
                     df_data = df_data.append(temp_df,ignore_index=True)
                     delete_list.append((seller_id,marketplace_id,sku,listing_id,product_id))
                 row += 1
@@ -682,8 +682,7 @@ class SpApiRequest:
                         "timezone","seller_id","country_code"
                         ]
         list_df = decom_df[reserve_columns].to_numpy().tolist()
-        # print(list_df)
-        # print(list_df[0])
+
         # tuple_data = [tuple(i) for i in list_df]
         conn = self.mysql_connect()
         cursor = conn.cursor()

+ 5 - 5
sync_get_order_data.py

@@ -725,11 +725,11 @@ def func_run():
 
 
 if __name__ == '__main__':
-    # func_run()
-    sched = BlockingScheduler()
-    sched.add_job(func_run, 'cron', hour=0, minute=0,
-                  second=30)
-    sched.start()
+    func_run()
+    # sched = BlockingScheduler()
+    # sched.add_job(func_run, 'cron', hour=0, minute=0,
+    #               second=30)
+    # sched.start()
 
 
 """