diff --git a/app/modules/dispatch/router.py b/app/modules/dispatch/router.py index 1190782..94a9d09 100644 --- a/app/modules/dispatch/router.py +++ b/app/modules/dispatch/router.py @@ -260,12 +260,14 @@ async def batch_create( except PdfParseError as exc: logger.warning("라벨 PDF 파싱 실패 — PII 없이 진행: %s", exc) recipients = {} + # PDF 가 받는 사람 정보의 정본(authoritative). xlsx 의 가려진 이름/주소는 + # 신뢰하지 않으므로 PDF 값이 있으면 덮어쓴다. for p in parcels: rec = recipients.get((p.get("order_id") or "").strip()) if not rec: continue for field in ("recipient_name", "recipient_phone", "recipient_address"): - if rec.get(field) and not (p.get(field) or "").strip(): + if rec.get(field): p[field] = rec[field] batch = st.create_batch( diff --git a/app/modules/dispatch/store.py b/app/modules/dispatch/store.py index 374b208..99637e7 100644 --- a/app/modules/dispatch/store.py +++ b/app/modules/dispatch/store.py @@ -60,11 +60,8 @@ COLUMN_ALIASES: dict[str, tuple[str, ...]] = { "parent sku reference no.", "판매자 sku", "상품코드"), "product_name": ("product name", "product_name", "item name", "product", "상품명"), "quantity": ("quantity", "qty", "수량", "수량(개)"), - "recipient_name": ("recipient", "recipient name", "buyer name", "consignee", "받는 사람", "받는사람", "수취인", "수령인"), - "recipient_phone": ("phone #", "phone#", "phone", "phone number", "contact number", "contact", - "전화", "전화번호", "연락처"), - "recipient_address": ("detail address", "detailed address", "address", "delivery address", - "shipping address", "full address", "주소", "배송지", "배송주소", "수령지 주소"), + # 받는 사람(이름/전화/주소)은 xlsx 에서 매핑하지 않는다 — xlsx 값은 가려져 있어 + # 신뢰할 수 없다. PII 는 라벨 PDF 에서만 가져온다(pdf_parser, Order ID 조인). } # 사용자에게 보여줄 컬럼 이름(누락 안내 메시지용). 비교키는 소문자라 별도 표기.