Compare commits

...

21 Commits

Author SHA1 Message Date
yangsh
6d87a209e0 링크이동 수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
2026-02-09 14:32:54 +09:00
yangsh
a7dca8c5fa 링크이동 수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
2026-02-09 11:00:15 +09:00
yangsh
9a27018922 사이드메뉴 수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
2026-02-09 09:49:08 +09:00
yangsh
8b621a065e 현장확인 수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled
2026-02-06 10:38:18 +09:00
53695a1dc3 Merge pull request 'feature/template' (#53) from feature/template into master
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/53
2026-02-05 15:08:43 +09:00
b9b3f43956 상세수정
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/52
2026-02-05 12:43:00 +09:00
fc4ce793e3 상세수정
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/51
2026-02-05 10:37:22 +09:00
ae5677a635 모델 수정 2026-02-04 21:45:23 +09:00
1311dc529a 쿼리문 출력 2026-02-04 21:40:30 +09:00
54f0a2a4d2 수정 2026-02-04 21:27:20 +09:00
9f20f4347a 수정 2026-02-04 21:07:28 +09:00
f9b6336eab 수정 2026-02-04 21:03:31 +09:00
6bed688be0 오류 확인 2026-02-04 20:19:07 +09:00
fef656243c 수정 2026-02-04 20:15:07 +09:00
c93a2035dd 저장 실패시 상세 로그 2026-02-04 20:09:52 +09:00
db70b28eb9 modifyinfo 입력 수정 2026-02-04 20:04:24 +09:00
918e27da67 오타수정 2026-02-04 19:59:45 +09:00
f7bda06ddf Merge branch 'master' of http://192.168.10.243:3000/owrainfo/confirms 2026-02-04 18:34:16 +09:00
2781638f58 db_now format 수정 reg_price_yn -> req_price_yn 으로 수정 2026-02-04 18:34:11 +09:00
c21a137dbb 상세수정
Reviewed-on: http://192.168.10.243:3000/owrainfo/confirms/pulls/50
2026-02-04 17:54:06 +09:00
9a2d0af8d0 v2 파라메터 2026-02-04 17:43:55 +09:00
29 changed files with 1922 additions and 216 deletions

View File

@@ -67,11 +67,13 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
$routes->get('excel', 'Receipt::excel'); $routes->get('excel', 'Receipt::excel');
$routes->post('saveTel', 'Receipt::saveTel'); // 연락가능전화 저장 $routes->post('saveTel', 'Receipt::saveTel'); // 연락가능전화 저장
$routes->post('resDbYn', 'Receipt::resDbYn'); // 거주여부 저장
$routes->post('resGround', 'Receipt::resGround'); // 평면도요청 저장 $routes->post('resGround', 'Receipt::resGround'); // 평면도요청 저장
$routes->post('assignRegist', 'Receipt::assignRegist'); // 예약확정 저장 $routes->post('assignRegist', 'Receipt::assignRegist'); // 예약확정 저장
$routes->post('requestMovie', 'Receipt::requestMovie'); // 동영상 촬영여부저장 $routes->post('requestMovie', 'Receipt::requestMovie'); // 동영상 촬영여부저장
$routes->post('requestMessage', 'Receipt::requestMessage'); // 중개사메모 저장 $routes->post('requestMessage', 'Receipt::requestMessage'); // 중개사메모 저장
$routes->post('rsrvcancel', 'Receipt::rsrvcancel'); // 예약취소 $routes->post('rsrvcancel', 'Receipt::rsrvcancel'); // 예약취소
$routes->post('chgStatus', 'Receipt::chgStatus'); // 상태변경
$routes->post('sendSms', 'Receipt::sendSms'); // 문자발송 $routes->post('sendSms', 'Receipt::sendSms'); // 문자발송
$routes->post('saveRecInfo', 'Receipt::saveRecInfo'); // 거주인정보저장 $routes->post('saveRecInfo', 'Receipt::saveRecInfo'); // 거주인정보저장
$routes->post('uploadFile', 'Receipt::uploadFile'); // 파일업로드 $routes->post('uploadFile', 'Receipt::uploadFile'); // 파일업로드

View File

@@ -5,8 +5,11 @@ use App\Controllers\BaseController;
use App\Libraries\Common; use App\Libraries\Common;
use App\Libraries\MyUpload; use App\Libraries\MyUpload;
use App\Libraries\NaverApiClient;
use App\Models\article\DeptModel;
use App\Models\article\ReceiptModel; use App\Models\article\ReceiptModel;
use App\Models\common\CodeModel; use App\Models\common\CodeModel;
use Exception;
class Receipt extends BaseController class Receipt extends BaseController
{ {
@@ -20,18 +23,31 @@ class Receipt extends BaseController
public function lists(): string public function lists(): string
{ {
$usr_id = $this->request->getGet('usr_id') ?: '';
$sBonbu = $this->request->getGet('bonbu') ?: '';
$sTeanm = $this->request->getGet('dept_sq') ?: '';
$codes = $this->codeModel->getCodeLists(['NHN_DEAL_TYPE', 'CP_ID', 'ARTICLE_TYPE', 'VRFCREQ_WAY', 'STEP_VERIFICATION']); // 코드조회 $codes = $this->codeModel->getCodeLists(['NHN_DEAL_TYPE', 'CP_ID', 'ARTICLE_TYPE', 'VRFCREQ_WAY', 'STEP_VERIFICATION']); // 코드조회
$sido = $this->model->getAreaList(); // 지역조회 $sido = $this->model->getAreaList(); // 지역조회
$bonbu = $this->model->getBonbuList(); $bonbu = $this->model->getBonbuList();
$team = $this->model->getTeamList(); $team = $this->model->getTeamList();
$user = $this->model->getUserList(); $user = $this->model->getUserList();
$this->data['sido'] = $sido; $this->data['sido'] = $sido;
$this->data['bonbu'] = $bonbu; $this->data['bonbu'] = $bonbu;
$this->data['team'] = $team; $this->data['team'] = $team;
$this->data['user'] = $user; $this->data['user'] = $user;
$this->data['codes'] = $codes; $this->data['codes'] = $codes;
if (!empty($usr_id)) {
$srchUser = $this->model->getSrchUserInfo($usr_id);
$this->data['srchUser'] = $srchUser;
}
$this->data['sBonbu'] = $sBonbu;
$this->data['sTeanm'] = $sTeanm;
return view("pages/article/receipt/lists", $this->data); return view("pages/article/receipt/lists", $this->data);
} }
@@ -143,6 +159,7 @@ class Receipt extends BaseController
// 상세화면 // 상세화면
public function detail($id) public function detail($id)
{ {
$naver = new NaverApiClient();
$id = (string) $id; $id = (string) $id;
if ($id === '') { if ($id === '') {
@@ -161,6 +178,10 @@ class Receipt extends BaseController
$team = $this->model->getTeamList(); $team = $this->model->getTeamList();
log_message('info', '[Receipt::detail] getTeamList {ms}ms', ['ms' => (int) ((microtime(true) - $t2) * 1000)]); log_message('info', '[Receipt::detail] getTeamList {ms}ms', ['ms' => (int) ((microtime(true) - $t2) * 1000)]);
$damdang = $this->model->getUserList();
// sms 코드 // sms 코드
$sms = []; $sms = [];
foreach ($codes as $c) { foreach ($codes as $c) {
@@ -209,6 +230,9 @@ class Receipt extends BaseController
$tmCount = $this->model->getUsrRsrvDateTmCount($id); $tmCount = $this->model->getUsrRsrvDateTmCount($id);
log_message('info', '[Receipt::detail] getUsrRsrvDateTmCount {ms}ms', ['ms' => (int) ((microtime(true) - $t10) * 1000)]); log_message('info', '[Receipt::detail] getUsrRsrvDateTmCount {ms}ms', ['ms' => (int) ((microtime(true) - $t10) * 1000)]);
// 당일 방문예정 매물.
$assignList = $this->model->getAssignReceiptListByUser($data['rsrv_date'], $data['usr_sq'], array($id));
// 체크리스트 조회 // 체크리스트 조회
$t11 = microtime(true); $t11 = microtime(true);
if ($data['exp_photo_yn'] === "N") { if ($data['exp_photo_yn'] === "N") {
@@ -217,13 +241,30 @@ class Receipt extends BaseController
$result_check = []; $result_check = [];
} }
$pdept = '';
if (!empty($data['dept_sq'])) {
$pdept = $this->model->getDeptDetail($data['dept_sq']);
} else {
$pdept = $this->model->getDeptDetail($data['region_dept_sq']);
}
$complexList = []; $complexList = [];
$ptpList = []; $ptpList = [];
// print_r($data);
// exit;
if ($data['comp_sq'] == '2') { if ($data['comp_sq'] == '2') {
// $callApi = new CallApi(); // 아파트단지목록
$complexList = $naver->complexList($data['rcpt_dong']);
// 평형목록
$ptpList = $naver->ptpList($data['rcpt_hscp_no']);
} }
// print_r($ptpList);
// exit;
log_message('info', '[Receipt::detail] getChecklist {ms}ms', ['ms' => (int) ((microtime(true) - $t11) * 1000)]); log_message('info', '[Receipt::detail] getChecklist {ms}ms', ['ms' => (int) ((microtime(true) - $t11) * 1000)]);
log_message('info', '[Receipt::detail] total {ms}ms', ['ms' => (int) ((microtime(true) - $t0) * 1000)]); log_message('info', '[Receipt::detail] total {ms}ms', ['ms' => (int) ((microtime(true) - $t0) * 1000)]);
@@ -231,9 +272,13 @@ class Receipt extends BaseController
$this->data['codes'] = $codes; $this->data['codes'] = $codes;
$this->data['bonbu'] = $bonbu; $this->data['bonbu'] = $bonbu;
$this->data['team'] = $team; $this->data['team'] = $team;
$this->data['damdang'] = $damdang;
$this->data['pdept'] = $pdept;
$this->data['sms'] = $sms; $this->data['sms'] = $sms;
$this->data['data'] = $data; $this->data['data'] = $data;
$this->data['assignList'] = $assignList;
$this->data['history'] = $history; $this->data['history'] = $history;
$this->data['dupleGroundPlan'] = $dupleGroundPlan; $this->data['dupleGroundPlan'] = $dupleGroundPlan;
@@ -247,6 +292,9 @@ class Receipt extends BaseController
$this->data['tmCount'] = $tmCount; $this->data['tmCount'] = $tmCount;
$this->data['result_check'] = $result_check; $this->data['result_check'] = $result_check;
$this->data['complexList'] = $complexList;
$this->data['ptpList'] = $ptpList;
return view("pages/article/receipt/detail", $this->data); return view("pages/article/receipt/detail", $this->data);
} }
@@ -275,6 +323,48 @@ class Receipt extends BaseController
} }
} }
// 거주여부 저장
public function resDbYn()
{
$naver = new NaverApiClient();
try {
$rcpt_key = $this->request->getPost('rcpt_key');
$rcpt_sq = $this->request->getPost('rcpt_sq');
$rsrv_sq = $this->request->getPost('rsrv_sq');
$res_yn = $this->request->getPost('resYn');
$dbUsageAgrYn = $this->request->getPost('dbUsageAgrYn');
$this->model->saveResDB($rcpt_sq, $rsrv_sq, $res_yn, $dbUsageAgrYn);
$receipt = $this->getDetail($rcpt_key);
if ($res_yn == 'Y') {
$isResidentsExist = true;
} else {
$isResidentsExist = false;
}
$api_result = $naver->residentsExistence($rcpt_key, $isResidentsExist);
if (!isset($api_result['result'])) {
throw new \Exception('API 통신오류입니다.\n다시 저장하여 주십시요.');
}
return $this->response->setJSON([
'code' => '0',
'msg' => 'success'
]);
} catch (\Exception $e) {
return $this->response->setJSON([
'code' => '9',
'msg' => $e->getMessage(),
]);
}
}
// 평면도요청 저장 // 평면도요청 저장
public function resGround() public function resGround()
{ {
@@ -302,13 +392,42 @@ class Receipt extends BaseController
// 예약확정 저장 // 예약확정 저장
public function assignRegist() public function assignRegist()
{ {
$naver = new NaverApiClient();
$deptModel = new DeptModel();
try { try {
//전달받은 값
$rcpt_sq = $this->request->getPost('rcpt_sq');
$rcpt_key = $this->request->getPost('rcpt_key');
$rsrv_sq = $this->request->getPost('rsrv_sq');
$rsrv_date = $this->request->getPost('rsrv_date');
$rsrv_tm_ap = $this->request->getPost('rsrv_tm_ap');
$rsrv_tm_hour = $this->request->getPost('rsrv_tm_hour');
$bonbu = $this->request->getPost('bonbu');
$dept_sq = $this->request->getPost('dept_sq');
$usr_sq = $this->request->getPost('usr_sq');
$bonbuInfo = $deptModel->getDeptDetail($bonbu);
$deptInfo = $deptModel->getDeptDetail($dept_sq);
$userInfo = $this->model->getUserDetail($usr_sq);
$receipt = $this->model->getDetail($rcpt_key);
/*** 네이버 연동[s] ***/
$na_result = $naver->reserveSuccess($rcpt_key, 'Y', $bonbuInfo['dept_nm'], $deptInfo['dept_nm'], $userInfo['usr_nm'], $userInfo['usr_tel1'], $rsrv_date, $rsrv_tm_ap);
/*** 네이버 연동[e] ***/
if (array_key_exists('result', $na_result)) { //네이버연동 상태변경 완료
$result = $this->model->assignRegist($rcpt_sq, $rsrv_date, $rsrv_tm_ap, $rsrv_tm_hour, $dept_sq, $usr_sq, $receipt);
return $this->response->setJSON([
'code' => '0',
'msg' => 'success'
]);
} else {
throw new \Exception($na_result['message']);
}
return $this->response->setJSON([
'code' => '0',
'msg' => 'success'
]);
} catch (\Exception $e) { } catch (\Exception $e) {
return $this->response->setJSON([ return $this->response->setJSON([
@@ -371,10 +490,44 @@ class Receipt extends BaseController
// 예약취소 // 예약취소
public function rsrvcancel() public function rsrvcancel()
{ {
$naver = new NaverApiClient();
try { try {
//전달받은 값
$rcpt_sq = $this->request->getPost('rcpt_sq');
$rsrv_sq = $this->request->getPost('rsrv_sq');
$rcpt_key = $this->request->getPost('rcpt_key');
$result_cd2 = $this->request->getPost('result_cd2');
$result_cd3 = $this->request->getPost('result_cd3');
$result_msg = $this->request->getPost('result_msg');
$rcpt_stat1 = $this->request->getPost('rcpt_stat1');
$receipt = $this->model->getDetail($rcpt_key);
/*** 네이버 연동[s] ***/
if ($result_cd2 == '9010' || $result_cd2 == '9020') { //예약취소
$na_result = $naver->reserveFail($rcpt_key, "E11", $result_msg);
} else if ($result_cd2 == '9030') {
if ($rcpt_stat1 == '70') {
throw new \Exception('방문전 취소 할 수 없습니다.');
} else {
$na_result = $naver->shootFail($rcpt_key, "E21", $result_msg);
}
} else if ($result_cd2 == '9040') {
$na_result = $naver->shootFail($rcpt_key, "E22", $result_msg);
} else if ($result_cd2 == '9045') {
$na_result = $naver->shootFail($rcpt_key, "E23", $result_msg);
} else if ($result_cd2 == '9050') {
$na_result = $naver->inspectFail($rcpt_key, 'E31', $result_msg);
}
/*** 네이버 연동[e] ***/
if (array_key_exists('result', $na_result)) { //네이버연동 상태변경 완료
$result = $this->model->rsrvcancel($rcpt_sq, $rsrv_sq, $result_cd2, $result_cd3, $result_msg, $receipt);
} else {
throw new \Exception($na_result['message']);
}
return $this->response->setJSON([ return $this->response->setJSON([
'code' => '0', 'code' => '0',
@@ -389,6 +542,55 @@ class Receipt extends BaseController
} }
} }
// 상태변경
public function chgStatus()
{
try {
$rcpt_sq = $this->request->getPost('rcpt_sq');
$rcpt_key = $this->request->getPost('rcpt_key');
$rcpt_stat = $this->request->getGet('rcpt_stat');
$rsrv_sq = $this->request->getPost('rsrv_sq');
$req_rec_yn = $this->request->getGet('reqRecYn');
$rsrv_date = $this->request->getPost('rsrv_date');
$rsrv_tm_ap = $this->request->getPost('rsrv_tm_ap');
$rsrv_tm_hour = $this->request->getPost('rsrv_tm_hour');
$bonbu = $this->request->getPost('bonbu');
$dept_sq = $this->request->getPost('dept_sq');
$usr_sq = $this->request->getPost('usr_sq');
$rletTypeCd = $this->request->getGet('rletTypeCd');
// 파라미터 디버그 로깅
$p = [
'rcpt_sq' => $rcpt_sq,
'rcpt_key' => $rcpt_key,
'rcpt_stat' => $rcpt_stat,
'rsrv_sq' => $rsrv_sq,
'req_rec_yn' => $req_rec_yn,
'rsrv_date' => $rsrv_date,
'rsrv_tm_ap' => $rsrv_tm_ap,
'rsrv_tm_hour' => $rsrv_tm_hour,
'bonbu' => $bonbu,
'dept_sq' => $dept_sq,
'usr_sq' => $usr_sq,
'rletTypeCd' => $rletTypeCd,
];
print_r($p);
exit;
} catch (\Exception $e) {
return $this->response->setJSON([
'code' => '9',
'msg' => $e->getMessage(),
]);
}
}
// 문자발송 // 문자발송
public function sendSms() public function sendSms()

View File

@@ -245,8 +245,17 @@ if (!function_exists('db_now')) {
function db_now(?string $format = null) function db_now(?string $format = null)
{ {
if ($format) { if ($format) {
$mysqlFormat = strtr($format, [
'Y' => '%Y', 'y' => '%y',
'm' => '%m', 'n' => '%c',
'd' => '%d', 'j' => '%e',
'H' => '%H', 'h' => '%h',
'i' => '%i', 's' => '%s',
'A' => '%p', 'a' => '%p',
]);
// 포맷이 있으면 DATE_FORMAT(NOW(), '포맷') 형태로 생성 // 포맷이 있으면 DATE_FORMAT(NOW(), '포맷') 형태로 생성
return new \CodeIgniter\Database\RawSql("DATE_FORMAT(NOW(), '$format')"); return new \CodeIgniter\Database\RawSql("DATE_FORMAT(NOW(), '$mysqlFormat')");
} }
// 포맷이 없으면 기본 NOW() 반환 // 포맷이 없으면 기본 NOW() 반환
return new \CodeIgniter\Database\RawSql('NOW()'); return new \CodeIgniter\Database\RawSql('NOW()');

View File

@@ -363,6 +363,78 @@ class NaverApiClient
return $this->request('POST', $url, $postData); return $this->request('POST', $url, $postData);
} }
/**
* 현장확인 거주인 여부 변경
*/
public function residentsExistence($reserveNumber, $isResidentsExist)
{
$url = $this->commonModel->getCompanyInfo(3);
$url = $url['api_server'] . "/residents/existence";
$postData = [
'reserveNumber' => $reserveNumber,
'isResidentsExist' => $isResidentsExist
];
return $this->request('POST', $url, $postData);
}
/**
* 예약확인 완료
*/
public function reserveSuccess($reserveNo, $modyfyYn, $agency, $team, $staff, $staffTel, $reserveYmd, $apm)
{
$url = $this->commonModel->getCompanyInfo(3);
$url = $url['api_server'] . "/site/reserveSuccess.nhn";
$getData = ['reserveNo' => $reserveNo, 'modyfyYn' => $modyfyYn, 'agency' => $agency, 'team' => $team, 'staff' => $staff, 'staffTel' => $staffTel, 'reserveYmd' => $reserveYmd, 'apm' => $apm];
return $this->request('POST', $url, $getData);
}
/**
* 예약확인 실패
*/
public function reserveFail($reserveNo, $errorCode, $etcTxt)
{
$url = $this->commonModel->getCompanyInfo(3);
$url = $url['api_server'] . "/site/reserveFail.nhn";
$getData = ['reserveNo' => $reserveNo, 'errorCode' => $errorCode, 'errorDesc' => $etcTxt];
return $this->request('POST', $url, $getData);
}
/**
* 촬영 실패
*/
public function shootFail($reserveNo, $errorCode, $etcTxt)
{
$url = $this->commonModel->getCompanyInfo(3);
$url = $url['api_server'] . "/site/shootFail.nhn";
$getData = ['reserveNo' => $reserveNo, 'errorCode' => $errorCode, 'errorDesc' => $etcTxt];
return $this->request('POST', $url, $getData);
}
/**
* 현장확인2 및 썸네일 검수 실패
*/
public function inspectFail($reserveNumber, $failDescription)
{
$url = $this->commonModel->getCompanyInfo(3);
$url = $url['api_server'] . "/site/vr/inspect/fail";
$postData = [
'reserveNumber' => $reserveNumber,
'failDescription' => $failDescription
];
return $this->request('POST', $url, $postData);
}
/** /**
* CURL 공통 실행 함수 * CURL 공통 실행 함수
*/ */

View File

@@ -50,36 +50,36 @@ class V2modifyinfoModel extends Model
]; ];
// 검증 규칙 // 검증 규칙
protected $validationRules = [ // protected $validationRules = [
'vr_sq' => 'required|integer', // 'vr_sq' => 'required|integer',
'bild_nm' => 'string|max_length[60]', // 'bild_nm' => 'string|max_length[60]',
'rm_no' => 'string|max_length[30]', // 'rm_no' => 'string|max_length[30]',
'floor' => 'integer', // 'floor' => 'integer',
'floor2' => 'integer', // 'floor2' => 'integer',
'ugrodFloor' => 'integer', // 'ugrodFloor' => 'integer',
'address_code' => 'string|max_length[10]', // 'address_code' => 'string|max_length[10]',
'address2' => 'string|max_length[300]', // 'address2' => 'string|max_length[300]',
'address2a' => 'string|max_length[300]', // 'address2a' => 'string|max_length[300]',
'address2b' => 'string|max_length[300]', // 'address2b' => 'string|max_length[300]',
'address3' => 'string|max_length[300]', // 'address3' => 'string|max_length[300]',
'address4' => 'string|max_length[1000]', // 'address4' => 'string|max_length[1000]',
'trade_type' => 'string|max_length[2]', // 'trade_type' => 'string|max_length[2]',
'deal_amt' => 'integer', // 'deal_amt' => 'integer',
'wrrnt_amt' => 'integer', // 'wrrnt_amt' => 'integer',
'lease_amt' => 'integer', // 'lease_amt' => 'integer',
'isale_amt' => 'integer', // 'isale_amt' => 'integer',
'prem_amt' => 'integer', // 'prem_amt' => 'integer',
'sply_spc' => 'numeric', // 'sply_spc' => 'numeric',
'excls_spc' => 'numeric', // 'excls_spc' => 'numeric',
'tot_spc' => 'numeric', // 'tot_spc' => 'numeric',
'grnd_spc' => 'numeric', // 'grnd_spc' => 'numeric',
'bldg_spc' => 'numeric', // 'bldg_spc' => 'numeric',
'hscp_no' => 'string|max_length[30]', // 'hscp_no' => 'string|max_length[30]',
'hscp_nm' => 'string|max_length[60]', // 'hscp_nm' => 'string|max_length[60]',
'ptp_no' => 'string|max_length[30]', // 'ptp_no' => 'string|max_length[30]',
'ptp_nm' => 'string|max_length[60]', // 'ptp_nm' => 'string|max_length[60]',
'modify_yn' => 'in_list[Y,N]', // 'modify_yn' => 'in_list[Y,N]',
]; // ];
protected $validationMessages = []; protected $validationMessages = [];
protected $skipValidation = false; protected $skipValidation = false;

View File

@@ -115,6 +115,22 @@ class DeptModel extends Model
return $query->getResultArray(); return $query->getResultArray();
} }
/**
* 부서검색(상세)
*/
public function getDeptDetail($dept_sq)
{
$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 dept_sq = ?";
$data = array($dept_sq);
$query = $this->db->query($sql, $data);
$row = $query->getRowArray();
return $row;
}
// 조직별통계 // 조직별통계
public function getDeptStatistics($data) public function getDeptStatistics($data)
{ {

View File

@@ -116,6 +116,19 @@ class ReceiptModel extends Model
return $query->getResultArray(); return $query->getResultArray();
} }
public function getSrchUserInfo($usr_id)
{
$sql = "SELECT a.usr_sq, a.usr_id, b.dept_sq, b.pdept_sq FROM users a
JOIN departments b ON b.dept_sq = a.dept_sq
WHERE a.usr_id = ? AND a.use_yn = 'Y'";
$data = [$usr_id];
$query = $this->db->query($sql, $data);
$row = $query->getRowArray();
return $row;
}
/** /**
* 부서검색(상세) * 부서검색(상세)
*/ */
@@ -149,6 +162,31 @@ class ReceiptModel extends Model
return $query->getResultArray(); return $query->getResultArray();
} }
/**
* 사용자 상세정보
*/
public function getUserDetail($usr_sq)
{
$builder = $this->db->table('users a');
$builder->select("
a.usr_sq,
a.dept_sq,
a.usr_id,
a.usr_nm,
a.usr_level,
a.usr_tel1,
a.usr_tel2,
b.dept_nm
", false);
$builder->join('departments b', 'a.dept_sq = b.dept_sq', 'left');
$builder->where('a.usr_sq', $usr_sq);
return $builder->get()->getRowArray();
}
public function getTotalCount($data) public function getTotalCount($data)
{ {
$usr_sq = session('usr_sq'); $usr_sq = session('usr_sq');
@@ -1179,10 +1217,27 @@ class ReceiptModel extends Model
$builder->where('a.rcpt_key', $id); $builder->where('a.rcpt_key', $id);
return $builder->get()->getRowArray(); return $builder->get()->getRowArray();
} }
/**
* 사용자의 지정일자에 배정된 목록을 가져온다. (시간, 위치만...)
*/
public function getAssignReceiptListByUser($rsrv_date, $usr_sq, $arrExcept = [])
{
$sql = "SELECT a.rcpt_key, a.rcpt_atclno, a.rcpt_x, a.rcpt_y, b.rsrv_tm_ap, b.rsrv_tm_hour" .
" FROM receipt a" .
" INNER JOIN result b ON b.rcpt_sq = a.rcpt_sq AND b.usr_sq = ? AND b.rsrv_date = ?" .
" WHERE a.rcpt_key not in (?)";
$except_rcptKey = implode(',', $arrExcept);
$data = array($usr_sq, $rsrv_date, $except_rcptKey);
$query = $this->db->query($sql, $data);
$res = $query->getResultArray();
return $res;
}
public function getDupleGP($rcpt_key, $rcpt_sido, $rcpt_gugun, $rcpt_dong, $rcpt_hscp_nm, $rcpt_dtl_addr, $rcpt_ho) public function getDupleGP($rcpt_key, $rcpt_sido, $rcpt_gugun, $rcpt_dong, $rcpt_hscp_nm, $rcpt_dtl_addr, $rcpt_ho)
{ {
$sql = "select rcpt_sq, c.rcpt_key, c.photo_save_dt from" . $sql = "select rcpt_sq, c.rcpt_key, c.photo_save_dt from" .
@@ -1426,6 +1481,40 @@ class ReceiptModel extends Model
]; ];
} }
// 거주여부 저장
public function saveResDB($rcpt_sq, $rsrv_sq, $resYn, $dbUsageAgrYn)
{
$this->db->transStart();
$usr_id = session('usr_id');
$sql = "SELECT result_cd3, resYn, dbUsageAgrYn FROM result WHERE rsrv_sq = ?";
$data = array($rsrv_sq);
$query = $this->db->query($sql, $data);
$row = $query->getRowArray();
$sql = "UPDATE result" .
" SET resYn = ?" .
" ,dbUsageAgrYn = ?" .
" WHERE rsrv_sq = ?" .
" AND rcpt_sq = ?";
$data = array($resYn, $dbUsageAgrYn, $rsrv_sq, $rcpt_sq);
if ($this->db->query($sql, $data) === false) {
return [
'success' => false,
'msg' => '저장실패',
];
}
$this->saveChangedHistory($rcpt_sq, $row['result_cd3'], 'C24', $usr_id, $row['resYn'] . "|" . $row['dbUsageAgrYn']);
$this->db->transComplete();
return [
'success' => true,
];
}
// 평면도요청 저장 // 평면도요청 저장
public function saveGround($rcpt_sq, $ground_plan) public function saveGround($rcpt_sq, $ground_plan)
{ {
@@ -2044,4 +2133,202 @@ class ReceiptModel extends Model
} }
} }
/**
* 배정자 등록
*/
public function assignRegist($rcpt_sq, $rsrv_date, $rsrv_tm_ap, $rsrv_tm_hour, $dept_sq, $usr_sq, $receipt)
{
// 세션정보
$usr_id = session('usr_id');
$reg_usr_sq = session('usr_sq');
$this->db->transStart();
// 변경전 기존 데이터 가져오기
$org_sql = "SELECT * FROM result WHERE rcpt_sq = ?";
$query = $this->db->query($org_sql, [$rcpt_sq]);
$row = $query->getRowArray();
// 예약확인
$sql1 = "UPDATE result" .
" SET rsrv_date = ?" .
" ,rsrv_tm_ap = ?" .
" ,rsrv_tm_hour = ?" .
" ,rsrv_save_dt = now()" .
" ,update_tm = now()" .
" ,update_usr = ?" .
" WHERE rcpt_sq = ?";
$data1 = [
$rsrv_date,
$rsrv_tm_ap,
$rsrv_tm_hour,
$reg_usr_sq,
$rcpt_sq
];
if ($this->db->query($sql1, $data1) === false) {
return [
'success' => false,
'msg' => '저장 실패',
];
}
// 배정
$sql2 = "UPDATE result" .
" SET dept_sq = ?" .
" ,usr_sq = ?" .
" ,result_cd1 = 20" .
" ,result_cd2 = 2000" .
" ,result_cd3 = 200000" .
" ,update_usr = ?" .
" ,update_tm = now()" .
" ,assign_save_dt = now()" .
" ,rsrv_cplt_dt = now()" .
" WHERE rcpt_sq = ?";
$data2 = [
$dept_sq,
$usr_sq,
$reg_usr_sq,
$rcpt_sq
];
if ($this->db->query($sql2, $data2) === false) {
return [
'success' => false,
'msg' => '저장 실패',
];
}
// 매물상태 변경
$rcpt_sql = "UPDATE receipt" .
" SET rcpt_stat = 200000" .
" WHERE rcpt_sq = ?";
$this->db->query($rcpt_sql, [$rcpt_sq]);
// 정보변경이력 저장
if (!empty($row)) {
$remark = "{$row['rsrv_date']} {$row['rsrv_tm_ap']} {$row['rsrv_tm_hour']}시 -> {$rsrv_date} {$rsrv_tm_ap} {$rsrv_tm_hour}";
} else {
$remark = "{$receipt['rsrv_date']} {$receipt['rsrv_tm_ap']} -> {$rsrv_date} {$rsrv_tm_hour}";
}
$this->saveChangedHistory($rcpt_sq, '200000', 'C11', $usr_id, $remark);
$this->db->transComplete();
return [
'success' => true,
];
}
/**
* 취소
*/
public function rsrvcancel($rcpt_sq, $rsrv_sq, $result_cd2, $result_cd3, $result_msg, $receipt)
{
// 세션정보
$usr_id = session('usr_id');
$usr_sq = session('usr_sq');
$usr_nm = session('usr_nm');
// 변경전 기존 데이터 가져오기
$org_sql = "SELECT * FROM result WHERE rcpt_sq = ?";
$query = $this->db->query($org_sql, [$rcpt_sq]);
$row = $query->getRowArray();
$this->db->transStart();
if ($result_cd2 == "9050") {
$sql = "UPDATE result" .
" SET result_cd1 = '90'" .
" ,result_cd2 = ?" .
" ,result_cd3 = ?" .
" ,result_msg = ?" .
" ,check_fail_dt = now()" .
" ,update_usr = ?" .
" ,update_tm = now()" .
" WHERE rsrv_sq = ?";
} else {
$sql = "UPDATE result" .
" SET result_cd1 = '90'" .
" ,result_cd2 = ?" .
" ,result_cd3 = ?" .
" ,result_msg = ?" .
" ,cancel_dt = now()" .
" ,update_usr = ?" .
" ,update_tm = now()" .
" WHERE rsrv_sq = ?";
}
$data = [
$result_cd2,
$result_cd3,
$result_msg,
$usr_sq,
$rsrv_sq
];
$res = $this->db->query($sql, $data);
if (!$res) {
$return = [
'success' => false,
'msg' => '저장실패',
];
} else {
// 매물상태 변경
$rcpt_sql = "UPDATE receipt" .
" SET rcpt_stat = ?" .
" WHERE rcpt_sq = ?";
$rcpt_data = [$result_cd3, $rcpt_sq];
$this->db->query($rcpt_sql, $rcpt_data);
// 정보변경이력 저장
if (!empty($row['result_msg'])) {
$remark = $row['result_msg'] . " -> " . $result_msg;
} else {
$remark = $result_msg;
}
$this->saveChangedHistory($rcpt_sq, $result_cd3, 'C5', $usr_id, $remark);
// 문자발송
if ($result_cd2 == "9010" || $result_cd2 == "9020") {
// 접수취소, 예약취소
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S2', $receipt);
} else if ($result_cd2 == "9030") {
// 방문전 취소
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S4', $receipt);
} else if ($result_cd2 == "9040") {
// 방문후 취소
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S5', $receipt);
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S5-1', $receipt);
} else if ($result_cd2 == "9045") {
// 촬영후 취소
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S6', $receipt);
}
if ($result_cd3 == "905010") {
// 거주인녹취실패 취소(검수실패)
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S9', $receipt);
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S9-1', $receipt);
} else if ($result_cd3 == "905020") {
// 홍보확인서 미수취 취소(검수실패)
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S11', $receipt);
$this->sendSms($receipt['agent_head_tel'], $receipt['agent_nm'], '1600-5749', $usr_nm, 0, $rsrv_sq, $rcpt_sq, 'S11-1', $receipt);
}
$return = [
'success' => true,
];
}
$this->db->transComplete();
return $return;
}
} }

View File

@@ -93,13 +93,21 @@ class TypeV2Handler
// 기사 정보 추가 저장 // 기사 정보 추가 저장
$articleInfoEtcParam['vr_sq'] = $vrSq; $articleInfoEtcParam['vr_sq'] = $vrSq;
if (!$this->articleInfoEtcModel->replace($articleInfoEtcParam)) { if (!$this->articleInfoEtcModel->replace($articleInfoEtcParam)) {
CLI::write(CLI::color('❌ ArticleInfoEtc 저장 실패 :: ' . json_encode($articleInfoEtcParam), 'red'));
throw new Exception("ArticleInfoEtc Insert 실패: " . json_encode($this->db->error())); throw new Exception("ArticleInfoEtc Insert 실패: " . json_encode($this->db->error()));
} }
CLI::write(CLI::color('✅ ArticleInfoEtc 저장 성공', 'blue')); CLI::write(CLI::color('✅ ArticleInfoEtc 저장 성공', 'blue'));
// 수정 정보 입력 (있으면 update, 없으면 insert) // 수정 정보 입력 (있으면 update, 없으면 insert)
if (!$this->modifyInfoModel->saveModifyInfo($vrSq, $modifyInfoParam)) { $modifyInfoParam['vr_sq'] = $vrSq;
throw new Exception("ModifyInfo 저장 실패: " . json_encode($this->db->error()));
$sql = $this->modifyInfoModel->builder()->set($modifyInfoParam)->getCompiledInsert();
CLI::write(CLI::color("\n[생성된 쿼리 예상안]:", 'yellow'));
CLI::write($sql);
if (!$this->modifyInfoModel->replace($modifyInfoParam)) {
CLI::write(CLI::color('❌ modifyInfoParam 저장 실패 :: ' . json_encode($modifyInfoParam), 'red'));
throw new Exception("ModifyInfo 저장 실패: " . json_encode($this->db->error() . " sql: " . $this->modifyInfoModel->getLastQuery()));
} }
CLI::write(CLI::color('✅ ModifyInfo 저장 성공', 'blue')); CLI::write(CLI::color('✅ ModifyInfo 저장 성공', 'blue'));

View File

@@ -15,7 +15,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
{ {
$now = db_now(); $now = db_now();
$step = $rawData['step'] ?? '00'; $step = $rawData['step'] ?? '00';
$rdate = $payload['requestDate'] ?? db_now('YmdHis'); $rdate = date("YmdHis", strtotime($payload['requestDate'] ?? db_now('YmdHis')));
$files = $rawData['files'] ?? []; $files = $rawData['files'] ?? [];
$fileExtracted = $this->extractFilesByType($files); $fileExtracted = $this->extractFilesByType($files);
@@ -33,7 +33,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
'realtor_tel_no' => $rawData['realtor']['representativeCellphoneNumber'] ?? null, 'realtor_tel_no' => $rawData['realtor']['representativeCellphoneNumber'] ?? null,
'seller_tel_no' => $rawData['seller']['cellphoneNumber'] ?? null, 'seller_tel_no' => $rawData['seller']['cellphoneNumber'] ?? null,
'vrfc_type' => $rawData['verificationTypeCode'] ?? 'D', 'vrfc_type' => $rawData['verificationTypeCode'] ?? 'D',
'rgbk_confirm' => null, 'rgbk_confirm' => ($rawData['isNeedRegisterBookConfirm'] ?? false) ? 'Y' : 'N',
'req_type' => $reqType, 'req_type' => $reqType,
'rdate' => $rdate, 'rdate' => $rdate,
'cpTelNo' => null, 'cpTelNo' => null,
@@ -44,7 +44,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
'rgbk_confirm_owner_nm' => null, 'rgbk_confirm_owner_nm' => null,
'direct_trad_yn' => ($rawData['seller']['isDirectTrade'] ?? false) ? 'Y' : 'N', 'direct_trad_yn' => ($rawData['seller']['isDirectTrade'] ?? false) ? 'Y' : 'N',
'confirm_doc_img_url' => json_encode($fileExtracted['confirmDocImgUrl']), 'confirm_doc_img_url' => json_encode($fileExtracted['confirmDocImgUrl']),
'confirm_doc_owner_check_yn' => null, 'confirm_doc_owner_check_yn' => ($rawData['seller']['isOwnerCertificationAgree'] ?? false) ? 'Y' : 'N',
'certRegister' => json_encode($fileExtracted['certRegister']), 'certRegister' => json_encode($fileExtracted['certRegister']),
'referenceFileUrl' => json_encode($fileExtracted['referenceFileUrl']), 'referenceFileUrl' => json_encode($fileExtracted['referenceFileUrl']),
]; ];
@@ -103,7 +103,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
'ptp_no' => $address['pyeongTypeNumber'] ?? null, 'ptp_no' => $address['pyeongTypeNumber'] ?? null,
'ptp_nm' => $address['pyeongTypeNumber'] ?? null, 'ptp_nm' => $address['pyeongTypeNumber'] ?? null,
'charger' => null, 'charger' => null,
'reg_price_yn' => 'N', 'req_price_yn' => 'N',
'reg_charger' => null, 'reg_charger' => null,
'dept1_sq' => null, 'dept1_sq' => null,
'dept2_sq' => null, 'dept2_sq' => null,
@@ -112,7 +112,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
'dong_ho_chk' => ($address['isDongHoCheck'] ?? false) ? 'Y' : 'N', 'dong_ho_chk' => ($address['isDongHoCheck'] ?? false) ? 'Y' : 'N',
'hscplqry_lv' => $address['inquiryLevel'] ?? null, 'hscplqry_lv' => $address['inquiryLevel'] ?? null,
'ownerNm' => $seller['ownerName'] ?? null, 'ownerNm' => $seller['ownerName'] ?? null,
'ownerTelNo' => $seller['ownerName'] ?? null, 'ownerTelNo' => $seller['ownerTelephoneNumber'] ?? null,
'chg_trade_type' => null, 'chg_trade_type' => null,
'chg_address2' => null, 'chg_address2' => null,
'chg_address3' => null, 'chg_address3' => null,
@@ -121,7 +121,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
'reg_status' => null, 'reg_status' => null,
'cupnNo' => null, 'cupnNo' => null,
'roomSiteAtclRgstCnt' => null, 'roomSiteAtclRgstCnt' => null,
'rootSiteAtclExpsCnt' => null, 'roomSiteAtclExpsCnt' => null,
'redvlp_area_nm' => $address['redevelopAreaName'] ?? null, 'redvlp_area_nm' => $address['redevelopAreaName'] ?? null,
'biz_stp_desc' => $address['bizStepDescription'] ?? null, 'biz_stp_desc' => $address['bizStepDescription'] ?? null,
'cert_register' => json_encode($fileExtracted['certRegister'], JSON_UNESCAPED_UNICODE), 'cert_register' => json_encode($fileExtracted['certRegister'], JSON_UNESCAPED_UNICODE),
@@ -142,7 +142,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
]; ];
} }
/** /**
* 기사 정보 추가 파라미터 생성 * 기사 정보 추가 파라미터 생성
*/ */
public function mapArticleInfoEtc(string $articleNumber, array $rawData): array public function mapArticleInfoEtc(string $articleNumber, array $rawData): array
@@ -201,7 +201,7 @@ class TypeV2ParameterMapper extends BaseParameterMapper
: ($address['jibunAddress'] ?? null); : ($address['jibunAddress'] ?? null);
return [ return [
'atcl_no' => $articleNumber, // 'atcl_no' => $articleNumber,
'bild_nm' => $address['buildingName'] ?? null, 'bild_nm' => $address['buildingName'] ?? null,
'rm_no' => $address['hoName'] ?? null, 'rm_no' => $address['hoName'] ?? null,
'floor' => $floor['correspondenceFloorCount'] ?? null, 'floor' => $floor['correspondenceFloorCount'] ?? null,

View File

@@ -39,13 +39,13 @@
$serverIp = $_SERVER['SERVER_ADDR'] ?? ''; $serverIp = $_SERVER['SERVER_ADDR'] ?? '';
// 개발 서버 // 개발 서버
$devServers = ['192.168.200.8', '192.168.10.231']; $devServers = ['192.168.200.8', '192.168.10.231', '172.18.0.5'];
// 도커 테스트 서버 // 도커 테스트 서버
$dockerServers = ['172.18.0.2']; $dockerServers = ['172.18.0.2'];
// 테스트 서버 // 테스트 서버
$testServers = ['192.168.200.9', '192.168.10.237', '175.126.191.182']; $testServers = ['192.168.200.9', '192.168.10.237', '175.126.191.182', '192.168.10.243'];
// 운영 서버 IP 매핑 // 운영 서버 IP 매핑
$prodServers = [ $prodServers = [
@@ -58,7 +58,7 @@
if (in_array($serverIp, $devServers, true)) { if (in_array($serverIp, $devServers, true)) {
// 개발 // 개발
echo "<img src='/img/gnb_dev_00.png' alt='' />"; echo "개발";
} elseif (in_array($serverIp, $dockerServers, true)) { } elseif (in_array($serverIp, $dockerServers, true)) {
// 도커 // 도커
@@ -80,8 +80,6 @@
echo "{$serverName}"; echo "{$serverName}";
} }
?> ?>
</li> </li>

View File

@@ -718,7 +718,7 @@ $usr_nm = session('usr_nm');
const rcpt_key = rowData.rcpt_key; const rcpt_key = rowData.rcpt_key;
location.href = "<?= site_url('article/dept/detail') ?>/" + rcpt_key; window.open("<?= site_url('article/dept/detail') ?>/" + rcpt_key, '_blank');
}); });
$(document).on('change', '#chkAll', function () { $(document).on('change', '#chkAll', function () {

View File

@@ -749,7 +749,7 @@
if (!rowData) return; if (!rowData) return;
const id = rowData.rcpt_no; const id = rowData.rcpt_no;
location.href = "<?= site_url('article/apt/detail') ?>/" + id; window.open("<?= site_url('article/apt/detail') ?>/" + id, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

File diff suppressed because it is too large Load Diff

View File

@@ -109,7 +109,6 @@ $usr_nm = session('usr_nm');
<div class="main-card mb-3 card"> <div class="main-card mb-3 card">
<div class="card-body"> <div class="card-body">
<form id="frm_srch_info" method="get" onsubmit="return false;"> <form id="frm_srch_info" method="get" onsubmit="return false;">
<!-- 검색 폼 --> <!-- 검색 폼 -->
<div class="row g-3"> <div class="row g-3">
<div class="col-md-1"> <div class="col-md-1">
@@ -175,19 +174,20 @@ $usr_nm = session('usr_nm');
<label class="form-label mb-1">현재상태</label> <label class="form-label mb-1">현재상태</label>
<div class="d-flex gap-1"> <div class="d-flex gap-1">
<select name="rcpt_stat1" class="form-select form-select-sm"> <select name="rcpt_stat1" class="form-select form-select-sm">
<option value="">예약확인지연</option>
<option value="">선택</option>
<?php foreach ($codes as $c): ?> <?php foreach ($codes as $c): ?>
<?php if ($c['category'] === "STEP_VERIFICATION"): ?> <?php if ($c['category'] === "STEP_VERIFICATION"): ?>
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option> <option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<select name="rcpt_stat2" id="srcGugun" class="form-select form-select-sm"> <!-- <select name="rcpt_stat2" id="srcGugun" class="form-select form-select-sm">
<option value="">-상태2-</option> <option value="">-상태2-</option>
</select> </select>
<select name="rcpt_stat3" id="srcDong" class="form-select form-select-sm"> <select name="rcpt_stat3" id="srcDong" class="form-select form-select-sm">
<option value="">-상태3-</option> <option value="">-상태3-</option>
</select> </select> -->
</div> </div>
</div> </div>
@@ -404,6 +404,13 @@ $usr_nm = session('usr_nm');
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>; const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>; const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>; const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
<?php if (isset($srchUser) && !empty($srchUser)): ?>
const srchUser = <?= json_encode($srchUser, JSON_UNESCAPED_UNICODE); ?>;
<?php else: ?>
const srchUser = null;
<?php endif; ?>
const sBonbu = "<?= $sBonbu ?? '' ?>";
const sTeam = "<?= $sTeanm ?? '' ?>";
const date = new Date(); const date = new Date();
var table; var table;
@@ -412,6 +419,15 @@ $usr_nm = session('usr_nm');
initReceiptDate(); initReceiptDate();
// srchUser 데이터가 있으면 초기값 설정 (usr_id 파라미터)
if (srchUser) {
initSrchUser();
}
// bonbu, dept_sq 파라미터가 있으면 초기값 설정
else if (sBonbu || sTeam) {
initSrchParam();
}
$("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) { $("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) {
const targetId = this.id; const targetId = this.id;
@@ -640,7 +656,7 @@ $usr_nm = session('usr_nm');
{ data: null, render: fn_prd_render }, { data: null, render: fn_prd_render },
{ data: 'rcpt_product_info1' }, { data: 'rcpt_product_info1' },
<?php if ($usr_level != "45"): ?> <?php if ($usr_level != "45"): ?>
{ data: 'dept_nm' }, { data: 'dept_nm' },
{ data: 'usr_nm' }, { data: 'usr_nm' },
<?php endif; ?> <?php endif; ?>
{ data: 'parcel_out_yn' }, { data: 'parcel_out_yn' },
@@ -669,7 +685,7 @@ $usr_nm = session('usr_nm');
if (!rowData) return; if (!rowData) return;
const rcpt_atclno = rowData.rcpt_atclno; const rcpt_atclno = rowData.rcpt_atclno;
location.href = "<?= site_url('article/receipt/detail') ?>/" + rcpt_atclno; window.open("<?= site_url('article/receipt/detail') ?>/" + rcpt_atclno, '_blank');
}); });
@@ -710,6 +726,79 @@ $usr_nm = session('usr_nm');
} }
// 검색 사용자 초기화 (usr_id 파라미터용)
function initSrchUser() {
if (!srchUser) return;
const pdept_sq = srchUser.pdept_sq;
const dept_sq = srchUser.dept_sq;
const usr_id = srchUser.usr_id;
// 1단계: 본부 선택
if (pdept_sq) {
$("#bonbu").val(pdept_sq);
// 2단계: 팀 목록 로드 및 선택
let teamStr = `<option value="">-팀-</option>`;
if (teamArr.length > 0) {
for (let i = 0; i < teamArr.length; i++) {
if (String(teamArr[i].pdept_sq) === String(pdept_sq)) {
const selected = String(teamArr[i].dept_sq) === String(dept_sq) ? 'selected' : '';
teamStr += `<option value="${teamArr[i].dept_sq}" ${selected}>${teamArr[i].dept_nm}</option>`;
}
}
}
$("#team").html(teamStr);
// 3단계: 담당자 목록 로드 및 선택
if (dept_sq) {
let damdangStr = `<option value="">-담당자-</option>`;
if (userArr.length > 0) {
for (let i = 0; i < userArr.length; i++) {
if (String(userArr[i].dept_sq) === String(dept_sq)) {
const selected = String(userArr[i].usr_id) === String(usr_id) ? 'selected' : '';
damdangStr += `<option value="${userArr[i].usr_id}" ${selected}>${userArr[i].usr_nm}</option>`;
}
}
}
$("#damdang").html(damdangStr);
}
}
}
// 검색 파라미터 초기화 (bonbu, dept_sq 파라미터용)
function initSrchParam() {
// 1단계: 본부 선택
if (sBonbu) {
$("#bonbu").val(sBonbu);
// 2단계: 팀 목록 로드 및 선택
let teamStr = `<option value="">-팀-</option>`;
if (teamArr.length > 0) {
for (let i = 0; i < teamArr.length; i++) {
if (String(teamArr[i].pdept_sq) === String(sBonbu)) {
const selected = String(teamArr[i].dept_sq) === String(sTeam) ? 'selected' : '';
teamStr += `<option value="${teamArr[i].dept_sq}" ${selected}>${teamArr[i].dept_nm}</option>`;
}
}
}
$("#team").html(teamStr);
// 3단계: 팀이 선택되어 있으면 담당자 목록 로드
if (sTeam) {
let damdangStr = `<option value="">-담당자-</option>`;
if (userArr.length > 0) {
for (let i = 0; i < userArr.length; i++) {
if (String(userArr[i].dept_sq) === String(sTeam)) {
damdangStr += `<option value="${userArr[i].usr_id}">${userArr[i].usr_nm}</option>`;
}
}
}
$("#damdang").html(damdangStr);
}
}
}
function atcl_no_enter(event) { function atcl_no_enter(event) {
if (event.keyCode == 13) { if (event.keyCode == 13) {
table.ajax.reload() table.ajax.reload()

View File

@@ -520,7 +520,7 @@ $usr_nm = session('usr_nm');
if (!rowData) return; if (!rowData) return;
const rcpt_key = rowData.rcpt_key; const rcpt_key = rowData.rcpt_key;
location.href = "<?= site_url('article/record/detail') ?>/" + rcpt_key; window.open("<?= site_url('article/record/detail') ?>/" + rcpt_key, '_blank');
}); });

View File

@@ -337,7 +337,9 @@
const row = table.row(this).data() const row = table.row(this).data()
if (!row) return if (!row) return
location.href = '/article/receipt/lists';
location.href = '/article/receipt/lists?usr_id=' + row.usr_id;
}); });
// [검색] 버튼 눌렀을 때 다시 조회 // [검색] 버튼 눌렀을 때 다시 조회

