fix: 경동 BOM 계산 수정 및 품목-공정 매핑
- KyungdongFormulaHandler: product_type 자동 추론(item_category 기반), 철재 주자재 EGI코일로 변경, 조인트바 steel 공통 지원 - FormulaEvaluatorService: FG item_category에서 product_type 자동 판별 - MapItemsToProcesses: 경동 품목-공정 매핑 커맨드 정비 - KyungdongItemMasterSeeder: BOM child_item_id code 기반 재매핑 - ItemsBomController: ghost ID 유효성 검증 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1587,7 +1587,14 @@ private function calculateKyungdongBom(
|
||||
$H0 = (float) ($inputVariables['H0'] ?? 0);
|
||||
$QTY = (int) ($inputVariables['QTY'] ?? 1);
|
||||
$bracketInch = $inputVariables['bracket_inch'] ?? '5';
|
||||
$productType = $inputVariables['product_type'] ?? 'screen';
|
||||
// product_type: 프론트 입력값 우선, 없으면 FG item_category에서 자동 추론
|
||||
$finishedGoods = $this->getItemDetails($finishedGoodsCode, $tenantId);
|
||||
$itemCategory = $finishedGoods['item_category'] ?? null;
|
||||
$productType = $inputVariables['product_type'] ?? match (true) {
|
||||
$itemCategory === '철재' => 'steel',
|
||||
str_contains($itemCategory ?? '', '슬랫') => 'slat',
|
||||
default => 'screen',
|
||||
};
|
||||
|
||||
$this->addDebugStep(1, '입력값수집', [
|
||||
'formulas' => [
|
||||
@@ -1602,9 +1609,7 @@ private function calculateKyungdongBom(
|
||||
],
|
||||
]);
|
||||
|
||||
// Step 2: 완제품 조회 (경동 전용 계산은 완제품 없이도 동작)
|
||||
$finishedGoods = $this->getItemDetails($finishedGoodsCode, $tenantId);
|
||||
|
||||
// Step 2: 완제품 정보 활용 (Step 1에서 이미 조회됨)
|
||||
if ($finishedGoods) {
|
||||
$this->addDebugStep(2, '완제품선택', [
|
||||
'code' => $finishedGoods['code'],
|
||||
@@ -1672,6 +1677,12 @@ private function calculateKyungdongBom(
|
||||
$finishingType = $inputVariables['finishing_type'] ?? 'SUS';
|
||||
$installationType = $inputVariables['installation_type'] ?? '벽면형';
|
||||
|
||||
// 모터 전압: 프론트 MP(single/three) → motor_voltage(220V/380V) 매핑
|
||||
$motorVoltage = $inputVariables['motor_voltage'] ?? match ($inputVariables['MP'] ?? 'single') {
|
||||
'three' => '380V',
|
||||
default => '220V',
|
||||
};
|
||||
|
||||
$calculatedVariables = array_merge($inputVariables, [
|
||||
'W0' => $W0,
|
||||
'H0' => $H0,
|
||||
@@ -1687,6 +1698,7 @@ private function calculateKyungdongBom(
|
||||
'product_model' => $productModel,
|
||||
'finishing_type' => $finishingType,
|
||||
'installation_type' => $installationType,
|
||||
'motor_voltage' => $motorVoltage,
|
||||
]);
|
||||
|
||||
$this->addDebugStep(3, '변수계산', [
|
||||
|
||||
Reference in New Issue
Block a user