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 b322d706
authored
Nov 06, 2026
by
周立明
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
北汽结果表 环比数据显示问题修复
1 parent
38e3546a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
data-process/baic_special_processor.py
data-process/baic_special_processor.py
View file @
b322d70
...
@@ -1992,9 +1992,14 @@ class BaicSpecialProcessor:
...
@@ -1992,9 +1992,14 @@ class BaicSpecialProcessor:
_penetration
(
rights_total
,
total_delivery
),
_penetration
(
rights_total
,
total_delivery
),
_penetration
(
_prev_rights
,
_prev_delivery
)))
_penetration
(
_prev_rights
,
_prev_delivery
)))
else
:
else
:
# 无上月真实任务数据 → 清空,避免残留模板示例值
# 无上月真实任务数据 → 环比默认「本月 - 0 = 本月值」(上月视为 0)
for
c
in
range
(
15
,
19
):
_cur_open_rate
=
_dec_to_float
(
summary
.
after_sale_scene_open_rate
)
if
summary
else
None
_set_cell
(
ws
,
data_row
,
c
,
None
)
_set_cell
(
ws
,
data_row
,
15
,
_diff
(
_cur_open_rate
,
0
))
# O 售后场景开通率环比 = 本月值
_set_cell
(
ws
,
data_row
,
16
,
_diff
(
_visit_rate_total
,
0
))
# P 售前触客率环比 = 本月值
_set_cell
(
ws
,
data_row
,
17
,
_diff
(
# Q 整车延保渗透率环比 = 本月值
_penetration
(
ext_total
,
total_delivery
),
0
))
_set_cell
(
ws
,
data_row
,
18
,
_diff
(
# R 原厂权益渗透率环比 = 本月值
_penetration
(
rights_total
,
total_delivery
),
0
))
if
cur_prev_row
is
not
None
:
if
cur_prev_row
is
not
None
:
lbl
=
ws
.
cell
(
cur_prev_row
,
1
)
.
value
lbl
=
ws
.
cell
(
cur_prev_row
,
1
)
.
value
...
@@ -2063,11 +2068,16 @@ class BaicSpecialProcessor:
...
@@ -2063,11 +2068,16 @@ class BaicSpecialProcessor:
_diff
(
_penetration
(
rights_total
,
total_delivery
),
_diff
(
_penetration
(
rights_total
,
total_delivery
),
_penetration
(
_prev_rights
,
_prev_delivery
))
_penetration
(
_prev_rights
,
_prev_delivery
))
else
:
else
:
# 无上月真实任务 → 环比列清空(与结果表 O~R 一致)
# 无上月真实任务 → 环比默认「本月 - 0 = 本月值」(与结果表 O~R 一致)
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
after_sale_scene_open_rate_mom_pp
]
=
None
_cur_open_rate
=
_dec_to_float
(
summary
.
after_sale_scene_open_rate
)
if
summary
else
None
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
pre_sale_visit_rate_mom_pp
]
=
None
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
after_sale_scene_open_rate_mom_pp
]
=
\
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
vehicle_ext_warranty_penetration_rate_mom_pp
]
=
None
_diff
(
_cur_open_rate
,
0
)
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
original_rights_penetration_rate_mom_pp
]
=
None
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
pre_sale_visit_rate_mom_pp
]
=
\
_diff
(
_visit_rate_total
,
0
)
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
vehicle_ext_warranty_penetration_rate_mom_pp
]
=
\
_diff
(
_penetration
(
ext_total
,
total_delivery
),
0
)
_sm_update
[
BaicSpecialMonthSummaryMetrics
.
original_rights_penetration_rate_mom_pp
]
=
\
_diff
(
_penetration
(
rights_total
,
total_delivery
),
0
)
_sm_n
=
BaicSpecialMonthSummaryMetrics
.
query
.
filter_by
(
_sm_n
=
BaicSpecialMonthSummaryMetrics
.
query
.
filter_by
(
task_id
=
task
.
id
,
is_deleted
=
0
)
.
update
(
_sm_update
,
synchronize_session
=
False
)
task_id
=
task
.
id
,
is_deleted
=
0
)
.
update
(
_sm_update
,
synchronize_session
=
False
)
db
.
session
.
commit
()
db
.
session
.
commit
()
...
...
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