🔧 피팅 분류 및 표시 개선 완료
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled

 주요 개선사항:
• 엘보 90도/45도 각도 표시 개선 (ELBOW 90° LR BW 형태)
• RL/SL (Long/Short Radius) 표시 추가
• 엘보 서브타입 분류 로직 강화 (90DEG_LONG_RADIUS, 90DEG_SHORT_RADIUS)
• REDUCING FLANGE 분류 개선 (RED 키워드 제거로 피팅 오분류 방지)
• 구매신청 엑셀 중복 생성 문제 해결

🎯 분류기 개선:
• fitting_classifier.py: 엘보 조합 키워드 우선 확인 로직 추가
• integrated_classifier.py: FITTING 키워드에서 RED 제거
• NewMaterialsPage.jsx: 엘보 상세 표시 로직 개선

📊 테스트 완료:
• 엘보 각도 및 반경 정보 정확 표시
• REDUCING FLANGE → FLANGE 분류 확인
• 구매신청 엑셀 단일 생성 확인
This commit is contained in:
hyungi
2025-10-16 06:52:38 +09:00
parent c3ebb38669
commit f1e1fb6475
6 changed files with 1933 additions and 17 deletions

View File

@@ -513,18 +513,77 @@ def classify_fitting_subtype(fitting_type: str, description: str,
main_nom: str, red_nom: str, type_data: Dict) -> Dict:
"""피팅 서브타입 분류"""
desc_upper = description.upper()
subtypes = type_data.get("subtypes", {})
# 1. 키워드 기반 서브타입 분류 (우선)
# 1. 키워드 기반 서브타입 분류 (우선) - 대소문자 구분 없이
for subtype, keywords in subtypes.items():
for keyword in keywords:
if keyword in description:
if keyword.upper() in desc_upper:
return {
"subtype": subtype,
"confidence": 0.9,
"evidence": [f"SUBTYPE_KEYWORD: {keyword}"]
}
# 1.5. ELBOW 특별 처리 - 조합 키워드 우선 확인
if fitting_type == "ELBOW":
# 90도 + 반경 조합
if ("90" in desc_upper or "90°" in desc_upper or "90DEG" in desc_upper):
if ("LR" in desc_upper or "LONG RADIUS" in desc_upper or "장반경" in desc_upper):
return {
"subtype": "90DEG_LONG_RADIUS",
"confidence": 0.95,
"evidence": ["90DEG + LONG_RADIUS"]
}
elif ("SR" in desc_upper or "SHORT RADIUS" in desc_upper or "단반경" in desc_upper):
return {
"subtype": "90DEG_SHORT_RADIUS",
"confidence": 0.95,
"evidence": ["90DEG + SHORT_RADIUS"]
}
else:
return {
"subtype": "90DEG",
"confidence": 0.85,
"evidence": ["90DEG_DETECTED"]
}
# 45도 + 반경 조합
elif ("45" in desc_upper or "45°" in desc_upper or "45DEG" in desc_upper):
if ("LR" in desc_upper or "LONG RADIUS" in desc_upper or "장반경" in desc_upper):
return {
"subtype": "45DEG_LONG_RADIUS",
"confidence": 0.95,
"evidence": ["45DEG + LONG_RADIUS"]
}
elif ("SR" in desc_upper or "SHORT RADIUS" in desc_upper or "단반경" in desc_upper):
return {
"subtype": "45DEG_SHORT_RADIUS",
"confidence": 0.95,
"evidence": ["45DEG + SHORT_RADIUS"]
}
else:
return {
"subtype": "45DEG",
"confidence": 0.85,
"evidence": ["45DEG_DETECTED"]
}
# 반경만 있는 경우 (기본 90도 가정)
elif ("LR" in desc_upper or "LONG RADIUS" in desc_upper or "장반경" in desc_upper):
return {
"subtype": "90DEG_LONG_RADIUS",
"confidence": 0.8,
"evidence": ["LONG_RADIUS_DEFAULT_90DEG"]
}
elif ("SR" in desc_upper or "SHORT RADIUS" in desc_upper or "단반경" in desc_upper):
return {
"subtype": "90DEG_SHORT_RADIUS",
"confidence": 0.8,
"evidence": ["SHORT_RADIUS_DEFAULT_90DEG"]
}
# 2. 사이즈 분석이 필요한 경우 (TEE, REDUCER 등)
if type_data.get("size_analysis"):
if red_nom and str(red_nom).strip() and red_nom != main_nom: