diag_11e.py
1.03 KB
import sys
sys.path.insert(0, "F:/data-report/data-process")
import build_store_effect_board as B
from report_utils import fetch_indicator_data, INDICATOR_BIZ_MAP
from decimal import Decimal
src = r"C:/Users/66/Desktop/2026-09报表/店效人效及盈利测算/数据源"
s1, s2 = B.parse_saas(src)
stores_11 = {r['store'] for r in s2 if r['store']}
print("1.1 stores (sheet2 unique):", len(stores_11))
bz_l = INDICATOR_BIZ_MAP.get('light_reform')
ind_11 = fetch_indicator_data('2026-08-01', '2026-08-31', [bz_l], ['A036', 'A075', 'A084']) or {}
def ind_sum(ind_map, stores, code):
t = Decimal('0'); matched = []
for nm, vals in (ind_map or {}).items():
if B.match_any(nm, stores):
v = B.to_decimal((vals or {}).get(code)); t += v; matched.append((nm, float(v)))
return t, matched
t11, matched11 = ind_sum(ind_11, stores_11, 'A036')
print("BOARD 1.1产值 (indicator A036 matched to 1.1 stores) =", float(t11))
print(" matched merchants:", len(matched11))
for nm, v in matched11[:12]:
print(f" {nm!r}: {v}")