From 7dda385b7f045eae65c039b68d331679a9838c8b Mon Sep 17 00:00:00 2001 From: thug0bin Date: Fri, 6 Mar 2026 12:18:38 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A7=80=EC=98=A4=EC=98=81=20=EC=9E=AC?= =?UTF-8?q?=EA=B3=A0=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C=20=EB=8B=A8=EA=B0=80?= =?UTF-8?q?=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - geoyoung_api.py: include_price=True로 검색 - admin_rx_usage.html: 지오영 섹션에 단가 컬럼 추가 --- backend/geoyoung_api.py | 36 ++++++++++++++++++++------- backend/templates/admin_rx_usage.html | 4 ++- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/backend/geoyoung_api.py b/backend/geoyoung_api.py index 1084555..6bad557 100644 --- a/backend/geoyoung_api.py +++ b/backend/geoyoung_api.py @@ -35,18 +35,36 @@ def get_geo_session(): return _geo_session -def search_geoyoung_stock(keyword: str): - """지오영 재고 검색 (동기, 빠름)""" +def search_geoyoung_stock(keyword: str, include_price: bool = True): + """지오영 재고 검색 (동기, 단가 포함)""" try: session = get_geo_session() - products = session.search_stock(keyword) - return { - 'success': True, - 'keyword': keyword, - 'count': len(products), - 'items': products - } + # 새 API 사용 (단가 포함) + result = session.search_products(keyword, include_price=include_price) + + if result.get('success'): + # 기존 형식으로 변환 + items = [{ + 'insurance_code': item['code'], + 'internal_code': item.get('internal_code'), + 'manufacturer': item['manufacturer'], + 'product_name': item['name'], + 'specification': item['spec'], + 'stock': item['stock'], + 'price': item.get('price', 0), # 단가 추가! + 'box_qty': item.get('box_qty'), + 'case_qty': item.get('case_qty') + } for item in result['items']] + + return { + 'success': True, + 'keyword': keyword, + 'count': len(items), + 'items': items + } + else: + return {'success': False, 'error': result.get('error'), 'message': '검색 실패'} except Exception as e: logger.error(f"지오영 검색 오류: {e}") diff --git a/backend/templates/admin_rx_usage.html b/backend/templates/admin_rx_usage.html index ddcdaa2..8846ae8 100644 --- a/backend/templates/admin_rx_usage.html +++ b/backend/templates/admin_rx_usage.html @@ -1383,11 +1383,12 @@ if (geoItems.length > 0) { html += ` - + `; geoItems.forEach((item, idx) => { const hasStock = item.stock > 0; + const priceText = item.price ? item.price.toLocaleString() + '원' : '-'; html += ` + `;
제품명규격재고
제품명규격단가재고
@@ -1397,6 +1398,7 @@ ${item.specification}${priceText} ${item.stock} ${hasStock ? `` : ''}