qrpa 1.0.93__tar.gz → 1.0.95__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.0.93 → qrpa-1.0.95}/PKG-INFO +1 -1
  2. {qrpa-1.0.93 → qrpa-1.0.95}/pyproject.toml +1 -1
  3. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/fun_excel.py +1 -1
  4. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/shein_excel.py +101 -0
  5. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa.egg-info/PKG-INFO +1 -1
  6. {qrpa-1.0.93 → qrpa-1.0.95}/README.md +0 -0
  7. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/RateLimitedSender.py +0 -0
  8. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/__init__.py +0 -0
  9. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/db_migrator.py +0 -0
  10. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/feishu_bot_app.py +0 -0
  11. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/feishu_client.py +0 -0
  12. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/feishu_logic.py +0 -0
  13. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/fun_base.py +0 -0
  14. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/fun_file.py +0 -0
  15. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/fun_web.py +0 -0
  16. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/fun_win.py +0 -0
  17. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/mysql_module/__init__.py +0 -0
  18. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/mysql_module/shein_product_model.py +0 -0
  19. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/mysql_module/shein_return_order_model.py +0 -0
  20. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/shein_daily_report_model.py +0 -0
  21. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/shein_lib.py +0 -0
  22. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/shein_mysql.py +0 -0
  23. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/shein_sqlite.py +0 -0
  24. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/shein_ziniao.py +0 -0
  25. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/temu_chrome.py +0 -0
  26. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/temu_excel.py +0 -0
  27. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/temu_lib.py +0 -0
  28. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/time_utils.py +0 -0
  29. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/time_utils_example.py +0 -0
  30. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa/wxwork.py +0 -0
  31. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa.egg-info/SOURCES.txt +0 -0
  32. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa.egg-info/dependency_links.txt +0 -0
  33. {qrpa-1.0.93 → qrpa-1.0.95}/qrpa.egg-info/top_level.txt +0 -0
  34. {qrpa-1.0.93 → qrpa-1.0.95}/setup.cfg +0 -0
  35. {qrpa-1.0.93 → qrpa-1.0.95}/setup.py +0 -0
  36. {qrpa-1.0.93 → qrpa-1.0.95}/tests/test_db_migrator.py +0 -0
  37. {qrpa-1.0.93 → qrpa-1.0.95}/tests/test_wxwork.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.0.93
3
+ Version: 1.0.95
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.0.93"
7
+ version = "1.0.95"
8
8
  description = "qsir's rpa library"
9
9
  authors = [{ name = "QSir", email = "1171725650@qq.com" }]
10
10
  readme = "README.md"
