상세수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled

This commit is contained in:
yangsh
2026-02-04 10:48:51 +09:00
parent 107cc395d6
commit 2c96bd12de
10 changed files with 5052 additions and 1123 deletions

View File

@@ -191,6 +191,42 @@ class M415Model extends Model
return $res;
}
// 서류/전화 확인완료 시간 = 등기부등본 확인중 시간
public function getConfTimeForHistory($vr_sq)
{
$sql = "select insert_tm from v2_chg_history" .
" where vr_sq = ?" .
" and stat_cd = '35'" .
" and chg_type= 'C9'" .
" order by seq desc" .
" limit 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
// 검증완료 시간
public function get_60_ForHistory($vr_sq)
{
$sql = "select insert_tm from v2_chg_history" .
" where vr_sq = ?" .
" and stat_cd = '60'" .
" and chg_type= 'C9'" .
" order by seq desc" .
" limit 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
// 등기부등본 확인중 시간, 서류에서 등기로 넘어갈때 간혹 서류전화 확인 완료가 안찍히는 건들이 있다
public function get_cert_ing_TimeForHistory($vr_sq)
{
@@ -338,4 +374,196 @@ class M415Model extends Model
);
$this->db->query($sql, $data);
}
//전화확인 - 통화실패 카운트
public function getCallfailForHistory($vr_sq)
{
$sql = "SELECT 'x' from v2_chg_history" .
" WHERE vr_sq = ?" .
" AND chg_type= 'C29'" .
" ORDER BY seq desc" .
" LIMIT 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
// 서류/전화 인입시간
public function getSaveTimeForHistory($vr_sq)
{
$sql = "select insert_tm from v2_chg_history" .
" where vr_sq = ?" .
" and stat_cd = '30'" .
" and chg_type= 'C9'" .
" order by seq desc" .
" limit 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
// 등기부등본 확인실패 시간
public function get_cert_failTimeForHistory($vr_sq)
{
$sql = "select insert_tm from v2_chg_history" .
" where vr_sq = ?" .
" and stat_cd = '49'" .
" and chg_type= 'C9'" .
" order by seq desc" .
" limit 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
//등기부등본 확인완료(모바일)
public function insert_v2_time_required_M($atcl_no, $cpid, $vrfc_type, $insert_tm, $cert_comple_dt, $finishTime)
{
if (substr($insert_tm, 0, 10) == substr($cert_comple_dt, 0, 10)) {
if (('12:00:00' < substr($insert_tm, -8)) && (substr($insert_tm, -8) < '13:00:00')) {//접수시간이 12~13시 사이면 13시로 해준다
if ($cert_comple_dt > '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($cert_comple_dt, -8) < '17:30:00' || substr($cert_comple_dt, -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:00:00";
}
}
$stan_date = substr($insert_tm, 0, 10);
$sql = "INSERT INTO v2_time_required(stan_date, atcl_no, cpid, vrfc_type, insert_tm, cert_comple_dt, cert_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,
$cert_comple_dt,
$cert_comple_dt,
$insert_tm,
$cert_comple_dt,
$insert_tm
);
$this->db->query($sql, $data);
}
//등기부등본 확인완료(불일치)
public function update_v2_time_required_Conf($atcl_no, $cpid, $vrfc_type, $tel_doc_conf_dt, $cert_comple_dt, $sf)
{
if ($sf == 'F') {
if (substr($tel_doc_conf_dt, 0, 10) == substr($cert_comple_dt, 0, 10)) {
if (('12:00:00' < substr($tel_doc_conf_dt, -8)) && (substr($tel_doc_conf_dt, -8) < '13:00:00')) {//전서확인시간이 12~13시 사이면 13시로 해준다
// if (substr($finishTime, -8) > '13:00:00'){ //등본완료가 13시 '이후'에 끝나면 전서확인시간을 13시로 변경해준다
// $tel_doc_conf_dt = date("Y-m-d",time())." 13:00:00";
// }
}
}
}
$sql = "UPDATE v2_time_required " .
" SET cert_comple_dt = ?" .
" ,cert_required_tm = TIMEDIFF(?,?)" .//등본 소요시간 = 등본완료시간-/서확인완료시간
" WHERE atcl_no = ?";
$data = array(
$cert_comple_dt,
$cert_comple_dt,
$tel_doc_conf_dt,
$atcl_no
);
$this->db->query($sql, $data);
// echo $this->db->last_query().'<br>';
}
// 최초! 등기부등본 확인중 시간-모바일용
public function get_cert_M_timeForHistory($vr_sq)
{
$sql = "select insert_tm from v2_chg_history" .
" where vr_sq = ?" .
" and stat_cd = '40'" .
" and chg_type= 'C9'" .
" limit 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
// 검증실패 시간
public function get_69_ForHistory($vr_sq)
{
$sql = "select insert_tm from v2_chg_history" .
" where vr_sq = ?" .
" and stat_cd = '69'" .
" and chg_type= 'C9'" .
" order by seq desc" .
" limit 1";
$data = array(
$vr_sq
);
$query = $this->db->query($sql, $data);
$res = $query->getRowArray();
return $res;
}
//등기부등본 확인완료(일치/불일치), 검증완료/실패까지 갈때만!
public function update_v2_time_required_Conf_Done($atcl_no, $cpid, $vrfc_type, $tel_doc_conf_dt, $cert_comple_dt)
{
//1.검증소요시간 가져온다
$sql = "SELECT conf_required_tm" .
" FROM v2_time_required" .
" WHERE atcl_no = ?";
$data = array(
$atcl_no
);
$query = $this->db->query($sql, $data);
$res = $query->row_array();
if (substr($tel_doc_conf_dt, 0, 10) == substr($cert_comple_dt, 0, 10)) {
if (('12:00:00' < substr($tel_doc_conf_dt, -8)) && (substr($tel_doc_conf_dt, -8) < '13:00:00')) {//전서확인시간이 12~13시 사이면 13시로 해준다
if (substr($cert_comple_dt, -8) > '13:00:00') { //등본완료가 13시 '이후'에 끝나면 전서확인시간을 13시로 변경해준다
$tel_doc_conf_dt = date("Y-m-d", time()) . " 13:00:00";
}
}
}
//2.등본소요시간, 등본완료시간, 총소요시간을 넣는다
$sql = "UPDATE v2_time_required " .
" SET cert_comple_dt = ?" .
" ,cert_required_tm = TIMEDIFF(?,?)" . //등본 소요시간 = 등본완료시간-전/서확인완료시간
" ,tot_required_tm = ADDTIME(?,TIMEDIFF(?,?))" .//총소요시간 = 검증소요시간+등본소요시간
" WHERE atcl_no = ?";
$data = array(
$cert_comple_dt,
$cert_comple_dt,
$tel_doc_conf_dt,
$res['conf_required_tm'],
$cert_comple_dt,
$tel_doc_conf_dt,
$atcl_no
);
$this->db->query($sql, $data);
}
}