qrpa 1.1.6__py3-none-any.whl → 1.1.7__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
@@ -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)
qrpa/shein_lib.py CHANGED
@@ -322,12 +322,12 @@ 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,
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
331
  # "withdrawStatusList": [30]
332
332
  }
333
333
  log(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.6
3
+ Version: 1.1.7
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=fnmqsNTcrrNXXyvdLnwgnowNygLt8HvCTm8hY6Exhw8,145684
14
- qrpa/shein_lib.py,sha256=0DMkP0EI4OhPGzC1p5m18QmPjoHNEruuZL4mjlrTTJs,142479
13
+ qrpa/shein_excel.py,sha256=68LrGCESQz-Iqjp3EjZVKA21qjhaMZRjAytbKGoUjac,147019
14
+ qrpa/shein_lib.py,sha256=KUdP2zRNAqzJqU2hY95hmshGsVZL8hIAy2mgmMz1LNw,144341
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.6.dist-info/METADATA,sha256=HL1k5ls6Rfjmi8-JtmJCS6UudXitvLhsLqY5yzu1OaM,230
28
- qrpa-1.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- qrpa-1.1.6.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
30
- qrpa-1.1.6.dist-info/RECORD,,
27
+ qrpa-1.1.7.dist-info/METADATA,sha256=thgZPQzguzy9vACWd8IYq_w_5j2jUQn7b_KCUxveM3k,230
28
+ qrpa-1.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ qrpa-1.1.7.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
30
+ qrpa-1.1.7.dist-info/RECORD,,
File without changes