qrpa 1.1.8__py3-none-any.whl → 1.1.9__py3-none-any.whl

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/shein_excel.py CHANGED
@@ -20,7 +20,7 @@ class SheinExcel:
20
20
  dict_sku_not_found = read_dict_from_file(cache_file)
21
21
 
22
22
  excel_data = []
23
- for store_username,data_list in dict_sku_not_found.items():
23
+ for store_username, data_list in dict_sku_not_found.items():
24
24
  excel_data += data_list
25
25
 
26
26
  sheet_name1 = '未匹配SKU_需运营调整'
@@ -32,7 +32,7 @@ class SheinExcel:
32
32
  cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
33
33
  sku_to_skc = read_dict_from_file(cache_file)
34
34
  excel_data = []
35
- for store_username,data_list in sku_to_skc.items():
35
+ for store_username, data_list in sku_to_skc.items():
36
36
  excel_data += data_list
37
37
 
38
38
  sheet_name = 'sku到skc映射'
@@ -60,15 +60,18 @@ class SheinExcel:
60
60
  info = read_dict_from_file_ex(cache_file, store_username)
61
61
  return info['supplier_name']
62
62
 
63
- def write_withdraw_report_2024(self):
64
- excel_path = create_file_path(self.config.excel_withdraw_2024)
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)
65
68
  dict_store = read_dict_from_file(self.config.shein_store_alias)
66
69
 
67
70
  header = ['店铺名称', '店铺账号', '供应商名称', '交易单号', '提现时间', '提现成功时间', '更新时间', '提现明细单号',
68
71
  '收款帐户', '收款帐户所在地', '净金额', '保证金', '手续费', '汇率', '收款金额', '提现状态']
69
72
  summary_excel_data = [header]
70
73
  # 先读取提现明细列表写入
71
- first_day, last_day = TimeUtils.get_year_range_time(2024)
74
+ first_day, last_day = TimeUtils.get_year_range_time(year)
72
75
  cache_file = f'{self.config.auto_dir}/shein/cache/withdraw_list_{first_day}_{last_day}.json'
73
76
  dict_withdraw = read_dict_from_file(cache_file)
74
77
  account_list = []
@@ -115,7 +118,7 @@ class SheinExcel:
115
118
  row_item.append('')
116
119
  summary_excel_data.append(row_item)
117
120
 
118
- sheet_name = '汇总2024'
121
+ sheet_name = f'汇总{year}'
119
122
 
120
123
  operations.append([sheet_name, 'write', summary_excel_data])
121
124
  operations.append([sheet_name, 'format', self.format_withdraw_2024])
qrpa/shein_lib.py CHANGED
@@ -303,19 +303,14 @@ class SheinLib:
303
303
 
304
304
  return info
305
305
 
306
- def get_withdraw_list(self, supplier_id, mode='month'):
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 mode == 'month':
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(2024)
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 = response_text['info']['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])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.1.8
3
+ Version: 1.1.9
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
@@ -10,8 +10,8 @@ qrpa/fun_file.py,sha256=yzjDV16WL5vRys7J4uQcNzIFkX4D5MAlSCwxcD-mwQo,11966
10
10
  qrpa/fun_web.py,sha256=2aYrtRlf-p-P6AyjrlIcmMVq8oSDePEY48YLm4ZRS1A,11857
11
11
  qrpa/fun_win.py,sha256=-LnTeocdTt72NVH6VgLdpAT9_C5oV9okeudXG6CftMA,8034
12
12
  qrpa/shein_daily_report_model.py,sha256=H8oZmIN5Pyqe306W1_xuz87lOqLQ_LI5RjXbaxDkIzE,12589
13
- qrpa/shein_excel.py,sha256=4Ks1bIMOob7ZeWR7DoOYMBtVC8wbvEqKdsIwPAHLftM,147271
14
- qrpa/shein_lib.py,sha256=Z3l8T9-TaLzkJnB2VGtpRNa-P4HYdFLgPbKKmgrDBoM,144439
13
+ qrpa/shein_excel.py,sha256=8TYZt45BZ9e6oM2Z1G48SzUWrGpSI4Q5vBxvGm8433U,147408
14
+ qrpa/shein_lib.py,sha256=LxXI0-OyP6l8bpH39Y2Jh42fmpNbtNl1il3H0sfaFnk,144530
15
15
  qrpa/shein_mysql.py,sha256=Sgz6U0_3f4cT5zPf1Ht1OjvSFhrVPLkMxt91NV-ZPCM,3005
16
16
  qrpa/shein_sqlite.py,sha256=ZQwD0Gz81q9WY7tY2HMEYvSF9r3N_G_Aur3bYfST9WY,5707
17
17
  qrpa/shein_ziniao.py,sha256=SyxCvi49HKbQqoz9eQP4uU3jh-blxnUjjWw-0YA0n0w,21727
@@ -24,7 +24,7 @@ qrpa/wxwork.py,sha256=gIytG19DZ5g7Tsl0-W3EbjfSnpIqZw-ua24gcB78YEg,11264
24
24
  qrpa/mysql_module/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  qrpa/mysql_module/shein_product_model.py,sha256=v21_juWsZqTHj2k08GUGNkoRZ4hkKZKjaE-wmRl2a2k,19257
26
26
  qrpa/mysql_module/shein_return_order_model.py,sha256=Zt-bGOH_kCDbakW7uaTmqqo_qTT8v424yidcYSfWvWM,26562
27
- qrpa-1.1.8.dist-info/METADATA,sha256=yeALPMmZTo9WAdOiywwE0Om-N61OHtNPhkwb6n5P7X4,230
28
- qrpa-1.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- qrpa-1.1.8.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
30
- qrpa-1.1.8.dist-info/RECORD,,
27
+ qrpa-1.1.9.dist-info/METADATA,sha256=lltJAOp-oOwOzx4t8JKE8aXZBvWHFwUsyZCukm84qs8,230
28
+ qrpa-1.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ qrpa-1.1.9.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
30
+ qrpa-1.1.9.dist-info/RECORD,,
File without changes