qrpa 1.1.5__tar.gz → 1.1.7__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.

Files changed (37) hide show
  1. {qrpa-1.1.5 → qrpa-1.1.7}/PKG-INFO +1 -1
  2. {qrpa-1.1.5 → qrpa-1.1.7}/pyproject.toml +1 -1
  3. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/shein_excel.py +32 -1
  4. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/shein_lib.py +50 -7
  5. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa.egg-info/PKG-INFO +1 -1
  6. {qrpa-1.1.5 → qrpa-1.1.7}/README.md +0 -0
  7. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/RateLimitedSender.py +0 -0
  8. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/__init__.py +0 -0
  9. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/db_migrator.py +0 -0
  10. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/feishu_bot_app.py +0 -0
  11. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/feishu_client.py +0 -0
  12. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/feishu_logic.py +0 -0
  13. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/fun_base.py +0 -0
  14. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/fun_excel.py +0 -0
  15. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/fun_file.py +0 -0
  16. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/fun_web.py +0 -0
  17. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/fun_win.py +0 -0
  18. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/mysql_module/__init__.py +0 -0
  19. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/mysql_module/shein_product_model.py +0 -0
  20. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/mysql_module/shein_return_order_model.py +0 -0
  21. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/shein_daily_report_model.py +0 -0
  22. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/shein_mysql.py +0 -0
  23. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/shein_sqlite.py +0 -0
  24. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/shein_ziniao.py +0 -0
  25. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/temu_chrome.py +0 -0
  26. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/temu_excel.py +0 -0
  27. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/temu_lib.py +0 -0
  28. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/time_utils.py +0 -0
  29. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/time_utils_example.py +0 -0
  30. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa/wxwork.py +0 -0
  31. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa.egg-info/SOURCES.txt +0 -0
  32. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa.egg-info/dependency_links.txt +0 -0
  33. {qrpa-1.1.5 → qrpa-1.1.7}/qrpa.egg-info/top_level.txt +0 -0
  34. {qrpa-1.1.5 → qrpa-1.1.7}/setup.cfg +0 -0
  35. {qrpa-1.1.5 → qrpa-1.1.7}/setup.py +0 -0
  36. {qrpa-1.1.5 → qrpa-1.1.7}/tests/test_db_migrator.py +0 -0
  37. {qrpa-1.1.5 → qrpa-1.1.7}/tests/test_wxwork.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.1.5
3
+ Version: 1.1.7
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qrpa"
7
- version = "1.1.5"
7
+ version = "1.1.7"
8
8
  description = "qsir's rpa library"
9
9
  authors = [{ name = "QSir", email = "1171725650@qq.com" }]
10
10
  readme = "README.md"
@@ -15,6 +15,37 @@ class SheinExcel:
15
15
  self.bridge = bridge
16
16
  pass
17
17
 
18
+ def write_sku_not_found(self):
19
+ cache_file = f'{self.config.auto_dir}/shein/dict/sku_not_found.json'
20
+ dict_sku_not_found = read_dict_from_file(cache_file)
21
+ sheet_name1 = '未匹配SKU_需运营调整'
22
+ operations = [
23
+ [sheet_name1, 'write', [['店铺账户', '店铺别名', '店长', 'SPU', 'SKC', '商家SKC', '商家SKU']] + dict_sku_not_found],
24
+ [sheet_name1, 'format', self.format_sku_not_found],
25
+ ['Sheet1', 'delete'],
26
+ ]
27
+ cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
28
+ sku_to_skc = read_dict_from_file(cache_file)
29
+ sheet_name = 'sku到skc映射'
30
+ operations.append([sheet_name, 'write', [['商家SKU', '商家SKC']] + sku_to_skc])
31
+ operations.append([sheet_name, 'format', self.format_sku_to_skc])
32
+
33
+ operations.append([sheet_name1, 'move', 1])
34
+
35
+ batch_excel_operations(self.config.excel_sku_not_found, operations)
36
+
37
+ def format_sku_not_found(self, sheet):
38
+ beautify_title(sheet)
39
+ add_borders(sheet)
40
+ column_to_left(sheet, ['商家SKC', '商家SKU'])
41
+ pass
42
+
43
+ def format_sku_to_skc(self, sheet):
44
+ beautify_title(sheet)
45
+ add_borders(sheet)
46
+ column_to_left(sheet, ['商家SKC', '商家SKU'])
47
+ pass
48
+
18
49
  def get_supplier_name(self, store_username):
