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:
@@ -20,6 +20,7 @@ public function list(array $params): LengthAwarePaginator
|
||||
fn ($q2) => $q2
|
||||
->where('item_name', 'like', "%{$v}%")
|
||||
->orWhere('code', 'like', "%{$v}%")
|
||||
->orWhere('lot_no', 'like', "%{$v}%")
|
||||
->orWhere('item_spec', 'like', "%{$v}%")
|
||||
->orWhere('legacy_code', 'like', "%{$v}%")
|
||||
))
|
||||
@@ -48,6 +49,7 @@ public function create(array $data): BendingItem
|
||||
return BendingItem::create([
|
||||
'tenant_id' => $this->tenantId(),
|
||||
'code' => $data['code'],
|
||||
'lot_no' => $data['lot_no'] ?? null,
|
||||
'legacy_code' => $data['legacy_code'] ?? null,
|
||||
'legacy_bending_id' => $data['legacy_bending_id'] ?? null,
|
||||
'item_name' => $data['item_name'] ?? $data['name'] ?? '',
|
||||
@@ -77,7 +79,7 @@ public function update(int $id, array $data): BendingItem
|
||||
$item = BendingItem::findOrFail($id);
|
||||
|
||||
$columns = [
|
||||
'code', 'item_name', 'item_sep', 'item_bending',
|
||||
'code', 'lot_no', 'item_name', 'item_sep', 'item_bending',
|
||||
'material', 'item_spec', 'model_name', 'model_UA',
|
||||
'rail_width', 'exit_direction', 'box_width', 'box_height',
|
||||
'front_bottom', 'inspection_door', 'length_code', 'length_mm',
|
||||
|
||||
Reference in New Issue
Block a user