feat: [bending] 절곡품 전용 테이블 분리 API
- bending_items 전용 테이블 생성 (items.options → 정규 컬럼 승격) - bending_models 전용 테이블 생성 (가이드레일/케이스/하단마감재 통합) - bending_data JSON 통합 (별도 테이블 → bending_items.bending_data 컬럼) - bending_item_mappings 테이블 DROP (bending_items.code에 흡수) - BendingItemService/BendingCodeService → BendingItem 모델 전환 - GuiderailModelService component 이미지 자동 복사 - ItemsFileController bending_items/bending_models 폴백 지원 - Swagger 스키마 업데이트
This commit is contained in:
@@ -204,6 +204,9 @@ private function resolveOptions(string $code, string $name, array $existing): ?a
|
||||
$new[$key] = $value;
|
||||
}
|
||||
}
|
||||
if (empty($existing['item_name'])) {
|
||||
$new['item_name'] = $name;
|
||||
}
|
||||
|
||||
return $new;
|
||||
}
|
||||
@@ -222,10 +225,54 @@ private function resolveOptions(string $code, string $name, array $existing): ?a
|
||||
// 한글 패턴별 추가 파싱
|
||||
$this->parseKoreanPattern($code, $patternPrefix, $existing, $new);
|
||||
|
||||
// item_name 폴백: options에 없으면 items.name 사용
|
||||
if (empty($existing['item_name']) && empty($new['item_name'])) {
|
||||
$new['item_name'] = $name;
|
||||
}
|
||||
|
||||
return $new;
|
||||
}
|
||||
}
|
||||
|
||||
// 패턴 C: BD-LEGACY-NUM → chandj.bending에서 직접 조회
|
||||
if (preg_match('/^BD-LEGACY-(\d+)$/', $code, $m)) {
|
||||
$chandjNum = (int) $m[1];
|
||||
$chandjRow = DB::connection('chandj')->table('bending')
|
||||
->where('num', $chandjNum)
|
||||
->first();
|
||||
|
||||
if ($chandjRow) {
|
||||
$fields = [
|
||||
'item_name' => $chandjRow->itemName ?? $chandjRow->item_name ?? null,
|
||||
'item_sep' => $chandjRow->item_sep ?? null,
|
||||
'item_bending' => $chandjRow->item_bending ?? null,
|
||||
'material' => $chandjRow->material ?? null,
|
||||
'item_spec' => $chandjRow->item_spec ?? null,
|
||||
'model_name' => $chandjRow->model_name ?? null,
|
||||
'model_UA' => $chandjRow->model_UA ?? null,
|
||||
'rail_width' => $chandjRow->rail_width ?? null,
|
||||
'search_keyword' => $chandjRow->search_keyword ?? null,
|
||||
'legacy_bending_num' => $chandjNum,
|
||||
];
|
||||
foreach ($fields as $key => $value) {
|
||||
if (! empty($value) && empty($existing[$key])) {
|
||||
$new[$key] = $value;
|
||||
}
|
||||
}
|
||||
// item_name 폴백: chandj에도 없으면 items.name 사용
|
||||
if (empty($new['item_name']) && empty($existing['item_name'])) {
|
||||
$new['item_name'] = $name;
|
||||
}
|
||||
} else {
|
||||
// chandj에 없으면 items.name으로 폴백
|
||||
if (empty($existing['item_name'])) {
|
||||
$new['item_name'] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
return $new;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user