qrpa 1.1.7__tar.gz → 1.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of qrpa might be problematic. Click here for more details.
- {qrpa-1.1.7 → qrpa-1.1.9}/PKG-INFO +1 -1
- {qrpa-1.1.7 → qrpa-1.1.9}/pyproject.toml +1 -1
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/shein_excel.py +18 -6
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/shein_lib.py +12 -11
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa.egg-info/PKG-INFO +1 -1
- {qrpa-1.1.7 → qrpa-1.1.9}/README.md +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/RateLimitedSender.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/__init__.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/db_migrator.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/feishu_bot_app.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/feishu_client.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/feishu_logic.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/fun_base.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/fun_excel.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/fun_file.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/fun_web.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/fun_win.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/mysql_module/__init__.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/mysql_module/shein_product_model.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/mysql_module/shein_return_order_model.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/shein_daily_report_model.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/shein_mysql.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/shein_sqlite.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/shein_ziniao.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/temu_chrome.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/temu_excel.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/temu_lib.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/time_utils.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/time_utils_example.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa/wxwork.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa.egg-info/SOURCES.txt +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa.egg-info/dependency_links.txt +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/qrpa.egg-info/top_level.txt +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/setup.cfg +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/setup.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/tests/test_db_migrator.py +0 -0
- {qrpa-1.1.7 → qrpa-1.1.9}/tests/test_wxwork.py +0 -0
|
@@ -18,16 +18,25 @@ class SheinExcel:
|
|
|
18
18
|
def write_sku_not_found(self):
|
|
19
19
|
cache_file = f'{self.config.auto_dir}/shein/dict/sku_not_found.json'
|
|
20
20
|
dict_sku_not_found = read_dict_from_file(cache_file)
|
|
21
|
+
|
|
22
|
+
excel_data = []
|
|
23
|
+
for store_username, data_list in dict_sku_not_found.items():
|
|
24
|
+
excel_data += data_list
|
|
25
|
+
|
|
21
26
|
sheet_name1 = '未匹配SKU_需运营调整'
|
|
22
27
|
operations = [
|
|
23
|
-
[sheet_name1, 'write', [['店铺账户', '店铺别名', '店长', 'SPU', 'SKC', '商家SKC', '商家SKU']] +
|
|
28
|
+
[sheet_name1, 'write', [['店铺账户', '店铺别名', '店长', 'SPU', 'SKC', '商家SKC', '商家SKU']] + excel_data],
|
|
24
29
|
[sheet_name1, 'format', self.format_sku_not_found],
|
|
25
30
|
['Sheet1', 'delete'],
|
|
26
31
|
]
|
|
27
32
|
cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
|
|
28
33
|
sku_to_skc = read_dict_from_file(cache_file)
|
|
34
|
+
excel_data = []
|
|
35
|
+
for store_username, data_list in sku_to_skc.items():
|
|
36
|
+
excel_data += data_list
|
|
37
|
+
|
|
29
38
|
sheet_name = 'sku到skc映射'
|
|
30
|
-
operations.append([sheet_name, 'write', [['商家SKU', '商家SKC']] +
|
|
39
|
+
operations.append([sheet_name, 'write', [['商家SKU', '商家SKC']] + excel_data])
|
|
31
40
|
operations.append([sheet_name, 'format', self.format_sku_to_skc])
|
|
32
41
|
|
|
33
42
|
operations.append([sheet_name1, 'move', 1])
|
|
@@ -51,15 +60,18 @@ class SheinExcel:
|
|
|
51
60
|
info = read_dict_from_file_ex(cache_file, store_username)
|
|
52
61
|
return info['supplier_name']
|
|
53
62
|
|
|
54
|
-
def write_withdraw_report_2024(self):
|
|
55
|
-
|
|
63
|
+
def write_withdraw_report_2024(self, year=2024):
|
|
64
|
+
if year == 2025:
|
|
65
|
+
excel_path = create_file_path(self.config.excel_withdraw_2025)
|
|
66
|
+
else:
|
|
67
|
+
excel_path = create_file_path(self.config.excel_withdraw_2024)
|
|
56
68
|
dict_store = read_dict_from_file(self.config.shein_store_alias)
|
|
57
69
|
|
|
58
70
|
header = ['店铺名称', '店铺账号', '供应商名称', '交易单号', '提现时间', '提现成功时间', '更新时间', '提现明细单号',
|
|
59
71
|
'收款帐户', '收款帐户所在地', '净金额', '保证金', '手续费', '汇率', '收款金额', '提现状态']
|
|
60
72
|
summary_excel_data = [header]
|
|
61
73
|
# 先读取提现明细列表写入
|
|
62
|
-
first_day, last_day = TimeUtils.get_year_range_time(
|
|
74
|
+
first_day, last_day = TimeUtils.get_year_range_time(year)
|
|
63
75
|
cache_file = f'{self.config.auto_dir}/shein/cache/withdraw_list_{first_day}_{last_day}.json'
|
|
64
76
|
dict_withdraw = read_dict_from_file(cache_file)
|
|
65
77
|
account_list = []
|
|
@@ -106,7 +118,7 @@ class SheinExcel:
|
|
|
106
118
|
row_item.append('')
|
|
107
119
|
summary_excel_data.append(row_item)
|
|
108
120
|
|
|
109
|
-
sheet_name = '汇总
|
|
121
|
+
sheet_name = f'汇总{year}'
|
|
110
122
|
|
|
111
123
|
operations.append([sheet_name, 'write', summary_excel_data])
|
|
112
124
|
operations.append([sheet_name, 'format', self.format_withdraw_2024])
|
|
@@ -303,19 +303,14 @@ class SheinLib:
|
|
|
303
303
|
|
|
304
304
|
return info
|
|
305
305
|
|
|
306
|
-
def get_withdraw_list(self, supplier_id,
|
|
306
|
+
def get_withdraw_list(self, supplier_id, year=0):
|
|
307
307
|
self.web_page.goto('https://sso.geiwohuo.com/#/mws/seller/new-account-overview')
|
|
308
308
|
self.web_page.wait_for_load_state("load")
|
|
309
309
|
|
|
310
|
-
if
|
|
310
|
+
if year == 0:
|
|
311
311
|
first_day, last_day = TimeUtils.get_last_month_range_time()
|
|
312
312
|
else:
|
|
313
|
-
first_day, last_day = TimeUtils.get_year_range_time(
|
|
314
|
-
|
|
315
|
-
cache_file = f'{self.config.auto_dir}/shein/cache/withdraw_list_{first_day}_{last_day}.json'
|
|
316
|
-
withdraw_list = read_dict_from_file_ex(cache_file, self.store_username, 3600 * 12)
|
|
317
|
-
if len(withdraw_list) > 0:
|
|
318
|
-
return withdraw_list
|
|
313
|
+
first_day, last_day = TimeUtils.get_year_range_time(year)
|
|
319
314
|
|
|
320
315
|
page_num = 1
|
|
321
316
|
page_size = 200
|
|
@@ -341,12 +336,18 @@ class SheinLib:
|
|
|
341
336
|
total = response_text['info']['count']
|
|
342
337
|
totalPage = math.ceil(total / page_size)
|
|
343
338
|
|
|
339
|
+
cache_file = f'{self.config.auto_dir}/shein/cache/withdraw_list_{first_day}_{last_day}.json'
|
|
340
|
+
withdraw_list_cache = read_dict_from_file_ex(cache_file, self.store_username, 3600 * 12)
|
|
341
|
+
if len(withdraw_list_cache) == int(total):
|
|
342
|
+
log('返回缓存数据: ', len(withdraw_list_cache), total)
|
|
343
|
+
return withdraw_list_cache
|
|
344
|
+
|
|
344
345
|
for page in range(2, totalPage + 1):
|
|
345
346
|
log(f'获取提现列表 第{page}/{totalPage}页')
|
|
346
347
|
page_num = page
|
|
347
348
|
payload['pageNum'] = page_num
|
|
348
349
|
response_text = fetch(self.web_page, url, payload)
|
|
349
|
-
withdraw_list
|
|
350
|
+
withdraw_list += response_text['info']['list']
|
|
350
351
|
time.sleep(0.1)
|
|
351
352
|
|
|
352
353
|
write_dict_to_file_ex(cache_file, {self.store_username: withdraw_list}, [self.store_username])
|
|
@@ -1028,10 +1029,10 @@ class SheinLib:
|
|
|
1028
1029
|
])
|
|
1029
1030
|
|
|
1030
1031
|
cache_file = f'{self.config.auto_dir}/shein/dict/sku_not_found.json'
|
|
1031
|
-
|
|
1032
|
+
write_dict_to_file_ex(cache_file, {self.store_username: dict_sku_not_found}, [self.store_username])
|
|
1032
1033
|
|
|
1033
1034
|
cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
|
|
1034
|
-
|
|
1035
|
+
write_dict_to_file_ex(cache_file, {self.store_username: dict_sku_to_skc}, [self.store_username])
|
|
1035
1036
|
|
|
1036
1037
|
# 存储商品库
|
|
1037
1038
|
def store_product_info(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|