qrpa 1.0.62__py3-none-any.whl → 1.0.64__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 +7 -1
- qrpa/shein_lib.py +32 -0
- {qrpa-1.0.62.dist-info → qrpa-1.0.64.dist-info}/METADATA +1 -1
- {qrpa-1.0.62.dist-info → qrpa-1.0.64.dist-info}/RECORD +6 -6
- {qrpa-1.0.62.dist-info → qrpa-1.0.64.dist-info}/WHEEL +0 -0
- {qrpa-1.0.62.dist-info → qrpa-1.0.64.dist-info}/top_level.txt +0 -0
qrpa/shein_excel.py
CHANGED
|
@@ -281,6 +281,12 @@ class SheinExcel:
|
|
|
281
281
|
cache_file_excel = f'{self.config.auto_dir}/shein/cache/shein_return_order_list_excel_{start_date}_{end_date}.json'
|
|
282
282
|
write_dict_to_file(cache_file_excel, excel_data)
|
|
283
283
|
|
|
284
|
+
sheet_name = '希音退货列表'
|
|
285
|
+
batch_excel_operations(self.config.excel_return_list, [
|
|
286
|
+
(sheet_name, 'write', excel_data, ['W', 'Z']),
|
|
287
|
+
(sheet_name, 'format', self.format_return_list)
|
|
288
|
+
])
|
|
289
|
+
|
|
284
290
|
excel_data = [header]
|
|
285
291
|
cache_file = f'{self.config.auto_dir}/shein/cache/shein_return_order_list_{TimeUtils.today_date()}.json'
|
|
286
292
|
dict = read_dict_from_file(cache_file)
|
|
@@ -1656,7 +1662,7 @@ class SheinExcel:
|
|
|
1656
1662
|
store_excel_data = [header]
|
|
1657
1663
|
for comment in comment_list:
|
|
1658
1664
|
row_item = []
|
|
1659
|
-
row_item.append(comment['commentId'])
|
|
1665
|
+
row_item.append(f'{comment['commentId']}\n{store_name}')
|
|
1660
1666
|
row_item.append(comment['goodsThumb'])
|
|
1661
1667
|
product_info = f'属性:{comment["goodsAttribute"]}\n货号:{comment["goodSn"]}\nSPU:{comment["spu"]}\nSKC:{comment["skc"]}\nSKU:{comment["sku"]}'
|
|
1662
1668
|
row_item.append(product_info)
|
qrpa/shein_lib.py
CHANGED
|
@@ -631,6 +631,32 @@ class SheinLib:
|
|
|
631
631
|
log(f'正在获取 {self.store_name} 最近一个月出库金额: {last_item["totalCustomerAmount"]}')
|
|
632
632
|
return last_item['totalCustomerAmount']
|
|
633
633
|
|
|
634
|
+
# 存储商品库
|
|
635
|
+
def store_product_info(self):
|
|
636
|
+
# todo 商品详情 属性 规格 图片 重量 与 尺寸
|
|
637
|
+
skc_list = self.get_bak_base_info()
|
|
638
|
+
cache_file = f'{self.config.auto_dir}/shein/sku_price/sku_price_{self.store_username}.json'
|
|
639
|
+
dict_sku = read_dict_from_file(cache_file)
|
|
640
|
+
for skc_item in skc_list:
|
|
641
|
+
skc_item['store_username'] = self.store_username
|
|
642
|
+
skc_item['store_name'] = self.store_name
|
|
643
|
+
skc_item['store_manager'] = self.config.shein_store_manager.get(str(self.store_username).lower())
|
|
644
|
+
spu = skc_item['spu']
|
|
645
|
+
|
|
646
|
+
# 倒序遍历 skuList,安全删除
|
|
647
|
+
for i in range(len(skc_item['skuList']) - 1, -1, -1):
|
|
648
|
+
sku_item = skc_item['skuList'][i]
|
|
649
|
+
if sku_item['skuCode'] == '合计':
|
|
650
|
+
del skc_item['skuList'][i] # 删除“合计”
|
|
651
|
+
continue
|
|
652
|
+
sku_item['price'] = dict_sku[sku_item['skuCode']]
|
|
653
|
+
cost_price = self.bridge.get_sku_cost(sku_item['supplierSku'], self.config.erp_source)
|
|
654
|
+
sku_item['erp_cost_price'] = cost_price if isinstance(cost_price, (int, float)) else None
|
|
655
|
+
sku_item['erp_supplier_name'] = self.bridge.get_sku_supplier(sku_item['supplierSku'], self.config.erp_source)
|
|
656
|
+
|
|
657
|
+
cache_file = f'{self.config.auto_dir}/shein/product/skc_list_{self.store_username}.json'
|
|
658
|
+
write_dict_to_file_ex(cache_file, {self.store_username: skc_list}, [self.store_username])
|
|
659
|
+
|
|
634
660
|
# 获取备货信息列表
|
|
635
661
|
def get_bak_base_info(self):
|
|
636
662
|
log(f'获取备货信息列表 {self.store_name} {self.store_username}')
|
|
@@ -680,7 +706,10 @@ class SheinLib:
|
|
|
680
706
|
spu_list = response_text['info']['list']
|
|
681
707
|
|
|
682
708
|
skc_list = [item['skc'] for item in spu_list]
|
|
709
|
+
self.get_activity_label(skc_list)
|
|
710
|
+
self.get_preemption_list(skc_list)
|
|
683
711
|
self.get_sku_price_v2(skc_list)
|
|
712
|
+
self.get_stock_advice(skc_list)
|
|
684
713
|
|
|
685
714
|
total = response_text['info']['count']
|
|
686
715
|
totalPage = math.ceil(total / pageSize)
|
|
@@ -693,7 +722,10 @@ class SheinLib:
|
|
|
693
722
|
spu_list += new_spu_list
|
|
694
723
|
|
|
695
724
|
skc_list = [item['skc'] for item in new_spu_list]
|
|
725
|
+
self.get_activity_label(skc_list)
|
|
726
|
+
self.get_preemption_list(skc_list)
|
|
696
727
|
self.get_sku_price_v2(skc_list)
|
|
728
|
+
self.get_stock_advice(skc_list)
|
|
697
729
|
|
|
698
730
|
time.sleep(0.3)
|
|
699
731
|
|
|
@@ -10,8 +10,8 @@ qrpa/fun_file.py,sha256=yzjDV16WL5vRys7J4uQcNzIFkX4D5MAlSCwxcD-mwQo,11966
|
|
|
10
10
|
qrpa/fun_web.py,sha256=F6cxwwOxB8twg2XK73oAvKla0FqpwDYJiM37CWmFwXo,6322
|
|
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=vtmeEF_LbH6cVyitDDCNjuT76Nuov6Zvhsf-gIMd0H0,124780
|
|
14
|
+
qrpa/shein_lib.py,sha256=jwJshOIiRtCMQWRwi0QwYIOCyLLE-AYnWPTDUSNgTu8,122127
|
|
15
15
|
qrpa/shein_mysql.py,sha256=MGPJsz13evsLygZWhmitpPzUswiTKZ91VFvr8KA0M40,750
|
|
16
16
|
qrpa/shein_sqlite.py,sha256=ZQwD0Gz81q9WY7tY2HMEYvSF9r3N_G_Aur3bYfST9WY,5707
|
|
17
17
|
qrpa/shein_ziniao.py,sha256=kAOirjawPf-VxBxHFNpdDHCN2zL-O1U-2xybpmt34Xs,18692
|
|
@@ -23,7 +23,7 @@ qrpa/time_utils_example.py,sha256=shHOXKKF3QSzb0SHsNc34M61wEkkLuM30U9X1THKNS8,80
|
|
|
23
23
|
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_return_order_model.py,sha256=Zt-bGOH_kCDbakW7uaTmqqo_qTT8v424yidcYSfWvWM,26562
|
|
26
|
-
qrpa-1.0.
|
|
27
|
-
qrpa-1.0.
|
|
28
|
-
qrpa-1.0.
|
|
29
|
-
qrpa-1.0.
|
|
26
|
+
qrpa-1.0.64.dist-info/METADATA,sha256=l-P6F14pdH8Mxv2ijd2f9bQ0YgLwWzhR7GY-MS-zDC8,231
|
|
27
|
+
qrpa-1.0.64.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
qrpa-1.0.64.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
|
|
29
|
+
qrpa-1.0.64.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|