diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 1e4d5b0..876e3c4 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -134,6 +134,16 @@ $routes->group('', ['namespace' => 'App\Controllers\Article'], static function (
$routes->get('excel', 'Receipt2::excel');
});
+ /**
+ * 현장확인V2 조직별 배정 현황
+ */
+ $routes->group('article/dept2', static function ($routes) {
+ $routes->get('lists', 'Dept2::lists');
+
+ $routes->get('getResultList', 'Dept2::getResultList');
+ $routes->get('excel', 'Dept2::excel');
+ });
+
});
diff --git a/app/Controllers/Article/Dept2.php b/app/Controllers/Article/Dept2.php
new file mode 100644
index 0000000..50c7a18
--- /dev/null
+++ b/app/Controllers/Article/Dept2.php
@@ -0,0 +1,139 @@
+codeModel = new CodeModel();
+ $this->model = new DeptModel();
+ }
+
+ public function lists(): string
+ {
+
+ $codes = $this->codeModel->getCodeLists(['NHN_PRODUCT_TYPE', 'RECEIPT_STATUS1', 'RESERVED_APM']); // 코드조회
+ $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/article/dept/lists2", $this->data);
+ }
+
+ public function getResultList()
+ {
+ $start = (int) $this->request->getGet('start') ?: 0;
+ $end = (int) $this->request->getGet('length') ?: 10;
+
+ $data = [
+ 'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
+
+ 'sdate' => $this->request->getGet('sdate'), // 시작일
+ 'edate' => $this->request->getGet('edate'), // 종료일
+
+ 'rsrv_tm_ap' => $this->request->getGet('rsrv_tm_ap'), // 유형
+ 'rsrv_sdate' => $this->request->getGet('rsrv_sdate'), // 시작일
+ 'rsrv_edate' => $this->request->getGet('rsrv_edate'), // 종료일
+
+ 'bonbu' => $this->request->getGet('bonbu'), // 본부
+ 'team' => $this->request->getGet('team'), // 팀
+ 'user' => $this->request->getGet('user'), // 담당자
+
+ 'sido' => $this->request->getGet('sido'), // 시도
+ 'gugun' => $this->request->getGet('gugun'), // 시군구
+ 'dong' => $this->request->getGet('dong'), // 읍면동
+
+ 'ground_plan_yn' => $this->request->getGet('ground_plan_yn'), // 평면도유무
+ 'ground_plan' => $this->request->getGet('ground_plan'), // 평면도요청
+ 'direct_trad_yn' => $this->request->getGet('direct_trad_yn'), // 직거래
+
+ 'isSiteVRVerification' => $this->request->getGet('isSiteVRVerification'), // 검증방식
+ 'conf_img_yn' => $this->request->getGet('conf_img_yn'), // 홍보확인서 여부
+
+ 'stat' => $this->request->getGet('stat'),
+
+ 'srchType' => $this->request->getGet('srchType'), // 검색유형
+ 'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
+ ];
+
+ $totalCount = $this->model->getTotalCount($data);
+
+ $datas = $this->model->getResultList($start, $end, $data);
+
+ $deptStatistics = $this->model->getDeptStatistics($data); // 조직별통계
+ $areaStatistics = $this->model->getAreaStatistics($data); // 지역별통계
+
+ return $this->response->setJSON(body: [
+ 'recordsTotal' => $totalCount,
+ 'recordsFiltered' => $totalCount,
+ 'data' => $datas,
+ 'widgets' => [
+ 'deptList' => $deptStatistics,
+ 'areaStats' => $areaStatistics,
+ ],
+ ]);
+ }
+
+
+ // 엑셀 다운로드
+ public function excel()
+ {
+ try {
+
+ $data = [
+ 'req_rec_yn' => 'Y',
+ 'rcpt_atclno' => $this->request->getGet('rcpt_atclno'), // 매물ID
+
+ 'sdate' => $this->request->getGet('sdate'), // 시작일
+ 'edate' => $this->request->getGet('edate'), // 종료일
+
+ 'rsrv_tm_ap' => $this->request->getGet('rsrv_tm_ap'), // 유형
+ 'rsrv_sdate' => $this->request->getGet('rsrv_sdate'), // 시작일
+ 'rsrv_edate' => $this->request->getGet('rsrv_edate'), // 종료일
+
+ 'bonbu' => $this->request->getGet('bonbu'), // 본부
+ 'team' => $this->request->getGet('team'), // 팀
+ 'user' => $this->request->getGet('user'), // 담당자
+
+ 'sido' => $this->request->getGet('sido'), // 시도
+ 'gugun' => $this->request->getGet('gugun'), // 시군구
+ 'dong' => $this->request->getGet('dong'), // 읍면동
+
+ 'ground_plan_yn' => $this->request->getGet('ground_plan_yn'), // 평면도유무
+ 'ground_plan' => $this->request->getGet('ground_plan'), // 평면도요청
+ 'direct_trad_yn' => $this->request->getGet('direct_trad_yn'), // 직거래
+
+ 'isSiteVRVerification' => $this->request->getGet('isSiteVRVerification'), // 검증방식
+ 'conf_img_yn' => $this->request->getGet('conf_img_yn'), // 홍보확인서 여부
+
+ 'stat' => $this->request->getGet('stat'),
+
+ 'srchType' => $this->request->getGet('srchType'), // 검색유형
+ 'srchTxt' => $this->request->getGet('srchTxt'), // 검색어
+ ];
+
+ $datas = $this->model->getExcelList($data);
+
+ return $this->response->setJSON(body: [
+ 'data' => $datas,
+ ]);
+
+ } catch (\Exception $e) {
+ $e->getPrevious()->getTraceAsString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/Models/article/DeptModel.php b/app/Models/article/DeptModel.php
index 8ca36e2..3c1cdbe 100644
--- a/app/Models/article/DeptModel.php
+++ b/app/Models/article/DeptModel.php
@@ -418,7 +418,7 @@ class DeptModel extends Model
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
} else {
- $builder->where('a.isSiteVRVerification', 'N');
+ $builder->where('b.req_rec_yn', 'Y');
// 접수일자
/*
@@ -490,6 +490,20 @@ class DeptModel extends Model
$builder->where('a.direct_trad_yn', 'N');
}
+ // 검증방식
+ if (!empty($data['isSiteVRVerification'])) {
+ $builder->where('a.isSiteVRVerification', $data['isSiteVRVerification']);
+ }
+
+ // 홍보확인서 여부
+ if (!empty($data['conf_img_yn'])) {
+ if ($data['conf_img_yn'] == "Y") {
+ $builder->where('exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I1\' and imgs.use_yn=\'Y\')', NULL, FALSE);
+ } else if ($data['conf_img_yn'] == "N") {
+ $builder->where('not exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I1\' and imgs.use_yn=\'Y\')', NULL, FALSE);
+ }
+ }
+
// 상태
if (!empty($data['stat'])) {
$builder->whereIn('substring(a.rcpt_stat, 1, 2)', $data['stat']);
@@ -648,7 +662,7 @@ class DeptModel extends Model
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
} else {
- $builder->where('a.isSiteVRVerification', 'N');
+ $builder->where('b.req_rec_yn', 'Y');
// 접수일자
/*
@@ -720,6 +734,20 @@ class DeptModel extends Model
$builder->where('a.direct_trad_yn', 'N');
}
+ // 검증방식
+ if (!empty($data['isSiteVRVerification'])) {
+ $builder->where('a.isSiteVRVerification', $data['isSiteVRVerification']);
+ }
+
+ // 홍보확인서 여부
+ if (!empty($data['conf_img_yn'])) {
+ if ($data['conf_img_yn'] == "Y") {
+ $builder->where('exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I1\' and imgs.use_yn=\'Y\')', NULL, FALSE);
+ } else if ($data['conf_img_yn'] == "N") {
+ $builder->where('not exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I1\' and imgs.use_yn=\'Y\')', NULL, FALSE);
+ }
+ }
+
// 상태
if (!empty($data['stat'])) {
$builder->whereIn('substring(a.rcpt_stat, 1, 2)', $data['stat']);
@@ -930,7 +958,7 @@ class DeptModel extends Model
$builder->where('a.rcpt_atclno', $data['rcpt_atclno']);
} else {
- $builder->where('a.isSiteVRVerification', 'N');
+ $builder->where('b.req_rec_yn', 'Y');
// 접수일자
/*
@@ -1002,6 +1030,20 @@ class DeptModel extends Model
$builder->where('a.direct_trad_yn', 'N');
}
+ // 검증방식
+ if (!empty($data['isSiteVRVerification'])) {
+ $builder->where('a.isSiteVRVerification', $data['isSiteVRVerification']);
+ }
+
+ // 홍보확인서 여부
+ if (!empty($data['conf_img_yn'])) {
+ if ($data['conf_img_yn'] == "Y") {
+ $builder->where('exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I1\' and imgs.use_yn=\'Y\')', NULL, FALSE);
+ } else if ($data['conf_img_yn'] == "N") {
+ $builder->where('not exists (select \'x\' from result_imgs imgs where imgs.rsrv_sq = b.rsrv_sq and imgs.img_type = \'I1\' and imgs.use_yn=\'Y\')', NULL, FALSE);
+ }
+ }
+
// 상태
if (!empty($data['stat'])) {
$builder->whereIn('substring(a.rcpt_stat, 1, 2)', $data['stat']);
diff --git a/app/Views/pages/article/dept/lists2.php b/app/Views/pages/article/dept/lists2.php
new file mode 100644
index 0000000..0a7447d
--- /dev/null
+++ b/app/Views/pages/article/dept/lists2.php
@@ -0,0 +1,1065 @@
+
+= $this->extend('layouts/main') ?>
+
+= $this->section('content') ?>
+
+
+
현장확인V2 조직별 배정 현황
+
+
+
+
+
+= $this->section('modals') ?>
+
+= $this->endSection() ?>
+
+
+
+
+
+= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/pages/results/assign/stats_a01.php b/app/Views/pages/results/assign/stats_a01.php
index 1323f56..555b507 100644
--- a/app/Views/pages/results/assign/stats_a01.php
+++ b/app/Views/pages/results/assign/stats_a01.php
@@ -136,7 +136,9 @@
사용자 목록
+ id="excel-download">
+ 엑셀다운로드
+
@@ -335,30 +337,7 @@
const row = table.row(this).data()
if (!row) return
- const modalEl = document.getElementById('userModal');
- const myModal = new bootstrap.Modal(modalEl);
-
- $("#frm_user_info")[0].reset()
-
- $("#frm_user_info [name=usr_sq]").val(row.usr_sq)
- $("#frm_user_info [name=type]").val("update")
-
- $("#frm_user_info [name=addUserNm]").val(row.usr_nm)
- $("#frm_user_info [name=addUserDept]").val(row.dept_sq)
- $("#frm_user_info [name=addUserId]").val(row.usr_id)
- $("#frm_user_info [name=addUserId]").prop("readonly", true)
-
- $("#frm_user_info [name=addUserLevel]").val(row.usr_level)
- $("#frm_user_info [name=addUserPosition]").val(row.usr_position)
- $("#frm_user_info [name=addUserTel1]").val(row.usr_tel1)
- $("#frm_user_info [name=addUserTel2]").val(row.usr_tel2)
- $("#frm_user_info [name=addSmsYn]").val(row.sms_auth_yn)
- $("#frm_user_info [name=addUserAddr1]").val(row.usr_addr1)
- $("#frm_user_info [name=addUserAddr2]").val(row.usr_addr2)
- $("#frm_user_info [name=addUseYn]").val(row.use_yn)
-
- myModal.show();
-
+ location.href = '/article/receipt/lists';
});
// [검색] 버튼 눌렀을 때 다시 조회
diff --git a/app/Views/pages/results/dept/stats_d01.php b/app/Views/pages/results/dept/stats_d01.php
index 8d1fc22..5558c02 100644
--- a/app/Views/pages/results/dept/stats_d01.php
+++ b/app/Views/pages/results/dept/stats_d01.php
@@ -112,7 +112,9 @@
요약 실적
+ id="excel-download">
+ 엑셀다운로드
+
@@ -148,7 +150,7 @@
// $rowPars = array_merge($pars, array('bonbu' => $row['pdept_sq'], 'dept_sq' => $row['dept_sq']));
// }
- echo '
';
+ echo '
';
echo '| ' . $nRow . ' | ';
echo '' . str_replace(' ', ' ', $row['dept_nm']) . ' | ';
echo '' . $row['region_cnt'] . ' | ';
@@ -229,8 +231,8 @@
});
- function tr_onclick(pars) {
- location.href = '/article/receipt/lists' + pars + '&m=M201';
+ function tr_onclick() {
+ location.href = '/article/receipt/lists';
}
// 엑셀 다운로드
diff --git a/app/Views/pages/results/m409/stats.php b/app/Views/pages/results/m409/stats.php
index f97f67b..69f5a49 100644
--- a/app/Views/pages/results/m409/stats.php
+++ b/app/Views/pages/results/m409/stats.php
@@ -83,7 +83,9 @@
사용자 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/m410/stats.php b/app/Views/pages/results/m410/stats.php
index 5613392..5cbc0ce 100644
--- a/app/Views/pages/results/m410/stats.php
+++ b/app/Views/pages/results/m410/stats.php
@@ -83,7 +83,9 @@
상담원 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/m411/stats.php b/app/Views/pages/results/m411/stats.php
index a324dbd..d46adb5 100644
--- a/app/Views/pages/results/m411/stats.php
+++ b/app/Views/pages/results/m411/stats.php
@@ -77,7 +77,9 @@
매체사 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/m412/stats.php b/app/Views/pages/results/m412/stats.php
index c835c80..858f906 100644
--- a/app/Views/pages/results/m412/stats.php
+++ b/app/Views/pages/results/m412/stats.php
@@ -206,7 +206,9 @@
매체사 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/m415/stats.php b/app/Views/pages/results/m415/stats.php
index 0d710eb..dfb22cf 100644
--- a/app/Views/pages/results/m415/stats.php
+++ b/app/Views/pages/results/m415/stats.php
@@ -77,7 +77,9 @@
매체사 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/m416/stats.php b/app/Views/pages/results/m416/stats.php
index 979bc54..c29a292 100644
--- a/app/Views/pages/results/m416/stats.php
+++ b/app/Views/pages/results/m416/stats.php
@@ -96,7 +96,9 @@
사용자 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/m417/stats.php b/app/Views/pages/results/m417/stats.php
index 9d75fe3..f891048 100644
--- a/app/Views/pages/results/m417/stats.php
+++ b/app/Views/pages/results/m417/stats.php
@@ -72,7 +72,9 @@
매체사 목록
+ id="excel-download">
+ 엑셀다운로드
+
diff --git a/app/Views/pages/results/person/stats_p01.php b/app/Views/pages/results/person/stats_p01.php
index f4f299c..5cdeb9f 100644
--- a/app/Views/pages/results/person/stats_p01.php
+++ b/app/Views/pages/results/person/stats_p01.php
@@ -136,7 +136,9 @@
사용자 목록
+ id="excel-download">
+ 엑셀다운로드
+
@@ -322,29 +324,9 @@
const row = table.row(this).data()
if (!row) return
- const modalEl = document.getElementById('userModal');
- const myModal = new bootstrap.Modal(modalEl);
+ // myModal.show();
- $("#frm_user_info")[0].reset()
-
- $("#frm_user_info [name=usr_sq]").val(row.usr_sq)
- $("#frm_user_info [name=type]").val("update")
-
- $("#frm_user_info [name=addUserNm]").val(row.usr_nm)
- $("#frm_user_info [name=addUserDept]").val(row.dept_sq)
- $("#frm_user_info [name=addUserId]").val(row.usr_id)
- $("#frm_user_info [name=addUserId]").prop("readonly", true)
-
- $("#frm_user_info [name=addUserLevel]").val(row.usr_level)
- $("#frm_user_info [name=addUserPosition]").val(row.usr_position)
- $("#frm_user_info [name=addUserTel1]").val(row.usr_tel1)
- $("#frm_user_info [name=addUserTel2]").val(row.usr_tel2)
- $("#frm_user_info [name=addSmsYn]").val(row.sms_auth_yn)
- $("#frm_user_info [name=addUserAddr1]").val(row.usr_addr1)
- $("#frm_user_info [name=addUserAddr2]").val(row.usr_addr2)
- $("#frm_user_info [name=addUseYn]").val(row.use_yn)
-
- myModal.show();
+ location.href = '/article/receipt/lists';
});