diff --git a/app/Services/QmsLotAuditService.php b/app/Services/QmsLotAuditService.php index cc8dcac9..606822a0 100644 --- a/app/Services/QmsLotAuditService.php +++ b/app/Services/QmsLotAuditService.php @@ -602,7 +602,7 @@ private function groupBendingParts($steelItems, int $shutterCount = 0): array } // 품목명 기반 이미지 매칭 - $imageUrl = null; + $imageFileId = null; if (str_contains($name, '연기차단재')) { $groupKey = '연기차단재'; } elseif ($isGuideRail) { @@ -618,24 +618,24 @@ private function groupBendingParts($steelItems, int $shutterCount = 0): array // 품목명에서 세부 키워드로 이미지 매칭 시도 foreach ($groupImageMap as $itemName => $url) { if (str_contains($name, $itemName) || str_contains($itemName, $name)) { - $imageUrl = $url; + $imageFileId = $url; break; } } // 세부 매칭 실패 시 item_bending(카테고리)으로 매칭 - if (! $imageUrl) { + if (! $imageFileId) { $bendingCategory = match ($groupKey) { '하단마감' => '하단마감재', default => $groupKey, }; - $imageUrl = $groupImageMap["_group_{$bendingCategory}"] ?? null; + $imageFileId = $groupImageMap["_group_{$bendingCategory}"] ?? null; } $row = [ 'name' => $item['item_name'], 'spec' => $item['specification'] ?? '-', 'qty' => (int) $qty, - 'image_url' => $imageUrl, + 'image_file_id' => $imageFileId, ]; if ($groupKey === '연기차단재') { @@ -670,7 +670,7 @@ private function groupBendingParts($steelItems, int $shutterCount = 0): array * item_bending(가이드레일/케이스/하단마감재 등) 기준으로 이미지가 있는 bending_item을 조회하여 * item_name → image_url, _group_{category} → image_url 매핑 반환 * - * @return array 매핑 (item_name → url, _group_카테고리 → url) + * @return array 매핑 (item_name → file_id, _group_카테고리 → file_id) */ private function getBendingGroupImages(int $tenantId): array { @@ -688,17 +688,17 @@ private function getBendingGroupImages(int $tenantId): array continue; } - $url = url("/api/v1/files/{$file->id}/view"); + $fileId = $file->id; // item_name으로 세부 매칭용 if ($bi->item_name) { - $result[$bi->item_name] = $url; + $result[$bi->item_name] = $fileId; } // item_bending(카테고리)별 첫 번째 이미지 → 그룹 대표 if ($bi->item_bending && ! isset($groupFirst[$bi->item_bending])) { - $groupFirst[$bi->item_bending] = $url; - $result["_group_{$bi->item_bending}"] = $url; + $groupFirst[$bi->item_bending] = $fileId; + $result["_group_{$bi->item_bending}"] = $fileId; } }