feat: 견적 단가를 items+item_details+prices 통합 구조로 전환

- EstimatePriceService 생성: items+item_details+prices JOIN 기반 단가 조회
  - item_details.product_category/part_type/specification 컬럼 매핑
  - items.attributes JSON으로 model_name/finishing_type 추가 차원 처리
  - 세션 내 캐시로 중복 조회 방지
- MigrateBDModelsPrices 커맨드: 레거시 BDmodels + kd_price_tables → 85건 마이그레이션
- KyungdongFormulaHandler: KdPriceTable 의존 제거 → EstimatePriceService 사용
- FormulaEvaluatorService: W1 마진 140→160, 면적 공식 W1×(H1+550) 수정
  - 가이드레일 H0+250, 케이스/L바/평철 W0+220 (레거시 일치)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-29 19:30:46 +09:00
parent e882d33de1
commit 6c9735581d
4 changed files with 745 additions and 98 deletions

View File

@@ -658,7 +658,7 @@ public function calculateBomWithDebug(
$marginW = 110; // 철재 마진
$marginH = 350;
} else {
$marginW = 140; // 스크린 기본 마진
$marginW = 160; // 스크린 기본 마진
$marginH = 350;
}
@@ -1625,9 +1625,9 @@ private function calculateKyungdongBom(
$handler = new KyungdongFormulaHandler;
// Step 3: 경동 전용 변수 계산
$W1 = $W0 + 140;
$W1 = $W0 + 160;
$H1 = $H0 + 350;
$area = ($W0 * ($H0 + 550)) / 1000000;
$area = ($W1 * ($H1 + 550)) / 1000000;
// 중량 계산 (제품타입별)
if ($productType === 'steel') {
@@ -1665,8 +1665,8 @@ private function calculateKyungdongBom(
[
'var' => 'W1',
'desc' => '제작 폭',
'formula' => 'W0 + 140',
'calculation' => "{$W0} + 140",
'formula' => 'W0 + 160',
'calculation' => "{$W0} + 160",
'result' => $W1,
'unit' => 'mm',
],
@@ -1681,8 +1681,8 @@ private function calculateKyungdongBom(
[
'var' => 'AREA',
'desc' => '면적',
'formula' => '(W0 × (H0 + 550)) / 1,000,000',
'calculation' => "({$W0} × ({$H0} + 550)) / 1,000,000",
'formula' => '(W1 × (H1 + 550)) / 1,000,000',
'calculation' => "({$W1} × ({$H1} + 550)) / 1,000,000",
'result' => round($area, 4),
'unit' => '㎡',
],