# -*- coding: utf-8 -*- """마스터 JSON에 실제 쇼핑몰 APC 매핑""" import json import os # 마스터 JSON → 쇼핑몰 APC 매핑 APC_MAPPING = { "nexgard_spectra.json": "0232555060207", # 넥스포인트(20~40kg) - 넥스가드 대용 "heartsaver.json": "0230467230300", # 하트세이버L(23~45kg) "impact.json": "0232873820205", # 임팩트 독(4~10kg) "antelmin.json": "0230237810109", # 안텔민 킹(5kg이상) "selight.json": "0232545420203", # 셀라이트 독(4~10kg) "meloxicash.json": "0232523510309", # 멜록시캐시CH "asikaff_carprofen.json": "0232635710103", # 아시카프정 "enrofloxacin.json": "0232532310106", # 아시엔로정 "tiergard.json": "0231089420409", # 티어가드(100T) "chlorhexidine_shampoo.json": "0231334930108", # 클로르헥시딘샴푸(200ml) "actibet.json": "9240043910403", # 액티벳(100T) "serenia_maropitant.json": "0231884620107", # 세레니아정 24mg "terbiderm.json": "0232064110102", # 터비더미 솔루션 "simparica.json": "0232571730106", # 심파리카 트리오 L(20~40kg) "gaesidin.json": "0231093520106", # 복합개시딘겔(10g) "oridermyl.json": "0231065620103", # 오이드로믹스클린(10ml) - 귀약 대용 "fronilspot.json": None, # 쇼핑몰 미등록 "apoquel.json": None, # 쇼핑몰 미등록 "bravecto.json": None, # 쇼핑몰 미등록 "gabapentin.json": None, # 쇼핑몰 미등록 "metronidazole.json": None, # 쇼핑몰 미등록 } MASTER_DIR = os.path.join(os.path.dirname(__file__), "..", "data", "master") def update_json_files(): updated = [] skipped = [] for filename, apc in APC_MAPPING.items(): filepath = os.path.join(MASTER_DIR, filename) if not os.path.exists(filepath): skipped.append(f"{filename} (파일 없음)") continue with open(filepath, 'r', encoding='utf-8') as f: data = json.load(f) old_apc = data.get('apc_code', '') if apc: data['apc_code'] = apc with open(filepath, 'w', encoding='utf-8') as f: json.dump(data, f, ensure_ascii=False, indent=2) updated.append(f"{filename}: {old_apc} → {apc}") else: skipped.append(f"{filename} (매핑 없음)") print("=" * 60) print("APC 매핑 업데이트 완료") print("=" * 60) print(f"\n✅ 업데이트됨 ({len(updated)}개):") for item in updated: print(f" {item}") print(f"\n⏭️ 건너뜀 ({len(skipped)}개):") for item in skipped: print(f" {item}") if __name__ == "__main__": update_json_files()