상세수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled

This commit is contained in:
yangsh
2026-02-05 12:41:07 +09:00
parent 36355f75f3
commit 790216404c
8 changed files with 1108 additions and 29 deletions

View File

@@ -547,7 +547,7 @@ class M706 extends BaseController
//memo 저장
if (!empty($memo)) {
$this->model->updateMemo([$memo, $atcl_vr_sq]);
$this->model->saveMemo([$memo, $atcl_vr_sq]);
}
//API 호출

View File

@@ -3,8 +3,12 @@ namespace App\Controllers\V2;
use App\Controllers\BaseController;
use App\Libraries\Common;
use App\Libraries\NaverApiClient;
use App\Models\common\CodeModel;
use App\Models\results\M415Model;
use App\Models\v2\M708Model;
use App\Models\v2\M710Model;
use Exception;
class M708 extends BaseController
{
@@ -129,7 +133,6 @@ class M708 extends BaseController
$data = $this->model->getDetail($id);
$memo = $this->model->getMemo($id);
$article = null;
$confirm = null;
if (!empty($data)) {
@@ -360,6 +363,11 @@ class M708 extends BaseController
// 확인결과 저장
public function saveResult()
{
$naver = new NaverApiClient();
$model710 = new M710Model();
$model415 = new M415Model();
$v2DailyModel = new V2StDailyModel();
try {
$fax_sq = $this->request->getPost('fax_sq');
$vr_sq = $this->request->getPost('vr_sq');
@@ -387,9 +395,72 @@ class M708 extends BaseController
}
// DB에 결과 저장
// $this->model->saveHongBoFAX($fax_sq, $vr_sq, $atcl_no, $work_type, $send_yn, $result_d11, $comment_d11, $fax_conf_yn_1, $fax_conf_yn_2, $fax_conf_yn_3, $fax_conf_info_1, $fax_conf_info_2, $fax_conf_info_3, $file_type);
$return = $this->model->saveHongBoFAX($fax_sq, $vr_sq, $atcl_no, $work_type, $send_yn, $result_d11 ?? null, $comment_d11 ?? null, $fax_conf_yn_1 ?? null, $fax_conf_yn_2 ?? null, $fax_conf_yn_3 ?? null, $fax_conf_info_1 ?? null, $fax_conf_info_2 ?? null, $fax_conf_info_3 ?? null, $file_type);
if (empty($return['code']) && $work_type == '2') {
// 검증센터에 데이터를 전송한다.
$sendData = $this->model->getDataConfirmAPI($vr_sq);
if (($fax_conf_yn_3 ?? 'N') == 'Y' || (int) $article['try_cnt'] < 1) {
$send_result = $naver->confirm($sendData['atclNo'], $sendData['success'], $sendData['checkList'], $sendData['charger'], $sendData['modifyInfo'], $sendData['date']);
if ($send_result['result'] == 'success') {
$this->model->InsCharger($vr_sq);
// DB에 상태값을 전송완료로 저장한다.
if (empty($sendData['success'])) {
$stat_cd = '39'; // 서류/전화 확인 실패
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경..
if ($sendData['try_cnt'] >= '1') {
$stat_cd = '69'; // 검증실패
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경..
$v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0302', '1', 'add'); // 최종실패로 저장
} else {
$v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0301', '1', 'add'); // 1차실패로 저장
}
// $res_try = $this->m708_model->chgTryCnt($vr_sq, intval($sendData['try_cnt']) +1);
$this->model->increseTryCnt($vr_sq);
if (($result_d11 ?? '') == '20013') {
$v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0203', '1', 'add'); // 기타로 저장
} else {
$v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0202', '1', 'add'); // 불일치로 저장
}
} else {
$stat_cd = '35'; // 서류/전화 확인 성공
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경..
$rgbk_cofirm = $this->model->getRgbk_confirm($vr_sq);
if ($rgbk_cofirm == '1') {
$stat_cd = '40';
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 등기부등본 확인중 상태로 변경..
$v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0201', '1', 'add'); // 일치로 저장
} else {
$stat_cd = '60';
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 검증완료 상태로 변경..
$v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0205', '1', 'add'); // 홍보확인서완료 등기부등본확인 안함 저장
}
}
} else {
throw new \Exception($send_result['error']);
}
} else {
$stat_cd = '39'; // 서류/전화 확인 실패
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd);
$stat_cd = '30'; // 서류/전화 확인 중
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd);
$this->model->increseTryCnt($vr_sq);
throw new \Exception('의뢰인 정보 불일치로 저장되었습니다.');
}
}
return $this->response->setJSON([
@@ -408,14 +479,131 @@ class M708 extends BaseController
}
}
// 분양계약서 저장
// 분양계약서 조회
public function saveBunyangCnt()
{
try {
$vr_sq = $this->request->getPost('vr_sq');
$rsrv_sq = $this->model->get_rsrv_sq($vr_sq);
$cnt = $this->model->getI8Cnt($rsrv_sq['rsrv_sq']);
return $this->response->setJSON([
'code' => '0',
'msg' => 'success',
'cnt' => $cnt,
]);
} catch (\Exception $e) {
return $this->response->setJSON([
'code' => '9',
'msg' => $e->getMessage(),
]);
}
}
// 분양계약서 저장
public function saveResult3()
{
$naver = new NaverApiClient();
$v2StDailyModel = new V2StDailyModel();
try {
$fax_sq = $this->request->getPost('fax_sq');
$vr_sq = $this->request->getPost('vr_sq');
$atcl_no = $this->request->getPost('atcl_no');
$work_type = $this->request->getPost('work_type');
$resyn = $this->request->getPost('resYn');
$dbusageagryn = $this->request->getPost('dbUsageAgrYn');
$send_yn = 'Y'; // 업데이트 된다면 미처리->처리상태로 변경
$article = $this->model->getArticleInfo2($atcl_no, $vr_sq);
$v2_vrfc_req = $v2StDailyModel->get_v2_vrfc_req($vr_sq);
if ((int) $article['stat_cd'] >= 40) {
throw new \Exception('이미 저장된 데이터입니다.');
} else {
if (!empty($resyn)) {
$this->model->updateResDB($resyn, $dbusageagryn, $vr_sq);
}
// DB에 결과를 저장한다.
$return = $this->model->saveresult3FAX($fax_sq, $vr_sq, $atcl_no, $work_type, $send_yn, $result_d11 ?? null, $comment_d11 ?? null, $fax_conf_yn_1 ?? null, $fax_conf_yn_2 ?? null, $fax_conf_yn_3 ?? null, $fax_conf_info_1 ?? null, $fax_conf_info_2 ?? null, $fax_conf_info_3 ?? null);
if (empty($return['code']) && $work_type == '2') {
// 검증센터에 데이터를 전송한다.
$sendData = $this->model->getDataConfirmAPI($vr_sq);
if (($fax_conf_yn_3 ?? 'N') == 'Y' || $article['try_cnt'] < '1') {
$send_result = $naver->confirm($sendData['atclNo'], $sendData['success'], $sendData['checkList'], $sendData['charger'], $sendData['modifyInfo'], $sendData['date']);
if ($send_result['result'] == 'success') {
$this->model->InsCharger($vr_sq);
// DB에 상태값을 전송완료로 저장한다.
if (empty($sendData['success'])) {
$stat_cd = '39'; // 서류/전화 확인 실패
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경
if ($sendData['try_cnt'] >= '1') {
$stat_cd = '69'; // 검증실패
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경..
$v2StDailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0302', '1', 'add'); // 최종실패로 저장
} else {
$v2StDailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0301', '1', 'add'); // 1차실패로 저장
}
// $res_try = $this->m708_model->chgTryCnt($vr_sq, intval($sendData['try_cnt']) +1);
$this->model->increseTryCnt($vr_sq);
if (($result_d11 ?? '') == '20013') {
$v2StDailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0203', '1', 'add'); // 기타로 저장
} else {
$v2StDailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0202', '1', 'add'); // 불일치로 저장
}
} else {
$stat_cd = '35'; // 서류/전화 확인 성공
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경..
$rgbk_cofirm = $this->model->getRgbk_confirm($vr_sq);
if ($rgbk_cofirm == '1') {
$stat_cd = '40';
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 등기부등본 확인중 상태로 변경..
$v2StDailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0201', '1', 'add'); // 일치로 저장
} else {
$stat_cd = '60';
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 검증완료 상태로 변경..
$v2StDailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0205', '1', 'add'); // 홍보확인서완료 등기부등본확인 안함 저장
}
}
} else {
throw new \Exception($send_result['error']);
}
} else {
$stat_cd = '39'; // 서류/전화 확인 실패
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd);
$stat_cd = '30'; // 서류/전화 확인 중
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd);
$this->model->increseTryCnt($vr_sq);
throw new \Exception('의뢰인 정보 불일치로 저장되었습니다.');
}
}
return $this->response->setJSON([
'code' => '0',
'msg' => 'success',
]);
}
} catch (\Exception $e) {
return $this->response->setJSON([