From 4a07ef139dff4b74eb908dafc356b40ead5a4251 Mon Sep 17 00:00:00 2001 From: king Date: Fri, 19 Jun 2026 19:09:16 +0900 Subject: [PATCH] =?UTF-8?q?feat(dispatch):=20=EC=9E=91=EC=97=85=202?= =?UTF-8?q?=EB=8B=A8=EA=B3=84=EB=A1=9C=20=EC=B6=95=EC=86=8C=20+=20J&T=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20URL=20=EC=88=98=EC=A0=95=20+=20Order=20ID?= =?UTF-8?q?=20=ED=99=95=EB=8C=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 택배스캔 단계 제거 → 라벨부착 / Kagayaku 전달 2단계 - 버튼 라벨에서 '완료' 제거(라벨부착 / Kagayaku 전달) - 완료 판정/배치목록 완료수를 label_attached AND handed_to_kagayaku 기준으로 - J&T 송장 조회 딥링크를 gzquery.html?bills= 로 교체(billcode 미입력 문제) - Order ID 27px 로 확대, 송장 링크 밑줄 강조(굵기/오프셋) Co-Authored-By: Claude Opus 4.8 --- app/modules/dispatch/db.py | 8 +++++--- app/modules/dispatch/store.py | 9 ++++----- app/modules/dispatch/templates/dispatch/batches.html | 8 ++++---- app/modules/dispatch/templates/dispatch/detail.html | 9 ++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/modules/dispatch/db.py b/app/modules/dispatch/db.py index 3f7082f..eba5935 100644 --- a/app/modules/dispatch/db.py +++ b/app/modules/dispatch/db.py @@ -126,8 +126,10 @@ class DispatchStore: rows = conn.execute( """ SELECT b.*, - COUNT(p.id) AS parcel_count, - COUNT(p.id) FILTER (WHERE p.courier_scanned) AS scanned_count + COUNT(p.id) AS parcel_count, + COUNT(p.id) FILTER ( + WHERE p.label_attached AND p.handed_to_kagayaku + ) AS done_count FROM dispatch_batches b LEFT JOIN dispatch_parcels p ON p.batch_id = b.id GROUP BY b.id @@ -301,7 +303,7 @@ class DispatchStore: elif isinstance(v, date): out[k] = v.isoformat() for k in ("id", "batch_id", "parcel_id", "seq", "quantity", - "parcel_count", "scanned_count", "total_qty", "box_count"): + "parcel_count", "done_count", "total_qty", "box_count"): if k in out and out[k] is not None: try: out[k] = int(out[k]) diff --git a/app/modules/dispatch/store.py b/app/modules/dispatch/store.py index b4b6aad..61f3d85 100644 --- a/app/modules/dispatch/store.py +++ b/app/modules/dispatch/store.py @@ -27,14 +27,13 @@ from urllib.parse import quote STATUS_FIELDS: tuple[str, ...] = ( "label_attached", "handed_to_kagayaku", - "courier_scanned", ) STATUS_LABELS: dict[str, dict[str, str]] = { - "product_ready": {"ko": "상품준비 완료", "en": "Product Ready"}, + "product_ready": {"ko": "상품준비", "en": "Product Ready"}, "packed": {"ko": "포장완료", "en": "Packed"}, - "label_attached": {"ko": "라벨부착 완료", "en": "Label Attached"}, - "handed_to_kagayaku": {"ko": "Kagayaku 전달 완료", "en": "Handed to Kagayaku"}, + "label_attached": {"ko": "라벨부착", "en": "Label Attached"}, + "handed_to_kagayaku": {"ko": "Kagayaku 전달", "en": "Handed to Kagayaku"}, "courier_scanned": {"ko": "택배스캔 확인", "en": "Courier Scanned"}, } @@ -265,7 +264,7 @@ def courier_logo_url(provider: Any) -> str: # 매핑 없는 배송사는 링크 없이 텍스트로 표시(courier_tracking_url 가 "" 반환). _COURIER_TRACK_URL: dict[str, str] = { "ninjavan": "https://www.ninjavan.co/en-my/tracking?id={t}", - "jnt": "https://www.jtexpress.my/tracking?billcode={t}", + "jnt": "https://www.jtexpress.my/index/query/gzquery.html?bills={t}", "flash": "https://www.flashexpress.my/fle/tracking?se={t}", "citylink": "https://www.citylinkexpress.com/tracking-result/?track_no={t}", "poslaju": "https://track.pos.com.my/postal-services/quick-access/?track-trace&trackingNo03={t}", diff --git a/app/modules/dispatch/templates/dispatch/batches.html b/app/modules/dispatch/templates/dispatch/batches.html index 3d8b67c..6df0ace 100644 --- a/app/modules/dispatch/templates/dispatch/batches.html +++ b/app/modules/dispatch/templates/dispatch/batches.html @@ -15,7 +15,7 @@ 날짜플랫폼배치명 박스 - 스캔완료 + 완료 생성시각 @@ -27,9 +27,9 @@ {{ b.batch_name or '(이름없음)' }} {{ b.parcel_count }} - {% if b.parcel_count and b.scanned_count == b.parcel_count %} - {{ b.scanned_count }} ✓ - {% else %}{{ b.scanned_count }}{% endif %} + {% if b.parcel_count and b.done_count == b.parcel_count %} + {{ b.done_count }} ✓ + {% else %}{{ b.done_count }}{% endif %} {{ b.created_at }} diff --git a/app/modules/dispatch/templates/dispatch/detail.html b/app/modules/dispatch/templates/dispatch/detail.html index f34ec7c..2cb32bf 100644 --- a/app/modules/dispatch/templates/dispatch/detail.html +++ b/app/modules/dispatch/templates/dispatch/detail.html @@ -15,8 +15,9 @@ .dsp-meta b { color:#0f172a; } .dsp-order { font-size:15px;line-height:1.3;color:#334155;word-break:break-all; } .dsp-order b { display:block;font-size:11px;font-weight:600;color:#64748b;letter-spacing:.5px; } - .dsp-order span { font-size:22px;font-weight:800;color:#0f172a; } - .dsp-track-link { color:#2563eb;font-weight:700;text-decoration:underline;text-underline-offset:2px; } + .dsp-order span { font-size:27px;font-weight:800;color:#0f172a;letter-spacing:.2px; } + .dsp-track-link { color:#2563eb;font-weight:700;text-decoration:underline; + text-decoration-thickness:2px;text-underline-offset:3px;cursor:pointer; } .dsp-items { list-style:none;margin:0;padding:8px 0;border-top:1px dashed #e2e8f0;border-bottom:1px dashed #e2e8f0; } .dsp-items li { font-size:16px;font-weight:600;color:#0f172a;padding:2px 0; } .dsp-items .qty { color:#2563eb; } @@ -49,7 +50,6 @@ - @@ -57,12 +57,11 @@
{% for p in parcels %} - {% set is_done = p.label_attached and p.handed_to_kagayaku and p.courier_scanned %} + {% set is_done = p.label_attached and p.handed_to_kagayaku %}
{% set logo = p.shipping_provider | courier_logo %} {% if logo %}