19
50
  cache_file = f'{self.config.auto_dir}/shein/dict/supplier_data.json'
20
51
  info = read_dict_from_file_ex(cache_file, store_username)
@@ -97,7 +128,7 @@ class SheinExcel:
97
128
  format_to_money(sheet, ['金额'])
98
129
  format_to_datetime(sheet, ['时间'])
99
130
  add_sum_for_cell(sheet, ['总收款金额'])
100
- add_formula_for_column(sheet, '总收款金额', "=SUMIF('提现明细汇总'!I:I, A3, '提现明细汇总'!O:O)", 3)
131
+ add_formula_for_column(sheet, '总收款金额', "=SUMIFS(提现明细汇总!O:O,提现明细汇总!I:I,A3,提现明细汇总!P:P,\"提现成功\")", 3)
101
132
  add_borders(sheet)
102
133
 
103
134
  def write_product(self):
@@ -322,13 +322,13 @@ class SheinLib:
322
322
 
323
323
  url = f"https://sso.geiwohuo.com/mws/mwms/sso/withdraw/transferRecordList"
324
324
  payload = {
325
- "reqSystemCode" : "mws-front",
326
- "supplierId" : supplier_id,
327
- "pageNum" : page_num,
328
- "pageSize" : page_size,
329
- "createTimeStart" : first_day,
330
- "createTimeEnd" : last_day,
331
- "withdrawStatusList": [30]
325
+ "reqSystemCode" : "mws-front",
326
+ "supplierId" : supplier_id,
327
+ "pageNum" : page_num,
328
+ "pageSize" : page_size,
329
+ "createTimeStart": first_day,
330
+ "createTimeEnd" : last_day,
331
+ # "withdrawStatusList": [30]
332
332
  }
333
333
  log(payload)
334
334
  response_text = fetch(self.web_page, url, payload)
@@ -990,6 +990,49 @@ class SheinLib:
990
990
  write_dict_to_file_ex(cache_file, {self.store_username: excel_data}, [self.store_username])
991
991
  return excel_data
992
992
 
993
+ def generate_product_dict(self):
994
+ pass
995
+ dict_sku_to_skc = []
996
+ dict_sku_not_found = []
997
+ skc_list = self.get_bak_base_info()
998
+ for skc_item in skc_list:
999
+ skc_item['store_username'] = self.store_username
1000
+ skc_item['store_name'] = self.store_name
1001
+ skc_item['store_manager'] = self.config.shein_store_manager.get(str(self.store_username).lower())
1002
+ spu = skc_item['spu']
1003
+ skc = skc_item['skc']
1004
+ supplierCode = skc_item['supplierCode']
1005
+
1006
+ # 倒序遍历 skuList,安全删除
1007
+ for i in range(len(skc_item['skuList']) - 1, -1, -1):
1008
+ sku_item = skc_item['skuList'][i]
1009
+ if sku_item['skuCode'] == '合计':
1010
+ del skc_item['skuList'][i] # 删除“合计”
1011
+ continue
1012
+
1013
+ cost_price = self.bridge.get_sku_cost(sku_item['supplierSku'], self.config.erp_source)
1014
+ if not isinstance(cost_price, (int, float)):
1015
+ dict_sku_not_found.append([
1016
+ self.store_username,
1017
+ self.store_name,
1018
+ self.config.shein_store_manager.get(str(self.store_username).lower()),
1019
+ spu,
1020
+ skc,
1021
+ supplierCode,
1022
+ sku_item['supplierSku'],
1023
+ ])
1024
+
1025
+ dict_sku_to_skc.append([
1026
+ sku_item['supplierSku'],
1027
+ supplierCode,
1028
+ ])
1029
+
1030
+ cache_file = f'{self.config.auto_dir}/shein/dict/sku_not_found.json'
1031
+ write_dict_to_file(cache_file, dict_sku_not_found)
1032
+
1033
+ cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
1034
+ write_dict_to_file(cache_file, dict_sku_to_skc)
1035
+
993
1036
  # 存储商品库
994
1037
  def store_product_info(self):
995
1038
  # todo 商品详情 属性 规格 图片 重量 与 尺寸
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.1.5
3
+ Version: 1.1.7
4
4
  Summary: qsir's rpa library
5
5
  Author: QSir
6
6
  Author-email: QSir <1171725650@qq.com>
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