feat: 견적 참조 데이터 API, 수주 전환 로직 개선, 검사기준서 필드 통합

- 견적 참조 데이터(현장명, 부호) 조회 API 추가 (GET /quotes/reference-data)
- 수주 전환 시 floor_code/symbol_code를 quoteItem.note에서 파싱하도록 변경
- 수주 전환 시 note에 formula_category 저장
- 검사기준서 프리셋: standard + standard_criteria → text_with_criteria로 통합
- tolerance 컬럼 width 조정 (120px → 85px)
- LOGICAL_RELATIONSHIPS.md 문서 갱신

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 23:07:08 +09:00
parent fa07e5b58a
commit e364239572
7 changed files with 169 additions and 34 deletions

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
// 1. 기존 문자열 데이터를 JSON으로 변환
DB::table('document_template_section_items')
->whereNotNull('tolerance')
->where('tolerance', '!=', '')
->orderBy('id')
->each(function ($row) {
// 이미 JSON인 경우 스킵
$decoded = json_decode($row->tolerance, true);
if (is_array($decoded) && isset($decoded['type'])) {
return;
}
// 기존 문자열 → symmetric 타입으로 변환
$value = trim($row->tolerance);
$numericValue = preg_replace('/[^\d.]/', '', $value);
$json = json_encode([
'type' => 'symmetric',
'value' => $numericValue !== '' ? (float) $numericValue : 0,
], JSON_UNESCAPED_UNICODE);
DB::table('document_template_section_items')
->where('id', $row->id)
->update(['tolerance' => $json]);
});
// 2. 컬럼 타입 변경: VARCHAR → JSON
Schema::table('document_template_section_items', function (Blueprint $table) {
$table->json('tolerance')->nullable()->comment('공차/허용범위 (JSON)')->change();
});
}
public function down(): void
{
Schema::table('document_template_section_items', function (Blueprint $table) {
$table->string('tolerance', 100)->nullable()->comment('공차/허용범위')->change();
});
}
};

View File

@@ -20,9 +20,8 @@ public function run(): void
'fields' => json_encode([
['field_key' => 'category', 'label' => '구분', 'field_type' => 'text', 'width' => '65px', 'is_required' => false],
['field_key' => 'item', 'label' => '검사항목', 'field_type' => 'text', 'width' => '130px', 'is_required' => true],
['field_key' => 'standard', 'label' => '검사기준', 'field_type' => 'text', 'width' => '180px', 'is_required' => false],
['field_key' => 'standard_criteria', 'label' => '기준범위', 'field_type' => 'json_criteria', 'width' => '100px', 'is_required' => false],
['field_key' => 'tolerance', 'label' => '공차/범위', 'field_type' => 'json_tolerance', 'width' => '120px', 'is_required' => false],
['field_key' => 'standard', 'label' => '검사 기준/범위', 'field_type' => 'text_with_criteria', 'width' => '220px', 'is_required' => false],
['field_key' => 'tolerance', 'label' => '공차/범위', 'field_type' => 'json_tolerance', 'width' => '85px', 'is_required' => false],
['field_key' => 'method', 'label' => '검사방식', 'field_type' => 'select_api', 'width' => '110px', 'is_required' => false, 'options' => [
'api_endpoint' => '/api/admin/common-codes/inspection_method',
'auto_map' => [
@@ -64,9 +63,8 @@ public function run(): void
'fields' => json_encode([
['field_key' => 'category', 'label' => '구분', 'field_type' => 'text', 'width' => '65px', 'is_required' => false],
['field_key' => 'item', 'label' => '검사항목', 'field_type' => 'text', 'width' => '130px', 'is_required' => true],
['field_key' => 'standard', 'label' => '검사기준', 'field_type' => 'text', 'width' => '180px', 'is_required' => false],
['field_key' => 'standard_criteria', 'label' => '기준범위', 'field_type' => 'json_criteria', 'width' => '100px', 'is_required' => false],
['field_key' => 'tolerance', 'label' => '공차/범위', 'field_type' => 'json_tolerance', 'width' => '120px', 'is_required' => false],
['field_key' => 'standard', 'label' => '검사 기준/범위', 'field_type' => 'text_with_criteria', 'width' => '220px', 'is_required' => false],
['field_key' => 'tolerance', 'label' => '공차/범위', 'field_type' => 'json_tolerance', 'width' => '85px', 'is_required' => false],
['field_key' => 'method', 'label' => '검사방식', 'field_type' => 'select_api', 'width' => '110px', 'is_required' => false, 'options' => [
'api_endpoint' => '/api/admin/common-codes/inspection_method',
'auto_map' => [
@@ -108,9 +106,8 @@ public function run(): void
'fields' => json_encode([
['field_key' => 'category', 'label' => '구분', 'field_type' => 'text', 'width' => '65px', 'is_required' => false],
['field_key' => 'item', 'label' => '검사항목', 'field_type' => 'text', 'width' => '130px', 'is_required' => true],
['field_key' => 'standard', 'label' => '검사기준', 'field_type' => 'text', 'width' => '180px', 'is_required' => false],
['field_key' => 'standard_criteria', 'label' => '기준범위', 'field_type' => 'json_criteria', 'width' => '100px', 'is_required' => false],
['field_key' => 'tolerance', 'label' => '공차/범위', 'field_type' => 'json_tolerance', 'width' => '120px', 'is_required' => false],
['field_key' => 'standard', 'label' => '검사 기준/범위', 'field_type' => 'text_with_criteria', 'width' => '220px', 'is_required' => false],
['field_key' => 'tolerance', 'label' => '공차/범위', 'field_type' => 'json_tolerance', 'width' => '85px', 'is_required' => false],
['field_key' => 'method', 'label' => '검사방식', 'field_type' => 'select_api', 'width' => '110px', 'is_required' => false, 'options' => [
'api_endpoint' => '/api/admin/common-codes/inspection_method',
'auto_map' => [