pharmacy-pos-qr-system/backend/check_basen_detail.py
thug0bin 0ae4ae66f0 fix(baekje): 장바구니 담기 시 internal_code 사용하도록 수정
- kd_code 대신 internal_code로 장바구니 추가
- internal_code 없으면 검색 후 규격 매칭으로 찾기
- 백제 장바구니 담기 정상 작동 확인
2026-03-07 21:29:00 +09:00

40 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
import requests
import sys
sys.path.insert(0, 'c:/Users/청춘약국/source/pharmacy-wholesale-api')
from dotenv import load_dotenv
load_dotenv('c:/Users/청춘약국/source/pharmacy-wholesale-api/.env')
from wholesale import GeoYoungSession
# 지오영 베이슨 검색
print("=== 지오영 베이슨 검색 결과 ===")
res = requests.get('http://localhost:7001/api/geoyoung/stock?keyword=베이슨', timeout=30).json()
for item in res.get('items', []):
internal = item.get('internal_code', '')
spec = item.get('specification', '')
name = item.get('product_name', '')
print(f" 내부: {internal} | spec: {spec:8} | {name}")
print()
# 어제 주문 상세
print("=== 어제 베이슨 주문 상세 ===")
session = GeoYoungSession()
session.login()
result = session.get_order_list('2026-03-06', '2026-03-06')
if result.get('success'):
for order in result.get('orders', []):
for item in order.get('items', []):
name = item.get('product_name', '')
if '베이슨' in name:
internal = item.get('product_code', '')
qty = item.get('quantity', 0)
status = item.get('status', '')
print(f" 주문번호: {order.get('order_num')}")
print(f" 제품명: {name}")
print(f" 내부코드: {internal}")
print(f" 수량: {qty}박스")
print(f" 상태: {status}")
print()