This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace App\Controllers\V2;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Libraries\Common;
|
||||
use App\Models\common\CodeModel;
|
||||
use App\Models\v2\M708Model;
|
||||
|
||||
@@ -112,4 +113,346 @@ class M708 extends BaseController
|
||||
$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']); // 코드조회
|
||||
|
||||
$data = $this->model->getDetail($id);
|
||||
$memo = $this->model->getMemo($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;
|
||||
}
|
||||
|
||||
$history = $this->model->getHistory($data['vr_sq']);
|
||||
|
||||
$this->data['codes'] = $codes;
|
||||
$this->data['data'] = $data;
|
||||
$this->data['memo'] = $memo;
|
||||
$this->data['history'] = $history;
|
||||
|
||||
|
||||
return view("pages/v2/m708/detail", $this->data);
|
||||
}
|
||||
|
||||
|
||||
// 이미지회전
|
||||
public function rotateImage()
|
||||
{
|
||||
$common = new Common();
|
||||
|
||||
try {
|
||||
|
||||
$vr_sq = $this->request->getPost('vr_sq');
|
||||
$degress = $this->request->getPost('degress');
|
||||
|
||||
if (empty($degrees) || !is_numeric($degrees)) {
|
||||
$degrees = 90;
|
||||
}
|
||||
|
||||
$regist = $this->model->getRecordInfo($vr_sq, '2');
|
||||
$fullPath = $regist['file_path'] . $regist['file_name'];
|
||||
$fullPath = $_SERVER['DOCUMENT_ROOT'] . $common->realpath_to_webpath($fullPath);
|
||||
|
||||
$degrees = (float) $degrees;
|
||||
|
||||
$im = new \Imagick($fullPath);
|
||||
|
||||
// 배경색(회전 시 빈 공간 채우는 색). 투명 원하면 'transparent'
|
||||
$im->setImageBackgroundColor(new \ImagickPixel('white'));
|
||||
|
||||
// 회전
|
||||
$im->rotateImage($im->getImageBackgroundColor(), $degrees);
|
||||
|
||||
// 포맷/압축 유지(옵션)
|
||||
$im->setImageCompressionQuality(90);
|
||||
|
||||
// 덮어쓰기
|
||||
$im->writeImage($fullPath);
|
||||
|
||||
$im->clear();
|
||||
$im->destroy();
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success',
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 매물검색
|
||||
public function getArticleInfo()
|
||||
{
|
||||
try {
|
||||
|
||||
$atcl_no = $this->request->getGet('atcl_no');
|
||||
|
||||
$row = $this->model->getArticleInfo($atcl_no);
|
||||
|
||||
|
||||
if (empty($row)) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => '매물이 존재하지 않습니다.',
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success',
|
||||
'atcl_no' => $row['vr_sq'],
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 홍보확인서 아님 저장
|
||||
public function saveNotArticle()
|
||||
{
|
||||
try {
|
||||
|
||||
$fax_sq = $this->request->getPost('fax_sq');
|
||||
|
||||
$this->model->saveNotArticle($fax_sq);
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success',
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 중복으로 저장
|
||||
public function saveDuplImgs()
|
||||
{
|
||||
try {
|
||||
|
||||
$fax_sq = $this->request->getPost('fax_sq');
|
||||
$atcl_no = $this->request->getPost('atcl_no');
|
||||
$vr_sq = $this->request->getPost('vr_sq');
|
||||
|
||||
$this->model->saveDuplImgs($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 saveMobileBunyang()
|
||||
{
|
||||
try {
|
||||
|
||||
$fax_sq = $this->request->getPost('fax_sq');
|
||||
$atcl_no = $this->request->getPost('atcl_no');
|
||||
$vr_sq = $this->request->getPost('vr_sq');
|
||||
|
||||
$this->model->saveMobileBunyang($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 saveBunyang()
|
||||
{
|
||||
try {
|
||||
|
||||
$fax_sq = $this->request->getPost('fax_sq');
|
||||
|
||||
$this->model->saveBunyang($fax_sq);
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success',
|
||||
]);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 중개인 요청사항 저장
|
||||
public function saveRequestMessage()
|
||||
{
|
||||
$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'
|
||||
]);
|
||||
}
|
||||
|
||||
// 확인결과 저장
|
||||
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');
|
||||
$file_type = $this->request->getPost('file_type');
|
||||
|
||||
$resyn = $this->request->getPost('resYn');
|
||||
$dbusageagryn = $this->request->getPost('dbUsageAgrYn');
|
||||
$send_yn = 'Y';
|
||||
|
||||
$article = $this->model->getArticleInfo2($atcl_no, $vr_sq);
|
||||
$v2_vrfc_req = $this->model->get_v2_vrfc_req($vr_sq);
|
||||
|
||||
if (intval($article['stat_cd']) >= 40) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => '이미 저장된 데이터입니다.',
|
||||
]);
|
||||
} else {
|
||||
|
||||
// 거주여부 & DB활용동의여부 수정 UPDATE
|
||||
if (!empty($resyn)) {
|
||||
$this->model->updateResDb($resyn, $dbusageagryn, $vr_sq);
|
||||
}
|
||||
|
||||
// DB에 결과 저장
|
||||
// $this->model->saveHongBoFAX($fax_sq, $vr_sq, $atcl_no, $work_type, $send_yn, $result_d11, $comment_d11, $fax_conf_yn_1, $fax_conf_yn_2, $fax_conf_yn_3, $fax_conf_info_1, $fax_conf_info_2, $fax_conf_info_3, $file_type);
|
||||
|
||||
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'code' => '0',
|
||||
'msg' => 'success',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return $this->response->setJSON([
|
||||
'code' => '9',
|
||||
'msg' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 분양계약서 저장
|
||||
public function saveBunyangCnt()
|
||||
{
|
||||
try {
|
||||
|
||||
$vr_sq = $this->request->getPost('vr_sq');
|
||||
|
||||
|
||||
|
||||
} 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(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user