From b36405b1baff67b354816f16045e82459d70bea6 Mon Sep 17 00:00:00 2001 From: FANGKK Date: Tue, 1 Sep 2026 13:36:47 +0800 Subject: [PATCH] =?UTF-8?q?Attribute=20Adpingid=2011729927=20to=20?= =?UTF-8?q?=E9=BB=84=E6=94=BF=20via=20roster=20supplement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New roster_extra.json fills in Adpingids missing from 投手.xlsx. It only applies when the roster has no entry for that id, so a future roster always wins. Co-Authored-By: Claude Opus 5 --- build_data.py | 14 ++++++++++++++ data.json | 17 ++++++----------- roster_extra.json | 6 ++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 roster_extra.json diff --git a/build_data.py b/build_data.py index 4c48828..f5843b7 100644 --- a/build_data.py +++ b/build_data.py @@ -61,6 +61,18 @@ for r in roster.iter_rows(min_row=2, values_only=True): continue amap[k] = b.lstrip('@').strip() +# 花名册补充:只填花名册里查不到的 Adpingid(花名册优先) +EXTRA_PATH = os.path.join(HERE, 'roster_extra.json') +extra_used = [] +if os.path.exists(EXTRA_PATH): + for a, b in json.load(open(EXTRA_PATH)).get('adpings', {}).items(): + a = str(a).strip() + if a in EXCL_ADP or a in dropped_ids: + continue + if a not in amap: + amap[a] = str(b).strip().lstrip('@').strip() + extra_used.append(a) + owned = collections.Counter(amap.values()) # 每位投手名下的 Adpingid 数(已扣除排除包名) # --- 平台消耗统计:逐文件读取,按日期归组,新文件覆盖同一天的旧数据 --- @@ -161,6 +173,8 @@ json.dump(data, open(os.path.join(HERE, 'data.json'), 'w'), ensure_ascii=False, print('源文件:', ', '.join(os.path.basename(f) for f in SRC_FILES)) print('投手表取自:', os.path.basename(roster_file)) +if extra_used: + print('roster_extra 补充生效:', ', '.join(f'{a}->{amap[a]}' for a in extra_used)) print(f"窗口 {start} -> {end}") print(f"排除包名命中 {excluded_rows} 行,剔除花费 {excluded_spend:.2f}") print(f"合计 {data['grand_total']:.2f} / Adpingid {data['week34_id_count']}") diff --git a/data.json b/data.json index da00276..0e6b7ab 100644 --- a/data.json +++ b/data.json @@ -6,22 +6,22 @@ "date_range": "2026/08/29-2026/08/31", "note": "投放人以「投手」表 Media Buyer 列为准,@某某 已与某某合并计算;未填写投放人的 Adpingid 不计入;exclude.json 所列包名已排除。Package 后缀为该 Package 花费最高的投放地区,Adpingid 为该地区内花费最高的 Adping。" }, - "grand_total": 11872.5278, - "week34_id_count": 119, + "grand_total": 11886.0278, + "week34_id_count": 120, "buyers": [ { "name": "黄政", "@name": "黄政", - "total": 3480.3241, - "active_ids": 31, - "owned_ids": 133, + "total": 3493.8241, + "active_ids": 32, + "owned_ids": 134, "pkgs": [ { "pkg": "com.amazon.mShop.android.shopping", "geo": "SA", "label": "com.amazon.mShop.android.shopping_SA", "adping": "2732727", - "spend": 1220.3056 + "spend": 1233.8056 }, { "pkg": "com.king.candycrushsodasaga", @@ -231,11 +231,6 @@ } ], "unmatched": [ - { - "adping": "11729927", - "pkg": "com.amazon.mShop.android.shopping", - "spend": 13.5 - }, { "adping": "11729830", "pkg": "com.amazon.mShop.android.shopping", diff --git a/roster_extra.json b/roster_extra.json new file mode 100644 index 0000000..b92b8a7 --- /dev/null +++ b/roster_extra.json @@ -0,0 +1,6 @@ +{ + "_comment": "花名册补充:投手.xlsx 里查不到的 Adpingid 在这里补投放人。仅在花名册中不存在该 Adpingid 时生效——花名册里有的,一律以花名册为准。", + "adpings": { + "11729927": "黄政" + } +}