qrpa 1.1.14__py3-none-any.whl → 1.1.15__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 +8 -4
- qrpa/time_utils.py +28 -0
- {qrpa-1.1.14.dist-info → qrpa-1.1.15.dist-info}/METADATA +1 -1
- {qrpa-1.1.14.dist-info → qrpa-1.1.15.dist-info}/RECORD +6 -6
- {qrpa-1.1.14.dist-info → qrpa-1.1.15.dist-info}/WHEEL +0 -0
- {qrpa-1.1.14.dist-info → qrpa-1.1.15.dist-info}/top_level.txt +0 -0
qrpa/shein_excel.py
CHANGED
|
@@ -339,9 +339,13 @@ class SheinExcel:
|
|
|
339
339
|
data.sort(key=lambda row: row[8], reverse=True)
|
|
340
340
|
excel_path = create_file_path(self.config.excel_week_report)
|
|
341
341
|
sheet_name = '按店铺汇总'
|
|
342
|
+
|
|
343
|
+
date_A = f'新品上架数量({TimeUtils.get_past_nth_day(29, TimeUtils.get_month_first_day())},{TimeUtils.get_past_nth_day(29, TimeUtils.get_yesterday())})'
|
|
344
|
+
date_B = f'成功转备货款({TimeUtils.get_month_first_day()},{TimeUtils.get_yesterday()})'
|
|
345
|
+
|
|
342
346
|
data.insert(0, ['汇总', '', '', '', '', '', '', '', '', '', '', '', ''])
|
|
343
347
|
data.insert(0, ['店铺名称', '店铺账号', '店长', '在途商品金额', '在仓商品金额', '待结算金额', '可提现金额', '汇总',
|
|
344
|
-
'销售出库金额',
|
|
348
|
+
'销售出库金额', date_A, date_B, '成功率', '导出时间'])
|
|
345
349
|
write_data(excel_path, sheet_name, data)
|
|
346
350
|
app, wb, sheet = open_excel(excel_path, sheet_name)
|
|
347
351
|
beautify_title(sheet)
|
|
@@ -349,9 +353,9 @@ class SheinExcel:
|
|
|
349
353
|
self.dealFundsExcelFormat(sheet)
|
|
350
354
|
format_to_percent(sheet, ['成功率'], 0)
|
|
351
355
|
add_formula_for_column(sheet, '成功率', '=IF(J2=0, 0, k2/J2)', 2)
|
|
352
|
-
add_formula_for_column(sheet,
|
|
353
|
-
add_formula_for_column(sheet,
|
|
354
|
-
add_sum_for_cell(sheet, [
|
|
356
|
+
add_formula_for_column(sheet, date_A, "=COUNTIF('新品转备货款明细'!A:A, B3)", 3)
|
|
357
|
+
add_formula_for_column(sheet, date_B, "=COUNTIFS('新品转备货款明细'!A:A, B3, '新品转备货款明细'!G:G, 1)", 3)
|
|
358
|
+
add_sum_for_cell(sheet, [date_A, date_B])
|
|
355
359
|
column_to_right(sheet, ['金额', '汇总'])
|
|
356
360
|
sheet.autofit()
|
|
357
361
|
delete_sheet_if_exists(wb, 'Sheet1')
|
qrpa/time_utils.py
CHANGED
|
@@ -159,6 +159,34 @@ class TimeUtils:
|
|
|
159
159
|
|
|
160
160
|
return start_date.strftime(format_str), end_date.strftime(format_str)
|
|
161
161
|
|
|
162
|
+
@staticmethod
|
|
163
|
+
def get_month_first_day(start_from: Optional[str] = None, format_str: str = '%Y-%m-%d') -> str:
|
|
164
|
+
"""
|
|
165
|
+
获取某月的第一天
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
start_from: 参考日期,格式为'YYYY-MM-DD',默认使用今天
|
|
169
|
+
format_str: 返回的日期格式,默认是'%Y-%m-%d'
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
指定格式的某月第一天日期字符串
|
|
173
|
+
|
|
174
|
+
Example:
|
|
175
|
+
>>> get_month_first_day('2025-07-02')
|
|
176
|
+
'2025-07-01'
|
|
177
|
+
"""
|
|
178
|
+
if start_from:
|
|
179
|
+
try:
|
|
180
|
+
base_date = datetime.strptime(start_from, '%Y-%m-%d')
|
|
181
|
+
except ValueError:
|
|
182
|
+
raise ValueError("start_from 格式必须是 'YYYY-MM-DD'")
|
|
183
|
+
else:
|
|
184
|
+
base_date = datetime.today()
|
|
185
|
+
|
|
186
|
+
# 获取当月第一天
|
|
187
|
+
first_day = base_date.replace(day=1)
|
|
188
|
+
return first_day.strftime(format_str)
|
|
189
|
+
|
|
162
190
|
@staticmethod
|
|
163
191
|
def get_past_nth_day(n: int, start_from: Optional[str] = None, format_str: str = '%Y-%m-%d') -> str:
|
|
164
192
|
"""
|
|
@@ -10,7 +10,7 @@ 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=
|
|
13
|
+
qrpa/shein_excel.py,sha256=Bp9_QEXZ7Z74WvbQ0mbXAdDH1YBzLkDDTIwQ4HsWBNA,147598
|
|
14
14
|
qrpa/shein_lib.py,sha256=yOHww1FMetuTgYzpUlxgcl65iIh3FvR_gc554Jnjn-k,148318
|
|
15
15
|
qrpa/shein_mysql.py,sha256=XvEolaorH307PcPZMg10tZzFAtpVUlFM9rKIaNYA9VI,3335
|
|
16
16
|
qrpa/shein_sqlite.py,sha256=ZQwD0Gz81q9WY7tY2HMEYvSF9r3N_G_Aur3bYfST9WY,5707
|
|
@@ -18,14 +18,14 @@ qrpa/shein_ziniao.py,sha256=B7HNz31YWDcWDIhX3ETDZpIe6_BRyEbtwyqlkFNsPNE,21945
|
|
|
18
18
|
qrpa/temu_chrome.py,sha256=CbtFy1QPan9xJdJcNZj-EsVGhUvv3ZTEPVDEA4-im40,2803
|
|
19
19
|
qrpa/temu_excel.py,sha256=2hGw76YWzkTZGyFCuuUAab4oHptYX9a6U6yjpNsL7FE,6990
|
|
20
20
|
qrpa/temu_lib.py,sha256=hYB59zsLS3m3NTic_duTwPMOTSxlHyQVa8OhHnHm-1g,7199
|
|
21
|
-
qrpa/time_utils.py,sha256=
|
|
21
|
+
qrpa/time_utils.py,sha256=5fe4wbjwzUecfmvEND6WMrogGofVm_Rqpc3hSHQRRvE,32325
|
|
22
22
|
qrpa/time_utils_example.py,sha256=shHOXKKF3QSzb0SHsNc34M61wEkkLuM30U9X1THKNS8,8053
|
|
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_ledger_model.py,sha256=O1pUFwXGC9hySU7-h07sAu70Xhzl0OxnXPMzRwphiGU,18629
|
|
26
26
|
qrpa/mysql_module/shein_product_model.py,sha256=v21_juWsZqTHj2k08GUGNkoRZ4hkKZKjaE-wmRl2a2k,19257
|
|
27
27
|
qrpa/mysql_module/shein_return_order_model.py,sha256=Zt-bGOH_kCDbakW7uaTmqqo_qTT8v424yidcYSfWvWM,26562
|
|
28
|
-
qrpa-1.1.
|
|
29
|
-
qrpa-1.1.
|
|
30
|
-
qrpa-1.1.
|
|
31
|
-
qrpa-1.1.
|
|
28
|
+
qrpa-1.1.15.dist-info/METADATA,sha256=m8ZIFLxaR_JDXxd69g-g0cqLa5e-U0h3nLFmfJdH8BY,231
|
|
29
|
+
qrpa-1.1.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
qrpa-1.1.15.dist-info/top_level.txt,sha256=F6T5igi0fhXDucPPUbmmSC0qFCDEsH5eVijfVF48OFU,5
|
|
31
|
+
qrpa-1.1.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|