@@ -762,7 +762,7 @@ def download_images_concurrently(image_urls, platform='shein', img_save_dir=None
762
762
  def download_img_by_chrome(image_url, save_name):
763
763
  try:
764
764
  with sync_playwright() as p:
765
- browser = p.chromium.launch(headless=True, executable_path=chromium_path) # 运行时可以看到浏览器
765
+ browser = p.chromium.launch(headless=True) # 运行时可以看到浏览器
766
766
  context = browser.new_context()
767
767
  page = context.new_page()
768
768
  # 直接通过Playwright下载图片
@@ -185,6 +185,107 @@ class SheinExcel:
185
185
  close_excel(app, wb)
186
186
  WxWorkBot('b30aaa8d-1a1f-4378-841a-8b0f8295f2d9').send_file(excel_path)
187
187
 
188
+ def write_return_list_range(self, erp, start_date, end_date):
189
+ header = ['退货单号', '退货出库时间', '签收状态', '店铺信息', '店长', '退货类型', '退货原因', 'SKC图片', 'SKC信息', '商家SKU', '属性集', 'SKU退货数量', '平台SKU', 'ERP默认供货商', 'ERP成本', '包裹名', '包裹号', '退货计划单号', '订单号', '发货单', '退回方式', '快递名称', '运单号', '退货地址', '商家联系人', '商家手机号', '入库问题图片地址']
190
+ excel_data = [header]
191
+
192
+ dict_store = read_dict_from_file(self.config.shein_store_alias)
193
+
194
+ cache_file = f'{self.config.auto_dir}/shein/cache/shein_return_order_list_{start_date}_{end_date}.json'
195
+ dict = read_dict_from_file(cache_file)
196
+ for store_username, shein_back_list in dict.items():
197
+ for item in shein_back_list:
198
+
199
+ store_name = dict_store.get(store_username)
200
+
201
+ returnOrderId = item['id']
202
+ cache_file = f'{self.config.auto_dir}/shein/cache/shein_return_order_box_detail_{returnOrderId}.json'
203
+ return_detail = read_dict_from_file(cache_file)
204
+ if len(return_detail) == 0:
205
+ continue
206
+
207
+ returnOrderNo = item['returnOrderNo']
208
+ returnOrderTypeName = item['returnOrderTypeName']
209
+ returnOrderStatusName = item['returnOrderStatusName']
210
+ returnReasonTypeName = item['returnReasonTypeName']
211
+ returnReason = item['returnReason']
212
+ waitReturnQuantity = item['waitReturnQuantity']
213
+ skcReturnQuantity = item['returnQuantity']
214
+ returnAmount = item['returnAmount']
215
+ currencyCode = item['currencyCode']
216
+ returnPlanNo = item['returnPlanNo']
217
+ sellerOrderNo = item['sellerOrderNo']
218
+ sellerDeliveryNo = item['sellerDeliveryNo']
219
+ completeTime = item['completeTime']
220
+ returnWayTypeName = item['returnWayTypeName']
221
+ returnExpressCompanyName = item['returnExpressCompanyName']
222
+ expressNoList = item['expressNoList']
223
+ returnAddress = item['returnAddress']
224
+ sellerContract = item['sellerContract']
225
+ sellerContractPhone = item['sellerContractPhone']
226
+ isSign = ['已报废', '已签收', '待签收'][item['isSign']]
227
+ if item['returnScrapType'] == 1:
228
+ urls = item.get('qc_report_url', '-')
229
+ else:
230
+ urls = '\n'.join(item['rejectPicUrlList'])
231
+
232
+ for box_list in return_detail:
233
+ for package_list in box_list['boxList']:
234
+ package_name = package_list['packageName']
235
+ package_no = package_list['returnBoxNo']
236
+ for skc_item in package_list['goods']:
237
+ skc_img = skc_item['imgPath']
238
+ skc = skc_item['skc']
239
+ supplierCode = skc_item['supplierCode']
240
+ for sku_item in skc_item['details']:
241
+ platformSku = sku_item['platformSku']
242
+ supplierSku = sku_item['supplierSku']
243
+ suffixZh = sku_item['suffixZh']
244
+ returnQuantity = sku_item['returnQuantity']
245
+
246
+ store_info = f'{store_username}\n{store_name}\n处理类型: {returnOrderTypeName}\n退货状态: {returnOrderStatusName}'
247
+ skc_info = f'SKC: {skc}\n供方货号: {supplierCode}\n预计退货数量/执行退货数量: {waitReturnQuantity}/{skcReturnQuantity}\n预计退货货值: {returnAmount} {currencyCode}'
248
+
249
+ row_item = []
250
+ row_item.append(returnOrderNo)
251
+ row_item.append(completeTime)
252
+ row_item.append(isSign)
253
+ row_item.append(store_info)
254
+ row_item.append(self.config.shein_store_manager.get(str(store_username).lower()))
255
+ row_item.append(returnReasonTypeName)
256
+ row_item.append(returnReason)
257
+ row_item.append(skc_img)
258
+ row_item.append(skc_info)
259
+ row_item.append(supplierSku)
260
+ row_item.append(suffixZh)
261
+ row_item.append(returnQuantity)
262
+ row_item.append(platformSku)
263
+ row_item.append(self.bridge.get_sku_supplier(supplierSku, erp))
264
+ row_item.append(self.bridge.get_sku_cost(supplierSku, erp))
265
+ row_item.append(package_name)
266
+ row_item.append(package_no)
267
+ row_item.append(returnPlanNo)
268
+ row_item.append(sellerOrderNo)
269
+ row_item.append(sellerDeliveryNo)
270
+ row_item.append(returnWayTypeName)
271
+ row_item.append(returnExpressCompanyName)
272
+ row_item.append(expressNoList)
273
+ row_item.append(returnAddress)
274
+ row_item.append(sellerContract)
275
+ row_item.append(sellerContractPhone)
276
+ row_item.append(urls)
277
+
278
+ excel_data.append(row_item)
279
+
280
+ cache_file_excel = f'{self.config.auto_dir}/shein/cache/shein_return_order_list_excel_{start_date}_{end_date}.json'
281
+ write_dict_to_file(cache_file_excel, excel_data)
282
+
283
+ sheet_name = '希音退货列表'
284
+ batch_excel_operations(self.config.excel_return_list, [
285
+ (sheet_name, 'write', excel_data, ['W', 'Z']),
286
+ (sheet_name, 'format', self.format_return_list)
287
+ ])
288
+
188
289
  # 退货列表
189
290
  def write_return_list(self, erp, start_date, end_date):
190
291
  header = ['退货单号', '退货出库时间', '签收状态', '店铺信息', '店长', '退货类型', '退货原因', 'SKC图片', 'SKC信息', '商家SKU', '属性集', 'SKU退货数量', '平台SKU', 'ERP默认供货商', 'ERP成本', '包裹名', '包裹号', '退货计划单号', '订单号', '发货单', '退回方式', '快递名称', '运单号', '退货地址', '商家联系人', '商家手机号', '入库问题图片地址']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrpa
3
- Version: 1.0.93
3
+ Version: 1.0.95
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