diff --git a/app/Controllers/V2/M703.php b/app/Controllers/V2/M703.php index a7cbc7e..1e6dfd4 100644 --- a/app/Controllers/V2/M703.php +++ b/app/Controllers/V2/M703.php @@ -126,6 +126,7 @@ class M703 extends BaseController // 상세화면 public function detail($id) { + $naver = new NaverApiClient(); $id = (string) $id; if ($id === '') { @@ -162,11 +163,11 @@ class M703 extends BaseController $apt_rlet_type_cd = ['A01', 'A02', 'A03', 'A04', 'B01', 'B02', 'B03']; $villa_rlet_type_cd = ['A05', 'A06']; if (in_array($article['rlet_type_cd'], $apt_rlet_type_cd)) { // apt 단지 - // $detail_hscp = $this->call_kiso_api->aptDetail($article['hscp_no']); + $detail_hscp = $naver->aptDetail($article['hscp_no']); } if (in_array($article['rlet_type_cd'], $villa_rlet_type_cd)) { // villa 단지 - // $detail_hscp = $this->call_kiso_api->villaDetail($article['hscp_no']); + $detail_hscp = $naver->villaDetail($article['hscp_no']); } $this->data['hscp_info'] = $hscp_info; diff --git a/app/Controllers/V2/M712.php b/app/Controllers/V2/M712.php index 38d7a21..c393640 100644 --- a/app/Controllers/V2/M712.php +++ b/app/Controllers/V2/M712.php @@ -4,7 +4,9 @@ namespace App\Controllers\V2; use App\Controllers\BaseController; use App\Libraries\Common; use App\Libraries\MyUpload; +use App\Libraries\NaverApiClient; use App\Models\common\CodeModel; +use App\Models\results\M415Model; use App\Models\v2\M712Model; class M712 extends BaseController @@ -124,6 +126,7 @@ class M712 extends BaseController public function detail($id): string { + $naver = new NaverApiClient(); $id = (string) $id; if ($id === '') { @@ -139,12 +142,37 @@ class M712 extends BaseController $regist = $this->model->getRecordInfo($id, '2'); //등기부등본 $display = $this->model->getDisplay('M705_detail'); + $hscp_info = []; + if (!empty($data['hscp_no'])) { + $apt_rlet_type_cd = ['A01', 'A02', 'A03', 'A04', 'B01', 'B02', 'B03']; + $villa_rlet_type_cd = ['A05', 'A06']; + + + if (in_array($data['rlet_type_cd'], $apt_rlet_type_cd)) { // apt 단지 + $detail_hscp = $naver->aptDetail($data['hscp_no']); + } + + if (in_array($data['rlet_type_cd'], $villa_rlet_type_cd)) { // villa 단지 + $detail_hscp = $naver->villaDetail($data['hscp_no']); + } + + // print_r($data); + // print_r($detail_hscp); + // exit; + + if (!empty($detail_hscp) && isset($detail_hscp['result'])) { + $hscp_info = $detail_hscp['result']; + } + + } + $this->data['codes'] = $codes; $this->data['data'] = $data; $this->data['memo'] = $memo; $this->data['record'] = $record; $this->data['regist'] = $regist; $this->data['display'] = $display; + $this->data['hscp_info'] = $hscp_info; return view("pages/v2/m712/detail", $this->data); } @@ -294,13 +322,383 @@ class M712 extends BaseController // 정보저장 public function saveRegi() { + /* + 1.0.1 POST 데이터 받기. + 1.1.1 1차 검증인지 2차검증인지 확인. + 1.1.2 1차, 2차 검증이면 v2_confirm.type에 넣을 값을 알맞게 셋팅. + 1.2.1 v2_confirms에 데이터가 있는지 확인. + 1.3.1 데이터가 있음 : success 여부 판단 후 updateConfirm 실행 success값만 UPDATE. (수정변경이력 저장) + 1.4.1 데이터가 없음 : success 여부 판단 후 insertConfirm 실행 v2_confirms INSERT. (수정변경이력 저장) + 1.4.2 상태변경 하기 : 등기부등본 확인중 상태로 변경. (수정변경이력 저장) + 1.5.1 이미지파일 서버에 UPLOAD (수정변경이력 저장) + 1.6.1 기존파일 탐색. + 1.7.1 기존파일 있음 : 기존파일 use_yn 'N'으로 UPDATE 후 v2_files INSERT. + 1.8.1 기존파일 없음 : v2_files INSERT. + 1.9.1 매물주소, 의뢰인 정보 v2_check_list INSERT. (수정변경이력 저장) + 1.10.1 API 전송. + 1.11.1 API 전송결과 : SUCCESS 이면 상태값 변경 : 등기부등본 확인완료 상태. (수정변경이력 저장) + 1.12.1 서류 확인내용 v2_article_info_etc document_cert_method 저장 + */ + + $naver = new NaverApiClient(); + // $model710 = new M710Model(); + $model415 = new M415Model(); + $v2DailyModel = new V2StDailyModel(); + try { + $usr_id = session('usr_id'); + $toDay = date('Y-m-d H:i:s'); + $atcl_vrtc_way = 'R'; //검증구분 + $atcl_vr_sq = $this->request->getPost('rcpt_key'); + // $atcl_no = $this->request->getPost('atcl_no'); + $reg_conf_yn_1 = $this->request->getPost('reg_conf_yn_1'); //확인내용 + $reg_conf_yn_2 = $this->request->getPost('reg_conf_yn_2'); //매물주소 + $reg_conf_yn_3 = $this->request->getPost('reg_conf_yn_3'); //의뢰인정보 + $reg_conf_yn_info_2 = $this->request->getPost('reg_conf_yn_info_2'); //매물주소 + $reg_conf_yn_info_3 = $this->request->getPost('reg_conf_yn_info_3'); //의뢰인정보 + $memo = $this->request->getPost('memo'); //메모 + $owner_verifiable = $this->request->getPost('owner_verifiable'); //실소유주 확인여부 + $noimg_chk_chk = $this->request->getPost('noimg_chk_chk'); // 등기부등본이미지 파일없음. + $img_chk_chk = $this->request->getPost('img_chk_chk'); // 등기소, 리얼탑 열람, 리얼탑 기열람, 열람 + $atcl_vrtc_type = $this->request->getPost('atcl_vrtc_type'); // 검증구분 + $vrfc_type_sub = $this->request->getPost('vrfc_type_sub'); // 하위검증구분 + $arr_uncnfrm_status = $this->request->getPost('arr_uncnfrm_status'); // 등기부등본 미확인여부 상세 + $ownerTypeCode = $this->request->getPost('ownerTypeCode'); // 소유자명 확인 일치 , 불일치 + $document_cert_method = $this->request->getPost('document_cert_method'); // 서류 내용 확인 + + if ($owner_verifiable == "1") { + $owner_verifiable = true; + } else { + $owner_verifiable = false; + } + + //상태가 이미 등기부등본확인중 이상이면 저장하지 않는다. + $resStat = $this->model->chkStat($atcl_vr_sq); + $v2_vrfc_req = $v2DailyModel->get_v2_vrfc_req($atcl_vr_sq); + $rlet_type_cd = $model415->get_rlet_type_cd($atcl_vr_sq); + + if ((int) $resStat['stat_cd'] >= 60 || (int) $resStat['stat_cd'] == 19) { + throw new \Exception('이미 저장된 데이터입니다.'); + } else { + $resultCnt = $this->model->chkRegiTryCnt($atcl_vr_sq); //1차검증인지 2차검증인지 확인 쿼리 : v2_vrfc_req.type_cnt + if ($resultCnt['reg_try_cnt'] == 0) { // 1차 검증일 때 + log_message('debug', '712 page >> 매물번호 : ' . $atcl_vr_sq . ' 등기부등본 불일치 횟수 : 0 '); + $try_cnt = '1'; + } else if ($resultCnt['reg_try_cnt'] == 1) { // 2차 검증일 때 + log_message('debug', '712 page >> 매물번호 : ' . $atcl_vr_sq . ' 등기부등본 불일치 횟수 : 1 '); + $try_cnt = '2'; + } else { + log_message('debug', '712 page >> 매물번호 : ' . $atcl_vr_sq . ' 등기부등본 불일치 횟수 : 예외처리 '); + $try_cnt = '2'; + //$try_cnt = intval($try_cnt) + 1; + } + + $result = $this->model->chkConfirm($atcl_vr_sq, $atcl_vrtc_way); + if ($result == 0) { //v2_confirm 존재하지 않는다면 + if ($reg_conf_yn_2 == '10000' && $reg_conf_yn_3 == '10000') { //success 여부 판단 + $chk_type = '1'; + //$chk_delay = '0'; //지연여부 + //$chk_zombie = '0'; //좀비매물 + } else { + // 2015.06.29 추가 + // 불일치가 날 경우에 10분 이내에 다시 불일치 처리 불가능(같은 매물을 두사람이 중복처리할 가능성 사전 방지) + // 1. 현재 매물의 마지막으로 업데이트 된 시간을 가져옴. + // 2. 현재 시간과 비교하여 10분 이내면 경고창을 띄어줌. + + $chk_type = '0'; + //$chk_delay = '1'; //지연여부 + //$chk_zombie = '0'; //좀비매물 + + $result_tm = $this->model->getUpdateFailTime($atcl_vr_sq); + $update_tm = $result_tm['insert_tm']; + $ten_ago = date("Y-m-d H:i:s", mktime(date("H"), date("i") - 1, date("s"), date("m"), date("d"), date("Y"))); + + if ($update_tm > $ten_ago) { + // 수정한 시간이 현재시간10분전 보다 클 경우 수정불가능 + throw new \Exception('이미 불일치 처리 된 매물입니다.'); + } + } + $this->model->insertConfirm($atcl_vr_sq, $atcl_vrtc_way, $chk_type, $try_cnt); + } else { + if ($reg_conf_yn_2 == '10000' && $reg_conf_yn_3 == '10000') { //success 여부 판단 + $chk_type = '1'; + //$chk_delay = '0'; //지연여부 + //$chk_zombie = '0'; //좀비매물 + } else { + // 2015.06.29 추가 + // 불일치가 날 경우에 10분 이내에 다시 불일치 처리 불가능(같은 매물을 두사람이 중복처리할 가능성 사전 방지) + // 1. 현재 매물의 마지막으로 업데이트 된 시간을 가져옴. + // 2. 현재 시간과 비교하여 10분 이내면 경고창을 띄어줌. + + $chk_type = '0'; + //$chk_delay = '1'; //지연여부 + //$chk_zombie = '0'; //좀비매물 + + $result_tm = $this->model->getUpdateFailTime($atcl_vr_sq); + $update_tm = $result_tm['insert_tm']; + $ten_ago = date("Y-m-d H:i:s", mktime(date("H"), date("i") - 1, date("s"), date("m"), date("d"), date("Y"))); + + if ($update_tm > $ten_ago) { + throw new \Exception('이미 불일치 처리 된 매물입니다.'); + } + } + + $this->model->updateConfirm($atcl_vr_sq, $atcl_vrtc_way, $chk_type); + } + + + $this->model->InsResChar($atcl_vr_sq); //담당자 업데이트 + + // 모바일v1,v2고 등기부등본 미확인여부 상세 저장 + if ($vrfc_type_sub == 'M1' || $vrfc_type_sub == 'O1') { + $this->model->add_cert_uncnfrm_status($atcl_vr_sq, $arr_uncnfrm_status); + if (strpos($arr_uncnfrm_status, '20020') !== false) { //등기부등본 미확인여부 상세에 20020(파일 오첨부)있고 + if ($vrfc_type_sub == 'M1') { // 모바일v1일땐 코드 20020,코멘트x + $reg_conf_yn_2 = '20020'; + $reg_conf_yn_info_2 = ''; + } else { // 모바일v2일땐 일반 불일치코드,코멘트=파일 오첨부 + $reg_conf_yn_info_2 = '파일 오첨부'; + } + } + } + //v2_check_list 확인여부 INSERT + $this->model->insertChkList($atcl_vr_sq, $atcl_vrtc_way, '21', $reg_conf_yn_2, $reg_conf_yn_info_2); + + //v2_check_list 매물주소 INSERT + $this->model->insertChkList($atcl_vr_sq, $atcl_vrtc_way, '22', $reg_conf_yn_3, $reg_conf_yn_info_3); + + //memo 저장 + $this->model->saveMemo([$memo, $atcl_vr_sq]); + + // document_cert_method + $this->model->updatedocument_cert_method($atcl_vr_sq, $document_cert_method); + + + //실소유주 확인 저장 + $this->model->update_owner_verifiable($atcl_vr_sq, $owner_verifiable); + $sendData = $this->model->getDatacertAPI($atcl_vr_sq, 'R'); + + log_message('debug', '712 saveRegi => ' . $sendData['atclNo'] . ' ::: ' . json_encode($sendData) . PHP_EOL); + + $d_yn = $this->model->get_send_yn('D'); + + if ($d_yn['stop_yn'] == 'N') { //전송금지 + //1.해당매물정보를v2_stop_api_save_info에다 넣음 + $this->model->insert_v2_stop_api_save_info($sendData['atclNo'], $atcl_vr_sq, 'D', ''); + //2.아무렇지않게 행동한다 + $send_result['result'] = 'success'; + } else { + //API 호출 + $send_result = $naver->certification_712($sendData['atclNo'], $try_cnt, $sendData['success'], $sendData['checkList'], $sendData['charger'], $sendData['date'], $sendData['modifyInfo'], $sendData['ownerVerifiable']); + } + + if ($send_result['result'] == 'success') { + if ($chk_type == '1') { + //상태변경 TABLE INSERT : 등기부등본 확인완료 상태로 변경 + $this->model->chgStat($atcl_vr_sq, '45', $toDay); + $chgVrfc45 = $this->model->chgStatVrfc($atcl_vr_sq, '45'); //v2_vrfc_req INSERT + $statFaxUp45 = $this->model->chgStatFax($atcl_vr_sq, '45'); //fax_imgs + + //상태변경 TABLE INSERT : 검증완료 상태로 변경 + $this->model->chgStat($atcl_vr_sq, '60', $toDay); + $chgVrfc60 = $this->model->chgStatVrfc($atcl_vr_sq, '60'); //v2_vrfc_req INSERT + $statFaxUp60 = $this->model->chgStatFax($atcl_vr_sq, '60'); //fax_imgs + + // ★ 검증완료 + //0.불일치 이력이 있는지 확인 + $cnt = $model415->get_cert_failTimeForHistory($atcl_vr_sq); + if (empty($cnt)) { + if ($atcl_vrtc_type == 'M' || $atcl_vrtc_type == 'N') { //모바일은 등기가 첨 시작이니까 insert해줘야함 + if (!($atcl_vrtc_type == 'M' && in_array($rlet_type_cd['rlet_type_cd'], array('B01', 'B02', 'B03')))) {//만약 분양권들이면 넘어가고 아니면 체크 + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_M_timeForHistory($atcl_vr_sq); + //2.등기부등본 확인완료 시간 + $cert_comple_dt = $model415->get_cert_confTimeForHistory($atcl_vr_sq); + //3.검증완료시간 + $finishTime = $model415->get_60_ForHistory($atcl_vr_sq); + //4.해당 정보를 테이블에 넣는다 + $model415->insert_v2_time_required_M($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm'], $finishTime['insert_tm']); + } + } else { + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_ing_TimeForHistory($atcl_vr_sq); + //2.등기부등본 확인완료 시간 + $cert_comple_dt = $model415->get_cert_confTimeForHistory($atcl_vr_sq); + //3.해당 정보를 테이블에 넣는다 + $model415->update_v2_time_required_Conf_Done($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm']); + } + } + + if ($noimg_chk_chk == 'Y') { + $this->model->chgStat($atcl_vr_sq, '70', $toDay); + $this->model->updateStat($atcl_vr_sq, 'Y'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0103', '1', 'add'); // 등기부등본이미지 없음 저장 + } + if ($img_chk_chk == 'O') { + $this->model->chgStat($atcl_vr_sq, '76', $toDay); + $this->model->updateStat($atcl_vr_sq, 'O'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0105', '1', 'add'); // (열람)간소화확인으로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0101', '1', 'add'); // 일치로 저장 + } else if ($img_chk_chk == 'T') { + $this->model->chgStat($atcl_vr_sq, '80', $toDay); + $this->model->updateStat($atcl_vr_sq, 'T'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0111', '1', 'add'); // 등기소로 일치로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0101', '1', 'add'); // 일치로 저장 + } else if ($img_chk_chk == 'R') { + $this->model->chgStat($atcl_vr_sq, '86', $toDay); + $this->model->updateStat($atcl_vr_sq, 'R'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0107', '1', 'add'); // 리얼탑 열람 일치로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0101', '1', 'add'); // 일치로 저장 + } else if ($img_chk_chk == 'G') { + $this->model->chgStat($atcl_vr_sq, '87', $toDay); + $this->model->updateStat($atcl_vr_sq, 'G'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0108', '1', 'add'); // 리얼탑 기열람 일치으로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0101', '1', 'add'); // 일치로 저장 + } + } else { + if ($atcl_vrtc_type == 'M') { + //상태변경 TABLE INSERT : 등기부등본 확인 불일치 상태로 변경 + $this->model->chgStat($atcl_vr_sq, '49', $toDay); + $chgVrfc49 = $this->model->chgStatVrfc($atcl_vr_sq, '49'); //v2_vrfc_req INSERT + $statFaxUp49 = $this->model->chgStatFax($atcl_vr_sq, '49'); //fax_imgs + + //v2_vrfc_req try_cnt 값을 1로 update + $this->model->chgRegiTryCnt($atcl_vr_sq, '2'); + + //상태변경 TABLE INSERT : 검증실패 상태로 변경 + $this->model->chgStat($atcl_vr_sq, '69', $toDay); + $chgVrfc69 = $this->model->chgStatVrfc($atcl_vr_sq, '69'); //v2_vrfc_req INSERT + $statFaxUp69 = $this->model->chgStatFax($atcl_vr_sq, '69'); //fax_imgs + + // ★모바일이고 검증실패 + if (!in_array($rlet_type_cd['rlet_type_cd'], array('B01', 'B02', 'B03'))) {//만약 분양권들이면 넘어가고 아니면 체크 + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_M_timeForHistory($atcl_vr_sq); + //2.등기부등본 확인실패 시간 + $cert_comple_dt = $model415->get_cert_failTimeForHistory($atcl_vr_sq); + //3.검증실패시간 + $finishTime = $model415->get_69_ForHistory($atcl_vr_sq); + //4.해당 정보를 테이블에 넣는다 + $model415->insert_v2_time_required_M($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm'], $finishTime['insert_tm']); + } + } else { + //상태변경 TABLE INSERT : 등기부등본 확인 불일치 상태로 변경 + $this->model->chgStat($atcl_vr_sq, '49', $toDay); + $chgVrfc49 = $this->model->chgStatVrfc($atcl_vr_sq, '49'); //v2_vrfc_req INSERT + $statFaxUp49 = $this->model->chgStatFax($atcl_vr_sq, '49'); //fax_imgs + + //등기부등본 확인중 상태로 변경. + $this->model->saveChangedHistory($atcl_vr_sq, '30', 'C9', $usr_id, '상태변경 : 49 => 30'); //검증결과 변동사항 HISTORY + $chgVrfc40 = $this->model->chgStatVrfc($atcl_vr_sq, '30'); //v2_vrfc_req INSERT + $statFaxUp40 = $this->model->chgStatFax($atcl_vr_sq, '30'); //fax_imgs + + if ($try_cnt == '1') { + //v2_vrfc_req try_cnt 값을 1로 update + $this->model->chgRegiTryCnt($atcl_vr_sq, '1'); + if ($atcl_vrtc_type == 'T') { + //검증구분이 전화매물일 경우 사전에 일치로 처리된 값을 초기화 시켜준다. + $reset_query = $this->model->resetTelConf($atcl_vr_sq); + } + + // ★1차실패 + if ($atcl_vrtc_type == 'N') { + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_M_timeForHistory($atcl_vr_sq); + //2.등기부등본 확인실패 시간 + $cert_comple_dt = $model415->get_cert_failTimeForHistory($atcl_vr_sq); + //3.검증실패시간 + $finishTime = $model415->get_69_ForHistory($atcl_vr_sq); + //4.해당 정보를 테이블에 넣는다 + $model415->insert_v2_time_required_M($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm'], $finishTime['insert_tm']); + } else { + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_ing_TimeForHistory($atcl_vr_sq); + //2.등기부등본 확인실패 시간 + $cert_comple_dt = $model415->get_cert_failTimeForHistory($atcl_vr_sq); + //3.해당 정보를 테이블에 넣는다 + $sf = 'F'; + $model415->update_v2_time_required_Conf($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm'], $sf); + } + } else if ($try_cnt == '2') { + //v2_vrfc_req try_cnt 값을 2로 update + $this->model->chgRegiTryCnt($atcl_vr_sq, '2'); + + //상태변경 TABLE INSERT : 검증실패 상태로 변경. + $this->model->chgStat($atcl_vr_sq, '69', $toDay); + $chgVrfc69 = $this->model->chgStatVrfc($atcl_vr_sq, '69'); //v2_vrfc_req INSERT + $statFaxUp69 = $this->model->chgStatFax($atcl_vr_sq, '69'); //fax_imgs + + // ★모바일 이외 검증실패 + if ($atcl_vrtc_type == 'N') { + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_M_timeForHistory($atcl_vr_sq); + //2.등기부등본 확인실패 시간 + $cert_comple_dt = $model415->get_cert_failTimeForHistory($atcl_vr_sq); + //3.검증실패시간 + $finishTime = $model415->get_69_ForHistory($atcl_vr_sq); + //4.해당 정보를 테이블에 넣는다 + $model415->insert_v2_time_required_M($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm'], $finishTime['insert_tm']); + } else { + //1.등기부등본 확인중 시간 + $tel_doc_conf_dt = $model415->get_cert_ing_TimeForHistory($atcl_vr_sq); + //2.등기부등본 확인실패 시간 + $cert_comple_dt = $model415->get_cert_failTimeForHistory($atcl_vr_sq); + //3.해당 정보를 테이블에 넣는다 + $model415->update_v2_time_required_Conf_Done($v2_vrfc_req['atcl_no'], $v2_vrfc_req['cpid'], $atcl_vrtc_type, $tel_doc_conf_dt['insert_tm'], $cert_comple_dt['insert_tm']); + } + } + } + + if ($noimg_chk_chk == 'Y') { + $this->model->chgStat($atcl_vr_sq, '70', $toDay); + $this->model->updateStat($atcl_vr_sq, 'Y'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0103', '1', 'add'); // 등기부등본이미지 없음 저장 + } + if ($img_chk_chk == 'O') { + $this->model->chgStat($atcl_vr_sq, '77', $toDay); + $this->model->updateStat($atcl_vr_sq, 'O'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0105', '1', 'add'); // (열람)간소화확인으로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0102', '1', 'add'); // 불일치로 저장 + } else if ($img_chk_chk == 'T') { + $this->model->chgStat($atcl_vr_sq, '85', $toDay); + $this->model->updateStat($atcl_vr_sq, 'T'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0112', '1', 'add'); // 등기소 불일치로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0102', '1', 'add'); // 불일치로 저장 + } else if ($img_chk_chk == 'R') { + $this->model->chgStat($atcl_vr_sq, '88', $toDay); + $this->model->updateStat($atcl_vr_sq, 'R'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0109', '1', 'add'); // 리얼탑 열람 불일치로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0102', '1', 'add'); // 불일치로 저장 + } else if ($img_chk_chk == 'G') { + $this->model->chgStat($atcl_vr_sq, '89', $toDay); + $this->model->updateStat($atcl_vr_sq, 'G'); // reg_status를 업데이트해준다. + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0110', '1', 'add'); // 리얼탑 기열람 불일치로 저장 + $v2DailyModel->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'R0102', '1', 'add'); // 불일치로 저장 + } + + } + } else { + if (isset($send_result['error'])) { + $error_message = $send_result['error']['code'] . "\\n" . $send_result['error']['message']; + + // API 호출 에러 발생시 해당 내용들을 DB에 저장해준다. + $err_time = date("Y-m-d H:i:s"); + $this->model->saveApiErr($atcl_vr_sq, $send_result['error']['code'], $send_result['error']['message'], $err_time, $v2_vrfc_req['atcl_no']); + throw new \Exception($error_message); + } else { + throw new \Exception('네이버 전송 중 오류가 발생되었습니다. 다시 시도하세요.'); + } + } + + + return $this->response->setJSON([ + 'code' => '0', + 'msg' => 'success', + ]); + + } - return $this->response->setJSON([ - 'code' => '0', - 'msg' => 'success', - ]); } catch (\Exception $e) { return $this->response->setJSON([ diff --git a/app/Libraries/NaverApiClient.php b/app/Libraries/NaverApiClient.php index 9c27190..6d3c5ec 100644 --- a/app/Libraries/NaverApiClient.php +++ b/app/Libraries/NaverApiClient.php @@ -3,6 +3,8 @@ namespace App\Libraries; use App\Models\common\CommonModel; +use App\Models\v2\M712Model; +use CodeIgniter\Model; class NaverApiClient { @@ -43,7 +45,7 @@ class NaverApiClient { $this->charger = $charger; $url = "{$this->baseUrl}/kiso/center/verification-article/{$articleNumber}?charger={$this->charger}"; - + return $this->request('PUT', $url, $updateData); } /** @@ -105,7 +107,7 @@ class NaverApiClient { $this->charger = $charger; $url = "{$this->baseUrl}/kiso/center/verification-article/price/{$articleNumber}?charger={$this->charger}"; - + return $this->request('POST', $url, $priceData); } @@ -115,14 +117,14 @@ class NaverApiClient $url .= '?reserveNoList=' . $reserveNoList; return $this->request('GET', $url); } - + /** * 단지상세정보조회 * hscpNo : 단지번호(숫자) */ public function aptDetail($hscpNo) { - $url = $this->commonModel->getCompanyInfo(2); + $url = $this->commonModel->getCompanyInfo(3); $url = $url['api_server'] . "/confirms/APTDetail?hscpNo={$hscpNo}"; return $this->request('GET', $url); } @@ -134,7 +136,7 @@ class NaverApiClient public function villaDetail($hscpNo) { - $url = $this->commonModel->getCompanyInfo(2); + $url = $this->commonModel->getCompanyInfo(3); $url = $url['api_server'] . "/confirms/villa/{$hscpNo}"; return $this->request('GET', $url); } @@ -321,7 +323,46 @@ class NaverApiClient return $this->request('POST', $url, $postData); } - + + /** + * 등기부 등본 확인 결과 + * 712 OwnerVerifiable 전송 오류 우회 테스트 + */ + public function certification_712($atclNo, $type, $success, $checkList, $charger, $date, $modifyInfo, $ownerVerifiable) + { + $url = $this->commonModel->getCompanyInfo(3); + $url = $url['api_server'] . "/confirms/certification"; + + $model712 = new M712Model(); + $data = $model712->getOwnerVerifiable($atclNo); + + $ov = $data['OwnerVerifiable_change']; + if (isset($ov)) { + if ($ov > 0) { + $ownerVerifiable = true; + } else { + $ownerVerifiable = false; + } + } else { + $ownerVerifiable = null; + } + + $postData = [ + "atclNo" => $atclNo, + "type" => $type, + "success" => $success, + "checkList" => $checkList, + "charger" => $charger, + "date" => $date, + "modifyInfo" => $modifyInfo, + "ownerVerifiable" => $ownerVerifiable + ]; + + log_message('debug', '712 certification_712 => ' . $atclNo . ' ::: ' . json_encode($postData) . PHP_EOL); + + return $this->request('POST', $url, $postData); + } + /** * CURL 공통 실행 함수 */ @@ -363,7 +404,7 @@ class NaverApiClient 'X-Naver-Client-Id: yqBbvQZ123_hjH3b3Df9' ]); } - } elseif ( $method === 'PATCH') { + } elseif ($method === 'PATCH') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); if ($data) { $payload = json_encode($data); diff --git a/app/Models/v2/M701Model.php b/app/Models/v2/M701Model.php index 57f51af..aafadbe 100644 --- a/app/Models/v2/M701Model.php +++ b/app/Models/v2/M701Model.php @@ -1345,7 +1345,7 @@ class M701Model extends Model $comment = implode('|', $comment); } - $usr_sq = $this->session->userdata('usr_sq'); + $usr_sq = session('usr_sq'); $sql = "INSERT INTO v2_check_list" . "(vr_sq, vrfc_type, type, code, comment, insert_user, insert_tm)" . "VALUES" . diff --git a/app/Models/v2/M703Model.php b/app/Models/v2/M703Model.php index ae39ac2..7bbb5c6 100644 --- a/app/Models/v2/M703Model.php +++ b/app/Models/v2/M703Model.php @@ -2117,8 +2117,8 @@ class M703Model extends Model */ public function saveChangeStep($fax_sq, $vr_sq, $stat_cd) { - $insert_user = $this->session->userdata('usr_sq'); - $insert_id = $this->session->userdata('usr_id'); + $insert_user = session('usr_sq'); + $insert_id = session('usr_id'); $this->db->transStart(); diff --git a/app/Models/v2/M705Model.php b/app/Models/v2/M705Model.php index d458b02..f166c11 100644 --- a/app/Models/v2/M705Model.php +++ b/app/Models/v2/M705Model.php @@ -1187,7 +1187,7 @@ class M705Model extends Model public function InsResChar($atcl_vr_sq) { - $usr_id = $this->session->userdata('usr_id'); + $usr_id = session('usr_id'); $sql = "UPDATE v2_article_info" . " SET reg_charger = ?" . diff --git a/app/Models/v2/M706Model.php b/app/Models/v2/M706Model.php index f6a291d..f7fa936 100644 --- a/app/Models/v2/M706Model.php +++ b/app/Models/v2/M706Model.php @@ -1056,7 +1056,7 @@ class M706Model extends Model public function insertChkList($vr_sq, $vrfc_type, $type, $code, $comment) { //v2_check_list INSERT - $usr_sq = $this->session->userdata('usr_sq'); + $usr_sq = session('usr_sq'); $sql = "INSERT INTO v2_check_list" . diff --git a/app/Models/v2/M712Model.php b/app/Models/v2/M712Model.php index 39118aa..69d460c 100644 --- a/app/Models/v2/M712Model.php +++ b/app/Models/v2/M712Model.php @@ -906,6 +906,504 @@ class M712Model extends Model } } + /* 현재 상태 확인 */ + public function chkStat($vr_sq) + { + $sql = "SELECT stat_cd FROM v2_vrfc_req WHERE vr_sq = ?"; + $data = array( + $vr_sq + ); + $query = $this->db->query($sql, $data); + return $query->getRowArray(); + } + + //1차 검증인지 2차 검증인지 확인. + public function chkRegiTryCnt($atcl_vr_sq) + { + $sql = "SELECT reg_try_cnt FROM v2_vrfc_req WHERE vr_sq = ?"; + $query = $this->db->query($sql, [$atcl_vr_sq]); + return $query->getRowArray(); + } + + //검증결과 table에 있는지 확인. + public function chkConfirm($atcl_vr_sq, $reg_yn) + { + $builder = $this->db->table('v2_confirm a'); + $builder->select('a.vr_sq'); + $builder->where('vr_sq', $atcl_vr_sq); + + if ($reg_yn) { + $builder->where('vrfc_type', $reg_yn); + } + + $query = $builder->get(); + return $query->getNumRows(); + } + + public function getUpdateFailTime($vr_sq) + { + $sql = "select vr_sq, stat_cd, insert_user, insert_tm " . + "from v2_chg_stat " . + "where vr_sq = ? and stat_cd = '49' " . + "order by insert_tm desc " . + "limit 1"; + $data = array($vr_sq); + $query = $this->db->query($sql, $data); + $row = $query->getRowArray(); + + return $row; + } + + //v2_confirm INSERT + public function insertConfirm($vr_sq, $vrfc_type, $success, $type, $usr_id = '', $usr_sq = '') + { + + if (empty($usr_sq)) + $usr_sq = session('usr_sq'); + if (empty($usr_id)) + $usr_id = session('usr_id'); + + $sql = "INSERT INTO v2_confirm" . + "(vr_sq, vrfc_type, success, type, charger, date, insert_user, insert_tm, update_user, update_tm)" . + "VALUES" . + "(?, ?, ?, ?, ?, '" . date('YmdHis') . "', ?, NOW(), ?, NOW()) " . + " ON DUPLICATE KEY UPDATE" . + " success=values(success), type=values(type), charger=values(charger), date=values(date) + , update_user=values(update_user), update_tm=values(update_tm)"; + + $data = array( + $vr_sq, + $vrfc_type, + $success, + $type, + $usr_id, + $usr_sq, + $usr_sq + ); + + $this->db->query($sql, $data); + } + + public function updateConfirm($vr_sq, $vrfc_type, $success) + { + $data = [ + 'success' => $success, + ]; + + $builder = $this->db->table('v2_confirm'); + $builder->where('vr_sq', $vr_sq); + $builder->where('vrfc_type', $vrfc_type); + $builder->update($data); + + return [ + 'error_number' => $this->db->error()['code'], + 'error_message' => $this->db->error()['message'] + ]; + } + + public function InsResChar($atcl_vr_sq) + { + $usr_id = session('usr_id'); + + $sql = "UPDATE v2_article_info" . + " SET reg_charger = ?" . + " WHERE vr_sq = ?"; + + $data = array( + $usr_id, + $atcl_vr_sq + ); + //echo $this->db->last_query(); + $res = $this->db->query($sql, $data); + $log_v = $this->db->getLastQuery(); + log_message('debug', $log_v); + } + + public function add_cert_uncnfrm_status($vr_sq, $cert_uncnfrm_status) + { + $sql = "UPDATE v2_article_info_etc" . + " SET cert_uncnfrm_status = ?" . + " WHERE vr_sq = ?"; + $data = array( + $cert_uncnfrm_status, + $vr_sq + ); + + $this->db->query($sql, $data); + } + + public function insertChkList($vr_sq, $vrfc_type, $type, $code, $comment) + { //v2_check_list INSERT + + $usr_sq = session('usr_sq'); + + $sql = "INSERT INTO v2_check_list" . + "(vr_sq, vrfc_type, type, code, comment, insert_user, insert_tm)" . + "VALUES" . + "(?, ?, ?, ?, ?, ?, NOW())" . + " ON DUPLICATE KEY UPDATE" . + " vr_sq=values(vr_sq), vrfc_type=values(vrfc_type), type=values(type), code=values(code), comment=values(comment), insert_user=values(insert_user), insert_tm=values(insert_tm)"; + + $data = array( + $vr_sq, + $vrfc_type, + $type, + $code, + $comment, + $usr_sq + ); + + + $this->db->query($sql, $data); + + } + + /** + * update updatedocument_cert_method + */ + public function updatedocument_cert_method($vr_sq, $document_cert_method) + { + $sql = "UPDATE v2_article_info_etc SET " . + " document_cert_method = ? " . + " WHERE vr_sq = ? "; + + $document_cert_method = json_encode($document_cert_method, JSON_UNESCAPED_UNICODE); + if ($document_cert_method == 'false') { + $document_cert_method = NULL; + } + $data = array( + $document_cert_method, + $vr_sq + ); + $this->db->query($sql, $data); + $s = $this->db->getLastQuery(); + log_message('debug', "====updatedocument_cert_method:712====" . $s); + } + + public function update_owner_verifiable($vr_sq, $owner_verifiable) + { + $sql = "UPDATE v2_vrfc_req" . + " SET owner_verifiable = ?" . + " WHERE vr_sq = ?"; + $data = array( + $owner_verifiable, + $vr_sq + ); + + $this->db->query($sql, $data); + $s = $this->db->getLastQuery(); + log_message('debug', "====update_owner_verifiable:712====" . $s); + } + + /* 등기부등본 API 호출*/ + public function getDatacertAPI($vr_sq, $vrfc_type = '') + { + // 요청정보 + $sql = "SELECT vr_sq, atcl_no, step, cpid, cp_atcl_id, trade_type, realtor_nm, realtor_tel_no, seller_tel_no, vrfc_type, rgbk_confirm, req_type, rdate, stat_cd, try_cnt, insert_user, insert_tm, owner_verifiable" . + " FROM v2_vrfc_req where vr_sq = ?"; + $query = $this->db->query($sql, [$vr_sq]); + $row_vrfc_req = $query->getRowArray(); + + if (!empty($vrfc_type)) { + $row_vrfc_req['vrfc_type'] = $vrfc_type; + } + + log_message('debug', 'getDatacertApi_query => ' . $this->db->getLastQuery()); + log_message('debug', 'getDatacertApi_result => ' . json_encode($row_vrfc_req)); + + // 매물정보 + $sql = "SELECT vr_sq, atcl_no, cpid, cp_atcl_id, rlet_type_cd, trade_type, address_code, address1, address2, address3, sply_spc, excls_spc, tot_spc, grnd_spc, bldg_spc, deal_amt, wrrnt_amt, lease_amt, isale_amt, prem_amt, sise, floor, rdate, seller_tel_no, seller_nm, realtor_nm, realtor_tel_no, hscp_no, hscp_nm, ptp_no, ptp_nm, charger, req_price_yn, reg_charger, dept1_sq, dept2_sq, reg_dept1_sq, reg_dept2_sq, floor2, vrfc_type_sub" . + " FROM v2_article_info where vr_sq = ?"; + $query = $this->db->query($sql, [$vr_sq]); + $row_article_info = $query->getRowArray(); + + log_message('debug', $this->db->getLastQuery()); + + // 수정정보 + $sql = "SELECT vr_sq, bild_nm, rm_no, floor, address_code, address2, address3, trade_type, deal_amt, wrrnt_amt, lease_amt, isale_amt, prem_amt, sply_spc, excls_spc, tot_spc, grnd_spc, bldg_spc, hscp_no, hscp_nm, ptp_no, ptp_nm, modify_yn, floor2" . + " FROM v2_modify_info where vr_sq = ?"; + $query = $this->db->query($sql, [$vr_sq]); + $row_modify_info = $query->getRowArray(); + + log_message('debug', $this->db->getLastQuery()); + + // 검증결과 + $sql = "SELECT vr_sq, vrfc_type, success, type, charger, date, insert_user, insert_tm, update_user, update_tm, work_type" . + " FROM v2_confirm where vr_sq = ? and vrfc_type = ?"; + $query = $this->db->query($sql, [$vr_sq, $row_vrfc_req['vrfc_type']]); + $row_confirm = $query->getRowArray(); + + log_message('debug', $this->db->getLastQuery()); + + // 확인정보 + $sql = "SELECT a.type, a.code, a.comment, b.ownerNm, b.owner_birth" . + " FROM v2_check_list a " . + " INNER JOIN v2_article_info b on a.vr_sq = b.vr_sq" . + " WHERE a.vr_sq = ? and a.vrfc_type = ?"; + $query = $this->db->query($sql, [$vr_sq, $row_vrfc_req['vrfc_type']]); + $res_check_list = $query->getResultArray(); + + log_message('debug', $this->db->getLastQuery()); + + log_message('debug', implode(', ', $row_confirm ?? [])); + + $atclNo = $row_vrfc_req['atcl_no']; + $type = $row_vrfc_req['try_cnt']; + $success = empty($row_confirm['success']) ? false : true; + $charger = $row_confirm['charger'] ?? ''; + $date = $row_confirm['date'] ?? ''; + + switch ($row_vrfc_req['owner_verifiable']) { + case "1": + case "true": + $ownerVerifiable = true; + break; + default: + $ownerVerifiable = false; + break; + } + + $checkList = []; + foreach ($res_check_list as $row) { + $checkList[] = [ + 'type' => $row['type'], + 'code' => $row['code'], + 'comment' => $row['comment'], + 'ownerNm' => $row['ownerNm'], + 'ownerBirth' => $row['owner_birth'], + ]; + } + + $modifyInfo = []; + if ($row_modify_info['modify_yn'] == 'Y') { + if (!empty($row_modify_info['hscp_no'])) { + // 공동주택 + $modifyInfo = [ + 'hscpNo' => $row_modify_info['hscp_no'], + 'ptpNo' => $row_modify_info['ptp_no'], + 'bildNm' => $row_modify_info['address2'], + 'rmNo' => $row_modify_info['address3'], + 'tradeType' => $row_modify_info['trade_type'], + 'dealAmt' => $row_modify_info['deal_amt'], + 'wrrntAmt' => $row_modify_info['wrrnt_amt'], + 'leaseAmt' => $row_modify_info['lease_amt'], + 'isaleAmt' => $row_modify_info['isale_amt'], + 'premAmt' => $row_modify_info['prem_amt'], + 'floor' => $row_modify_info['floor'], + ]; + } else { + // 비공동주택 + $modifyInfo = [ + 'addressCode' => $row_modify_info['address_code'], + 'address2' => $row_modify_info['address2'], + 'address3' => $row_modify_info['address3'], + 'tradeType' => $row_modify_info['trade_type'], + 'dealAmt' => $row_modify_info['deal_amt'], + 'wrrntAmt' => $row_modify_info['wrrnt_amt'], + 'leaseAmt' => $row_modify_info['lease_amt'], + 'splySpc' => $row_modify_info['sply_spc'], + 'exclsSpc' => $row_modify_info['excls_spc'], + 'totSpc' => $row_modify_info['tot_spc'], + 'grndSpc' => $row_modify_info['grnd_spc'], + 'bldgSpc' => $row_modify_info['bldg_spc'], + 'floor' => $row_modify_info['floor'], + 'floor2' => $row_modify_info['floor2'], + ]; + } + + return [ + 'atclNo' => $atclNo, + 'type' => $type, + 'success' => $success, + 'checkList' => $checkList, + 'charger' => $charger, + 'modifyInfo' => $modifyInfo, + 'date' => $date, + 'vrfcType' => $row_article_info['vrfc_type_sub'], + 'ownerVerifiable' => $ownerVerifiable, + ]; + } else { + return [ + 'atclNo' => $atclNo, + 'type' => $type, + 'success' => $success, + 'checkList' => $checkList, + 'charger' => $charger, + 'date' => $date, + 'vrfcType' => $row_article_info['vrfc_type_sub'], + 'ownerVerifiable' => $ownerVerifiable, + ]; + } + } + + public function get_send_yn($type) + { + $sql = "SELECT stop_yn + FROM v2_stop_api_chg_stat + WHERE TYPE = ? + ORDER BY pk DESC + LIMIT 1"; + $date = array( + $type + ); + $query = $this->db->query($sql, $date); + $return = $query->getRowArray(); + + return $return; + } + + public function insert_v2_stop_api_save_info($atcl_no, $vr_sq, $type, $fax_sq) + { + $sql = "INSERT INTO v2_stop_api_save_info(atcl_no,vr_sq,type,status,stop_dt,fax_sq)" . + " VALUE(?,?,?,'stop',now(),?)"; + $date = array( + $atcl_no, + $vr_sq, + $type, + $fax_sq + ); + $this->db->query($sql, $date); + } + + /** + * 712 소유자 확인 을 위한 쿼리 + */ + public function getOwnerVerifiable($atcl_no) + { + $sql = "select * , + case + when owner_verifiable = 'true' then '1' + when owner_verifiable = '1' then '1' + when owner_verifiable = 'false' then '0' + when owner_verifiable = '0' then '0' + ELSE null + END AS OwnerVerifiable_change + from v2_vrfc_req where atcl_no = ? "; + $data = array( + $atcl_no + ); + $query = $this->db->query($sql, $data); + $row = $query->getRowArray(); + + return $row; + } + + public function chgStat($vr_sq, $stat_cd, $insert_tm) + { //상태변경 TABLE INSERT + + $usr_sq = session('usr_sq'); + $usr_id = session('usr_id'); + + $list = $this->get_detail($vr_sq); + + $sql = "INSERT INTO v2_chg_stat (vr_sq, stat_cd, insert_user, insert_tm)" . + "VALUES (?, ?, ?, ?)" . + "ON DUPLICATE KEY " . + "UPDATE vr_sq=VALUES(vr_sq), stat_cd=VALUES(stat_cd), insert_user=VALUES(insert_user), insert_tm=VALUES(insert_tm)"; + + $data = array( + 'vr_sq' => $vr_sq, + 'stat_cd' => $stat_cd, + 'usr_sq' => $usr_sq, + 'insert_tm' => $insert_tm + ); + + $this->db->transStart(); + $res = $this->db->query($sql, $data); + + $return['error_number'] = $this->db->_error_number(); + $return['error_message'] = $this->db->_error_message(); + + if (empty($return['error_number'])) { + //로그를 남긴다. + if ($this->db->affected_rows() > 0) { + if (!empty($changed)) { + $this->saveChangedHistory($list['data']['vr_sq'], $stat_cd, 'C9', $usr_id, "상태변경 저장"); //검증결과 변동사항 HISTORY + } + } + } + $this->db->transComplete(); + } + + public function chgStatVrfc($vr_sq, $stat_cd) + { + $data = ['stat_cd' => $stat_cd]; + + $builder = $this->db->table('v2_vrfc_req'); + $builder->where('vr_sq', $vr_sq); + $builder->update($data); + + return [ + 'error_number' => $this->db->error()['code'], + 'error_message' => $this->db->error()['message'] + ]; + } + + public function chgStatFax($vr_sq, $stat_cd) + { + $data = ['stat_cd' => $stat_cd]; + + $builder = $this->db->table('fax_imgs'); + $builder->where('vr_sq', $vr_sq); + $builder->update($data); + + return [ + 'error_number' => $this->db->error()['code'], + 'error_message' => $this->db->error()['message'] + ]; + } + + //v2_vrfc_req try_cnt 값 변경. + public function chgRegiTryCnt($vr_sq, $try_cnt) + { + $sql = "UPDATE v2_vrfc_req" . + " SET reg_try_cnt = ?" . + " WHERE vr_sq = ?"; + + $data = array( + $try_cnt, + $vr_sq + ); + + $res = $this->db->query($sql, $data); + } + + public function resetTelConf($vr_sq) + { + $sql = "update v2_check_list " . + "set code = '' " . + "where type in ('T11', 'T12', 'T13', 'T14') " . + "and vr_sq = ?"; + + $data = array($vr_sq); + $this->db->query($sql, $data); + } + + // 메모저장 + public function saveMemo($data) + { + $usr_id = session('usr_id'); + + $sql = "UPDATE v2_vrfc_req SET + memo = ? + WHERE vr_sq = ?"; + + if ($this->db->query($sql, $data) === false) { + return [ + 'success' => false, + 'msg' => '파일정보 저장 실패', + ]; + } + + $row = $this->getDetail($data[1]); + + $memo = "메모변경 : " . $row['memo'] . " => " . $data[0]; + $this->saveChangedHistory($data[1], $row['pre_stat_cd'], 'C19', $usr_id, $memo); + + return [ + 'success' => true + ]; + } // 정보변경 이력 저장 public function saveChangedHistory($vr_sq, $stat_cd, $chg_type, $usr_id, $memo) diff --git a/app/Views/pages/v2/m709/detail.php b/app/Views/pages/v2/m709/detail.php index 4d74c4c..52b1a2b 100644 --- a/app/Views/pages/v2/m709/detail.php +++ b/app/Views/pages/v2/m709/detail.php @@ -43,7 +43,7 @@ $usr_level = session('usr_level');
- + @@ -153,7 +153,7 @@ $usr_level = session('usr_level'); style="max-width: 320px;">
-
-
-
+ + + + + + + + + +
+
+
-
-
-
- - - - - +
+
+
+ + + + + + + - - - - - - - + + + + + +
-
-
-
- - - - - +
+
+
+ + + + - - - - + + + -
-
- 등기부등본 - 보기    - - - - +
-
'; - } else { - echo '
'; - if (empty($arrRegist)) { - echo 'Image'; +
+
'; } else { - foreach ($arrRegist as $row) { - $img_path = $row['file_path'] . $row['file_name']; - echo '' . - 'Image' . - ''; + echo '
'; + if (empty($arrRegist)) { + echo 'Image'; + } else { + foreach ($arrRegist as $row) { + $img_path = $row['file_path'] . $row['file_name']; + echo '' . + 'Image' . + ''; + } } + echo '

