diff --git a/inbound_verify/db_compare.py b/inbound_verify/db_compare.py index ff93494..b9deca9 100644 --- a/inbound_verify/db_compare.py +++ b/inbound_verify/db_compare.py @@ -499,10 +499,10 @@ def _stats_to_dict(s: CompareStats) -> dict: def _target_date_for(site: str) -> str: - """4 站比对锚点:today - expected_offset(与 _site_undelivered_handler 一致)。""" + """4 站比对锚点:today - actual_offset(以实到扫描日为锚,与 _site_undelivered_handler 一致)。""" from inbound_verify import state_store # 懒导入,避免成环 - offset = state_store.get_offset(site, "expected") + offset = state_store.get_offset(site, "actual") return (date.today() - timedelta(days=offset)).strftime("%Y-%m-%d") @@ -555,7 +555,7 @@ def _baishi_from_pg(cur, target: str): def build_full_report(date=None) -> str: """DB 版全站汇总报表:4 站走 DB 比对、百世走 PG,复用 compare.build_summary 渲染。 - 产出 output/应到未到数据.xlsx(/report 下载)。date=None 时各站按 expected_offset 算锚点。 + 产出 output/应到未到数据.xlsx(/report 下载)。date=None 时各站按 actual_offset 算锚点(以实到扫描日为锚)。 返回输出路径。""" from inbound_verify import compare # 复用 build_summary / write_station / OUTFILE diff --git a/inbound_verify/runtime.py b/inbound_verify/runtime.py index 54546d0..867ca4b 100644 --- a/inbound_verify/runtime.py +++ b/inbound_verify/runtime.py @@ -517,7 +517,7 @@ def _site_undelivered_handler(site): if date: target_date = date else: - offset = state_store.get_offset(site, "expected") + offset = state_store.get_offset(site, "actual") target_date = (datetime.now().date() - timedelta(days=offset)).strftime( "%Y-%m-%d" )