Commit 3993b627 by 江名洋

fix(harmony):修正兜底类型字段并完善安心包专岗逻辑

1 parent 3a4651cb
......@@ -67,6 +67,7 @@ MODULE_LOG_FILES = {
"app.db": "db.log",
"app.scheduler": "scheduler.log",
"app.strategy_service": "strategy.log",
"app.harmony_analysis_service": "harmony.log",
}
......
......@@ -562,6 +562,12 @@ class HarmonyAnalysisService:
store_name_str = str(store_name)
perf = db_perf.get(store_name_str, {})
# 部分门店在DB中以"门店名(鸿蒙)"存储,回退查找
if not perf and "(鸿蒙)" not in store_name_str:
hm_name = store_name_str + "(鸿蒙)"
perf = db_perf.get(hm_name, {})
if perf:
logger.info(f"[名称匹配] 门店={store_name_str}, 以'{hm_name}'匹配到DB数据")
ws.row_dimensions[row_num].height = 18
......@@ -600,12 +606,21 @@ class HarmonyAnalysisService:
touch = _safe_float(store_row.get("触客数", 0))
if touch == 0:
touch = db_touch
baodi_type = str(store_row.get("兜底指标", "")).strip()
baodi_type = str(store_row.get("兜底类型", "")).strip()
special_cond = str(store_row.get("特殊情况", "")).strip()
capped = False
if baodi_type == "触客" and "安心包专岗" in special_cond and touch > db_delivery:
touch = db_delivery
capped = True
logger.debug(f"[安心包专岗] 门店={store_name_str}, "
f"兜底类型={baodi_type}, 特殊情况={special_cond}, "
f"原始触客数={touch}, 交付数2(db_delivery)={db_delivery}")
if baodi_type == "触客" and "安心包专岗" in special_cond:
if touch > db_delivery:
logger.info(f"[安心包专岗-CAP] 门店={store_name_str}, "
f"触客数被限制: {touch} → {db_delivery}")
touch = db_delivery
capped = True
else:
logger.debug(f"[安心包专岗-NO-CAP] 门店={store_name_str}, "
f"触客数={touch} ≤ 交付数2={db_delivery}, 无需限制")
_style_cell(row_num, 14, touch)
yb_orders = _safe_float(store_row.get("整车延保成交数", 0))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!