'; } - echo '
'; - } - } else { //등기api이미지 저장여부가 N - if (strtolower($file_pdf) == 'pdf') { - echo '
'; - } else { - echo '
'; - if (empty($arr_cert_register)) { - echo 'Image'; + } else { //등기api이미지 저장여부가 N + if (strtolower($file_pdf) == 'pdf') { + echo '
'; } else { - foreach ($arr_cert_register as $img_path) { - echo '' . - 'Image' . - ''; + echo '
'; + if (empty($arr_cert_register)) { + echo 'Image'; + } else { + foreach ($arr_cert_register as $img_path) { + echo '' . + 'Image' . + ''; + } } + echo '

'; } - echo '

'; } - } - } else { - if (empty($regist)) { - $regi_img_path = '/plugin/img/photo.gif'; } else { - if (empty($regist['file_path']) || empty($regist['file_name'])) { + if (empty($regist)) { $regi_img_path = '/plugin/img/photo.gif'; } else { - if ($regist['cloud_upload_yn'] == 'Y') { - $regi_img_path = NCLOUD_OBJECT_STORAGE_URL . $regist['file_path'] . $regist['file_name']; + if (empty($regist['file_path']) || empty($regist['file_name'])) { + $regi_img_path = '/plugin/img/photo.gif'; } else { - // 로컬에 저장된 이미지 - $regi_img_path = $regist['file_path'] . $regist['file_name']; + if ($regist['cloud_upload_yn'] == 'Y') { + $regi_img_path = NCLOUD_OBJECT_STORAGE_URL . $regist['file_path'] . $regist['file_name']; + } else { + // 로컬에 저장된 이미지 + $regi_img_path = $regist['file_path'] . $regist['file_name']; + } } } + ?> + +
+
+ 등기부등본 + 보기    + +
-
-
-
- 기본 정보 -
- +
+
+
+
+ 기본 정보 +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
매물번호 +
+ +
+
CP ID + +
현재 상태 + + +
등기부등본
불일치횟수
참고용 파일 + Image'; + } elseif ($file_ext == 'zip') { + echo 'Image'; + } else { + echo 'Image'; + } + } + endif; + } + + if (!empty($data['referenceFileUrl'])) { + $arrRefrenceFileUrl = json_decode($data['referenceFileUrl']); + if (!empty($arrRefrenceFileUrl)): + foreach ($arrRefrenceFileUrl as $rows) { + $file_ext = trim(parseurl($rows)); + if ($file_ext == 'pdf') { + echo 'Image'; + } elseif ($file_ext == 'zip') { + echo "\"Image\""; + } else { + echo "\"Image\""; + } + } + endif; + } + ?> +
+
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
매물번호 -
- -
-
CP ID - -
현재 상태 - - -
등기부등본
불일치횟수
참고용 파일 - Image'; - } elseif ($file_ext == 'zip') { - echo 'Image'; - } else { - echo 'Image'; - } - } - endif; - } - - if (!empty($data['referenceFileUrl'])) { - $arrRefrenceFileUrl = json_decode($data['referenceFileUrl']); - if (!empty($arrRefrenceFileUrl)): - foreach ($arrRefrenceFileUrl as $rows) { - $file_ext = trim(parseurl($rows)); - if ($file_ext == 'pdf') { - echo 'Image'; - } elseif ($file_ext == 'zip') { - echo "\"Image\""; - } else { - echo "\"Image\""; - } - } - endif; - } - ?> -
-
- - - -
-
- 매물 정보 -
-
- - - - - - - - - - - - - - - - - - - - - - - + +
+
+ 매물 정보 +
+
+
등록일시 - -
등기부 고유번호
의뢰인(매도자) - -
매물구분 - -
+ + + + + - + - - + + + + + - - + - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - + echo $th; + ?> + - - - - - - - - - - - - - - - - - - - - - - + @@ -565,460 +542,512 @@ function parseurl($url) - - + + - + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
지역구분등록일시 - +
사용승인일 - + 등기부 고유번호
의뢰인(매도자) +
승인종료일 - + 매물구분 +
단지 정보지역구분 - - - - - - - - - - - - - - - - - - - - - -
단지명 - -
단지주소 -
상세주소 - -
사용승인일단지 총 동수
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
단지명단지타입명 -
소재법정동번호 - -
소재 주소(전체) -
주소(광역시/도)주소(시군구)
주소(읍면동)소재 동이하 상세주소
단지 총 세대수단지 총 동수
- +
사용승인일 + +
승인종료일 + +
단지 정보 + + + + + + + + + + + + + + + + + + + + +
단지명 + +
단지주소 + +
상세주소 + +
사용승인일 + 단지 총 동수 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
단지명 + 단지타입명 +
소재법정동번호 + +
소재 주소(전체) + +
주소(광역시/도)주소(시군구)
주소(읍면동)소재 동이하 상세주소
단지 총 세대수 + 단지 총 동수 +
+ +
리 주소 + +
상세주소 + + + +
+ + + +
+ + + +
+
기타주소 + +
리 주소거래구분/가격 - + / + 만원 + / + 만원 (월)
상세주소평형 - - - -
- - - -
- - - -
+
기타주소 - -
거래구분/가격 - / - 만원 - / - 만원 (월) -
평형 - -
- + - - -
공급면적 - - - +
전용면적 - - - -
단지명 - - - ※ 특이단지 - -
재개발구역명 - -
사업단계설명 - -
공급면적 - +
전용면적 - +
대지면적단지명 - - - + + + ※ 특이단지 + +
재개발구역명 +
연면적사업단계설명 - - - +
대지면적 - -
건축면적 - -
가주소 여부 - > - - -
소유자 구분 - -
검증참고란 - -
미등기 검증요청 여부 - -
건축물대장
면적 검증요청
- -
-
-
- - -
-
- 확인 정보 -
-
- - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - + elseif ( + ($data['rlet_type_cd'] == 'C03' and $data['trade_type_cd'] == 'A1') || + $data['rlet_type_cd'] == 'C04' || + ($data['rlet_type_cd'] == 'C05' and $data['trade_type_cd'] == 'A1') || + $data['rlet_type_cd'] == 'D03' || + $data['rlet_type_cd'] == 'D04' || + $data['rlet_type_cd'] == 'E01' || + $data['rlet_type_cd'] == 'E02' || + $data['rlet_type_cd'] == 'Z00' + ): ?> + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + // 소유자 구분 + switch ($data['ownerTypeCode']): + case "0": + $strOwnerTypeCode = "개인"; + break; + case "1": + $strOwnerTypeCode = "법인"; + break; + case "2": + $strOwnerTypeCode = "외국인"; + break; + case "3": + $strOwnerTypeCode = "위임장"; + break; + endswitch; + ?> - + - - - - - - - - - - - - - - - - - - - - - - - - -
확인담당자 - -       - -
등기부등본
미확인여부
상세
- - - - $value) { - if ($cnt % 2 == 0 && $cnt != 0) { - echo ''; - } - - - ?> - - - - - - 0) { ?> - - - -
-
- - -
-
-
서류확인내용 - $method): ?> + + +
공급면적 + + + +
전용면적 + + + +
대지면적 + + + +
연면적 + + + +
대지면적 + +
건축면적 + +
확인내용 - -
매물주소 - - -
의뢰인정보 - - -
실소유주 확인가주소 여부 - />확인  - />미확인 + > + +
매도자명 - -
소유자명 - -
소유자명 확인 - - > - 일치 - - > - 불일치 -
메모 - -
등기부등본 확인 - - - - - - - 소유자명 확인       - - - - - - - - - - - - - - - - -
-
- -
- - -
-
- 기타 정보 -
-
- - - - - - - - - + + + + + + + + + + + + + + + + + +
소유자명 + 소유자 구분 + +
검증참고란 + +
미등기 검증요청 여부 + +
건축물대장
면적 검증요청
+ +
+
+
+ + +
+
+ 확인 정보 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
확인담당자 + +       + +
등기부등본
미확인여부
상세
+ + + + $value) { + if ($cnt % 2 == 0 && $cnt != 0) { + echo ''; + } + + + ?> + + + + + + 0) { ?> + + + +
+
+ + +
+
+
서류확인내용 + $method): ?> + + + +
확인내용 + +
매물주소 + + +
의뢰인정보 + + +
실소유주 확인 + />확인  + />미확인 +
매도자명 + +
소유자명 + +
소유자명 확인 + + > + 일치 + + > + 불일치 +
메모 + +
등기부등본 확인 + + + + + + + 소유자명 확인       + + + + + + + + + + + + + + + + +
+
+ +
+ + +
+
+ 기타 정보 +
+
+ + + + + + + + + + + + + + > + + - - - > - - - - -
소유자명 + +
소유자 전화번호
소유자 전화번호 - -
-
-
- -
-
- = '35' && $data['stat_cd'] != '39' && $data['stat_cd'] != '49'): - ?> - - - - +
+
-
- - - +
+
+ = '35' && $data['stat_cd'] != '39' && $data['stat_cd'] != '49'): + ?> + + + + +
+ +
+ + + +
+
-
-
+ section('modals') ?>