qrpa 1.1.6__py3-none-any.whl → 1.1.8__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,46 @@ 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
|
+
|
|
22
|
+
excel_data = []
|
|
23
|
+
for store_username,data_list in dict_sku_not_found.items():
|
|
24
|
+
excel_data += data_list
|
|
25
|
+
|
|
26
|
+
sheet_name1 = '未匹配SKU_需运营调整'
|
|
27
|
+
operations = [
|
|
28
|
+
[sheet_name1, 'write', [['店铺账户', '店铺别名', '店长', 'SPU', 'SKC', '商家SKC', '商家SKU']] + excel_data],
|
|
29
|
+
[sheet_name1, 'format', self.format_sku_not_found],
|
|
30
|
+
['Sheet1', 'delete'],
|
|
31
|
+
]
|
|
32
|
+
cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
|
|
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
|
+
|
|
38
|
+
sheet_name = 'sku到skc映射'
|
|
39
|
+
operations.append([sheet_name, 'write', [['商家SKU', '商家SKC']] + excel_data])
|
|
40
|
+
operations.append([sheet_name, 'format', self.format_sku_to_skc])
|
|
41
|
+
|
|
42
|
+
operations.append([sheet_name1, 'move', 1])
|
|
43
|
+
|
|
44
|
+
batch_excel_operations(self.config.excel_sku_not_found, operations)
|
|
45
|
+
|
|
46
|
+
def format_sku_not_found(self, sheet):
|
|
47
|
+
beautify_title(sheet)
|
|
48
|
+
add_borders(sheet)
|
|
49
|
+
column_to_left(sheet, ['商家SKC', '商家SKU'])
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
def format_sku_to_skc(self, sheet):
|
|
53
|
+
beautify_title(sheet)
|
|
54
|
+
add_borders(sheet)
|
|
55
|
+
column_to_left(sheet, ['商家SKC', '商家SKU'])
|
|
56
|
+
pass
|
|
57
|
+
|
|
18
58
|
def get_supplier_name(self, store_username):
|
|
19
59
|
cache_file = f'{self.config.auto_dir}/shein/dict/supplier_data.json'
|
|
20
60
|
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"
|
|
326
|
-
"supplierId"
|
|
327
|
-
"pageNum"
|
|
328
|
-
"pageSize"
|
|
329
|
-
"createTimeStart"
|
|
330
|
-
"createTimeEnd"
|
|
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_ex(cache_file, {self.store_username: dict_sku_not_found}, [self.store_username])
|
|
1032
|
+
|
|
1033
|
+
cache_file = f'{self.config.auto_dir}/shein/dict/sku_to_skc.json'
|
|
1034
|
+
write_dict_to_file_ex(cache_file, {self.store_username: dict_sku_to_skc}, [self.store_username])
|
|
1035
|
+
|
|
993
1036
|
# 存储商品库
|
|
994
1037
|
def store_product_info(self):
|
|
995
1038
|
# todo 商品详情 属性 规格 图片 重量 与 尺寸
|
|
@@ -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=
|
|
14
|
-
qrpa/shein_lib.py,sha256=
|
|
13
|
+
qrpa/shein_excel.py,sha256=4Ks1bIMOob7ZeWR7DoOYMBtVC8wbvEqKdsIwPAHLftM,147271
|
|
14
|
+
qrpa/shein_lib.py,sha256=Z3l8T9-TaLzkJnB2VGtpRNa-P4HYdFLgPbKKmgrDBoM,144439
|
|
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.
|
|
28
|
-
qrpa-1.1.
|
|
29
|
-
qrpa-1.1.
|
|
30
|
-
qrpa-1.1.
|
|
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,,
|
|
File without changes
|
|
File without changes
|