refactor: [절곡] code/lot_no 분리 — 코드 체계와 LOT 번호 분리

- bending_items.code: LOT번호(CP260319) → 코드체계(CP)만 저장
- bending_items.lot_no: 기존 code 값 이관 (LOT 번호)
- bending_models.code: 전체코드(GR-KSS01-벽면형-SUS) → 접두사(GR)만 저장
- bending_models.lot_no: 기존 code 값 이관
- unique 제약: code → lot_no로 이동
- BendingCodeService.resolveItem: LIKE → 정확 매칭
- 검색: lot_no 필드 추가
- Swagger 문서 업데이트
This commit is contained in:
2026-03-21 15:06:55 +09:00
parent 78ff01d6b1
commit d6591acdff
8 changed files with 90 additions and 11 deletions

View File

@@ -134,9 +134,9 @@ public function getCodeMap(): array
*/
public function resolveItem(string $prodCode, string $specCode, string $lengthCode): ?array
{
// 1차: code + length_code로 조회 (신규 LOT 체계)
// 1차: code(코드 체계) + length_code로 조회
$item = BendingItem::where('tenant_id', $this->tenantId())
->where('code', 'like', "{$prodCode}{$specCode}%")
->where('code', "{$prodCode}{$specCode}")
->where('length_code', $lengthCode)
->where('is_active', true)
->first();
@@ -156,7 +156,7 @@ public function resolveItem(string $prodCode, string $specCode, string $lengthCo
return [
'item_id' => $item->id,
'item_code' => $item->code,
'item_code' => $item->lot_no ?? $item->code,
'item_name' => $item->item_name,
'specification' => $item->item_spec,
'unit' => 'EA',