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 8fb747d4
authored
Oct 27, 2026
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
广爱bug修复
1 parent
9a47cab5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
157 additions
and
35 deletions
data-process/app.py
data-process/config.py
data-process/guangai_processor.py
data-process/report_utils.py
data-process/scheduler.py
data-process/static/js/list.js
data-process/test_guangai_processor.py
data-process/app.py
View file @
8fb747d
...
@@ -909,7 +909,12 @@ if __name__ == '__main__':
...
@@ -909,7 +909,12 @@ if __name__ == '__main__':
try
:
try
:
app
.
run
(
host
=
os
.
getenv
(
'FLASK_HOST'
,
'0.0.0.0'
),
app
.
run
(
host
=
os
.
getenv
(
'FLASK_HOST'
,
'0.0.0.0'
),
port
=
int
(
os
.
getenv
(
'FLASK_PORT'
,
'5000'
)),
port
=
int
(
os
.
getenv
(
'FLASK_PORT'
,
'5000'
)),
debug
=
os
.
getenv
(
'FLASK_DEBUG'
,
'true'
)
.
lower
()
==
'true'
)
debug
=
os
.
getenv
(
'FLASK_DEBUG'
,
'true'
)
.
lower
()
==
'true'
,
# ⚠ 必须关闭 reloader:debug 模式下 reloader 会另起一个子进程,
# Windows 下子进程继承了父进程的 .scheduler.lock 句柄,msvcrt 视为同一
# 持有者 → 父子两个调度器同时跑,同一任务被并发处理两次(结果文件互相覆盖、
# error_msg 残留"连接失败"等)。改代码后请手动重启(项目本来就要求重启)。
use_reloader
=
False
)
finally
:
finally
:
for
name
,
sch
in
ALL_SCHEDULERS
:
for
name
,
sch
in
ALL_SCHEDULERS
:
sch
.
stop
()
sch
.
stop
()
...
...
data-process/config.py
View file @
8fb747d
...
@@ -103,11 +103,12 @@ class Config:
...
@@ -103,11 +103,12 @@ class Config:
# 区域展示表「说明行」末尾的线上运营咨询人:默认林泽娜、邓锦婷,换人时改环境变量即可
# 区域展示表「说明行」末尾的线上运营咨询人:默认林泽娜、邓锦婷,换人时改环境变量即可
COMMON_EQUITY_ONLINE_OPERATORS
=
os
.
getenv
(
'COMMON_EQUITY_ONLINE_OPERATORS'
,
'林泽娜、邓锦婷'
)
COMMON_EQUITY_ONLINE_OPERATORS
=
os
.
getenv
(
'COMMON_EQUITY_ONLINE_OPERATORS'
,
'林泽娜、邓锦婷'
)
# ---------- 广爱专项:D+ 主服务商户 ID(驻店类型"直营"判定基准) ----------
# ---------- 广爱专项:驻店类型"直营"判定基准商户号集合 ----------
# 源码口径(ServiceMerchantService#dealSingleBusinessTypeData):
# ⚠ 2026-10-27 口径重定义(业务确认,原"== D+ 主服务商户 ID"逻辑作废):
# yq_merchant_config.partner_merchant_id == 本 ID → directSalesFlag=1(直营)
# yq_merchant_config.partner_merchant_id IN (44206988, 44217696) → 直营,
# 生产 44217696 / 测试 44212541,按环境通过环境变量配置
# 否则非直营;同商户多条配置任一命中即直营
GUANGAI_DJ_SERVICE_MERCHANT_ID
=
int
(
os
.
getenv
(
'GUANGAI_DJ_SERVICE_MERCHANT_ID'
,
'44212541'
))
GUANGAI_DIRECT_SALES_PARTNER_MERCHANT_IDS
=
os
.
getenv
(
'GUANGAI_DIRECT_SALES_PARTNER_MERCHANT_IDS'
,
'44206988,44217696'
)
# 广爱专项:原厂权益商品类目 ID(goods_sub_order 一/二/三级商品类目任一命中即计入)
# 广爱专项:原厂权益商品类目 ID(goods_sub_order 一/二/三级商品类目任一命中即计入)
GUANGAI_ORIGINAL_EQUITY_GOODS_TYPE
=
int
(
os
.
getenv
(
'GUANGAI_ORIGINAL_EQUITY_GOODS_TYPE'
,
'189'
))
GUANGAI_ORIGINAL_EQUITY_GOODS_TYPE
=
int
(
os
.
getenv
(
'GUANGAI_ORIGINAL_EQUITY_GOODS_TYPE'
,
'189'
))
...
...
data-process/guangai_processor.py
View file @
8fb747d
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
"""
"""
import
logging
import
logging
import
os
import
os
import
re
import
tempfile
import
tempfile
from
copy
import
copy
from
copy
import
copy
from
datetime
import
date
,
datetime
,
timedelta
from
datetime
import
date
,
datetime
,
timedelta
...
@@ -34,7 +35,8 @@ from sqlalchemy import text, bindparam
...
@@ -34,7 +35,8 @@ from sqlalchemy import text, bindparam
from
config
import
Config
from
config
import
Config
from
indicator_client
import
IndicatorClient
from
indicator_client
import
IndicatorClient
from
oss_utils
import
upload_file
from
oss_utils
import
upload_file
from
report_utils
import
mark_task_failed
,
cleanup_tmp_dir
,
download_all_files
,
_get_biz_sql_conn
from
report_utils
import
(
mark_task_failed
,
cleanup_tmp_dir
,
download_all_files
,
_get_biz_sql_conn
,
biz_sql_last_error
)
from
models
import
DataProcessTask
,
GuangaiStoreReportData
,
db
from
models
import
DataProcessTask
,
GuangaiStoreReportData
,
db
from
voyah_processor
import
shorten_province
from
voyah_processor
import
shorten_province
...
@@ -171,7 +173,7 @@ class GuangaiProcessor:
...
@@ -171,7 +173,7 @@ class GuangaiProcessor:
"""广爱门店清单(merchant_id/merchant_name),ORDER BY g.id, r.merchant_id。"""
"""广爱门店清单(merchant_id/merchant_name),ORDER BY g.id, r.merchant_id。"""
conn
=
_get_biz_sql_conn
()
conn
=
_get_biz_sql_conn
()
if
conn
is
None
:
if
conn
is
None
:
raise
Exception
(
"业务库(dj_smartcarlife)连接失败
"
)
raise
Exception
(
f
"业务库(dj_smartcarlife)连接失败:{biz_sql_last_error()}
"
)
try
:
try
:
rows
=
conn
.
execute
(
text
(
rows
=
conn
.
execute
(
text
(
"select r.merchant_id, r.merchant_name "
"select r.merchant_id, r.merchant_name "
...
@@ -189,7 +191,7 @@ class GuangaiProcessor:
...
@@ -189,7 +191,7 @@ class GuangaiProcessor:
r.created_date <= 月末 且(未删除 或 updated_date > 月末)。"""
r.created_date <= 月末 且(未删除 或 updated_date > 月末)。"""
conn
=
_get_biz_sql_conn
()
conn
=
_get_biz_sql_conn
()
if
conn
is
None
:
if
conn
is
None
:
raise
Exception
(
"业务库(dj_smartcarlife)连接失败
"
)
raise
Exception
(
f
"业务库(dj_smartcarlife)连接失败:{biz_sql_last_error()}
"
)
try
:
try
:
rows
=
conn
.
execute
(
text
(
rows
=
conn
.
execute
(
text
(
"select r.merchant_id, r.merchant_name "
"select r.merchant_id, r.merchant_name "
...
@@ -218,7 +220,7 @@ class GuangaiProcessor:
...
@@ -218,7 +220,7 @@ class GuangaiProcessor:
goods_type
=
int
(
Config
.
GUANGAI_ORIGINAL_EQUITY_GOODS_TYPE
)
goods_type
=
int
(
Config
.
GUANGAI_ORIGINAL_EQUITY_GOODS_TYPE
)
conn
=
_get_biz_sql_conn
()
conn
=
_get_biz_sql_conn
()
if
conn
is
None
:
if
conn
is
None
:
raise
Exception
(
"业务库(dj_smartcarlife)连接失败
"
)
raise
Exception
(
f
"业务库(dj_smartcarlife)连接失败:{biz_sql_last_error()}
"
)
try
:
try
:
rows
=
conn
.
execute
(
text
(
rows
=
conn
.
execute
(
text
(
"select go.merchant_id, "
"select go.merchant_id, "
...
@@ -613,10 +615,19 @@ class GuangaiProcessor:
...
@@ -613,10 +615,19 @@ class GuangaiProcessor:
finally
:
finally
:
cleanup_tmp_dir
(
tmp_dir
)
cleanup_tmp_dir
(
tmp_dir
)
task
=
DataProcessTask
.
query
.
filter_by
(
id
=
task_id
)
.
first
()
# ⚠ 用 query.update() 显式覆盖全部字段,不要用"对象赋值 + commit":
task
.
status
=
'COMPLETED'
# 多实例并发时(本机 + 另一台服务连同一个库),本 session 扫描时读到的
task
.
result_file_url
=
file_url
# error_msg 是空串,另一个实例失败后把"业务库连接失败"写进了库;
task
.
error_msg
=
''
# 此时再赋 '' 属于"值未变化",ORM 不会把这列放进 UPDATE → 失败原因
# 残留在已成功的任务上(2026-10-27 task 53 实测)。
DataProcessTask
.
query
.
filter_by
(
id
=
task_id
)
.
update
(
{
'status'
:
'COMPLETED'
,
'result_file_url'
:
file_url
,
'error_msg'
:
''
,
# bulk update 不会触发 onupdate,这里显式维护更新时间
'updated_at'
:
datetime
.
now
()},
synchronize_session
=
False
,
)
db
.
session
.
commit
()
db
.
session
.
commit
()
logger
.
info
(
f
"[广爱专项] 任务 {task_id} 处理完成,结果文件: {file_url}"
)
logger
.
info
(
f
"[广爱专项] 任务 {task_id} 处理完成,结果文件: {file_url}"
)
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -650,7 +661,7 @@ class GuangaiProcessor:
...
@@ -650,7 +661,7 @@ class GuangaiProcessor:
province
,
shop_type
,
director
,
biz_dev_date
=
{},
{},
{},
{}
province
,
shop_type
,
director
,
biz_dev_date
=
{},
{},
{},
{}
conn
=
_get_biz_sql_conn
()
conn
=
_get_biz_sql_conn
()
if
conn
is
None
:
if
conn
is
None
:
raise
Exception
(
"业务库(dj_smartcarlife)连接失败
"
)
raise
Exception
(
f
"业务库(dj_smartcarlife)连接失败:{biz_sql_last_error()}
"
)
try
:
try
:
# B 省份
# B 省份
for
r
in
conn
.
execute
(
text
(
for
r
in
conn
.
execute
(
text
(
...
@@ -658,23 +669,48 @@ class GuangaiProcessor:
...
@@ -658,23 +669,48 @@ class GuangaiProcessor:
"where deleted_flag='N' and merchant_id in :mids"
"where deleted_flag='N' and merchant_id in :mids"
)
.
bindparams
(
bindparam
(
'mids'
,
expanding
=
True
)),
{
'mids'
:
mids
}):
)
.
bindparams
(
bindparam
(
'mids'
,
expanding
=
True
)),
{
'mids'
:
mids
}):
province
[
str
(
r
[
0
])]
=
shorten_province
(
r
[
1
])
province
[
str
(
r
[
0
])]
=
shorten_province
(
r
[
1
])
# C 驻店类型:yqmerchant_config.partner_merchant_id == D+ 主服务商户 ID → 直营
# C 驻店类型:⚠ 2026-10-27 口径(业务确认,二次修正):
# ⚠ 真实表列名为 merchant_id(无 shop_merchant_id),2026-10-19 实测修正;
# 广爱报表里的门店是 4S 店,**延保商户配置挂在它关联的园区店上**
# 同商户可能有多条配置,任一命中 D+ 主服务商户 ID 即直营
# (dj_car_life_scene_merchant_ref:main=4S 店 / sub=园区店,
dj_id
=
str
(
Config
.
GUANGAI_DJ_SERVICE_MERCHANT_ID
)
# main_merchant_type=2、sub_merchant_type IN (6,8)、scene=0);
partners
=
{}
# 因此要先按 4S 店找到它关联的园区店,再用「园区店」的
# partner_merchant_id 判定:命中 {44206988,44217696}
# (Config.GUANGAI_DIRECT_SALES_PARTNER_MERCHANT_IDS)→ 直营,否则非直营。
# ⚠ 不能直接用 4S 店自己的 merchant_id 查配置:广爱 21 家门店在自己号下
# 全是 0 行,会导出 21/21「非直营」(2026-10-27 实测)。
# 仅当 4S 店压根没有园区店映射时,才回退查本店配置。
# ⚠ 表列名为 merchant_id(无 shop_merchant_id),同商户可能多条配置,
# 任一条 partner_merchant_id 命中集合即直营。
direct_ids
=
{
s
.
strip
()
for
s
in
str
(
Config
.
GUANGAI_DIRECT_SALES_PARTNER_MERCHANT_IDS
)
.
split
(
','
)
if
s
.
strip
()}
park_partners
,
own_partners
=
{},
{}
# ① 4S 店 → 关联园区店 → 园区店配置
for
r
in
conn
.
execute
(
text
(
"select ref.main_merchant_id, c.partner_merchant_id "
"from dj_car_life_scene_merchant_ref ref "
"join dj_car_life_yqmerchant_config c "
" on c.merchant_id = ref.sub_merchant_id and c.deleted_flag='N' "
"where ref.deleted_flag='N' and ref.scene=0 "
" and ref.main_merchant_type=2 and ref.sub_merchant_type in (6,8) "
" and ref.main_merchant_id in :mids"
)
.
bindparams
(
bindparam
(
'mids'
,
expanding
=
True
)),
{
'mids'
:
mids
}):
park_partners
.
setdefault
(
str
(
r
[
0
]),
set
())
.
add
(
str
(
r
[
1
])
if
r
[
1
]
is
not
None
else
''
)
# ② 兜底:门店自身配置(无园区店映射的店才用)
for
r
in
conn
.
execute
(
text
(
for
r
in
conn
.
execute
(
text
(
"select merchant_id, partner_merchant_id "
"select merchant_id, partner_merchant_id "
"from dj_car_life_yqmerchant_config "
"from dj_car_life_yqmerchant_config "
"where merchant_id in :mids and deleted_flag='N' "
"where merchant_id in :mids and deleted_flag='N' "
"group by merchant_id, partner_merchant_id"
"group by merchant_id, partner_merchant_id"
)
.
bindparams
(
bindparam
(
'mids'
,
expanding
=
True
)),
{
'mids'
:
mids
}):
)
.
bindparams
(
bindparam
(
'mids'
,
expanding
=
True
)),
{
'mids'
:
mids
}):
partners
.
setdefault
(
str
(
r
[
0
]),
set
())
.
add
(
own_
partners
.
setdefault
(
str
(
r
[
0
]),
set
())
.
add
(
str
(
r
[
1
])
if
r
[
1
]
is
not
None
else
''
)
str
(
r
[
1
])
if
r
[
1
]
is
not
None
else
''
)
for
mid
in
mids
:
for
mid
in
mids
:
vals
=
partners
.
get
(
str
(
mid
))
vals
=
par
k_partners
.
get
(
str
(
mid
))
or
own_par
tners
.
get
(
str
(
mid
))
shop_type
[
str
(
mid
)]
=
(
shop_type
[
str
(
mid
)]
=
(
'直营'
if
vals
and
dj_id
in
val
s
else
'非直营'
)
'直营'
if
vals
and
vals
&
direct_id
s
else
'非直营'
)
# G 运营经理:director_type=9(2.1 区域运营),多值 / 分割
# G 运营经理:director_type=9(2.1 区域运营),多值 / 分割
for
r
in
conn
.
execute
(
text
(
for
r
in
conn
.
execute
(
text
(
"select merchant_id, director_name "
"select merchant_id, director_name "
...
@@ -815,6 +851,24 @@ class GuangaiProcessor:
...
@@ -815,6 +851,24 @@ class GuangaiProcessor:
title
=
title
.
replace
(
'8月'
,
f
'{period_start.month}月'
)
title
=
title
.
replace
(
'8月'
,
f
'{period_start.month}月'
)
t1
.
value
=
title
t1
.
value
=
title
# ---------- 1.5) 表头 / 取值说明(2~5 行)里的月份跟着报表周期走 ----------
# 模板写死「7月(一店一群)」「8月(一店一群)」,说明行里还有「7+8 月合计」「8月汇总」等:
# 7月 = 上月(J~P 取上月附件+上月指标),8月 = 本月(Q~R 取本月附件)。
prev_last
=
data
.
get
(
'prev_last'
)
or
(
period_start
-
timedelta
(
days
=
1
))
prev_m
,
cur_m
=
prev_last
.
month
,
period_start
.
month
def
_relabel_month
(
v
):
"""7月→上月、8月→本月;「7+8月」这种合计写法先整体替换,避免被单月规则拆开。"""
v
=
re
.
sub
(
r'7\s*\+\s*8\s*月'
,
f
'{prev_m}+{cur_m}月'
,
v
)
return
re
.
sub
(
r'([78])\s?月'
,
lambda
m
:
f
'{prev_m}月'
if
m
.
group
(
1
)
==
'7'
else
f
'{cur_m}月'
,
v
)
for
row
in
ws
.
iter_rows
(
min_row
=
2
,
max_row
=
5
,
max_col
=
ws
.
max_column
):
for
cell
in
row
:
if
isinstance
(
cell
.
value
,
str
)
and
re
.
search
(
r'[78]\s?月'
,
cell
.
value
):
cell
.
value
=
_relabel_month
(
cell
.
value
)
# ---------- 2) 解除 38 行以下全部合并(品牌汇总/周区间区,行平移后重建) ----------
# ---------- 2) 解除 38 行以下全部合并(品牌汇总/周区间区,行平移后重建) ----------
below_merges
=
[]
below_merges
=
[]
for
rng
in
[
r
for
r
in
ws
.
merged_cells
.
ranges
if
r
.
min_row
>=
38
]:
for
rng
in
[
r
for
r
in
ws
.
merged_cells
.
ranges
if
r
.
min_row
>=
38
]:
...
...
data-process/report_utils.py
View file @
8fb747d
...
@@ -1493,16 +1493,41 @@ BIZ_TYPE_TO_SMARTCARLIFE = {
...
@@ -1493,16 +1493,41 @@ BIZ_TYPE_TO_SMARTCARLIFE = {
}
}
def
_get_biz_sql_conn
():
_BIZ_SQL_LAST_ERR
=
''
"""从 config.BIZ_SQL_DATABASE_URL 创建 SQLAlchemy engine + pymysql 连接。"""
def
biz_sql_last_error
():
"""最近一次业务库连接失败的原始原因(供上层拼进任务 error_msg,便于排障)。"""
return
_BIZ_SQL_LAST_ERR
def
_get_biz_sql_conn
(
retries
=
2
,
retry_wait
=
0.5
):
"""从 config.BIZ_SQL_DATABASE_URL 创建 SQLAlchemy engine + pymysql 连接。
连不上返回 None(调用方按"连接失败"处理),并把**原始异常**记到
`_BIZ_SQL_LAST_ERR`,上层可用 biz_sql_last_error() 取出来写进任务错误信息——
否则任务上只会看到一句笼统的"业务库连接失败",无法区分超时/拒绝/网络不通。
默认重试 2 次(间隔 0.5s、1s),覆盖跨网段偶发瞬断。
"""
global
_BIZ_SQL_LAST_ERR
from
config
import
Config
from
config
import
Config
try
:
last
=
None
from
sqlalchemy
import
create_engine
,
text
for
i
in
range
(
max
(
1
,
retries
)):
engine
=
create_engine
(
Config
.
BIZ_SQL_DATABASE_URL
,
echo
=
False
,
pool_pre_ping
=
True
)
try
:
return
engine
.
connect
()
from
sqlalchemy
import
create_engine
except
Exception
as
e
:
engine
=
create_engine
(
Config
.
BIZ_SQL_DATABASE_URL
,
echo
=
False
,
logger
.
error
(
f
"[BizSQL] 连接 dj_smartcarlife 失败: {e}"
)
pool_pre_ping
=
True
)
return
None
conn
=
engine
.
connect
()
_BIZ_SQL_LAST_ERR
=
''
return
conn
except
Exception
as
e
:
last
=
e
logger
.
warning
(
f
"[BizSQL] 连接 dj_smartcarlife 失败(第 {i + 1} 次): {e}"
)
if
retry_wait
and
i
<
retries
-
1
:
_time
.
sleep
(
retry_wait
*
(
i
+
1
))
_BIZ_SQL_LAST_ERR
=
f
'{type(last).__name__}: {last}'
if
last
else
'unknown'
logger
.
error
(
f
"[BizSQL] 连接 dj_smartcarlife 最终失败: {_BIZ_SQL_LAST_ERR}"
)
return
None
def
fetch_biz_sql_aggregated
(
start_date
,
end_date
,
biz_type
,
store_names
=
None
):
def
fetch_biz_sql_aggregated
(
start_date
,
end_date
,
biz_type
,
store_names
=
None
):
...
...
data-process/scheduler.py
View file @
8fb747d
...
@@ -20,6 +20,29 @@ import sys
...
@@ -20,6 +20,29 @@ import sys
import
traceback
import
traceback
from
datetime
import
datetime
from
datetime
import
datetime
def
_pid_alive
(
pid
):
"""判断进程是否存活(用于锁文件的 PID 校验)。"""
if
not
pid
or
pid
<=
0
:
return
False
if
sys
.
platform
.
startswith
(
'win'
):
try
:
import
ctypes
PROCESS_QUERY_LIMITED_INFORMATION
=
0x1000
h
=
ctypes
.
windll
.
kernel32
.
OpenProcess
(
PROCESS_QUERY_LIMITED_INFORMATION
,
False
,
int
(
pid
))
if
h
:
ctypes
.
windll
.
kernel32
.
CloseHandle
(
h
)
return
True
return
False
except
Exception
:
return
False
try
:
os
.
kill
(
int
(
pid
),
0
)
return
True
except
OSError
:
return
False
from
config
import
Config
from
config
import
Config
logger
=
logging
.
getLogger
(
'TaskScheduler'
)
logger
=
logging
.
getLogger
(
'TaskScheduler'
)
...
@@ -67,6 +90,22 @@ class TaskScheduler:
...
@@ -67,6 +90,22 @@ class TaskScheduler:
返回 True = 获取成功 (本进程可以启动调度器)
返回 True = 获取成功 (本进程可以启动调度器)
返回 False = 另一个进程已持有锁
返回 False = 另一个进程已持有锁
"""
"""
# ① PID 校验:Windows 下 Flask reloader / gunicorn 的子进程会**继承父进程的
# 锁文件句柄**,msvcrt 把父子视为同一持有者 → 父进程持锁时子进程仍能"加锁成功",
# 导致两个调度器同时跑、同一任务被并发处理两次。这里显式比对锁文件里的 PID。
if
os
.
path
.
exists
(
self
.
_lock_path
):
try
:
with
open
(
self
.
_lock_path
,
'r'
,
encoding
=
'utf-8'
,
errors
=
'ignore'
)
as
f
:
holder
=
(
f
.
read
()
or
''
)
.
strip
()
except
(
IOError
,
OSError
)
as
e
:
# 锁文件被独占打不开 → 一定有别的实例正在持有
logger
.
warning
(
f
"[调度器] 锁文件已被其他实例占用,本实例跳过启动: {e}"
)
return
False
holder_pid
=
int
(
holder
)
if
holder
.
isdigit
()
else
0
if
holder_pid
and
holder_pid
!=
os
.
getpid
()
and
_pid_alive
(
holder_pid
):
logger
.
warning
(
f
"[调度器] ⚠️ 另一个调度器实例已在运行 (PID {holder_pid}),本实例跳过启动"
)
return
False
try
:
try
:
self
.
_lock_file
=
open
(
self
.
_lock_path
,
'w'
)
self
.
_lock_file
=
open
(
self
.
_lock_path
,
'w'
)
if
sys
.
platform
.
startswith
(
'win'
):
if
sys
.
platform
.
startswith
(
'win'
):
...
...
data-process/static/js/list.js
View file @
8fb747d
...
@@ -279,9 +279,6 @@
...
@@ -279,9 +279,6 @@
empty
.
value
=
''
;
empty
.
textContent
=
'请选择'
;
empty
.
value
=
''
;
empty
.
textContent
=
'请选择'
;
mType
.
appendChild
(
empty
);
mType
.
appendChild
(
empty
);
typeConfigs
.
forEach
(
function
(
t
)
{
typeConfigs
.
forEach
(
function
(
t
)
{
// 广爱专项本期暂不上线:仅「新增数据」时从下拉临时隐藏(重新生成仍要回填原类型)
// 恢复上线把这行删掉即可
if
(
modalMode
!==
'regenerate'
&&
t
.
code
===
'guangai_special'
)
return
;
var
o
=
document
.
createElement
(
'option'
);
var
o
=
document
.
createElement
(
'option'
);
o
.
value
=
t
.
code
;
o
.
textContent
=
t
.
name
;
o
.
value
=
t
.
code
;
o
.
textContent
=
t
.
name
;
mType
.
appendChild
(
o
);
mType
.
appendChild
(
o
);
...
...
data-process/test_guangai_processor.py
View file @
8fb747d
...
@@ -31,6 +31,7 @@ if 'report_utils' not in sys.modules:
...
@@ -31,6 +31,7 @@ if 'report_utils' not in sys.modules:
_ru
.
cleanup_tmp_dir
=
lambda
p
:
None
_ru
.
cleanup_tmp_dir
=
lambda
p
:
None
_ru
.
download_all_files
=
lambda
t
,
d
:
{}
_ru
.
download_all_files
=
lambda
t
,
d
:
{}
_ru
.
_get_biz_sql_conn
=
lambda
:
None
_ru
.
_get_biz_sql_conn
=
lambda
:
None
_ru
.
biz_sql_last_error
=
lambda
:
''
sys
.
modules
[
'report_utils'
]
=
_ru
sys
.
modules
[
'report_utils'
]
=
_ru
if
'oss_utils'
not
in
sys
.
modules
:
if
'oss_utils'
not
in
sys
.
modules
:
_ou
=
types
.
ModuleType
(
'oss_utils'
)
_ou
=
types
.
ModuleType
(
'oss_utils'
)
...
...
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