View File

@@ -144,13 +144,14 @@
$nRow = 1; $nRow = 1;
foreach ($st_list as $row) { foreach ($st_list as $row) {
// if ($row['depth'] == '1') { $pars = [];
// $rowPars = array_merge($pars, array('bonbu' => $row['dept_sq'])); if ($row['depth'] == '1') {
// } else { $rowPars = array_merge($pars, array('bonbu' => $row['dept_sq']));
// $rowPars = array_merge($pars, array('bonbu' => $row['pdept_sq'], 'dept_sq' => $row['dept_sq'])); } else {
// } $rowPars = array_merge($pars, array('bonbu' => $row['pdept_sq'], 'dept_sq' => $row['dept_sq']));
}
echo '<tr onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'normal\'" style="cursor:pointer" onclick="tr_onclick();">';
echo '<tr onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'normal\'" style="cursor:pointer" onclick="tr_onclick(\'' . make_query_string($rowPars) . '\');">';
echo '<td>' . $nRow . '</td>'; echo '<td>' . $nRow . '</td>';
echo '<td style="text-align:left">' . str_replace(' ', '&nbsp;', $row['dept_nm']) . '</td>'; echo '<td style="text-align:left">' . str_replace(' ', '&nbsp;', $row['dept_nm']) . '</td>';
echo '<td>' . $row['region_cnt'] . '</td>'; echo '<td>' . $row['region_cnt'] . '</td>';
@@ -231,8 +232,8 @@
}); });
function tr_onclick() { function tr_onclick(pars) {
location.href = '/article/receipt/lists'; location.href = '/article/receipt/lists' + pars;
} }
// 엑셀 다운로드 // 엑셀 다운로드

