Merge pull request 'feature/template' (#7) from feature/template into master
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/7
This commit was merged in pull request #7.
This commit is contained in:
@@ -57,7 +57,7 @@ $routes->group('board', ['namespace' => 'App\Controllers\Board'], function ($rou
|
|||||||
*/
|
*/
|
||||||
$routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($routes) {
|
$routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($routes) {
|
||||||
/**
|
/**
|
||||||
* 일반확인매물관리
|
* 확인매물현황
|
||||||
*/
|
*/
|
||||||
$routes->group('m701', static function ($routes) {
|
$routes->group('m701', static function ($routes) {
|
||||||
$routes->get('m701a/lists', 'M701::lists');
|
$routes->get('m701a/lists', 'M701::lists');
|
||||||
@@ -68,7 +68,48 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
|||||||
*/
|
*/
|
||||||
$routes->get('m701a/getResultList', 'M701::getResultList');
|
$routes->get('m701a/getResultList', 'M701::getResultList');
|
||||||
$routes->get('m701a/excel', 'M701::excel');
|
$routes->get('m701a/excel', 'M701::excel');
|
||||||
|
$routes->post('m701a/chgArticleStatus', 'M701::chgArticleStatus'); // 상태정보변경
|
||||||
|
|
||||||
|
$routes->post('m701a/saveMemo', 'M701::saveMemo'); // 메모저장
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 배정매물현황
|
||||||
|
*/
|
||||||
|
$routes->group('m702', static function ($routes) {
|
||||||
|
$routes->get('m702a/lists', 'M702::lists');
|
||||||
|
$routes->get('m702a/detail/(:num)', 'M702::detail/$1');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 배정매물현황 - API
|
||||||
|
*/
|
||||||
|
$routes->get('m702a/getResultList', 'M702::getResultList');
|
||||||
|
$routes->get('m702a/excel', 'M702::excel');
|
||||||
|
$routes->post('m702a/updateAssign', 'M702::updateAssign'); // 배정변경
|
||||||
|
// 서류누락
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 홍보확인서현황
|
||||||
|
*/
|
||||||
|
$routes->group('m703', static function ($routes) {
|
||||||
|
$routes->get('m703a/lists', 'M703::lists');
|
||||||
|
$routes->get('m703a/detail/(:num)', 'M703::detail/$1');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 홍보확인서현황 - API
|
||||||
|
*/
|
||||||
|
$routes->get('m703a/getResultList', 'M703::getResultList');
|
||||||
|
$routes->post('m703a/saveBunyang', 'M703::saveBunyang'); // 현장확인저장
|
||||||
|
$routes->post('m703a/saveOthers', 'M703::saveOthers'); // 홍보확인서아님
|
||||||
|
$routes->post('m703a/saveDuplicate', 'M703::saveDuplicate'); // 중복
|
||||||
|
$routes->post('m703a/saveBubun', 'M703::saveBubun'); // 부분수신
|
||||||
|
$routes->post('m703a/saveFaxImgs', 'M703::saveFaxImgs'); // 매물정보변경
|
||||||
|
$routes->post('m703a/getNextFaxImgs', 'M703::getNextFaxImgs'); // 다음매물정보조회
|
||||||
|
$routes->post('m703a/saveRequestMessage', 'M703::saveRequestMessage'); // 중개사요청사항저장
|
||||||
|
$routes->post('m703a/saveResult', 'M703::saveResult'); // 결과저장
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -128,17 +128,97 @@ class M701 extends BaseController
|
|||||||
|
|
||||||
$codes = $this->codeModel->getCodeLists(['VRFCREQ_WAY', 'CONFIRM_RESULT_D11', 'CONFIRM_RESULT_T11', 'CONSULTANT_COMMENT', 'STEP_VERIFICATION', 'TEL_FAIL_CAUSE']); // 코드조회
|
$codes = $this->codeModel->getCodeLists(['VRFCREQ_WAY', 'CONFIRM_RESULT_D11', 'CONFIRM_RESULT_T11', 'CONSULTANT_COMMENT', 'STEP_VERIFICATION', 'TEL_FAIL_CAUSE']); // 코드조회
|
||||||
|
|
||||||
|
$record = $this->model->getRecordInfo($id, '1'); // 홍보확인서
|
||||||
|
$regist = $this->model->getRecordInfo($id, '2'); // 등기부등본
|
||||||
|
$tel = $this->model->getRecordInfo($id, '3'); // 녹취파일
|
||||||
|
$memo = $this->model->getMemo($id); // 메모
|
||||||
|
|
||||||
$data = $this->model->getDetail($id);
|
$data = $this->model->getDetail($id);
|
||||||
|
|
||||||
$history = $this->model->getHistory($id);
|
$history = $this->model->getHistory($id);
|
||||||
|
|
||||||
$this->data['codes'] = $codes;
|
$this->data['codes'] = $codes;
|
||||||
|
|
||||||
|
$this->data['record'] = $record;
|
||||||
|
$this->data['regist'] = $regist;
|
||||||
|
$this->data['tel'] = $tel;
|
||||||
|
$this->data['memo'] = $memo;
|
||||||
|
|
||||||
$this->data['data'] = $data;
|
$this->data['data'] = $data;
|
||||||
$this->data['history'] = $history;
|
$this->data['history'] = $history;
|
||||||
|
|
||||||
|
|
||||||
return view("pages/v2/m701/detail", $this->data);
|
return view("pages/v2/m701/detail", $this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 상태변경
|
||||||
|
public function chgArticleStatus()
|
||||||
|
{
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$usrLvl = session('usr_level');
|
||||||
|
|
||||||
|
if (in_array($usrLvl, ['1', '60', '70', '80'])) {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'vr_sq' => $this->request->getPost('vr_sq'),
|
||||||
|
'stat_cd' => $this->request->getPost('stat_cd'),
|
||||||
|
];
|
||||||
|
|
||||||
|
// update v2_chg_stat, v2_modify_info, v2_vrfc_req
|
||||||
|
$this->model->chgArticleStatus($data);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '6',
|
||||||
|
'msg' => '권한이 없습니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 전화정보>메모저장
|
||||||
|
public function saveMemo()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'vr_sq' => $this->request->getPost('vr_sq'),
|
||||||
|
'memo' => $this->request->getPost('memo'),
|
||||||
|
];
|
||||||
|
|
||||||
|
// UPDATE v2_vrfc_req
|
||||||
|
$this->model->saveMemo($data);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
195
app/Controllers/V2/M702.php
Normal file
195
app/Controllers/V2/M702.php
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\V2;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\common\CodeModel;
|
||||||
|
use App\Models\v2\M702Model;
|
||||||
|
|
||||||
|
class M702 extends BaseController
|
||||||
|
{
|
||||||
|
private $model;
|
||||||
|
private $codeModel;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M702Model();
|
||||||
|
$this->codeModel = new CodeModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
$codes = $this->codeModel->getCodeLists(['STEP_VERIFICATION', 'VRFCREQ_WAY', 'CP_ID', 'ARTICLE_TYPE']); // 코드조회
|
||||||
|
$sido = $this->model->getAreaList(); // 지역조회
|
||||||
|
$bonbu = $this->model->getBonbuList();
|
||||||
|
$team = $this->model->getTeamList();
|
||||||
|
$user = $this->model->getUserList();
|
||||||
|
|
||||||
|
$this->data['codes'] = $codes;
|
||||||
|
$this->data['sido'] = $sido;
|
||||||
|
$this->data['bonbu'] = $bonbu;
|
||||||
|
$this->data['team'] = $team;
|
||||||
|
$this->data['user'] = $user;
|
||||||
|
|
||||||
|
return view("pages/v2/m702/lists", $this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$start = (int) $this->request->getGet('start') ?: 0;
|
||||||
|
$end = (int) $this->request->getGet('length') ?: 10;
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
|
||||||
|
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
|
||||||
|
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
|
||||||
|
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
|
||||||
|
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
|
||||||
|
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
|
||||||
|
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
|
||||||
|
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
|
||||||
|
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
|
||||||
|
'srcSido' => $this->request->getGet('srcSido'), // 시도
|
||||||
|
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
|
||||||
|
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||||
|
'team' => $this->request->getGet('team'), // 팀
|
||||||
|
'damdang' => $this->request->getGet('damdang'), // 담당
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
|
||||||
|
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
|
||||||
|
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
|
||||||
|
'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
|
||||||
|
'corp_own' => $this->request->getGet('corp_own'), // 법인
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($start, $end, $data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
|
||||||
|
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
|
||||||
|
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
|
||||||
|
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
|
||||||
|
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
|
||||||
|
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
|
||||||
|
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
|
||||||
|
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
|
||||||
|
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
|
||||||
|
'srcSido' => $this->request->getGet('srcSido'), // 시도
|
||||||
|
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
|
||||||
|
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||||
|
'team' => $this->request->getGet('team'), // 팀
|
||||||
|
'damdang' => $this->request->getGet('damdang'), // 담당
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
|
||||||
|
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
|
||||||
|
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
|
||||||
|
'rlet_type_cd' => $this->request->getGet('rlet_type_cd'), // 매물종류
|
||||||
|
'corp_own' => $this->request->getGet('corp_own'), // 법인
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getExcelList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 배정변경
|
||||||
|
public function updateAssign()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$type = $this->request->getPost('type');
|
||||||
|
$rows = $this->request->getPost('rows');
|
||||||
|
$damdang = $this->request->getPost(index: 'damdang2');
|
||||||
|
|
||||||
|
$rows = json_decode($rows, true);
|
||||||
|
|
||||||
|
if (count($rows) > 0) {
|
||||||
|
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
|
||||||
|
$params = [
|
||||||
|
'vr_sq' => $row['vr_sq'],
|
||||||
|
'type' => $type,
|
||||||
|
'damdang' => $damdang,
|
||||||
|
];
|
||||||
|
|
||||||
|
// UPDATE v2_article_info, v2_vrfc_req
|
||||||
|
$this->model->updateAssign($params);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => '데이터 누락'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 상세화면
|
||||||
|
public function detail($id)
|
||||||
|
{
|
||||||
|
$id = (int) $id;
|
||||||
|
|
||||||
|
if ($id <= 0) {
|
||||||
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
$codes = $this->codeModel->getCodeLists(['VRFCREQ_WAY', 'CONFIRM_RESULT_D11', 'CONFIRM_RESULT_T11', 'CONSULTANT_COMMENT', 'TEL_FAIL_CAUSE']); // 코드조회
|
||||||
|
|
||||||
|
$record = $this->model->getRecordInfo($id, '1'); // 홍보확인서
|
||||||
|
$regist = $this->model->getRecordInfo($id, '2'); // 등기부등본
|
||||||
|
$tel = $this->model->getRecordInfo($id, '3'); // 녹취파일
|
||||||
|
$memo = $this->model->getMemo($id); // 메모
|
||||||
|
|
||||||
|
$data = $this->model->getDetail($id);
|
||||||
|
$history = $this->model->getHistory($id);
|
||||||
|
|
||||||
|
|
||||||
|
$this->data['codes'] = $codes;
|
||||||
|
|
||||||
|
$this->data['record'] = $record;
|
||||||
|
$this->data['regist'] = $regist;
|
||||||
|
$this->data['tel'] = $tel;
|
||||||
|
$this->data['memo'] = $memo;
|
||||||
|
|
||||||
|
$this->data['data'] = $data;
|
||||||
|
$this->data['history'] = $history;
|
||||||
|
|
||||||
|
return view("pages/v2/m702/detail", $this->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
607
app/Controllers/V2/M703.php
Normal file
607
app/Controllers/V2/M703.php
Normal file
@@ -0,0 +1,607 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers\V2;
|
||||||
|
|
||||||
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\common\CodeModel;
|
||||||
|
use App\Models\results\M415Model;
|
||||||
|
use App\Models\v2\M703Model;
|
||||||
|
use App\Models\v2\M710Model;
|
||||||
|
|
||||||
|
class M703 extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private $model, $codeModel;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->model = new M703Model();
|
||||||
|
$this->codeModel = new CodeModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function lists()
|
||||||
|
{
|
||||||
|
$codes = $this->codeModel->getCodeLists(['CP_ID', 'STEP_VERIFICATION', 'RECEIPT_STATUS3', 'FAX_CORP']); // 코드조회
|
||||||
|
$sido = $this->model->getAreaList(); // 지역조회
|
||||||
|
$bonbu = $this->model->getBonbuList();
|
||||||
|
$team = $this->model->getTeamList();
|
||||||
|
$user = $this->model->getUserList();
|
||||||
|
|
||||||
|
$this->data['sido'] = $sido;
|
||||||
|
$this->data['bonbu'] = $bonbu;
|
||||||
|
$this->data['team'] = $team;
|
||||||
|
$this->data['user'] = $user;
|
||||||
|
$this->data['codes'] = $codes;
|
||||||
|
|
||||||
|
|
||||||
|
return view("pages/v2/m703/lists", $this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList()
|
||||||
|
{
|
||||||
|
$start = (int) $this->request->getGet('start') ?: 0;
|
||||||
|
$end = (int) $this->request->getGet('length') ?: 10;
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
|
||||||
|
'chk_atcl_no' => $this->request->getGet('chk_atcl_no'), // 매물번호입력
|
||||||
|
'caller_no' => $this->request->getGet('caller_no'), // 발신팩스번호
|
||||||
|
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
|
||||||
|
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
|
||||||
|
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
|
||||||
|
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
|
||||||
|
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
|
||||||
|
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
|
||||||
|
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
|
||||||
|
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
|
||||||
|
'srcSido' => $this->request->getGet('srcSido'), // 시도
|
||||||
|
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
|
||||||
|
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||||
|
'team' => $this->request->getGet('team'), // 팀
|
||||||
|
'damdang' => $this->request->getGet('damdang'), // 담당
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
|
||||||
|
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
|
||||||
|
'target_yn' => $this->request->getGet('target_yn'), // 홍보확인서여부
|
||||||
|
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
|
||||||
|
'chk_rec' => $this->request->getGet('chk_rec'), // 동의서 유무
|
||||||
|
'fax_corp' => $this->request->getGet('fax_corp'), // 팩스업체
|
||||||
|
];
|
||||||
|
|
||||||
|
$totalCount = $this->model->getTotalCount($data);
|
||||||
|
|
||||||
|
$datas = $this->model->getResultList($start, $end, $data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'recordsTotal' => $totalCount,
|
||||||
|
'recordsFiltered' => $totalCount,
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function excel()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'atcl_no' => $this->request->getGet('atcl_no'), // 매물번호
|
||||||
|
'chk_atcl_no' => $this->request->getGet('chk_atcl_no'), // 매물번호입력
|
||||||
|
'caller_no' => $this->request->getGet('caller_no'), // 발신팩스번호
|
||||||
|
'stat_cd' => $this->request->getGet('stat_cd'), // 현재상태
|
||||||
|
'realtor_nm' => $this->request->getGet('realtor_nm'), // 중개소
|
||||||
|
'charger_gbn' => $this->request->getGet('charger_gbn'), // 배정여부
|
||||||
|
'assign_yn' => $this->request->getGet('assign_yn'), // 배정여부2
|
||||||
|
'receipt_sdate' => $this->request->getGet('receipt_sdate'), // 접수기간1
|
||||||
|
'receipt_edate' => $this->request->getGet('receipt_edate'), // 접수기간2
|
||||||
|
'complete_sdate' => $this->request->getGet('complete_sdate'), // 완료기간1
|
||||||
|
'complete_edate' => $this->request->getGet('complete_edate'), // 완료기간2
|
||||||
|
'srcSido' => $this->request->getGet('srcSido'), // 시도
|
||||||
|
'srcGugun' => $this->request->getGet('srcGugun'), // 시군구
|
||||||
|
'srcDong' => $this->request->getGet('srcDong'), // 읍면동
|
||||||
|
'bonbu' => $this->request->getGet('bonbu'), // 본부
|
||||||
|
'team' => $this->request->getGet('team'), // 팀
|
||||||
|
'damdang' => $this->request->getGet('damdang'), // 담당
|
||||||
|
'vrfcreq_way' => $this->request->getGet('vrfcreq_way'), // 검증방식1
|
||||||
|
'vrfc_type_sub' => $this->request->getGet('vrfc_type_sub'), // 검증방식2
|
||||||
|
'target_yn' => $this->request->getGet('target_yn'), // 홍보확인서여부
|
||||||
|
'rcpt_cpid' => $this->request->getGet('rcpt_cpid'), // 매체사
|
||||||
|
'chk_rec' => $this->request->getGet('chk_rec'), // 동의서 유무
|
||||||
|
'fax_corp' => $this->request->getGet('fax_corp'), // 팩스업체
|
||||||
|
];
|
||||||
|
|
||||||
|
$datas = $this->model->getExcelList($data);
|
||||||
|
|
||||||
|
return $this->response->setJSON(body: [
|
||||||
|
'data' => $datas,
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$e->getPrevious()->getTraceAsString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 상세화면
|
||||||
|
public function detail($id)
|
||||||
|
{
|
||||||
|
$id = (int) $id;
|
||||||
|
|
||||||
|
if ($id <= 0) {
|
||||||
|
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
$codes = $this->codeModel->getCodeLists(['CONFIRM_RESULT_D11', 'CONSULTANT_COMMENT', 'TRADE_TYPE', 'VRFCREQ_WAY']); // 코드조회
|
||||||
|
|
||||||
|
$data = $this->model->getDetail($id);
|
||||||
|
|
||||||
|
|
||||||
|
$article = null;
|
||||||
|
$confirm = null;
|
||||||
|
if (!empty($data)) {
|
||||||
|
switch ($data['work_type']) {
|
||||||
|
case "1": // 현장확인 매물
|
||||||
|
$article = $this->model->getArticleInfo1($data['atcl_no']);
|
||||||
|
$article['stat_cd'] = $data['stat_cd'];
|
||||||
|
$confirm = $this->model->getV2Confirm($data['vr_sq'], $data['work_type']);
|
||||||
|
break;
|
||||||
|
case "2": // 일반확인 매물
|
||||||
|
$article = $this->model->getArticleInfo2($data['atcl_no']);
|
||||||
|
$confirm = $this->model->getV2Confirm($data['vr_sq']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->data['article'] = $article;
|
||||||
|
$this->data['confirm'] = $confirm;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 단지번호
|
||||||
|
$hscp_info = [];
|
||||||
|
if (!empty($article['hscp_no'])) {
|
||||||
|
$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']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($article['rlet_type_cd'], $villa_rlet_type_cd)) { // villa 단지
|
||||||
|
// $detail_hscp = $this->call_kiso_api->villaDetail($article['hscp_no']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->data['hscp_info'] = $hscp_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$memo = $this->model->getMomo($data['vr_sq']);
|
||||||
|
$history = $this->model->getHistory($data['vr_sq'], $data['work_type']);
|
||||||
|
|
||||||
|
$this->data['codes'] = $codes;
|
||||||
|
|
||||||
|
$this->data['data'] = $data;
|
||||||
|
$this->data['memo'] = $memo;
|
||||||
|
$this->data['history'] = $history;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return view("pages/v2/m703/detail", $this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 현장확인 저장
|
||||||
|
public function saveBunyang()
|
||||||
|
{
|
||||||
|
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');
|
||||||
|
$work_type = '1';
|
||||||
|
$result_d11 = $this->request->getPost('result_d11');
|
||||||
|
$comment_d11 = $this->request->getPost('comment_d11');
|
||||||
|
|
||||||
|
$fax_conf_yn_1 = $this->request->getPost('fax_conf_yn_1');
|
||||||
|
$fax_conf_yn_2 = $this->request->getPost('fax_conf_yn_2');
|
||||||
|
$fax_conf_yn_3 = $this->request->getPost('fax_conf_yn_3');
|
||||||
|
|
||||||
|
$fax_conf_info_1 = $this->request->getPost('fax_conf_info_1');
|
||||||
|
$fax_conf_info_2 = $this->request->getPost('fax_conf_info_2');
|
||||||
|
$fax_conf_info_3 = $this->request->getPost('fax_conf_info_3');
|
||||||
|
|
||||||
|
$resyn = $this->request->getPost('resYn');
|
||||||
|
$dbusageagryn = $this->request->getPost('dbUsageAgrYn');
|
||||||
|
$memo1 = $this->request->getPost('memo_vie'); //메모
|
||||||
|
$memo2 = $this->request->getPost('memo_cal'); //메모
|
||||||
|
|
||||||
|
if (empty($memo1)) {
|
||||||
|
$memo = $memo2;
|
||||||
|
} else {
|
||||||
|
$memo = $memo1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->model->saveReceiptFax($memo, $fax_sq, $vr_sq, $atcl_no, $work_type, $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);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 홍보확인서 아님
|
||||||
|
public function saveOthers()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$fax_sq = $this->request->getPost('fax_sq');
|
||||||
|
|
||||||
|
$this->model->saveNotArticleFax($fax_sq);
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중복저장
|
||||||
|
public function saveDuplicate()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$fax_sq = $this->request->getPost('fax_sq');
|
||||||
|
$atcl_no = $this->request->getPost('atcl_no');
|
||||||
|
$vr_sq = $this->request->getPost('vr_sq');
|
||||||
|
|
||||||
|
$this->model->saveDuplicateFax($fax_sq, $atcl_no, $vr_sq);
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 부분수신
|
||||||
|
public function saveBubun()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$fax_sq = $this->request->getPost('fax_sq');
|
||||||
|
|
||||||
|
|
||||||
|
$this->model->saveBubunFax($fax_sq);
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매물정보 변경
|
||||||
|
public function saveFaxImgs()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$vr_sq = $this->request->getPost('vr_sq'); // 확인요청순번
|
||||||
|
$atcl_no = $this->request->getPost('atcl_no'); // 매물번호
|
||||||
|
$fax_sq = $this->request->getPost('fax_sq'); // fax 순번
|
||||||
|
$trade_type = $this->request->getPost('trade_type'); // 거래구분
|
||||||
|
$deal_amt = $this->request->getPost('deal_amt'); // 매매가
|
||||||
|
$wrrnt_amt = $this->request->getPost('wrrnt_amt'); // 전세가
|
||||||
|
$lease_amt = $this->request->getPost('lease_amt'); // 월세가
|
||||||
|
$isale_amt = $this->request->getPost('isale_amt'); // 분양가
|
||||||
|
$prem_amt = $this->request->getPost('prem_amt'); // 프리미엄
|
||||||
|
|
||||||
|
|
||||||
|
$this->model->saveFaxImgInfo($fax_sq, $vr_sq, $atcl_no, $trade_type, $deal_amt, $wrrnt_amt, $lease_amt, $isale_amt, $prem_amt);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 중개사 요청사항(메모) 저장
|
||||||
|
public function saveRequestMessage()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
$rcpt_sq = $this->request->getPost('vr_sq');
|
||||||
|
$atcl_no = $this->request->getPost('atcl_no');
|
||||||
|
$fax_sq = $this->request->getPost('fax_sq'); // FAX 순번
|
||||||
|
$msg = $this->request->getPost('msg');
|
||||||
|
|
||||||
|
$rsrv_sq = $this->request->getPost('rsrv_sq');
|
||||||
|
|
||||||
|
// UPDATE result
|
||||||
|
$this->model->saveRequestMessage($rcpt_sq, $rsrv_sq, $msg);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success'
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 다음 매물정보 조회
|
||||||
|
public function getNextFaxImgs()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$curr_fax_sq = $this->request->getPost('curr_fax_sq');
|
||||||
|
|
||||||
|
$data = $this->model->getNextFaxImgs($curr_fax_sq);
|
||||||
|
|
||||||
|
if (empty($data)) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => 'FAX 이미지가 존재하지 않습니다.'
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success',
|
||||||
|
'data' => $data
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 결과저장
|
||||||
|
public function saveResult()
|
||||||
|
{
|
||||||
|
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');
|
||||||
|
$result_d11 = $this->request->getPost('result_d11');
|
||||||
|
$comment_d11 = $this->request->getPost('comment_d11');
|
||||||
|
|
||||||
|
$fax_conf_yn_1 = $this->request->getPost('fax_conf_yn_1');
|
||||||
|
$fax_conf_yn_2 = $this->request->getPost('fax_conf_yn_2');
|
||||||
|
$fax_conf_yn_3 = $this->request->getPost('fax_conf_yn_3');
|
||||||
|
|
||||||
|
$fax_conf_info_1 = $this->request->getPost('fax_conf_info_1');
|
||||||
|
$fax_conf_info_2 = $this->request->getPost('fax_conf_info_2');
|
||||||
|
$fax_conf_info_3 = $this->request->getPost('fax_conf_info_3');
|
||||||
|
|
||||||
|
$resyn = $this->request->getPost('resYn');
|
||||||
|
$dbusageagryn = $this->request->getPost('dbUsageAgrYn');
|
||||||
|
$memo = $this->request->getPost('memo_cal'); //메모
|
||||||
|
|
||||||
|
$m415 = new M415Model();
|
||||||
|
|
||||||
|
|
||||||
|
$article = $this->model->getArticleInfo2($atcl_no, $vr_sq);
|
||||||
|
$v2_vrfc_req = $this->model->get_v2_vrfc_req($vr_sq);
|
||||||
|
|
||||||
|
$stat = intval($article['stat_cd']);
|
||||||
|
if ($stat > 40) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => '이미 저장된 데이터입니다.',
|
||||||
|
]);
|
||||||
|
} else if ($stat == 19) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => '해당 매물은 등록 취소된 매물입니다.',
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
//거주여부 & DB활용동의여부 수정 UPDATE
|
||||||
|
if (!empty($resyn)) {
|
||||||
|
$this->model->updateResDB($resyn, $dbusageagryn, $vr_sq);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DB에 결과를 저장한다.
|
||||||
|
$return = $this->model->saveArticleFAX($memo, $fax_sq, $vr_sq, $atcl_no, $work_type, $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);
|
||||||
|
|
||||||
|
if (empty($return['code']) && $work_type == "2") {
|
||||||
|
// 검증센터에 데이터를 전송한다.
|
||||||
|
$m710Model = new M710Model();
|
||||||
|
$sendData = $this->model->getDataConfirmAPI($vr_sq);
|
||||||
|
|
||||||
|
$h_yn = $this->model->get_send_yn('H');
|
||||||
|
if ($h_yn['stop_yn'] == 'N') { //전송금지
|
||||||
|
//1.해당매물정보를v2_stop_api_save_info에다 넣음
|
||||||
|
$m710Model->insert_v2_stop_api_save_info($sendData['atclNo'], $vr_sq, 'H', $fax_sq);
|
||||||
|
|
||||||
|
//2.아무렇지않게 행동한다
|
||||||
|
$send_result['result'] = 'success';
|
||||||
|
} else {
|
||||||
|
// $this->load->library('call_kiso_api');
|
||||||
|
// $send_result = $this->call_kiso_api->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 ($fax_conf_info_3 != 'Y' || intval($sendData['try_cnt']) < 1) {
|
||||||
|
$stat_cd = '30';
|
||||||
|
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd);
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => '의뢰인 정보 불일치로 저장되었습니다.',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($sendData['try_cnt'] >= '1') {
|
||||||
|
$stat_cd = '69'; // 검증실패
|
||||||
|
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경
|
||||||
|
|
||||||
|
//★ 검증실패면 검증실패시간 업데이트하고 검증소요시간, 전체소요시간 산출
|
||||||
|
//1.서류전화 들어온시간
|
||||||
|
$insert_tm = $m415->getFaxSaveTime($vr_sq);
|
||||||
|
//2.서류/전화 불일치 시간
|
||||||
|
$tel_doc_conf_dt = $m415->getFaxFailTimeForHistory($vr_sq);
|
||||||
|
//3.검증실패시간
|
||||||
|
$finishTime = $m415->get_69_ForHistory($vr_sq);
|
||||||
|
//3.해당 정보를 테이블에 넣는다
|
||||||
|
$m415->insert_v2_time_required_Conf_Done($atcl_no, $article['cpid'], $article['vrfc_type'], $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $finishTime['insert_tm']);
|
||||||
|
|
||||||
|
$this->model->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0302', '1', 'add'); // 최종실패로 저장
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//★ 1차실패니까 검증실패시간 업데이트하고 검증소요시간 산출
|
||||||
|
//1.서류전화 들어온시간
|
||||||
|
$insert_tm = $m415->getFaxSaveTime($vr_sq);
|
||||||
|
//2.서류/전화 불일치 시간
|
||||||
|
$tel_doc_conf_dt = $m415->getFaxFailTimeForHistory($vr_sq);
|
||||||
|
//3.해당 정보를 테이블에 넣는다
|
||||||
|
$sf = 'F';
|
||||||
|
$m415->insert_v2_time_required_Conf($atcl_no, $article['cpid'], $article['vrfc_type'], $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $sf);
|
||||||
|
|
||||||
|
$this->model->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0301', '1', 'add'); // 1차실패로 저장
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->model->increseTryCnt($vr_sq);
|
||||||
|
|
||||||
|
if ($result_d11 == '20013') {
|
||||||
|
$this->model->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0203', '1', 'add'); // 기타로 저장
|
||||||
|
} else {
|
||||||
|
$this->model->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0202', '1', 'add'); // 불일치로 저장
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
log_message('debug', '703 save stat_cd = 35 start ::: ' . $vr_sq);
|
||||||
|
$stat_cd = '35'; // 서류/전화 확인 성공
|
||||||
|
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 전송완료 상태로 변경
|
||||||
|
|
||||||
|
if ($article['vrfc_type_sub'] == "D2") {
|
||||||
|
log_message('debug', '703 save stat_cd = 35 D2 ::: ' . $vr_sq);
|
||||||
|
$rgbk_confirm = $this->model->getRgbk_confirm($vr_sq);
|
||||||
|
|
||||||
|
if ($rgbk_confirm == '1') {
|
||||||
|
log_message('debug', '703 save stat_cd = 35 rgbk_confirm ::: ' . $vr_sq);
|
||||||
|
if ($this->model->check_chg_stat49($vr_sq)) {
|
||||||
|
log_message('debug', '703 save stat_cd = 40 savechangeStep ::: ' . $vr_sq);
|
||||||
|
$stat_cd = '40';
|
||||||
|
$this->model->saveChangeStep($fax_sq, $vr_sq, $stat_cd); // 등기부등본 확인중 상태로 변경..
|
||||||
|
}
|
||||||
|
|
||||||
|
//★등기 로 넘어갈때
|
||||||
|
//1.서류전화 들어온시간
|
||||||
|
$insert_tm = $m415->getFaxSaveTime($vr_sq);
|
||||||
|
log_message('debug', '703 save stat_cd = 35 insert_tm ::: ' . $insert_tm['recv_time']);
|
||||||
|
//2.서류/전화 확인일자
|
||||||
|
$tel_doc_conf_dt = $m415->get_cert_ing_TimeForHistory($vr_sq);
|
||||||
|
log_message('debug', '703 save stat_cd = 35 tel_doc_conf_dt ::: ' . $tel_doc_conf_dt['insert_tm']);
|
||||||
|
|
||||||
|
//3.해당 정보를 테이블에 넣는다
|
||||||
|
if (empty($tel_doc_conf_dt)) {
|
||||||
|
$tel_doc_conf_dt['insert_tm'] = date("Y-m-d H:i:s");
|
||||||
|
log_message('debug', '703 save stat_cd = 35 tel_doc_conf_dt null ::: ' . $tel_doc_conf_dt['insert_tm']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sf = 'T';
|
||||||
|
$m415->insert_v2_time_required_Conf($atcl_no, $article['cpid'], $article['vrfc_type'], $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $sf);
|
||||||
|
log_message('debug', '703 save stat_cd = 35 insert_v2_time_required_Conf ::: ' . json_encode(array($atcl_no, $article['cpid'], $article['vrfc_type'], $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $sf)));
|
||||||
|
|
||||||
|
$this->model->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); // 검증완료 상태로 변경
|
||||||
|
|
||||||
|
//★검증완료일때
|
||||||
|
//0.불일치 이력이 있는지 확인
|
||||||
|
$cnt = $m415->getFaxFailTimeForHistory($vr_sq);
|
||||||
|
if (empty($cnt)) { //검증완료일땐 불일치가없어야 통계포함된다
|
||||||
|
//1.서류전화 들어온시간
|
||||||
|
$insert_tm = $m415->getFaxSaveTime($vr_sq);
|
||||||
|
//2.서류/전화 확인일자
|
||||||
|
$tel_doc_conf_dt = $m415->getConfTimeForHistory($vr_sq);
|
||||||
|
//3.검증시간
|
||||||
|
$finishTime = $m415->get_60_ForHistory($vr_sq);
|
||||||
|
//3.해당 정보를 테이블에 넣는다
|
||||||
|
$m415->insert_v2_time_required_Conf_Done($atcl_no, $article['cpid'], $article['vrfc_type'], $insert_tm['recv_time'], $tel_doc_conf_dt['insert_tm'], $finishTime['insert_tm']);
|
||||||
|
}
|
||||||
|
$this->model->set_v2_st_daily(NULL, $v2_vrfc_req['cpid'], 'D0205', '1', 'add'); // 홍보확인서완료 등기부등본확인 안함 저장
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$return = $send_result['error'];
|
||||||
|
$err_time = date("Y-m-d H:i:s");
|
||||||
|
$this->model->saveApiErr($fax_sq, $send_result['error']['code'], $send_result['error']['message'], $err_time, $v2_vrfc_req['atcl_no']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
149
app/Models/receipt/ReceiptModel.php
Normal file
149
app/Models/receipt/ReceiptModel.php
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\receipt;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class ReceiptModel extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 홍보확인서 fax 목록에서 선택할 경우.
|
||||||
|
*/
|
||||||
|
public function saveFaxImage($faxSq, $rcpt_sq, $rsrv_sq, $img_type, $img_path, $img_filenm, $img_nm, $img_size, $img_width, $img_height, $receipt)
|
||||||
|
{
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$usr_sq = session('usr_sq');
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
$sql = "";
|
||||||
|
$data = [];
|
||||||
|
$res = "";
|
||||||
|
$remark = "";
|
||||||
|
|
||||||
|
$result_img = [];
|
||||||
|
|
||||||
|
if ($img_type == 'I8') {
|
||||||
|
$yn_sql = "update receipt " .
|
||||||
|
" set parcel_out_yn = 'Y' " .
|
||||||
|
" where rcpt_sq = ? ";
|
||||||
|
$yn_data = [$rcpt_sq];
|
||||||
|
$this->db->query($yn_sql, $yn_data);
|
||||||
|
|
||||||
|
$sql = "update fax_imgs " .
|
||||||
|
" set bunyang_yn = 'Y' " .
|
||||||
|
" where fax_sq = ? ";
|
||||||
|
$data = [$faxSq];
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
//홍보확인서, 현장확인 내역서 저장
|
||||||
|
if ($img_type == 'I1' || $img_type == 'I2' || $img_type == 'I10') {
|
||||||
|
//기존에 있던 이미지는 사용유무 N으로 변경
|
||||||
|
$sql = "select img_sq from result_imgs" .
|
||||||
|
" WHERE rsrv_sq = ?" .
|
||||||
|
" AND img_type = ?" .
|
||||||
|
" AND use_yn = 'Y'";
|
||||||
|
$data = [$rsrv_sq, $img_type];
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
$row = $res->getRowArray();
|
||||||
|
if (!empty($row)) {
|
||||||
|
$this->updateImgSqNullOnFaxImgs($row['img_sq']); // 홍보확인서 재지정일
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "UPDATE result_imgs" .
|
||||||
|
" SET use_yn = 'N'" .
|
||||||
|
" WHERE rsrv_sq = ?" .
|
||||||
|
" AND img_type = ?" .
|
||||||
|
" AND use_yn = 'Y'";
|
||||||
|
$data = [$rsrv_sq, $img_type];
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
|
||||||
|
//새로운 이미지 생성
|
||||||
|
$sql = "INSERT INTO result_imgs(rsrv_sq, use_yn, img_type, view_odr, img_path, img_filenm, img_nm, img_size, img_width, img_height, insert_usr, insert_tm)" .
|
||||||
|
"VALUES (?, 'Y', ?, 1, ?, ?, ?, ?, ?, ?, ?, NOW())";
|
||||||
|
$data = [$rsrv_sq, $img_type, $img_path, $img_filenm, $img_nm, $img_size, $img_width, $img_height, $usr_sq];
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
|
||||||
|
if ($img_type == 'I1')
|
||||||
|
$remark = "홍보확인서 사진 업로드";
|
||||||
|
else if ($img_type == 'I2')
|
||||||
|
$remark = "현장확인 내역서 사진 업로드";
|
||||||
|
else if ($img_type == 'I10')
|
||||||
|
$remark = "촬영동의서 사진 업로드";
|
||||||
|
else if ($img_type == 'I11')
|
||||||
|
$remark = "체크리스트 사진 업로드";
|
||||||
|
} else {
|
||||||
|
//이미지 순번 검색
|
||||||
|
$odr_sql = "SELECT COALESCE(MAX(view_odr), 0) + 1 as seq FROM result_imgs WHERE rsrv_sq = ? AND img_type = ? AND use_yn = 'Y'";
|
||||||
|
$odr_data = [$rsrv_sq, $img_type];
|
||||||
|
$query = $this->db->query($odr_sql, $odr_data);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
$view_odr = $row['seq'];
|
||||||
|
|
||||||
|
$sql = "INSERT INTO result_imgs(rsrv_sq, use_yn, img_type, view_odr, img_path, img_filenm, img_nm, img_size, img_width, img_height, insert_usr, insert_tm)" .
|
||||||
|
"VALUES (?, 'Y', ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW())";
|
||||||
|
$data = array(
|
||||||
|
$rsrv_sq,
|
||||||
|
$img_type,
|
||||||
|
$view_odr,
|
||||||
|
$img_path,
|
||||||
|
$img_filenm,
|
||||||
|
$img_nm,
|
||||||
|
$img_size,
|
||||||
|
$img_width,
|
||||||
|
$img_height,
|
||||||
|
$usr_sq
|
||||||
|
);
|
||||||
|
|
||||||
|
$res = $this->db->query($sql, $data);
|
||||||
|
|
||||||
|
if ($img_type == 'I3')
|
||||||
|
$remark = "건물외관 사진 업르도";
|
||||||
|
else if ($img_type == 'I4')
|
||||||
|
$remark = "내부 사진 업로드";
|
||||||
|
else if ($img_type == 'I8')
|
||||||
|
$remark = "분양권 사진 업로드";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$imgSq = $this->db->insertID();
|
||||||
|
$this->updateImgSqOnFaxImgs($faxSq, $imgSq);
|
||||||
|
|
||||||
|
if (!$res) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 홍보확인서를 재지정했을 경우 기존의 홍보확인서는 선택되지 않음으로 ...
|
||||||
|
*/
|
||||||
|
public function updateImgSqNullOnFaxImgs($imgSq)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE fax_imgs" .
|
||||||
|
" SET img_sq = null" .
|
||||||
|
" WHERE img_sq = ?";
|
||||||
|
$data = [$imgSq];
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FAX이미지를 홍보확인서에서 선택할 경우...
|
||||||
|
*/
|
||||||
|
public function updateImgSqOnFaxImgs($faxSq, $imgSq)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE fax_imgs" .
|
||||||
|
" SET img_sq = ?" .
|
||||||
|
" WHERE fax_sq = ?";
|
||||||
|
|
||||||
|
$data = [$imgSq, $faxSq];
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -155,4 +155,187 @@ class M415Model extends Model
|
|||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 팩스 인입시간
|
||||||
|
public function getFaxSaveTime($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT recv_time from fax_imgs" .
|
||||||
|
" WHERE vr_sq = ?" .
|
||||||
|
" ORDER BY fax_sq DESC" .
|
||||||
|
" LIMIT 1";
|
||||||
|
$data = [
|
||||||
|
$vr_sq
|
||||||
|
];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
|
||||||
|
$res = $query->getRowArray();
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 서류/전화 불일치 시간
|
||||||
|
public function getFaxFailTimeForHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "select insert_tm from v2_chg_history" .
|
||||||
|
" where vr_sq = ?" .
|
||||||
|
" and stat_cd = '39'" .
|
||||||
|
" and chg_type= 'C9'" .
|
||||||
|
" order by seq desc" .
|
||||||
|
" limit 1";
|
||||||
|
$data = [
|
||||||
|
$vr_sq
|
||||||
|
];
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
// echo $this->db->last_query().'<br>';
|
||||||
|
$res = $query->row_array();
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 등기부등본 확인중 시간, 서류에서 등기로 넘어갈때 간혹 서류전화 확인 완료가 안찍히는 건들이 있다
|
||||||
|
public function get_cert_ing_TimeForHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "select insert_tm from v2_chg_history" .
|
||||||
|
" where vr_sq = ?" .
|
||||||
|
" and stat_cd = '40'" .
|
||||||
|
" and chg_type= 'C9'" .
|
||||||
|
" order by seq desc" .
|
||||||
|
" limit 1";
|
||||||
|
$data = array(
|
||||||
|
$vr_sq
|
||||||
|
);
|
||||||
|
$query = $this->db->query($sql, $data);
|
||||||
|
// echo $this->db->last_query().'<br>';
|
||||||
|
$res = $query->row_array();
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
//서류전화 (검증실패/검증완료)
|
||||||
|
public function insert_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $insert_tm, $tel_doc_conf_dt, $finishTime)
|
||||||
|
{
|
||||||
|
if (substr($insert_tm, 0, 10) == substr($tel_doc_conf_dt, 0, 10)) {
|
||||||
|
switch ($vrfc_type) {
|
||||||
|
case 'D':
|
||||||
|
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
|
||||||
|
if (substr($tel_doc_conf_dt, -8) > '13:00:00') { //검증완료가 13시 '이후'에 끝나면 접수시간을 13시로 변경해준다
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 13:00:00";
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') && //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이가 아니면
|
||||||
|
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||||
|
) {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'T':
|
||||||
|
if (('13:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '14:00:00')) {//접수시간이 13~14시 사이면 14시로 해준다
|
||||||
|
if (substr($tel_doc_conf_dt, -8) > '14:00:00') { //검증완료가 14시 '이후'에 끝나면 접수시간을 14시로 변경해준다
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 14:00:00";
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') &&
|
||||||
|
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||||
|
) { //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이면
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($vrfc_type == 'D') { //홍보
|
||||||
|
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||||
|
}
|
||||||
|
} else { //전화
|
||||||
|
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$stan_date = substr($insert_tm, 0, 10);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, tel_doc_conf_dt,conf_required_tm,tot_required_tm)" .
|
||||||
|
" VALUES(?, ?, ?, ?, ?, ?, TIMEDIFF(?,?), TIMEDIFF(?,?)) " .
|
||||||
|
" ON DUPLICATE KEY UPDATE insert_tm = VALUES(insert_tm), tel_doc_conf_dt=VALUES(tel_doc_conf_dt),conf_required_tm = VALUES(conf_required_tm),tot_required_tm = VALUES(tot_required_tm) ";
|
||||||
|
$data = [
|
||||||
|
$stan_date,
|
||||||
|
$atcl_no,
|
||||||
|
$cpid,
|
||||||
|
$vrfc_type,
|
||||||
|
$insert_tm,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$insert_tm,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$insert_tm
|
||||||
|
];
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
//서류전화 확인완료(일치/불일치)
|
||||||
|
//서류전화 (검증실패/검증완료)
|
||||||
|
public function insert_v2_time_required_Conf($atcl_no, $cpid, $vrfc_type, $insert_tm, $tel_doc_conf_dt, $finishTime)
|
||||||
|
{
|
||||||
|
if (substr($insert_tm, 0, 10) == substr($tel_doc_conf_dt, 0, 10)) {
|
||||||
|
switch ($vrfc_type) {
|
||||||
|
case 'D':
|
||||||
|
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
|
||||||
|
if (substr($tel_doc_conf_dt, -8) > '13:00:00') { //검증완료가 13시 '이후'에 끝나면 접수시간을 13시로 변경해준다
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 13:00:00";
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') && //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이가 아니면
|
||||||
|
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||||
|
) {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'T':
|
||||||
|
if (('13:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '14:00:00')) {//접수시간이 13~14시 사이면 14시로 해준다
|
||||||
|
if (substr($tel_doc_conf_dt, -8) > '14:00:00') { //검증완료가 14시 '이후'에 끝나면 접수시간을 14시로 변경해준다
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 14:00:00";
|
||||||
|
}
|
||||||
|
} else if (
|
||||||
|
(substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') &&
|
||||||
|
(substr($tel_doc_conf_dt, -8) < '17:30:00' || substr($tel_doc_conf_dt, -8) < '08:59:59')
|
||||||
|
) { //접수와 확인완료시간이 모두 17:30:00 ~ 09:00:00 사이면
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||||
|
}
|
||||||
|
;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($vrfc_type == 'D') { //홍보
|
||||||
|
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:00:00";
|
||||||
|
}
|
||||||
|
} else { //전화
|
||||||
|
if (substr($insert_tm, -8) > '17:30:00' || substr($insert_tm, -8) < '08:59:59') {
|
||||||
|
$insert_tm = date("Y-m-d", time()) . " 09:30:00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$stan_date = substr($insert_tm, 0, 10);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, tel_doc_conf_dt,conf_required_tm,tot_required_tm)" .
|
||||||
|
" VALUES(?, ?, ?, ?, ?, ?, TIMEDIFF(?,?), TIMEDIFF(?,?)) " .
|
||||||
|
" ON DUPLICATE KEY UPDATE insert_tm = VALUES(insert_tm), tel_doc_conf_dt=VALUES(tel_doc_conf_dt),conf_required_tm = VALUES(conf_required_tm),tot_required_tm = VALUES(tot_required_tm) ";
|
||||||
|
$data = array(
|
||||||
|
$stan_date,
|
||||||
|
$atcl_no,
|
||||||
|
$cpid,
|
||||||
|
$vrfc_type,
|
||||||
|
$insert_tm,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$insert_tm,
|
||||||
|
$tel_doc_conf_dt,
|
||||||
|
$insert_tm
|
||||||
|
);
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -682,6 +682,29 @@ class M701Model extends Model
|
|||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 홍보확인서 정보
|
||||||
|
public function getRecordInfo($vr_sq, $file_type)
|
||||||
|
{
|
||||||
|
$sql = "SELECT seq, vr_sq, use_yn, file_type, view_odr, IFNULL(file_path , '') AS file_path, IFNULL(file_name, '') AS file_name, file_ext, file_size, img_width, img_height, meta_data, insert_user, insert_tm, cloud_upload_yn
|
||||||
|
FROM v2_files
|
||||||
|
WHERE vr_sq = ? AND use_yn = 'Y' AND file_type = ?
|
||||||
|
ORDER BY seq DESC ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq, $file_type]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 메모확인
|
||||||
|
public function getMemo($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT memo FROM v2_vrfc_req where vr_sq = ?";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 상세화면
|
// 상세화면
|
||||||
public function getDetail($id)
|
public function getDetail($id)
|
||||||
@@ -692,7 +715,7 @@ class M701Model extends Model
|
|||||||
a.hscplqry_lv,
|
a.hscplqry_lv,
|
||||||
b.tel_fail_cause,
|
b.tel_fail_cause,
|
||||||
a.reg_charger,
|
a.reg_charger,
|
||||||
i2.usr_nm as reg_charger_nm,
|
i2.usr_nm AS reg_charger_nm,
|
||||||
a.atcl_no,
|
a.atcl_no,
|
||||||
b.try_cnt,
|
b.try_cnt,
|
||||||
a.cpid,
|
a.cpid,
|
||||||
@@ -852,4 +875,103 @@ class M701Model extends Model
|
|||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 상태변경
|
||||||
|
public function chgArticleStatus($data)
|
||||||
|
{
|
||||||
|
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$sql = "INSERT INTO v2_chg_stat
|
||||||
|
(vr_sq, stat_cd, insert_user, insert_tm)
|
||||||
|
VALUES
|
||||||
|
({$data['vr_sq']}, '{$data['stat_cd']}', '{$usr_id}', NOW())
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($this->db->query($sql) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$detail = $this->getDetail($data['vr_sq']);
|
||||||
|
|
||||||
|
$memo = "상태변경 : " . $detail['stat_cd'] . " => " . $data['stat_cd'];
|
||||||
|
$this->saveHistory($data['vr_sq'], $data['stat_cd'], 'C9', $usr_id, $memo);
|
||||||
|
|
||||||
|
$sql = "UPDATE v2_modify_info SET
|
||||||
|
modify_yn = 'Y'
|
||||||
|
WHERE vr_sq = {$data['vr_sq']}
|
||||||
|
";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "UPDATE v2_vrfc_req SET
|
||||||
|
stat_cd = '{$data['stat_cd']}'
|
||||||
|
WHERE vr_sq = {$data['vr_sq']}
|
||||||
|
";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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['memo'], $data['vr_sq']]) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$detail = $this->getDetail($data['vr_sq']);
|
||||||
|
|
||||||
|
$memo = "메모변경 : " . $detail['memo'] . " => " . $data['memo'];
|
||||||
|
$this->saveHistory($data['vr_sq'], $data['pre_stat_cd'], 'C19', $usr_id, $memo);
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 변경이력 저장
|
||||||
|
public function saveHistory($vr_sq, $stat_cd, $chg_type, $usr_id, $memo)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_chg_history
|
||||||
|
(vr_sq, stat_cd, chg_type, insert_id, insert_tm, memo)
|
||||||
|
VALUES
|
||||||
|
(?, ?, ?, ?, NOW(), ?)
|
||||||
|
";
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
$vr_sq,
|
||||||
|
$stat_cd,
|
||||||
|
$chg_type,
|
||||||
|
$usr_id,
|
||||||
|
$memo
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
953
app/Models/v2/M702Model.php
Normal file
953
app/Models/v2/M702Model.php
Normal file
@@ -0,0 +1,953 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\v2;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M702Model extends Model
|
||||||
|
{
|
||||||
|
// 지역 목록 조회
|
||||||
|
public function getAreaList($sido = '', $gugun = '')
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!empty($gugun)) {
|
||||||
|
$gugun = substr($gugun, '0', '5');
|
||||||
|
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,5),'00000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000'" .
|
||||||
|
" AND a.region_cd LIKE '%00'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$gugun]);
|
||||||
|
|
||||||
|
} else if (!empty($sido)) {
|
||||||
|
$chk_sido = substr($sido, '0', '2');
|
||||||
|
|
||||||
|
if ($chk_sido === '36') {
|
||||||
|
$sido = substr($sido, '0', '4');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,4),'000000') " .
|
||||||
|
"WHERE a.region_cd LIKE concat(?, '%') " .
|
||||||
|
"AND a.region_cd NOT LIKE '%000000' " .
|
||||||
|
"AND a.region_cd LIKE '%00' " .
|
||||||
|
"AND a.use_yn = 'Y' " .
|
||||||
|
"AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000')) " .
|
||||||
|
"ORDER BY a.region_nm ASC";
|
||||||
|
} else {
|
||||||
|
$sido = substr($sido, '0', '2');
|
||||||
|
$sql = "SELECT a.region_cd, TRIM(REPLACE(a.region_nm, b.region_nm, '')) region_nm" .
|
||||||
|
" FROM region_codes a" .
|
||||||
|
" LEFT JOIN region_codes b ON b.region_cd = CONCAT(SUBSTR(a.region_cd,1,2),'00000000')" .
|
||||||
|
" WHERE a.region_cd LIKE concat(?, '%')" .
|
||||||
|
" AND a.region_cd NOT LIKE '%00000000'" .
|
||||||
|
" AND a.region_cd LIKE '%00000'" .
|
||||||
|
" AND a.use_yn = 'Y'" .
|
||||||
|
" AND EXISTS (SELECT 'x' FROM region_codes c WHERE c.region_cd LIKE CONCAT(SUBSTR(a.region_cd,1,5),'%') AND c.region_cd > CONCAT(SUBSTR(a.region_cd,1,5),'00000'))" .
|
||||||
|
" ORDER BY a.region_nm ASC";
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$sido]);
|
||||||
|
} else {
|
||||||
|
$sql = "SELECT a.region_cd, a.region_nm " .
|
||||||
|
"FROM region_codes a " .
|
||||||
|
"WHERE (a.region_cd LIKE '%00000000' " .
|
||||||
|
"AND a.use_yn = 'Y') " .
|
||||||
|
"OR region_cd = 3611000000;";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 소속본부조회
|
||||||
|
public function getBonbuList()
|
||||||
|
{
|
||||||
|
$sql = "SELECT dept_sq, pdept_sq, dept_nm, dept_desc, dept_head, use_yn, depth, insert_tm, insert_usr, update_tm, update_usr, lft, rgt" .
|
||||||
|
" FROM departments" .
|
||||||
|
" WHERE depth = 1" .
|
||||||
|
" AND use_yn = 'Y'" .
|
||||||
|
" ORDER BY lft";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 소속팀 조회
|
||||||
|
public function getTeamList()
|
||||||
|
{
|
||||||
|
$sql = "SELECT dept_sq, pdept_sq, dept_nm" .
|
||||||
|
" FROM departments" .
|
||||||
|
" WHERE depth = 2" .
|
||||||
|
" AND use_yn = 'Y'" .
|
||||||
|
" ORDER BY dept_nm";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 유저 조회
|
||||||
|
public function getUserList()
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.usr_sq, a.usr_id, a.usr_nm, a.dept_sq
|
||||||
|
FROM users a
|
||||||
|
WHERE
|
||||||
|
a.usr_level IN ('3','4','40','5','50','6','60','61','62','7','8','70')
|
||||||
|
AND a.use_yn = 'Y'
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 'x' FROM departments a1 INNER JOIN departments a2 ON a2.lft BETWEEN a1.lft AND a1.rgt AND a2.use_yn = 'Y'
|
||||||
|
WHERE 1=1 AND a2.dept_sq = a.dept_sq AND a1.use_yn = 'Y'
|
||||||
|
)
|
||||||
|
ORDER BY a.usr_level DESC, a.usr_nm ASC ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotalCount($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
COUNT(*) AS cnt
|
||||||
|
FROM
|
||||||
|
v2_article_info a
|
||||||
|
JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
|
||||||
|
JOIN v2_article_info_etc k ON k.vr_sq = a.vr_sq
|
||||||
|
LEFT JOIN region_codes f ON a.address_code = f.region_cd
|
||||||
|
LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = '35'
|
||||||
|
LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = '60'
|
||||||
|
LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
|
||||||
|
LEFT JOIN users i ON a.charger = i.usr_id
|
||||||
|
LEFT JOIN users j ON a.charger = j.usr_id
|
||||||
|
LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = '39' ";
|
||||||
|
|
||||||
|
$sql .= "WHERE 1=1 ";
|
||||||
|
|
||||||
|
// 매물번호
|
||||||
|
if (!empty($data['atcl_no'])) {
|
||||||
|
$sql .= "AND a.atcl = '{$data['atcl_no']}' ";
|
||||||
|
} else {
|
||||||
|
// 현재상태
|
||||||
|
if (!empty($data['stat_cd'])) {
|
||||||
|
$sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중개소
|
||||||
|
if (!empty($data['realtor_nm'])) {
|
||||||
|
$sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매물구분
|
||||||
|
if (!empty($data['rlet_type_cd'])) {
|
||||||
|
$sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 접수기간
|
||||||
|
if (!empty($data['receipt_sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['receipt_edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 완료기간
|
||||||
|
if (!empty($data['complete_sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['complete_edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 검증방식
|
||||||
|
if (!empty($data['vrfc_type_sub'])) {
|
||||||
|
$sql .= "AND a.vrfc_type_sub = '{$data['vrfc_type_sub']}' ";
|
||||||
|
} else {
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매체사
|
||||||
|
if (!empty($data['rcpt_cpid'])) {
|
||||||
|
$sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 지역구분
|
||||||
|
if (!empty($data['srcDong'])) {
|
||||||
|
$sql .= "AND a.address_code = '{$data['srcDong']}' ";
|
||||||
|
} else {
|
||||||
|
if (!empty($data['srcGugun'])) {
|
||||||
|
$str_gugun = substr($data['srcGugun'], '0', '2');
|
||||||
|
if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
|
||||||
|
$sql .= "AND a.address_code = '{$data['srcGugun']}' ";
|
||||||
|
} else {
|
||||||
|
$gugunPrefix = substr($data['srcGugun'], '0', '5');
|
||||||
|
$sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!empty($data['srcSido'])) {
|
||||||
|
$sidoPrefix = substr($data['srcSido'], '0', '2');
|
||||||
|
$sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 담당자
|
||||||
|
if (!empty($data['damdang'])) {
|
||||||
|
|
||||||
|
switch ($data['charger_gbn']) {
|
||||||
|
case "1":
|
||||||
|
$sql .= "a.charger = '{$data['damdang']}' ";
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
$sql .= "a.reg_charger = '{$data['damdang']}' ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 배정여부
|
||||||
|
if ($data['assign_yn'] !== "A") {
|
||||||
|
switch ($data['charger_gbn'] . $data['assign_yn']) {
|
||||||
|
case "1Y": // 전화/서류 담당자
|
||||||
|
$sql .= "a.charger != '' ";
|
||||||
|
break;
|
||||||
|
case "1N": // 전화/서류 담당자
|
||||||
|
$sql .= "a.charger = '' ";
|
||||||
|
break;
|
||||||
|
case "2Y": // 등기부등본 담당자
|
||||||
|
$sql .= "a.reg_charger != '' ";
|
||||||
|
break;
|
||||||
|
case "2N": // 등기부등본 담당자
|
||||||
|
$sql .= "a.reg_charger IS NULL ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 본부
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
if ($data['charger_gbn'] === "1") {
|
||||||
|
$sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팀
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
if ($data['charger_gbn'] === "1") {
|
||||||
|
$sql .= "AND a.dept2_sq = '{$data['team']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 참고파일
|
||||||
|
if (!empty($data['reference_file_url_yn'])) {
|
||||||
|
$sql .= "AND a.reference_file_url_yn = '{$data['a.reference_file_url_yn']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 법인
|
||||||
|
if (!empty($data['corp_own'])) {
|
||||||
|
$sql .= "AND m.corp_own = '{$data['a.corp_own']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getRow()->cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResultList($start, $end, $data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.vr_sq,
|
||||||
|
a.atcl_no,
|
||||||
|
a.cpid,
|
||||||
|
a.cp_atcl_id,
|
||||||
|
a.rlet_type_cd,
|
||||||
|
a.address1,
|
||||||
|
a.sise,
|
||||||
|
a.rdate,
|
||||||
|
a.seller_tel_no,
|
||||||
|
a.seller_nm,
|
||||||
|
a.realtor_nm,
|
||||||
|
a.realtor_tel_no,
|
||||||
|
a.charger,
|
||||||
|
b.insert_tm,
|
||||||
|
b.stat_cd,
|
||||||
|
c.bild_nm,
|
||||||
|
b.vrfc_type as vrfc_type_cd,
|
||||||
|
c.rm_no,
|
||||||
|
c.floor,
|
||||||
|
c.address_code,
|
||||||
|
c.address2,
|
||||||
|
k.address2a,
|
||||||
|
k.address2b,
|
||||||
|
c.address3,
|
||||||
|
c.trade_type,
|
||||||
|
c.deal_amt,
|
||||||
|
c.wrrnt_amt,
|
||||||
|
c.lease_amt,
|
||||||
|
c.isale_amt,
|
||||||
|
c.prem_amt,
|
||||||
|
c.sply_spc,
|
||||||
|
c.excls_spc,
|
||||||
|
c.tot_spc,
|
||||||
|
c.grnd_spc,
|
||||||
|
c.bldg_spc,
|
||||||
|
c.hscp_nm,
|
||||||
|
c.ptp_no,
|
||||||
|
d.insert_tm as update_res_tm,
|
||||||
|
e.insert_tm as result_tm,
|
||||||
|
f.region_nm,
|
||||||
|
g.cd_nm as pre_stat,
|
||||||
|
h.cd_nm as vrfc_type,
|
||||||
|
i.usr_nm,
|
||||||
|
j.usr_nm as reg_charger,
|
||||||
|
d2.insert_tm as stat_39_tm
|
||||||
|
FROM
|
||||||
|
v2_article_info a
|
||||||
|
JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
|
||||||
|
JOIN v2_article_info_etc k ON k.vr_sq = a.vr_sq
|
||||||
|
LEFT JOIN region_codes f ON a.address_code = f.region_cd
|
||||||
|
LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = '35'
|
||||||
|
LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = '60'
|
||||||
|
LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
|
||||||
|
LEFT JOIN users i ON a.charger = i.usr_id
|
||||||
|
LEFT JOIN users j ON a.charger = j.usr_id
|
||||||
|
LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = '39' ";
|
||||||
|
|
||||||
|
$sql .= "WHERE 1=1 ";
|
||||||
|
|
||||||
|
// 매물번호
|
||||||
|
if (!empty($data['atcl_no'])) {
|
||||||
|
$sql .= "AND a.atcl = '{$data['atcl_no']}' ";
|
||||||
|
} else {
|
||||||
|
// 현재상태
|
||||||
|
if (!empty($data['stat_cd'])) {
|
||||||
|
$sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중개소
|
||||||
|
if (!empty($data['realtor_nm'])) {
|
||||||
|
$sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매물구분
|
||||||
|
if (!empty($data['rlet_type_cd'])) {
|
||||||
|
$sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 접수기간
|
||||||
|
if (!empty($data['receipt_sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['receipt_edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 완료기간
|
||||||
|
if (!empty($data['complete_sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['complete_edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 검증방식
|
||||||
|
if (!empty($data['vrfc_type_sub'])) {
|
||||||
|
$sql .= "AND a.vrfc_type_sub = '{$data['vrfc_type_sub']}' ";
|
||||||
|
} else {
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매체사
|
||||||
|
if (!empty($data['rcpt_cpid'])) {
|
||||||
|
$sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 지역구분
|
||||||
|
if (!empty($data['srcDong'])) {
|
||||||
|
$sql .= "AND a.address_code = '{$data['srcDong']}' ";
|
||||||
|
} else {
|
||||||
|
if (!empty($data['srcGugun'])) {
|
||||||
|
$str_gugun = substr($data['srcGugun'], '0', '2');
|
||||||
|
if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
|
||||||
|
$sql .= "AND a.address_code = '{$data['srcGugun']}' ";
|
||||||
|
} else {
|
||||||
|
$gugunPrefix = substr($data['srcGugun'], '0', '5');
|
||||||
|
$sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!empty($data['srcSido'])) {
|
||||||
|
$sidoPrefix = substr($data['srcSido'], '0', '2');
|
||||||
|
$sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 담당자
|
||||||
|
if (!empty($data['damdang'])) {
|
||||||
|
|
||||||
|
switch ($data['charger_gbn']) {
|
||||||
|
case "1":
|
||||||
|
$sql .= "a.charger = '{$data['damdang']}' ";
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
$sql .= "a.reg_charger = '{$data['damdang']}' ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 배정여부
|
||||||
|
if ($data['assign_yn'] !== "A") {
|
||||||
|
switch ($data['charger_gbn'] . $data['assign_yn']) {
|
||||||
|
case "1Y": // 전화/서류 담당자
|
||||||
|
$sql .= "a.charger != '' ";
|
||||||
|
break;
|
||||||
|
case "1N": // 전화/서류 담당자
|
||||||
|
$sql .= "a.charger = '' ";
|
||||||
|
break;
|
||||||
|
case "2Y": // 등기부등본 담당자
|
||||||
|
$sql .= "a.reg_charger != '' ";
|
||||||
|
break;
|
||||||
|
case "2N": // 등기부등본 담당자
|
||||||
|
$sql .= "a.reg_charger IS NULL ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 본부
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
if ($data['charger_gbn'] === "1") {
|
||||||
|
$sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팀
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
if ($data['charger_gbn'] === "1") {
|
||||||
|
$sql .= "AND a.dept2_sq = '{$data['team']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 참고파일
|
||||||
|
if (!empty($data['reference_file_url_yn'])) {
|
||||||
|
$sql .= "AND a.reference_file_url_yn = '{$data['a.reference_file_url_yn']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 법인
|
||||||
|
if (!empty($data['corp_own'])) {
|
||||||
|
$sql .= "AND m.corp_own = '{$data['a.corp_own']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "ORDER BY b.vr_sq DESC ";
|
||||||
|
|
||||||
|
$sql .= "LIMIT {$start}, {$end}";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
public function getExcelList($data)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.atcl_no AS '매물번호',
|
||||||
|
g.cd_nm AS '진행상태',
|
||||||
|
b.insert_tm AS '접수시간',
|
||||||
|
h.cd_nm AS '검증방식',
|
||||||
|
CONCAT(f.region_nm, ' ', c.rm_no) AS '주소',
|
||||||
|
CONCAT(c.address2, ' ', c.address3) AS '상세주소',
|
||||||
|
a.cpid AS '매체사',
|
||||||
|
a.realtor_nm AS '중개소',
|
||||||
|
i.usr_nm AS '서류/전화 담당자',
|
||||||
|
IFNULL(d.insert_tm, d2.insert_tm) AS '서류/전화 확인완료시간',
|
||||||
|
a.reg_charger AS '등기부등본 담당자',
|
||||||
|
e.insert_tm AS '검증완료 일시',
|
||||||
|
FROM
|
||||||
|
v2_article_info a
|
||||||
|
JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
|
||||||
|
JOIN v2_article_info_etc k ON k.vr_sq = a.vr_sq
|
||||||
|
LEFT JOIN region_codes f ON a.address_code = f.region_cd
|
||||||
|
LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = '35'
|
||||||
|
LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = '60'
|
||||||
|
LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
|
||||||
|
LEFT JOIN users i ON a.charger = i.usr_id
|
||||||
|
LEFT JOIN users j ON a.charger = j.usr_id
|
||||||
|
LEFT JOIN v2_chg_stat d2 ON d2.vr_sq = a.vr_sq AND d2.stat_cd = '39' ";
|
||||||
|
|
||||||
|
$sql .= "WHERE 1=1 ";
|
||||||
|
|
||||||
|
// 매물번호
|
||||||
|
if (!empty($data['atcl_no'])) {
|
||||||
|
$sql .= "AND a.atcl = '{$data['atcl_no']}' ";
|
||||||
|
} else {
|
||||||
|
// 현재상태
|
||||||
|
if (!empty($data['stat_cd'])) {
|
||||||
|
$sql .= "AND b.stat_cd = '{$data['stat_cd']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 중개소
|
||||||
|
if (!empty($data['realtor_nm'])) {
|
||||||
|
$sql .= "AND a.realtor_nm = '{$data['realtor_nm']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매물구분
|
||||||
|
if (!empty($data['rlet_type_cd'])) {
|
||||||
|
$sql .= "AND a.rlet_type_cd = '{$data['rlet_type_cd']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 접수기간
|
||||||
|
if (!empty($data['receipt_sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['receipt_sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['receipt_edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['receipt_edate']} 23:59:59' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 완료기간
|
||||||
|
if (!empty($data['complete_sdate'])) {
|
||||||
|
$sql .= "AND b.insert_tm >= '{$data['complete_sdate']} 00:00:00' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['complete_edate'])) {
|
||||||
|
$sql .= "AND b.insert_tm <= '{$data['complete_edate']} 23:59:59' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 검증방식
|
||||||
|
if (!empty($data['vrfc_type_sub'])) {
|
||||||
|
$sql .= "AND a.vrfc_type_sub = '{$data['vrfc_type_sub']}' ";
|
||||||
|
} else {
|
||||||
|
if (!empty($data['vrfcreq_way'])) {
|
||||||
|
$sql .= "AND b.vrfc_type = '{$data['vrfcreq_way']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 매체사
|
||||||
|
if (!empty($data['rcpt_cpid'])) {
|
||||||
|
$sql .= "AND a.cpid = '{$data['rcpt_cpid']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 지역구분
|
||||||
|
if (!empty($data['srcDong'])) {
|
||||||
|
$sql .= "AND a.address_code = '{$data['srcDong']}' ";
|
||||||
|
} else {
|
||||||
|
if (!empty($data['srcGugun'])) {
|
||||||
|
$str_gugun = substr($data['srcGugun'], '0', '2');
|
||||||
|
if ($str_gugun == '36') { //세종시는 군구가 없고 바로 동이라서 예외
|
||||||
|
$sql .= "AND a.address_code = '{$data['srcGugun']}' ";
|
||||||
|
} else {
|
||||||
|
$gugunPrefix = substr($data['srcGugun'], '0', '5');
|
||||||
|
$sql .= "AND a.address_code LIKE '{$gugunPrefix}%' ";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!empty($data['srcSido'])) {
|
||||||
|
$sidoPrefix = substr($data['srcSido'], '0', '2');
|
||||||
|
$sql .= "AND a.address_code LIKE '{$sidoPrefix}%' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 담당자
|
||||||
|
if (!empty($data['damdang'])) {
|
||||||
|
|
||||||
|
switch ($data['charger_gbn']) {
|
||||||
|
case "1":
|
||||||
|
$sql .= "a.charger = '{$data['damdang']}' ";
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
$sql .= "a.reg_charger = '{$data['damdang']}' ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 배정여부
|
||||||
|
if ($data['assign_yn'] !== "A") {
|
||||||
|
switch ($data['charger_gbn'] . $data['assign_yn']) {
|
||||||
|
case "1Y": // 전화/서류 담당자
|
||||||
|
$sql .= "a.charger != '' ";
|
||||||
|
break;
|
||||||
|
case "1N": // 전화/서류 담당자
|
||||||
|
$sql .= "a.charger = '' ";
|
||||||
|
break;
|
||||||
|
case "2Y": // 등기부등본 담당자
|
||||||
|
$sql .= "a.reg_charger != '' ";
|
||||||
|
break;
|
||||||
|
case "2N": // 등기부등본 담당자
|
||||||
|
$sql .= "a.reg_charger IS NULL ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 본부
|
||||||
|
if (!empty($data['bonbu'])) {
|
||||||
|
if ($data['charger_gbn'] === "1") {
|
||||||
|
$sql .= "AND a.dept1_sq = '{$data['bonbu']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND a.reg_dept1_sq = '{$data['bonbu']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팀
|
||||||
|
if (!empty($data['team'])) {
|
||||||
|
if ($data['charger_gbn'] === "1") {
|
||||||
|
$sql .= "AND a.dept2_sq = '{$data['team']}' ";
|
||||||
|
} else {
|
||||||
|
$sql .= "AND a.reg_dept2_sq = '{$data['team']}' ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 참고파일
|
||||||
|
if (!empty($data['reference_file_url_yn'])) {
|
||||||
|
$sql .= "AND a.reference_file_url_yn = '{$data['a.reference_file_url_yn']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 법인
|
||||||
|
if (!empty($data['corp_own'])) {
|
||||||
|
$sql .= "AND m.corp_own = '{$data['a.corp_own']}' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= "ORDER BY b.vr_sq DESC ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 배정변경
|
||||||
|
public function updateAssign($params)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->db->transStart();
|
||||||
|
|
||||||
|
$usr_id = session('usr_id');
|
||||||
|
$usr_sq = session('usr_sq');
|
||||||
|
|
||||||
|
// 현재상태 조회
|
||||||
|
$sql = "SELECT a.vr_sq, a.charger, b.stat_cd
|
||||||
|
FROM v2_article_info a
|
||||||
|
LEFT JOIN v2_vrfc_req b on b.vr_sq = a.vr_sq
|
||||||
|
WHERE a.vr_sq = ? ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$params['vr_sq']]);
|
||||||
|
$oldRow = $query->getRowArray();
|
||||||
|
|
||||||
|
// 담당자 부서 조회.
|
||||||
|
$sql = "SELECT a.usr_sq, a.usr_id
|
||||||
|
, IFNULL(CASE b.depth WHEN '1' THEN b.dept_sq END, CASE c.depth WHEN '1' THEN c.dept_sq END) dept1_sq
|
||||||
|
, IFNULL(CASE b.depth WHEN '2' THEN b.dept_sq END, CASE c.depth WHEN '2' THEN c.dept_sq END) dept2_sq
|
||||||
|
FROM users a
|
||||||
|
LEFT JOIN departments b ON b.dept_sq = a.dept_sq
|
||||||
|
LEFT JOIN departments c ON c.dept_sq = b.pdept_sq
|
||||||
|
WHERE a.usr_id = ?";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$params['damdang']]);
|
||||||
|
$row = $query->getRowArray();
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
if ($params['type'] == "1") {
|
||||||
|
$data = [
|
||||||
|
'damdang' => $params['damdang'],
|
||||||
|
'dept1_sq' => $row['dept1_sq'],
|
||||||
|
'dept2_sq' => $row['dept2_sq'],
|
||||||
|
];
|
||||||
|
} else if ($params['type'] == "2") {
|
||||||
|
$data = [
|
||||||
|
'damdang' => $params['damdang'],
|
||||||
|
'reg_dept1_sq' => $row['dept1_sq'],
|
||||||
|
'reg_dept2_sq' => $row['dept2_sq'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPDATE v2_article_info
|
||||||
|
$builder = $this->db->table('v2_article_info');
|
||||||
|
$builder->where('vr_sq', $params['vr_sq']);
|
||||||
|
if (!$builder->update()) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPDATE v2_vrfc_req
|
||||||
|
$builder = $this->db->table('v2_vrfc_req');
|
||||||
|
$builder->where('vr_sq', $params['vr_sq']);
|
||||||
|
$builder->where('CAST(stat_cd AS UNSIGNED) <', 20);
|
||||||
|
|
||||||
|
$builder->update();
|
||||||
|
|
||||||
|
$builder = $this->db->table('v2_vrfc_req');
|
||||||
|
$builder->where('vr_sq', $params['vr_sq']);
|
||||||
|
$builder->where('CAST(stat_cd AS UNSIGNED) <', 30);
|
||||||
|
|
||||||
|
$builder->update();
|
||||||
|
|
||||||
|
if (!empty($oldRow)) {
|
||||||
|
if (intval($oldRow['stat_cd']) < 20) {
|
||||||
|
$this->saveV2ChgStat($oldRow['vr_sq'], '20', $usr_sq);
|
||||||
|
}
|
||||||
|
|
||||||
|
$memo = $oldRow['charger'] . ' => ' . $params['damdang'];
|
||||||
|
$this->saveHistory($oldRow['vr_sq'], $oldRow['stat_cd'], 'C13', $usr_id, $memo);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->transComplete();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 상태변경 시각 기록
|
||||||
|
public function saveV2ChgStat($vr_sq, $stat_cd, $insert_user)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_chg_stat" .
|
||||||
|
" (vr_sq, stat_cd, insert_user, insert_tm)" .
|
||||||
|
" VALUES" .
|
||||||
|
" (?, ?, ?, now())" .
|
||||||
|
" ON DUPLICATE KEY UPDATE insert_user=VALUES(insert_user), insert_tm=VALUES(insert_tm)";
|
||||||
|
|
||||||
|
$this->db->query($sql, [$vr_sq, $stat_cd, $insert_user]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 변경이력 저장
|
||||||
|
public function saveHistory($vr_sq, $stat_cd, $chg_type, $usr_id, $memo)
|
||||||
|
{
|
||||||
|
$sql = "INSERT INTO v2_chg_history
|
||||||
|
(vr_sq, stat_cd, chg_type, insert_id, insert_tm, memo)
|
||||||
|
VALUES
|
||||||
|
(?, ?, ?, ?, NOW(), ?)
|
||||||
|
";
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
$vr_sq,
|
||||||
|
$stat_cd,
|
||||||
|
$chg_type,
|
||||||
|
$usr_id,
|
||||||
|
$memo
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->db->query($sql, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 홍보확인서 정보
|
||||||
|
public function getRecordInfo($vr_sq, $file_type)
|
||||||
|
{
|
||||||
|
$sql = "SELECT seq, vr_sq, use_yn, file_type, view_odr, IFNULL(file_path , '') AS file_path, IFNULL(file_name, '') AS file_name, file_ext, file_size, img_width, img_height, meta_data, insert_user, insert_tm, cloud_upload_yn
|
||||||
|
FROM v2_files
|
||||||
|
WHERE vr_sq = ? AND use_yn = 'Y' AND file_type = ?
|
||||||
|
ORDER BY seq DESC ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq, $file_type]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 메모확인
|
||||||
|
public function getMemo($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT memo FROM v2_vrfc_req where vr_sq = ?";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 상세목록 조회
|
||||||
|
public function getDetail($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.vr_sq,
|
||||||
|
a.dong_ho_chk,
|
||||||
|
a.hscplqry_lv,
|
||||||
|
b.tel_fail_cause,
|
||||||
|
a.atcl_no,
|
||||||
|
a.cpid,
|
||||||
|
a.cp_atcl_id,
|
||||||
|
a.rlet_type_cd,
|
||||||
|
a.address1,
|
||||||
|
a.sise,
|
||||||
|
a.rdate,
|
||||||
|
b.try_cnt,
|
||||||
|
a.seller_tel_no,
|
||||||
|
a.seller_nm,
|
||||||
|
a.realtor_nm,
|
||||||
|
a.realtor_tel_no,
|
||||||
|
a.charger,
|
||||||
|
b.insert_tm,
|
||||||
|
a.reg_charger,
|
||||||
|
b.stat_cd,
|
||||||
|
i2.usr_nm as reg_charger_nm,
|
||||||
|
c.bild_nm,
|
||||||
|
b.vrfc_type as vrfc_type_cd,
|
||||||
|
c.rm_no,
|
||||||
|
c.floor,
|
||||||
|
c.floor2,
|
||||||
|
c.address_code,
|
||||||
|
c.address2,
|
||||||
|
c1.address2a,
|
||||||
|
c1.address2b,
|
||||||
|
c.address3,
|
||||||
|
c.address4,
|
||||||
|
c.trade_type as trade_type_cd,
|
||||||
|
c.deal_amt,
|
||||||
|
c.wrrnt_amt,
|
||||||
|
c.lease_amt,
|
||||||
|
c.isale_amt,
|
||||||
|
c.prem_amt,
|
||||||
|
c.sply_spc,
|
||||||
|
c.excls_spc,
|
||||||
|
c.tot_spc,
|
||||||
|
c.grnd_spc,
|
||||||
|
c.bldg_spc,
|
||||||
|
c.hscp_no,
|
||||||
|
c.ptp_no,
|
||||||
|
d.insert_tm as update_res_tm,
|
||||||
|
e.insert_tm as result_tm,
|
||||||
|
f.region_nm,
|
||||||
|
g.cd_nm as pre_stat,
|
||||||
|
g.cd as pre_stat_cd,
|
||||||
|
h.cd_nm as vrfc_type,
|
||||||
|
i.usr_nm,
|
||||||
|
j.cd_nm as trade_type,
|
||||||
|
c.hscp_nm,
|
||||||
|
c.ptp_nm,
|
||||||
|
l.success,
|
||||||
|
k.cd_nm as atcl_nm,
|
||||||
|
m.code as result_d11,
|
||||||
|
m.comment,
|
||||||
|
n.code as fax_conf_yn_2,
|
||||||
|
o.code as fax_conf_yn_3,
|
||||||
|
p.code as fax_conf_yn_4,
|
||||||
|
n.comment as fax_conf_yn_info_2,
|
||||||
|
o.comment as fax_conf_yn_info_3,
|
||||||
|
p.comment as fax_conf_yn_info_4,
|
||||||
|
v.success AS tel_suc,
|
||||||
|
r.code AS tel_agree,
|
||||||
|
s.code AS tel_conf_yn_2,
|
||||||
|
t.code AS tel_conf_yn_3,
|
||||||
|
u.code AS tel_conf_yn_4,
|
||||||
|
s.comment AS tel_conf_yn_info_2,
|
||||||
|
t.comment AS tel_conf_yn_info_3,
|
||||||
|
u.comment AS tel_conf_yn_info_4,
|
||||||
|
w.success AS reg_conf_yn_1,
|
||||||
|
x.code AS reg_conf_yn_2,
|
||||||
|
y.code AS reg_conf_yn_3,
|
||||||
|
x.comment AS reg_conf_yn_info_2,
|
||||||
|
y.comment AS reg_conf_yn_info_3,
|
||||||
|
b.rgbk_confirm,
|
||||||
|
a.confirm_doc_img_url,
|
||||||
|
a.cert_register,
|
||||||
|
a.cert_register_save_yn,
|
||||||
|
a.confirm_doc_img_url_save_yn,
|
||||||
|
a.reference_file_url,
|
||||||
|
a.reference_file_url_save_yn,
|
||||||
|
a.reference_file_url_yn,
|
||||||
|
c1.vir_addr_yn
|
||||||
|
FROM
|
||||||
|
v2_article_info AS a
|
||||||
|
JOIN v2_vrfc_req b ON a.vr_sq = b.vr_sq
|
||||||
|
JOIN v2_modify_info c ON a.vr_sq = c.vr_sq
|
||||||
|
JOIN v2_article_info_etc c1 ON c1.vr_sq = a.vr_sq
|
||||||
|
LEFT JOIN region_codes f ON a.address_code = f.region_cd
|
||||||
|
LEFT JOIN v2_chg_stat d ON a.vr_sq = d.vr_sq AND d.stat_cd = '35'
|
||||||
|
LEFT JOIN v2_chg_stat e ON a.vr_sq = e.vr_sq AND e.stat_cd = '60'
|
||||||
|
LEFT JOIN codes g ON b.stat_cd = g.cd AND g.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes h ON b.vrfc_type = h.cd AND h.category = 'VRFCREQ_WAY'
|
||||||
|
LEFT JOIN codes j ON c.trade_type = j.cd AND j.category = 'TRADE_TYPE'
|
||||||
|
LEFT JOIN codes k ON a.rlet_type_cd = k.cd AND k.category = 'ARTICLE_TYPE'
|
||||||
|
LEFT JOIN v2_confirm l ON a.vr_sq = l.vr_sq AND l.vrfc_type = 'D'
|
||||||
|
LEFT JOIN v2_check_list m ON a.vr_sq = m.vr_sq AND m.type = 'D11'
|
||||||
|
LEFT JOIN v2_check_list n ON a.vr_sq = n.vr_sq AND n.type = 'D12'
|
||||||
|
LEFT JOIN v2_check_list o ON a.vr_sq = o.vr_sq AND o.type = 'D13'
|
||||||
|
LEFT JOIN v2_check_list p ON a.vr_sq = p.vr_sq AND p.type = 'D14'
|
||||||
|
LEFT JOIN v2_confirm v ON a.vr_sq = v.vr_sq AND v.vrfc_type = 'T'
|
||||||
|
LEFT JOIN v2_check_list r ON a.vr_sq = r.vr_sq AND r.type = 'T11'
|
||||||
|
LEFT JOIN v2_check_list s ON a.vr_sq = s.vr_sq AND s.type = 'T12'
|
||||||
|
LEFT JOIN v2_check_list t ON a.vr_sq = t.vr_sq AND t.type = 'T13'
|
||||||
|
LEFT JOIN v2_check_list u ON a.vr_sq = u.vr_sq AND u.type = 'T14'
|
||||||
|
LEFT JOIN v2_confirm w ON a.vr_sq = w.vr_sq AND w.vrfc_type = 'R'
|
||||||
|
LEFT JOIN v2_check_list x ON a.vr_sq = x.vr_sq AND x.type = '21'
|
||||||
|
LEFT JOIN v2_check_list y ON a.vr_sq = y.vr_sq AND y.type = '22'
|
||||||
|
LEFT JOIN users i ON a.charger = i.usr_id
|
||||||
|
LEFT JOIN users i2 ON a.reg_charger = i2.usr_id
|
||||||
|
|
||||||
|
WHERE a.vr_sq = ?";
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 변경이력 조회
|
||||||
|
public function getHistory($vr_sq)
|
||||||
|
{
|
||||||
|
$sql = "SELECT
|
||||||
|
a.seq,
|
||||||
|
a.vr_sq,
|
||||||
|
a.stat_cd,
|
||||||
|
a.chg_type,
|
||||||
|
a.insert_id,
|
||||||
|
a.insert_tm,
|
||||||
|
a.memo,
|
||||||
|
b.cd_nm as stat_cd_nm,
|
||||||
|
c.cd_nm as chg_type
|
||||||
|
FROM
|
||||||
|
v2_chg_history a
|
||||||
|
LEFT JOIN codes b ON a.stat_cd = b.cd AND b.category = 'STEP_VERIFICATION'
|
||||||
|
LEFT JOIN codes c ON a.chg_type = c.cd AND b.category = 'CHANGED_TYPE'
|
||||||
|
WHERE
|
||||||
|
a.vr_sq = ?
|
||||||
|
ORDER BY a.seq DESC ";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql, [$vr_sq]);
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
2185
app/Models/v2/M703Model.php
Normal file
2185
app/Models/v2/M703Model.php
Normal file
File diff suppressed because it is too large
Load Diff
23
app/Models/v2/M710Model.php
Normal file
23
app/Models/v2/M710Model.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models\v2;
|
||||||
|
|
||||||
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
|
class M710Model extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
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 = [
|
||||||
|
$atcl_no,
|
||||||
|
$vr_sq,
|
||||||
|
$type,
|
||||||
|
$fax_sq
|
||||||
|
];
|
||||||
|
$this->db->query($sql, $date);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1344,10 +1344,6 @@
|
|||||||
|
|
||||||
// 단지정보저장
|
// 단지정보저장
|
||||||
function fn_save_info(row, idx) {
|
function fn_save_info(row, idx) {
|
||||||
console.log('+++')
|
|
||||||
console.log(row)
|
|
||||||
console.log('idx ?? ' + idx)
|
|
||||||
console.log('+++')
|
|
||||||
|
|
||||||
const target = $("#video_target_" + idx).val();
|
const target = $("#video_target_" + idx).val();
|
||||||
console.log(target)
|
console.log(target)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
1258
app/Views/pages/v2/m702/detail.php
Normal file
1258
app/Views/pages/v2/m702/detail.php
Normal file
File diff suppressed because it is too large
Load Diff
902
app/Views/pages/v2/m702/lists.php
Normal file
902
app/Views/pages/v2/m702/lists.php
Normal file
@@ -0,0 +1,902 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ellipsis {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header-tab {
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-scroll {
|
||||||
|
max-height: 300px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<h1>확인매물 현황</h1>
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-body">
|
||||||
|
<form id="frm_srch_info" method="get" onsubmit="return false;">
|
||||||
|
<input type="hidden" name="m" id="m" value="M801" />
|
||||||
|
<input type="hidden" name="todo" id="todo" value="inq" />
|
||||||
|
<input type="hidden" name="usr_id" value="" />
|
||||||
|
|
||||||
|
<!-- 안내 -->
|
||||||
|
<div class="alert alert-warning py-2 mb-3">
|
||||||
|
<small class="mb-0">
|
||||||
|
매물번호를 입력하면 <b>다른 조건은 무시</b>됩니다.
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 검색 폼 -->
|
||||||
|
<div class="row g-3">
|
||||||
|
|
||||||
|
<!-- 매물번호 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매물번호</label>
|
||||||
|
<input type="text" name="atcl_no" class="form-control form-control-sm" placeholder="매물번호" maxlength="10"
|
||||||
|
onkeypress="atcl_no_enter(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 현재상태 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">현재상태</label>
|
||||||
|
<select name="stat_cd" class="form-select form-select-sm">
|
||||||
|
<option value="">-선택-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "STEP_VERIFICATION"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 중개소 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">중개소</label>
|
||||||
|
<input type="text" name="realtor_nm" class="form-control form-control-sm" placeholder="중개소">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 배정여부 (2개 셀렉트) -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">배정여부</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="charger_gbn" id="code_charger_gbn" class="form-select form-select-sm">
|
||||||
|
<option value="1">전화/서류담당자</option>
|
||||||
|
<option value="2">등기부등본담당자</option>
|
||||||
|
</select>
|
||||||
|
<select name="assign_yn" id="assign_yn" class="form-select form-select-sm">
|
||||||
|
<option value="A">-전체-</option>
|
||||||
|
<option value="Y">배정</option>
|
||||||
|
<option value="N">미배정</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row g-3">
|
||||||
|
<!-- 접수기간 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">접수기간</label>
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input type="date" class="form-control" name="receipt_sdate" id="receipt_sdate" placeholder="시작일">
|
||||||
|
<span class="input-group-text">~</span>
|
||||||
|
<input type="date" class="form-control" name="receipt_edate" id="receipt_edate" placeholder="종료일">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 완료기간 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">완료기간</label>
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input type="text" class="form-control" name="complete_sdate" id="complete_sdate" placeholder="시작일">
|
||||||
|
<span class="input-group-text">~</span>
|
||||||
|
<input type="text" class="form-control" name="complete_edate" id="complete_edate" placeholder="종료일">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 지역구분 -->
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label mb-1">지역구분</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="srcSido" id="srcSido" class="form-select form-select-sm">
|
||||||
|
<option value="">-시/도-</option>
|
||||||
|
<?php foreach ($sido as $s): ?>
|
||||||
|
<option value="<?= $s['region_cd'] ?>"><?= $s['region_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<select name="srcGugun" id="srcGugun" class="form-select form-select-sm">
|
||||||
|
<option value="">-시/군/구-</option>
|
||||||
|
</select>
|
||||||
|
<select name="srcDong" id="srcDong" class="form-select form-select-sm">
|
||||||
|
<option value="">-읍/면/동-</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row g-3">
|
||||||
|
<!-- 담당자 (본부/팀/담당 3셀렉트) -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">담당자</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="bonbu" id="bonbu" class="form-select form-select-sm">
|
||||||
|
<option value="">-본부-</option>
|
||||||
|
<?php foreach ($bonbu as $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<select name="team" id="team" class="form-select form-select-sm">
|
||||||
|
<option value="">-팀-</option>
|
||||||
|
</select>
|
||||||
|
<select name="damdang" id="damdang" class="form-select form-select-sm">
|
||||||
|
<option value="">-담당자-</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 검증방식 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">검증방식</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="vrfcreq_way" id="vrfcreq_way" class="form-select form-select-sm">
|
||||||
|
<option value="">-검증방식-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "VRFCREQ_WAY"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<select name="vrfc_type_sub" id="vrfc_type_sub" class="form-select form-select-sm">
|
||||||
|
<option value="">-선택-</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 매체사 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매체사</label>
|
||||||
|
<select name="rcpt_cpid" class="form-select form-select-sm">
|
||||||
|
<option value="">-전체-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "CP_ID"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 매물종류 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매물종류</label>
|
||||||
|
<select name="rlet_type_cd" class="form-select form-select-sm">
|
||||||
|
<option value="">-매물종류-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "ARTICLE_TYPE"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 법인소유 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">법인소유</label>
|
||||||
|
<select name="corp_own" class="form-select form-select-sm">
|
||||||
|
<option value="">-전체-</option>
|
||||||
|
<option value="Y">Y</option>
|
||||||
|
<option value="N">N</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid">
|
||||||
|
<label class="form-label mb-1 invisible">검색</label>
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">
|
||||||
|
<i class="pe-7s-search me-1"></i>검색
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<div class="d-flex align-items-center flex-wrap" style="gap:8px; flex:1;">
|
||||||
|
|
||||||
|
<select class="form-control form-control-sm" id="damdangT" style="width:150px;">
|
||||||
|
<option value="1">전화/서류 담당자</option>
|
||||||
|
<option value="2">등기부등본 담당자</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select class="form-control form-control-sm" id="bonbu2" style="width:140px;">
|
||||||
|
<option value="">-본부-</option>
|
||||||
|
<?php foreach ($bonbu as $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select class="form-control form-control-sm" id="team2" style="width:160px;">
|
||||||
|
<option value="">-팀-</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select class="form-control form-control-sm" id="damdang2" style="width:160px;">
|
||||||
|
<option value="">-담당자-</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-light" id="btn_part_change">
|
||||||
|
배정변경
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-light" id="btn_part_omit">
|
||||||
|
서류누락
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ml-auto">
|
||||||
|
<button class="btn btn-sm btn-outline-light" id="excel-download">
|
||||||
|
등기부등본 전송
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button class="btn btn-sm btn-outline-success" id="excel-download">
|
||||||
|
<i class="fa fa-fw" aria-hidden="true" title="file-excel-o"></i>
|
||||||
|
엑셀다운로드
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-center">
|
||||||
|
<input type="checkbox" class="form-check-input" name="chkAll" id="chkAll" />
|
||||||
|
</th>
|
||||||
|
<th>매물번호</th>
|
||||||
|
<th>진행상태</th>
|
||||||
|
<th>접수시간</th>
|
||||||
|
<th>검증방식</th>
|
||||||
|
<th>주소</th>
|
||||||
|
<th>상세주소</th>
|
||||||
|
<th>매체사</th>
|
||||||
|
<th>중개소</th>
|
||||||
|
<th>서류/전화<br />담당자</th>
|
||||||
|
<th>서류/전화<br />확인완료시간</th>
|
||||||
|
<th>등기부등본<br />담당자</th>
|
||||||
|
<th>검증완료<br />일시</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||||
|
<link href="https://unpkg.com/dropzone@6.0.0-beta.1/dist/dropzone.css" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||||
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
|
<script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=dtounkwjc5"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
const date = new Date();
|
||||||
|
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
|
var table;
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$("#bonbu").on("change", function (e) {
|
||||||
|
|
||||||
|
const value = e.target.value
|
||||||
|
|
||||||
|
$("#dept_sq").empty()
|
||||||
|
|
||||||
|
var str = "<option value=''>선택</option>"
|
||||||
|
if (teamArr != null) {
|
||||||
|
|
||||||
|
for (var i = 0; i < teamArr.length; i++) {
|
||||||
|
if (value === teamArr[i].pdept_sq) {
|
||||||
|
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#dept_sq").append(str)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) {
|
||||||
|
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
const isSecond = this.id.endsWith("2");
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
srcSido: isSecond
|
||||||
|
? $("#srcSido2").val()
|
||||||
|
: $("#frm_srch_info [name=srcSido]").val(),
|
||||||
|
|
||||||
|
srcGugun: isSecond
|
||||||
|
? $("#srcGugun2").val()
|
||||||
|
: $("#frm_srch_info [name=srcGugun]").val(),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/manage/areas/getAreaList",
|
||||||
|
method: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
data: params,
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
switch (targetId) {
|
||||||
|
case "srcSido":
|
||||||
|
$("#srcGugun").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>시/군/구</option>";
|
||||||
|
|
||||||
|
if ($("#srcSido").val() !== "") {
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcGugun").append(str);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "srcGugun":
|
||||||
|
$("#srcDong").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>읍/면/동</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcDong").append(str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#bonbu, #team, #bonbu2, #team2").on("change", function (e) {
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
|
||||||
|
var str = "";
|
||||||
|
var str2 = `<option value="">-담당자-</option>`;
|
||||||
|
if (targetId === "bonbu" || targetId === "bonbu2") {
|
||||||
|
const dept_sq = $("#" + targetId).val();
|
||||||
|
|
||||||
|
str += `<option value="">-팀-</option>`;
|
||||||
|
if (teamArr.length > 0) {
|
||||||
|
for (var i = 0; i < teamArr.length; i++) {
|
||||||
|
|
||||||
|
// 이 팀이 현재 본부에 속한 팀인지 체크
|
||||||
|
if (String(teamArr[i].pdept_sq) === String(dept_sq)) {
|
||||||
|
str += `
|
||||||
|
<option value="${teamArr[i].dept_sq}">${teamArr[i].dept_nm}</option>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetId === "bonbu") {
|
||||||
|
$("#team").html(str);
|
||||||
|
$("#damdang").html(str2);
|
||||||
|
} else if (targetId === "bonbu2") {
|
||||||
|
$("#team2").html(str);
|
||||||
|
$("#damdang2").html(str2);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (targetId === "team" || targetId === "team2") {
|
||||||
|
const dept_sq = $("#" + targetId).val();
|
||||||
|
|
||||||
|
str += `<option value="">-담당자-</option>`;
|
||||||
|
if (userArr.length > 0) {
|
||||||
|
for (var i = 0; i < userArr.length; i++) {
|
||||||
|
|
||||||
|
// 이 팀이 현재 본부에 속한 팀인지 체크
|
||||||
|
if (String(userArr[i].dept_sq) === String(dept_sq)) {
|
||||||
|
str += `
|
||||||
|
<option value="${userArr[i].usr_id}">${userArr[i].usr_nm}</option>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetId === "team") {
|
||||||
|
$("#damdang").html(str);
|
||||||
|
} else if (targetId === "team2") {
|
||||||
|
$("#damdang2").html(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 검증방식 onchange
|
||||||
|
$("#vrfcreq_way").on("change", function (e) {
|
||||||
|
const val = e.target.value;
|
||||||
|
|
||||||
|
var str = "";
|
||||||
|
str += `<option value="">-선택-</option>`;
|
||||||
|
if (e.val !== "") {
|
||||||
|
$.getJSON("/common/common/getVrfcCode?type=" + val, function (result) {
|
||||||
|
var total = result.length;
|
||||||
|
for (var i = 0; i < total; i++) {
|
||||||
|
var cateNm = result[i].cd_nm;
|
||||||
|
|
||||||
|
if (total == 1) {
|
||||||
|
str += "<option value=\"" + result[i].cd + "\" selected>" + cateNm + "</option>";
|
||||||
|
} else {
|
||||||
|
str += "<option value=\"" + result[i].cd + "\">" + cateNm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#vrfc_type_sub").html(str);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$("#vrfc_type_sub").html(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
serverSide: true,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m702/m702a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
initReceiptDate();
|
||||||
|
|
||||||
|
d.atcl_no = $("#frm_srch_info [name=atcl_no]").val(); // 매물번호
|
||||||
|
d.stat_cd = $("#frm_srch_info [name=stat_cd]").val(); // 현재상태
|
||||||
|
d.realtor_nm = $("#frm_srch_info [name=realtor_nm]").val(); // 중개소
|
||||||
|
d.charger_gbn = $("#frm_srch_info [name=charger_gbn]").val(); // 배정여부
|
||||||
|
d.assign_yn = $("#frm_srch_info [name=assign_yn]").val(); // 배정여부2
|
||||||
|
d.receipt_sdate = $("#frm_srch_info [name=receipt_sdate]").val(); // 접수기간1
|
||||||
|
d.receipt_edate = $("#frm_srch_info [name=receipt_edate]").val(); // 접수기간2
|
||||||
|
d.complete_sdate = $("#frm_srch_info [name=complete_sdate]").val(); // 완료기간1
|
||||||
|
d.complete_edate = $("#frm_srch_info [name=complete_edate]").val(); // 완료기간2
|
||||||
|
d.srcSido = $("#frm_srch_info [name=srcSido]").val(); // 시도
|
||||||
|
d.srcGugun = $("#frm_srch_info [name=srcGugun]").val(); // 시군구
|
||||||
|
d.srcDong = $("#frm_srch_info [name=srcDong]").val(); // 읍면동
|
||||||
|
d.bonbu = $("#frm_srch_info [name=bonbu]").val(); // 본부
|
||||||
|
d.team = $("#frm_srch_info [name=team]").val(); // 팀
|
||||||
|
d.damdang = $("#frm_srch_info [name=damdang]").val(); // 담당
|
||||||
|
d.vrfcreq_way = $("#frm_srch_info [name=vrfcreq_way]").val(); // 검증방식1
|
||||||
|
d.vrfc_type_sub = $("#frm_srch_info [name=vrfc_type_sub]").val(); // 검증방식2
|
||||||
|
d.rcpt_cpid = $("#frm_srch_info [name=rcpt_cpid]").val(); // 매체사
|
||||||
|
d.rlet_type_cd = $("#frm_srch_info [name=rlet_type_cd]").val(); // 매물종류
|
||||||
|
d.corp_own = $("#frm_srch_info [name=corp_own]").val(); // 법인
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: null, render: fn_chk_render, width: "50px", className: "dt-no-rowclick" },
|
||||||
|
{ data: 'atcl_no' },
|
||||||
|
{ data: 'pre_stat' },
|
||||||
|
{ data: 'insert_tm' },
|
||||||
|
{ data: 'vrfc_type' },
|
||||||
|
{ data: null, render: fn_region_render },
|
||||||
|
{ data: null, render: fn_addr_render },
|
||||||
|
{ data: 'cpid' },
|
||||||
|
{ data: 'realtor_nm' },
|
||||||
|
{ data: 'usr_nm', width: "80px" },
|
||||||
|
{ data: null, render: fn_tm_render },
|
||||||
|
{ data: 'reg_charger' },
|
||||||
|
{ data: 'result_tm' },
|
||||||
|
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: true,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#resultList tbody').on('click', 'tr', function (e) {
|
||||||
|
if ($(e.target).closest('td.dt-no-rowclick').length) return;
|
||||||
|
|
||||||
|
const rowData = table.row(this).data();
|
||||||
|
if (!rowData) return;
|
||||||
|
|
||||||
|
const vr_sq = rowData.vr_sq;
|
||||||
|
location.href = "<?= site_url('m702/m702a/detail') ?>/" + vr_sq;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#btnSearch').on('click', function () {
|
||||||
|
table.ajax.reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
$.ajax({
|
||||||
|
url: "/m702/m702a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadExcel(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('change', '#chkAll', function () {
|
||||||
|
const checked = this.checked;
|
||||||
|
|
||||||
|
$(table.rows({ page: 'current' }).nodes())
|
||||||
|
.find('input.row-chk')
|
||||||
|
.prop('checked', checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('change', '#resultList tbody input.row-chk', function () {
|
||||||
|
const $rows = $(table.rows({ page: 'current' }).nodes());
|
||||||
|
const total = $rows.find('input.row-chk').length;
|
||||||
|
const checkedCnt = $rows.find('input.row-chk:checked').length;
|
||||||
|
|
||||||
|
$('#chkAll').prop('checked', total > 0 && total === checkedCnt);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 전체 선택
|
||||||
|
$(document).on('change', '#depChkAll', function () {
|
||||||
|
$('.depChk').prop('checked', this.checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 개별 체크 시 전체 체크 동기화
|
||||||
|
$(document).on('change', '.depChk', function () {
|
||||||
|
const total = $('.depChk').length;
|
||||||
|
const checked = $('.depChk:checked').length;
|
||||||
|
$('#depChkAll').prop('checked', total === checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
table.on('draw', function () {
|
||||||
|
$('#chkAll').prop('checked', false);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 배정변경 click
|
||||||
|
$("#btn_part_change").on("click", function () {
|
||||||
|
|
||||||
|
const damdangT = $("#damdangT").val();
|
||||||
|
if (damdangT == "") {
|
||||||
|
Swal.fire({
|
||||||
|
title: "담당자 유형을 선택해 주세요.",
|
||||||
|
icon: "warning"
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const damdang = $("#damdang2").val();
|
||||||
|
if (damdang == "") {
|
||||||
|
Swal.fire({
|
||||||
|
title: "담당자를 선택해 주세요.",
|
||||||
|
icon: "warning"
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var arr = new Array();
|
||||||
|
$('#resultList tbody .row-chk:checked').each(function () {
|
||||||
|
const rowData = table.row($(this).closest('tr')).data();
|
||||||
|
arr.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (arr.length === 0) {
|
||||||
|
Swal.fire({
|
||||||
|
title: "선택된 데이터가 없습니다.",
|
||||||
|
icon: "warning"
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
swal.fire({
|
||||||
|
text: "선택한 매물의 담당자를 배정 변경 하시겠습니까?",
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "예",
|
||||||
|
cancelButtonText: "아니오",
|
||||||
|
closeOnConfirm: false,
|
||||||
|
closeOnCancel: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
cancelButtonColor: "#d33",
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
const param = {
|
||||||
|
'type': damdangT,
|
||||||
|
'damdang': damdang,
|
||||||
|
'rows': JSON.stringify(arr),
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/m702/m702a/updateAssign',
|
||||||
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
method: 'POST',
|
||||||
|
data: param,
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
error: function (xhr, error, thrown) {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
var msg = "";
|
||||||
|
if (xhr.responseText != null) {
|
||||||
|
msg = xhr.responseText
|
||||||
|
} else {
|
||||||
|
msg = "잠시후 다시 시도해 주세요."
|
||||||
|
}
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: msg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
if (result.code == '0') {
|
||||||
|
$("#btnSearch").trigger('click')
|
||||||
|
Swal.fire({
|
||||||
|
title: '정상 처리되었습니다.',
|
||||||
|
icon: "success"
|
||||||
|
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
Swal.fire({
|
||||||
|
title: result.msg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 서류누락 click
|
||||||
|
$("#btn_part_omit").on("click", function () {
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 접수기간 초기화
|
||||||
|
function initReceiptDate() {
|
||||||
|
|
||||||
|
const before3 = new Date();
|
||||||
|
before3.setDate(date.getDate() - 2);
|
||||||
|
|
||||||
|
const fmt = d => d.toISOString().slice(0, 10);
|
||||||
|
|
||||||
|
$('#receipt_sdate').val(fmt(before3));
|
||||||
|
$('#receipt_edate').val(fmt(date));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function atcl_no_enter(event) {
|
||||||
|
if (event.keyCode == 13) {
|
||||||
|
table.ajax.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_chk_render(data, type, row, meta) {
|
||||||
|
const rowIndex = meta.row;
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
str = `<input class="form-check-input row-chk" type="checkbox" id="row_${rowIndex}" value="Y">`;
|
||||||
|
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_region_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
str = row.region_nm + " " + row.rm_no;
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 주소 render
|
||||||
|
function fn_addr_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
if (row.address2b == null) {
|
||||||
|
str = row.address2 + " " + row.address3;
|
||||||
|
} else {
|
||||||
|
str = row.address2b + " " + row.address3;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_tm_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
if (row.update_res_tm == null) {
|
||||||
|
str = row.stat_39_tm;
|
||||||
|
} else {
|
||||||
|
str = row.update_res_tm;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcel(data) {
|
||||||
|
const ws = XLSX.utils.json_to_sheet(data);
|
||||||
|
ws['!cols'] = [
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
||||||
|
|
||||||
|
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
|
||||||
|
|
||||||
|
const blob = new Blob([wbout], { type: 'application/octet-stream' });
|
||||||
|
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = URL.createObjectURL(blob);
|
||||||
|
link.download = "배정매물_현황" + getDateTimeString() + ".xlsx";
|
||||||
|
link.click();
|
||||||
|
URL.revokeObjectURL(link.href);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getDateTimeString() {
|
||||||
|
const d = new Date();
|
||||||
|
const yyyy = d.getFullYear();
|
||||||
|
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
||||||
|
const dd = String(d.getDate()).padStart(2, '0');
|
||||||
|
const hh = String(d.getHours()).padStart(2, '0');
|
||||||
|
const mi = String(d.getMinutes()).padStart(2, '0');
|
||||||
|
const ss = String(d.getSeconds()).padStart(2, '0');
|
||||||
|
return `${yyyy}${mm}${dd}${hh}${mi}${ss}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractCode(code) {
|
||||||
|
|
||||||
|
var codeArr = new Array();
|
||||||
|
|
||||||
|
if (codes.length) {
|
||||||
|
|
||||||
|
for (var i = 0; i < codes.length; i++) {
|
||||||
|
|
||||||
|
if (code === codes[i].category) {
|
||||||
|
codeArr.push(codes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return codeArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 이미지 프리뷰
|
||||||
|
function fn_preview(src) {
|
||||||
|
const $img = $('#imgPreview');
|
||||||
|
|
||||||
|
// 이미지 표시
|
||||||
|
$img.attr('src', src).show();
|
||||||
|
|
||||||
|
$('#previewTitle').text('이미지 미리보기');
|
||||||
|
|
||||||
|
|
||||||
|
const modal = new bootstrap.Modal(document.getElementById('previewModal'));
|
||||||
|
modal.show();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
1775
app/Views/pages/v2/m703/detail.php
Normal file
1775
app/Views/pages/v2/m703/detail.php
Normal file
File diff suppressed because it is too large
Load Diff
775
app/Views/pages/v2/m703/lists.php
Normal file
775
app/Views/pages/v2/m703/lists.php
Normal file
@@ -0,0 +1,775 @@
|
|||||||
|
<?= $this->extend('layouts/main') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<style>
|
||||||
|
th {
|
||||||
|
font-size: 11px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#resultList tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blockUI {
|
||||||
|
z-index: 1500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ellipsis {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header-tab {
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-scroll {
|
||||||
|
max-height: 300px;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swal2-cancel {
|
||||||
|
background-color: #ff0000 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<h1>확인매물 현황</h1>
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-body">
|
||||||
|
<form id="frm_srch_info" method="get" onsubmit="return false;">
|
||||||
|
<input type="hidden" name="m" id="m" value="M801" />
|
||||||
|
<input type="hidden" name="todo" id="todo" value="inq" />
|
||||||
|
<input type="hidden" name="usr_id" value="" />
|
||||||
|
|
||||||
|
<!-- 안내 -->
|
||||||
|
<div class="alert alert-warning py-2 mb-3">
|
||||||
|
<small class="mb-0">
|
||||||
|
매물번호또는 발신팩스번호를 입력하면 <b>다른 조건은 무시</b>됩니다.
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 검색 폼 -->
|
||||||
|
<div class="row g-3">
|
||||||
|
|
||||||
|
<!-- 매물번호 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매물번호</label>
|
||||||
|
<input type="text" name="atcl_no" class="form-control form-control-sm" placeholder="매물번호" maxlength="10"
|
||||||
|
onkeypress="atcl_no_enter(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매물번호입력</label>
|
||||||
|
<select name="chk_atcl_no" class="form-select form-select-sm">
|
||||||
|
<option value="">-전체-</option>
|
||||||
|
<option value="Y">입력</option>
|
||||||
|
<option value="N">미입력</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">발신팩스번호</label>
|
||||||
|
<input type="text" name="caller_no" class="form-control form-control-sm" placeholder="매물번호" maxlength="10"
|
||||||
|
onkeypress="atcl_no_enter(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 현재상태 -->
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label class="form-label mb-1">현재상태</label>
|
||||||
|
<select name="stat_cd" class="form-select form-select-sm">
|
||||||
|
<option value="">-선택-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "STEP_VERIFICATION"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 중개소 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">중개소</label>
|
||||||
|
<input type="text" name="realtor_nm" class="form-control form-control-sm" placeholder="중개소">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 배정여부 (2개 셀렉트) -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">배정여부</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="charger_gbn" id="code_charger_gbn" class="form-select form-select-sm">
|
||||||
|
<option value="1">전화/서류담당자</option>
|
||||||
|
<option value="2">등기부등본담당자</option>
|
||||||
|
</select>
|
||||||
|
<select name="assign_yn" id="assign_yn" class="form-select form-select-sm">
|
||||||
|
<option value="A">-전체-</option>
|
||||||
|
<option value="Y">배정</option>
|
||||||
|
<option value="N">미배정</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row g-3">
|
||||||
|
<!-- 접수기간 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">수신기간</label>
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input type="date" class="form-control" name="receipt_sdate" id="receipt_sdate" placeholder="시작일">
|
||||||
|
<span class="input-group-text">~</span>
|
||||||
|
<input type="date" class="form-control" name="receipt_edate" id="receipt_edate" placeholder="종료일">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 완료기간 -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">완료기간</label>
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input type="text" class="form-control" name="complete_sdate" id="complete_sdate" placeholder="시작일">
|
||||||
|
<span class="input-group-text">~</span>
|
||||||
|
<input type="text" class="form-control" name="complete_edate" id="complete_edate" placeholder="종료일">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 지역구분 -->
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label mb-1">지역구분</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="srcSido" id="srcSido" class="form-select form-select-sm">
|
||||||
|
<option value="">-시/도-</option>
|
||||||
|
<?php foreach ($sido as $s): ?>
|
||||||
|
<option value="<?= $s['region_cd'] ?>"><?= $s['region_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<select name="srcGugun" id="srcGugun" class="form-select form-select-sm">
|
||||||
|
<option value="">-시/군/구-</option>
|
||||||
|
</select>
|
||||||
|
<select name="srcDong" id="srcDong" class="form-select form-select-sm">
|
||||||
|
<option value="">-읍/면/동-</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row g-3">
|
||||||
|
<!-- 담당자 (본부/팀/담당 3셀렉트) -->
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label mb-1">담당자</label>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<select name="bonbu" id="bonbu" class="form-select form-select-sm">
|
||||||
|
<option value="">-본부-</option>
|
||||||
|
<?php foreach ($bonbu as $d): ?>
|
||||||
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<select name="team" id="team" class="form-select form-select-sm">
|
||||||
|
<option value="">-팀-</option>
|
||||||
|
</select>
|
||||||
|
<select name="damdang" id="damdang" class="form-select form-select-sm">
|
||||||
|
<option value="">-담당자-</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">홍보확인서여부</label>
|
||||||
|
<select class="form-select" name="target_yn" id="target_yn">
|
||||||
|
<option value="" selected="selected">-전체-</option>
|
||||||
|
<option value="Y">Y</option>
|
||||||
|
<option value="N">N</option>
|
||||||
|
<option value="3">분양권</option>
|
||||||
|
<option value="B">부분수신</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 매체사 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">매체사</label>
|
||||||
|
<select name="rcpt_cpid" class="form-select form-select-sm">
|
||||||
|
<option value="">-전체-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "CP_ID"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 참고용 파일 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">동의서</label>
|
||||||
|
<div class="d-flex flex-wrap gap-2 align-items-center rounded p-2">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" name="chk_rec" id="chk_rec" value="Y">
|
||||||
|
<label class="form-check-label" for="chk_rec">동의서존재</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 법인소유 -->
|
||||||
|
<div class="col-md-1">
|
||||||
|
<label class="form-label mb-1">팩스업체</label>
|
||||||
|
<select name="fax_corp" class="form-select form-select-sm">
|
||||||
|
<option value="">-전체-</option>
|
||||||
|
<?php foreach ($codes as $c): ?>
|
||||||
|
<?php if ($c['category'] === "FAX_CORP"): ?>
|
||||||
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-1 d-grid">
|
||||||
|
<label class="form-label mb-1 invisible">검색</label>
|
||||||
|
<button type="button" class="btn btn-primary" id="btnSearch">
|
||||||
|
<i class="pe-7s-search me-1"></i>검색
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12 col-xl-12">
|
||||||
|
<div class="main-card mb-3 card">
|
||||||
|
<div class="card-header d-flex align-items-center">
|
||||||
|
<div class="d-flex align-items-center flex-wrap" style="gap: 8px; flex: 1">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ml-auto">
|
||||||
|
|
||||||
|
|
||||||
|
<button class="btn btn-sm btn-outline-success" id="excel-download">
|
||||||
|
<i class="fa fa-fw" aria-hidden="true" title="file-excel-o"></i>
|
||||||
|
엑셀다운로드
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>팩스업체</th>
|
||||||
|
<th>매물번호</th>
|
||||||
|
<th>현재상태</th>
|
||||||
|
<th>홍보확인서<br />여부</th>
|
||||||
|
<th>수신기간</th>
|
||||||
|
<th>발신번호</th>
|
||||||
|
<th>주소</th>
|
||||||
|
<th>상세주소</th>
|
||||||
|
<th>매체사</th>
|
||||||
|
<th>중개소</th>
|
||||||
|
<th>서류/전화<br />담당자</th>
|
||||||
|
<th>서류/전화<br />확인시간</th>
|
||||||
|
<th>등기부등본<br />담당자</th>
|
||||||
|
<th>검증완료<br />일시</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<!-- 여기는 비워둠: AJAX로 채움 -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css" />
|
||||||
|
<link href="https://unpkg.com/dropzone@6.0.0-beta.1/dist/dropzone.css" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||||
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
||||||
|
<script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=dtounkwjc5"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
const date = new Date();
|
||||||
|
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
const codes = <?= json_encode($codes, JSON_UNESCAPED_UNICODE); ?>;
|
||||||
|
|
||||||
|
var table;
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$("#bonbu").on("change", function (e) {
|
||||||
|
|
||||||
|
const value = e.target.value
|
||||||
|
|
||||||
|
$("#dept_sq").empty()
|
||||||
|
|
||||||
|
var str = "<option value=''>선택</option>"
|
||||||
|
if (teamArr != null) {
|
||||||
|
|
||||||
|
for (var i = 0; i < teamArr.length; i++) {
|
||||||
|
if (value === teamArr[i].pdept_sq) {
|
||||||
|
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#dept_sq").append(str)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) {
|
||||||
|
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
const isSecond = this.id.endsWith("2");
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
srcSido: isSecond
|
||||||
|
? $("#srcSido2").val()
|
||||||
|
: $("#frm_srch_info [name=srcSido]").val(),
|
||||||
|
|
||||||
|
srcGugun: isSecond
|
||||||
|
? $("#srcGugun2").val()
|
||||||
|
: $("#frm_srch_info [name=srcGugun]").val(),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/manage/areas/getAreaList",
|
||||||
|
method: "POST",
|
||||||
|
dataType: "json",
|
||||||
|
data: params,
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
|
||||||
|
switch (targetId) {
|
||||||
|
case "srcSido":
|
||||||
|
$("#srcGugun").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>시/군/구</option>";
|
||||||
|
|
||||||
|
if ($("#srcSido").val() !== "") {
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcGugun").append(str);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "srcGugun":
|
||||||
|
$("#srcDong").empty()
|
||||||
|
var str = "";
|
||||||
|
str += "<option value=''>읍/면/동</option>";
|
||||||
|
|
||||||
|
if (result.length > 0) {
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#srcDong").append(str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#bonbu, #team, #bonbu2, #team2").on("change", function (e) {
|
||||||
|
const targetId = this.id;
|
||||||
|
|
||||||
|
|
||||||
|
var str = "";
|
||||||
|
if (targetId === "bonbu" || targetId === "bonbu2") {
|
||||||
|
const dept_sq = $("#" + targetId).val();
|
||||||
|
|
||||||
|
str += `<option value="">-팀-</option>`;
|
||||||
|
if (teamArr.length > 0) {
|
||||||
|
for (var i = 0; i < teamArr.length; i++) {
|
||||||
|
|
||||||
|
// 이 팀이 현재 본부에 속한 팀인지 체크
|
||||||
|
if (String(teamArr[i].pdept_sq) === String(dept_sq)) {
|
||||||
|
str += `
|
||||||
|
<option value="${teamArr[i].dept_sq}">${teamArr[i].dept_nm}</option>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetId === "bonbu") {
|
||||||
|
$("#team").html(str);
|
||||||
|
} else if (targetId === "bonbu2") {
|
||||||
|
$("#team2").html(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (targetId === "team" || targetId === "team2") {
|
||||||
|
const dept_sq = $("#" + targetId).val();
|
||||||
|
|
||||||
|
str += `<option value="">-담당자-</option>`;
|
||||||
|
if (userArr.length > 0) {
|
||||||
|
for (var i = 0; i < userArr.length; i++) {
|
||||||
|
|
||||||
|
// 이 팀이 현재 본부에 속한 팀인지 체크
|
||||||
|
if (String(userArr[i].dept_sq) === String(dept_sq)) {
|
||||||
|
str += `
|
||||||
|
<option value="${userArr[i].usr_id}">${userArr[i].usr_nm}</option>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetId === "team") {
|
||||||
|
$("#damdang").html(str);
|
||||||
|
} else if (targetId === "team2") {
|
||||||
|
$("#damdang2").html(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
table = $('#resultList').DataTable({
|
||||||
|
language: lang_kor,
|
||||||
|
serverSide: true,
|
||||||
|
processing: true,
|
||||||
|
ajax: {
|
||||||
|
url: '/m703/m703a/getResultList',
|
||||||
|
type: 'GET',
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
data: function (d) {
|
||||||
|
initReceiptDate();
|
||||||
|
|
||||||
|
d.atcl_no = $("#frm_srch_info [name=atcl_no]").val(); // 매물번호
|
||||||
|
d.chk_atcl_no = $("#frm_srch_info [name=chk_atcl_no]").val(); // 매물번호입력
|
||||||
|
d.caller_no = $("#frm_srch_info [name=caller_no]").val(); // 발신팩스번호
|
||||||
|
d.stat_cd = $("#frm_srch_info [name=stat_cd]").val(); // 현재상태
|
||||||
|
d.realtor_nm = $("#frm_srch_info [name=realtor_nm]").val(); // 중개소
|
||||||
|
d.charger_gbn = $("#frm_srch_info [name=charger_gbn]").val(); // 배정여부
|
||||||
|
d.assign_yn = $("#frm_srch_info [name=assign_yn]").val(); // 배정여부2
|
||||||
|
d.receipt_sdate = $("#frm_srch_info [name=receipt_sdate]").val(); // 접수기간1
|
||||||
|
d.receipt_edate = $("#frm_srch_info [name=receipt_edate]").val(); // 접수기간2
|
||||||
|
d.complete_sdate = $("#frm_srch_info [name=complete_sdate]").val(); // 완료기간1
|
||||||
|
d.complete_edate = $("#frm_srch_info [name=complete_edate]").val(); // 완료기간2
|
||||||
|
d.srcSido = $("#frm_srch_info [name=srcSido]").val(); // 시도
|
||||||
|
d.srcGugun = $("#frm_srch_info [name=srcGugun]").val(); // 시군구
|
||||||
|
d.srcDong = $("#frm_srch_info [name=srcDong]").val(); // 읍면동
|
||||||
|
d.bonbu = $("#frm_srch_info [name=bonbu]").val(); // 본부
|
||||||
|
d.team = $("#frm_srch_info [name=team]").val(); // 팀
|
||||||
|
d.damdang = $("#frm_srch_info [name=damdang]").val(); // 담당
|
||||||
|
d.vrfcreq_way = $("#frm_srch_info [name=vrfcreq_way]").val(); // 검증방식1
|
||||||
|
d.vrfc_type_sub = $("#frm_srch_info [name=vrfc_type_sub]").val(); // 검증방식2
|
||||||
|
d.target_yn = $("#frm_srch_info [name=target_yn]").val(); // 홍보확인서여부
|
||||||
|
d.rcpt_cpid = $("#frm_srch_info [name=rcpt_cpid]").val(); // 매체사
|
||||||
|
d.chk_rec = $("#frm_srch_info [name=chk_rec]").is(":checked") === true ? "Y" : "N"; // 동의서유무
|
||||||
|
d.fax_corp = $("#frm_srch_info [name=fax_corp]").val(); // 팩스업체
|
||||||
|
|
||||||
|
d.start = d.start || 0
|
||||||
|
d.length = d.length || 10
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"columnDefs": [
|
||||||
|
{ className: 'text-center', targets: '_all' },
|
||||||
|
{ 'targets': '_all', "defaultContent": "" },
|
||||||
|
],
|
||||||
|
columns: [
|
||||||
|
{ data: 'receiver', render: fn_fax_render },
|
||||||
|
{ data: 'atcl_no' },
|
||||||
|
{ data: 'stat_cd', render: fn_stat_render },
|
||||||
|
{ data: 'work_type', render: fn_pr_render },
|
||||||
|
{ data: 'RECV_TIME' },
|
||||||
|
{ data: 'CALLER_NO' },
|
||||||
|
{ data: 'region_nm' },
|
||||||
|
{ data: null, render: fn_addr_render },
|
||||||
|
{ data: 'cpid' },
|
||||||
|
{ data: 'realtor_nm' },
|
||||||
|
{ data: 'usr_nm' },
|
||||||
|
{ data: 'stat_39_tm' },
|
||||||
|
{ data: 'reg_charger_nm' },
|
||||||
|
{ data: 'send_tm' },
|
||||||
|
],
|
||||||
|
// 옵션들 예시
|
||||||
|
paging: true,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#resultList tbody').on('click', 'tr', function (e) {
|
||||||
|
if ($(e.target).closest('td.dt-no-rowclick').length) return;
|
||||||
|
|
||||||
|
const rowData = table.row(this).data();
|
||||||
|
if (!rowData) return;
|
||||||
|
|
||||||
|
const fax_sq = rowData.fax_sq;
|
||||||
|
location.href = "<?= site_url('m703/m703a/detail') ?>/" + fax_sq;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#btnSearch').on('click', function () {
|
||||||
|
table.ajax.reload()
|
||||||
|
});
|
||||||
|
|
||||||
|
// 엑셀 다운로드 click
|
||||||
|
$("#excel-download").on("click", function () {
|
||||||
|
$.ajax({
|
||||||
|
url: "/m703/m703a/excel",
|
||||||
|
method: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
data: $("#frm_srch_info").serialize(),
|
||||||
|
beforeSend: function () {
|
||||||
|
blockUI.blockPage({
|
||||||
|
message: tpl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
blockUI.unblockPage()
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
downloadExcel(result.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 접수기간 초기화
|
||||||
|
function initReceiptDate() {
|
||||||
|
|
||||||
|
const before3 = new Date();
|
||||||
|
before3.setDate(date.getDate() - 2);
|
||||||
|
|
||||||
|
const fmt = d => d.toISOString().slice(0, 10);
|
||||||
|
|
||||||
|
$('#receipt_sdate').val(fmt(before3));
|
||||||
|
$('#receipt_edate').val(fmt(date));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function atcl_no_enter(event) {
|
||||||
|
if (event.keyCode == 13) {
|
||||||
|
table.ajax.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 팩스업체
|
||||||
|
function fn_fax_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
|
||||||
|
// if (codes.length > 0) {
|
||||||
|
// for (var i = 0; i < codes.length; i++) {
|
||||||
|
// if (codes[i].category === "FAX_CORP") {
|
||||||
|
// if (codes[i].cd === row.receiver) {
|
||||||
|
// str = codes[i].cd_nm + " " + row.receiver;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
str = getCodeString("FAX_CORP", row.receiver);
|
||||||
|
str = str + " " + row.receiver;
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 현재상태
|
||||||
|
function fn_stat_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
if (row.stat_cd2 == null) {
|
||||||
|
if (row.rcpt_stat == null) {
|
||||||
|
str = getCodeString("STEP_VERIFICATION", row.stat_cd);
|
||||||
|
} else {
|
||||||
|
str = getCodeString("RECEIPT_STATUS3", row.rcpt_stat);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
str = getCodeString("STEP_VERIFICATION", row.stat_cd2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 홍보확인서여부
|
||||||
|
function fn_pr_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
switch (row.work_type) {
|
||||||
|
case '1':
|
||||||
|
case '2':
|
||||||
|
str = 'Y';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '3':
|
||||||
|
str = '분양권';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'E':
|
||||||
|
str = 'N';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'B':
|
||||||
|
str = '부분수신';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 주소
|
||||||
|
function fn_addr_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
if (row.address2b == null) {
|
||||||
|
str = row.address2 + " " + row.address3;
|
||||||
|
} else {
|
||||||
|
str = row.address2b + " " + row.address3;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_tm_render(data, type, row) {
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
if (row.update_res_tm == null) {
|
||||||
|
str = row.stat_39_tm;
|
||||||
|
} else {
|
||||||
|
str = row.update_res_tm;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 엑셀 다운로드
|
||||||
|
function downloadExcel(data) {
|
||||||
|
const ws = XLSX.utils.json_to_sheet(data);
|
||||||
|
ws['!cols'] = [
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
{ wpx: 100 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const wb = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
||||||
|
|
||||||
|
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
|
||||||
|
|
||||||
|
const blob = new Blob([wbout], { type: 'application/octet-stream' });
|
||||||
|
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = URL.createObjectURL(blob);
|
||||||
|
link.download = "홍보확인서_현황" + getDateTimeString() + ".xlsx";
|
||||||
|
link.click();
|
||||||
|
URL.revokeObjectURL(link.href);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getDateTimeString() {
|
||||||
|
const d = new Date();
|
||||||
|
const yyyy = d.getFullYear();
|
||||||
|
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
||||||
|
const dd = String(d.getDate()).padStart(2, '0');
|
||||||
|
const hh = String(d.getHours()).padStart(2, '0');
|
||||||
|
const mi = String(d.getMinutes()).padStart(2, '0');
|
||||||
|
const ss = String(d.getSeconds()).padStart(2, '0');
|
||||||
|
return `${yyyy}${mm}${dd}${hh}${mi}${ss}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractCode(code) {
|
||||||
|
|
||||||
|
var codeArr = new Array();
|
||||||
|
|
||||||
|
if (codes.length) {
|
||||||
|
|
||||||
|
for (var i = 0; i < codes.length; i++) {
|
||||||
|
|
||||||
|
if (code === codes[i].category) {
|
||||||
|
codeArr.push(codes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return codeArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 이미지 프리뷰
|
||||||
|
function fn_preview(src) {
|
||||||
|
const $img = $('#imgPreview');
|
||||||
|
|
||||||
|
// 이미지 표시
|
||||||
|
$img.attr('src', src).show();
|
||||||
|
|
||||||
|
$('#previewTitle').text('이미지 미리보기');
|
||||||
|
|
||||||
|
|
||||||
|
const modal = new bootstrap.Modal(document.getElementById('previewModal'));
|
||||||
|
modal.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getCodeString(code, data) {
|
||||||
|
var str = "";
|
||||||
|
if (codes.length > 0) {
|
||||||
|
for (var i = 0; i < codes.length; i++) {
|
||||||
|
if (codes[i].category === code) {
|
||||||
|
if (codes[i].cd === data) {
|
||||||
|
str = codes[i].cd_nm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
Reference in New Issue
Block a user