This commit is contained in:
2026-03-10 19:38:13 +09:00
parent 9650707caf
commit 141f526f91
3 changed files with 30 additions and 8 deletions

View File

@@ -46,9 +46,11 @@ class TypeV2Handler
public function handle(string $articleNumber, array $rawData, array $payload): int
{
CLI::write(CLI::color('🟢 Type V2 처리 시작 :: ' . $articleNumber, 'green'));
write_custom_log("TypeV2Handler 진입 | Atcl: $articleNumber | Payload: " . json_encode($payload), 'INFO', 'service');
try {
$requestType = $payload['requestType'] ?? 'REG';
CLI::write(CLI::color("🔵 RequestType: $requestType", 'cyan'));
switch ($requestType) {
case 'REG':
@@ -62,7 +64,9 @@ class TypeV2Handler
}
} catch (Exception $e) {
write_custom_log("Type V2 처리 실패: " . $e->getMessage(), 'ERROR', 'service');
$errorDetail = "Type V2 처리 실패 | Atcl: $articleNumber | Error: " . $e->getMessage() . " | File: " . $e->getFile() . ":" . $e->getLine();
write_custom_log($errorDetail, 'ERROR', 'service');
CLI::write(CLI::color("" . $errorDetail, 'red'));
throw $e;
}
}
@@ -136,7 +140,9 @@ class TypeV2Handler
// 기존 검증 요청 확인
$existing = $this->vrfcReqModel->where('atcl_no', $articleNumber)->first();
if (!$existing) {
throw new Exception("수정할 기존 데이터가 없습니다. Atcl: $articleNumber");
CLI::write(CLI::color("⚠️ 수정할 기존 데이터가 없음 → 신규 등록으로 전환 (Atcl: $articleNumber)", 'yellow'));
write_custom_log("MOD → REG 자동 전환 | Atcl: $articleNumber | 사유: 기존 데이터 없음", 'WARNING', 'service');
return $this->handleRegister($articleNumber, $rawData, $payload);
}
$vrSq = $existing['vr_sq'];
$stat_cd = $existing['stat_cd'];
@@ -199,7 +205,9 @@ class TypeV2Handler
// 기존 검증 요청 확인
$existing = $this->vrfcReqModel->where('atcl_no', $articleNumber)->first();
if (!$existing) {
throw new Exception("취소할 기존 데이터가 없습니다. Atcl: $articleNumber");
CLI::write(CLI::color("⚠️ 취소할 데이터가 없음 → 무시 (Atcl: $articleNumber)", 'yellow'));
write_custom_log("CNC 무시 | Atcl: $articleNumber | 사유: 기존 데이터 없음", 'WARNING', 'service');
return 0; // 취소할 데이터가 없으므로 0 반환
}
$vrSq = $existing['vr_sq'];