Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
data_report
/
data-report
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1f89a426
authored
Sep 18, 2026
by
范富荣
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增通用+权益报表输出定时任务
1 parent
32acf65d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
data-process/app.py
data-process/config.py
data-process/exporttemplete/通用+权益导出模板.xlsx
data-process/scheduler.py
data-process/app.py
View file @
1f89a42
...
...
@@ -35,6 +35,7 @@ from scheduler import (
AvitaSpecialScheduler
,
VoyahScheduler
,
LeapmotorScheduler
,
CommonEquityScheduler
,
)
app
=
Flask
(
__name__
,
static_folder
=
'static'
,
static_url_path
=
''
)
...
...
@@ -657,6 +658,7 @@ output_value_scheduler = OutputValueScheduler(app=app)
store_effect_summary_scheduler
=
StoreEffectSummaryScheduler
(
app
=
app
)
voyah_scheduler
=
VoyahScheduler
(
app
=
app
)
leapmotor_scheduler
=
LeapmotorScheduler
(
app
=
app
)
common_equity_scheduler
=
CommonEquityScheduler
(
app
=
app
)
ALL_SCHEDULERS
=
[
(
'budget_achievement'
,
scheduler
),
...
...
@@ -668,6 +670,7 @@ ALL_SCHEDULERS = [
(
'store_effect_summary'
,
store_effect_summary_scheduler
),
(
'voyah_special'
,
voyah_scheduler
),
(
'leapmotor_special'
,
leapmotor_scheduler
),
(
'common_equity'
,
common_equity_scheduler
),
]
...
...
data-process/config.py
View file @
1f89a42
...
...
@@ -94,6 +94,9 @@ class Config:
INDICATOR_BIZ_LIGHT_REFORM
=
2
INDICATOR_BIZ_EQUITY
=
3
# ---------- 通用+权益:直营判定基准商户号 ----------
COMMON_EQUITY_PARTNER_MERCHANT_ID
=
int
(
os
.
getenv
(
'COMMON_EQUITY_PARTNER_MERCHANT_ID'
,
'44206988'
))
# ---------- 业务系统 SQL 数据源(嘀加 dj_smartcarlife 库)----------
BIZ_SQL_ENABLED
=
os
.
getenv
(
'BIZ_SQL_ENABLED'
,
'true'
)
.
lower
()
==
'true'
BIZ_SQL_DATABASE_URL
=
os
.
getenv
(
...
...
data-process/exporttemplete/通用+权益导出模板.xlsx
0 → 100644
View file @
1f89a42
No preview for this file type
data-process/scheduler.py
View file @
1f89a42
...
...
@@ -364,6 +364,39 @@ class OutputValueScheduler(NewReportScheduler):
self
.
_lock
.
release
()
class
CommonEquityScheduler
(
NewReportScheduler
):
"""通用+权益独立调度器(扫描 common_equity 类型任务)"""
OUTPUT_CATEGORY
=
'common_equity'
JOB_NAME
=
'common_equity_scan'
def
_execute_scan
(
self
):
if
not
self
.
_lock
.
acquire
(
blocking
=
False
):
logger
.
debug
(
f
"[{self.JOB_NAME}] 上一轮处理尚未完成,跳过本轮扫描"
)
return
self
.
_is_processing
=
True
self
.
_last_run_time
=
datetime
.
now
()
try
:
logger
.
info
(
f
"[{self.JOB_NAME}] 开始扫描 common_equity 待处理任务"
)
with
self
.
app
.
app_context
():
from
common_equity_processor
import
CommonEquityProcessor
processor
=
CommonEquityProcessor
(
app
=
self
.
app
)
result
=
processor
.
scan_common_equity
()
self
.
_last_run_result
=
result
logger
.
info
(
f
"[{self.JOB_NAME}] 扫描完成:成功 {result.get('success', 0)} 个,"
f
"失败 {result.get('failed', 0)} 个"
)
except
Exception
as
e
:
logger
.
error
(
f
"[{self.JOB_NAME}] 扫描执行异常: {str(e)}"
)
self
.
_last_run_result
=
{
'error'
:
str
(
e
)}
finally
:
self
.
_is_processing
=
False
self
.
_lock
.
release
()
class
StoreEffectSummaryScheduler
(
NewReportScheduler
):
"""门店店效人效汇总表独立调度器(扫描 store_effect_earnings 类型任务,整体合计一行,第5个sheet)"""
OUTPUT_CATEGORY
=
'store_effect_summary'
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment