This commit is contained in:
@@ -231,6 +231,8 @@ $routes->group('', ['namespace' => 'App\Controllers\V2'], static function ($rout
|
|||||||
* 모바일 추가 서류 - API
|
* 모바일 추가 서류 - API
|
||||||
*/
|
*/
|
||||||
$routes->get('m710a/getResultList', 'M710::getResultList');
|
$routes->get('m710a/getResultList', 'M710::getResultList');
|
||||||
|
$routes->get('m710a/excel', 'M710::excel');
|
||||||
|
$routes->get('m710a/sendApi', 'M710::sendApi'); // 전송요청 api 저장
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -109,4 +109,27 @@ class M710 extends BaseController
|
|||||||
$e->getPrevious()->getTraceAsString();
|
$e->getPrevious()->getTraceAsString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 전송 api
|
||||||
|
public function sendApi()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$type = $this->request->getPost('type');
|
||||||
|
|
||||||
|
$this->model->updateSendApi($type);
|
||||||
|
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '0',
|
||||||
|
'msg' => 'success',
|
||||||
|
]);
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->response->setJSON([
|
||||||
|
'code' => '9',
|
||||||
|
'msg' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -671,6 +671,25 @@ class M710Model extends Model
|
|||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 전송요청 api 수정
|
||||||
|
public function updateSendApi($type)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE v2_stop_api_save_info SET status = 'wait'
|
||||||
|
WHERE type like CONCAT(?, '%') AND status = 'stop'
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($this->db->query($sql, [$type]) === false) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'msg' => '저장 실패',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function insert_v2_stop_api_save_info($atcl_no, $vr_sq, $type, $fax_sq)
|
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)" .
|
$sql = "INSERT INTO v2_stop_api_save_info(atcl_no,vr_sq,type,status,stop_dt,fax_sq)" .
|
||||||
|
|||||||
@@ -248,6 +248,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ml-auto">
|
<div class="ml-auto">
|
||||||
|
<button class="btn btn-sm btn-outline-light" id="excel-download" onclick="send_api('O');">
|
||||||
|
모바일 V2 전송
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-sm btn-outline-light" id="excel-download" onclick="send_api('H');">
|
||||||
|
홍보확인서 전송
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-sm btn-outline-light" id="excel-download" onclick="send_api('T');">
|
||||||
|
전화확인 전송
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-sm btn-outline-light" id="excel-download" onclick="send_api('D');">
|
||||||
|
등기부등본 전송
|
||||||
|
</button>
|
||||||
<button class="btn btn-sm btn-outline-success" id="excel-download">
|
<button class="btn btn-sm btn-outline-success" id="excel-download">
|
||||||
<i class="fa fa-fw" aria-hidden="true" title="file-excel-o"></i>
|
<i class="fa fa-fw" aria-hidden="true" title="file-excel-o"></i>
|
||||||
엑셀다운로드
|
엑셀다운로드
|
||||||
@@ -679,6 +691,80 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 전송 api
|
||||||
|
function send_api(type) {
|
||||||
|
var nm = "";
|
||||||
|
|
||||||
|
if (type == "O") {
|
||||||
|
var nm = "모바일확인 V2";
|
||||||
|
} else if (type == 'H') {
|
||||||
|
var nm = '홍보확인서';
|
||||||
|
} else if (type == 'T') {
|
||||||
|
var nm = '전화확인';
|
||||||
|
} else {
|
||||||
|
var nm = '등기부등본';
|
||||||
|
}
|
||||||
|
|
||||||
|
swal.fire({
|
||||||
|
text: nm + " API를 전송하시겠습니까?",
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "예",
|
||||||
|
cancelButtonText: "아니오",
|
||||||
|
closeOnConfirm: false,
|
||||||
|
closeOnCancel: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
cancelButtonColor: "#d33",
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/m710/m710a/sendApi',
|
||||||
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||||
|
method: 'POST',
|
||||||
|
data: { 'type': type },
|
||||||
|
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') {
|
||||||
|
|
||||||
|
const fax_sq = result.data.fax_sq;
|
||||||
|
|
||||||
|
location.replace("<?= site_url('m708/m708a/detail') ?>/" + fax_sq);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Swal.fire({
|
||||||
|
title: result.msg,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getDateTimeString() {
|
function getDateTimeString() {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
const yyyy = d.getFullYear();
|
const yyyy = d.getFullYear();
|
||||||
|
|||||||
Reference in New Issue
Block a user