result 입력시 usr_sq dept_sq 를 region_codes 에서 가져오는 로직 넣기
This commit is contained in:
@@ -2,12 +2,20 @@
|
||||
|
||||
namespace App\Services\ParameterMapper;
|
||||
|
||||
use App\Models\Entities\RegionModel;
|
||||
|
||||
/**
|
||||
* Type S 파라미터 매퍼
|
||||
* 현장확인 매물 (A01 등) 데이터를 Receipt 테이블용 파라미터로 변환
|
||||
*/
|
||||
class TypeSParameterMapper extends BaseParameterMapper
|
||||
{
|
||||
private $regionModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->regionModel = new RegionModel();
|
||||
}
|
||||
/**
|
||||
* Receipt 테이블용 파라미터 생성
|
||||
*/
|
||||
@@ -96,10 +104,34 @@ class TypeSParameterMapper extends BaseParameterMapper
|
||||
public function mapResult(int $rcptSq, array $rawData): array
|
||||
{
|
||||
$now = db_now();
|
||||
|
||||
$address = $rawData['address'] ?? [];
|
||||
$sectorNumber = $address['legalDivision']['sectorNumber'] ?? null;
|
||||
|
||||
// VR 검증 여부에 따른 담당자 설정
|
||||
$deptSq = ($rawData['site']['isVrVerification'] ?? false) ? '29' : null;
|
||||
$usrSq = ($rawData['site']['isVrVerification'] ?? false) ? '1993' : null;
|
||||
// VR 검증 여부 확인
|
||||
$isVrVerification = ($rawData['site']['isVrVerification'] ?? false);
|
||||
|
||||
// 1. 지역별 담당자 조회
|
||||
$charge = null;
|
||||
if ($sectorNumber) {
|
||||
$charge = $this->regionModel->getChargeByRegionCd($sectorNumber);
|
||||
}
|
||||
|
||||
// 2. 기본 담당자 설정 (지역별 담당자가 없으면)
|
||||
$deptSq = $charge['dept_sq'] ?? '26';
|
||||
$usrSq = $charge['usr_sq'] ?? '1';
|
||||
|
||||
// 3. VR 검증인 경우 환경별 담당자로 덮어쓰기
|
||||
if ($isVrVerification) {
|
||||
if (ENVIRONMENT === 'development') {
|
||||
$deptSq = '29';
|
||||
$usrSq = '472';
|
||||
} else {
|
||||
// production
|
||||
$deptSq = '33';
|
||||
$usrSq = '1993';
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'rcpt_sq' => $rcptSq,
|
||||
|
||||
Reference in New Issue
Block a user