View File

@@ -326,7 +326,7 @@
// myModal.show(); // myModal.show();
location.href = '/article/receipt/lists'; location.href = '/article/receipt/lists?usr_id=' + row.usr_id;
}); });

View File

@@ -554,7 +554,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m701/m701a/detail') ?>/" + vr_sq; window.open("<?= site_url('m701/m701a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -578,7 +578,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m702/m702a/detail') ?>/" + vr_sq; window.open("<?= site_url('m702/m702a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -532,7 +532,7 @@
if (!rowData) return; if (!rowData) return;
const fax_sq = rowData.fax_sq; const fax_sq = rowData.fax_sq;
location.href = "<?= site_url('m703/m703a/detail') ?>/" + fax_sq; window.open("<?= site_url('m703/m703a/detail') ?>/" + fax_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -530,7 +530,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m704/m704a/detail') ?>/" + vr_sq; window.open("<?= site_url('m704/m704a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -569,7 +569,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m705/m705a/detail') ?>/" + vr_sq; window.open("<?= site_url('m705/m705a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -481,7 +481,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m706/m706a/detail') ?>/" + vr_sq; window.open("<?= site_url('m706/m706a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -557,7 +557,7 @@
if (!rowData) return; if (!rowData) return;
const fax_sq = rowData.fax_sq; const fax_sq = rowData.fax_sq;
location.href = "<?= site_url('m708/m708a/detail') ?>/" + fax_sq; window.open("<?= site_url('m708/m708a/detail') ?>/" + fax_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -557,7 +557,7 @@
if (!rowData) return; if (!rowData) return;
const fax_sq = rowData.fax_sq; const fax_sq = rowData.fax_sq;
location.href = "<?= site_url('m709/m709a/detail') ?>/" + fax_sq; window.open("<?= site_url('m709/m709a/detail') ?>/" + fax_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -560,7 +560,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m701/m701a/detail') ?>/" + vr_sq; window.open("<?= site_url('m701/m701a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -551,7 +551,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m712/m712a/detail') ?>/" + vr_sq; window.open("<?= site_url('m712/m712a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {

View File

@@ -570,7 +570,7 @@
if (!rowData) return; if (!rowData) return;
const vr_sq = rowData.vr_sq; const vr_sq = rowData.vr_sq;
location.href = "<?= site_url('m713/m713a/detail') ?>/" + vr_sq; window.open("<?= site_url('m713/m713a/detail') ?>/" + vr_sq, '_blank');
}); });
$('#btnSearch').on('click', function () { $('#btnSearch').on('click', function () {