운행정지 쿼리수정 및 아작스 여러번 호출되는 현상 수정

dev
Kurt92 2 years ago
parent 8ada7f148e
commit e8d3b7da41

@ -388,12 +388,9 @@ public class Rev010101Controller {
rev010101Service.addAnytmLevyProc(vo); rev010101Service.addAnytmLevyProc(vo);
result = true; result = true;
break; break;
case "disableDriveSave": case "disableDriveSave": case"disableDriveDelete":
rev010101Service.addDriveDisable(jsonArr, mode); rev010101Service.addDriveDisable(jsonArr, mode);
break; break;
/*case "disableDriveDelete":
rev010101Service.deleteDriveDisable(jsonArr, mode);
break;*/
default: default:
throw new RuntimeException("유효하지 않은 처리 요청 입니다."); throw new RuntimeException("유효하지 않은 처리 요청 입니다.");
} }

@ -1252,15 +1252,21 @@
<if test = "'disableDriveTarget'.toString() eq isSchDisableDriveSe"> <if test = "'disableDriveTarget'.toString() eq isSchDisableDriveSe">
AND EXISTS ( AND EXISTS (
SELECT 1 SELECT 1
FROM TB_REGIST_VIOLT_VHCLE_STTS SA FROM TB_REGIST_VIOLT_VHCLE_STTS sas
LEFT OUTER JOIN TB_DISABLE_DRIVE TDD on (SA.ATDRC_CD=TDD.ATDRC_CD and SA.VIOLT_IEM_CD=TDD.VIOLT_IEM_CD and SA.MANAGE_YEAR=TDD.MANAGE_YEAR and SA.MANAGE_NO=TDD.MANAGE_NO)
WHERE 1=1 WHERE 1=1
AND A.ATDRC_CD=SA.ATDRC_CD AND A.ATDRC_CD=sas.ATDRC_CD
AND A.VIOLT_IEM_CD=SA.VIOLT_IEM_CD AND A.VIOLT_IEM_CD=sas.VIOLT_IEM_CD
AND A.MANAGE_YEAR=SA.MANAGE_YEAR AND A.MANAGE_YEAR=sas.MANAGE_YEAR
AND A.MANAGE_NO=SA.MANAGE_NO AND A.MANAGE_NO=sas.MANAGE_NO
AND SA.EXP_INSPT_VALID_AT = 0 AND sas.EXP_INSPT_VALID_AT = 0
AND (TDD.DELETE_YN != 'N' OR TDD.DELETE_YN IS NULL) AND NOT exists (
SELECT 1 FROM TB_DISABLE_DRIVE tdd
WHERE sas.ATDRC_CD=tdd.ATDRC_CD
AND sas.VIOLT_IEM_CD=tdd.VIOLT_IEM_CD
AND sas.MANAGE_YEAR=tdd.MANAGE_YEAR
AND sas.MANAGE_NO=tdd.MANAGE_NO
AND tdd.delete_yn = 'N'
)
) )
</if> </if>
<if test = "'disableDriveY'.toString() eq isSchDisableDriveSe"> <if test = "'disableDriveY'.toString() eq isSchDisableDriveSe">

@ -474,9 +474,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<select name="isSchDisableDriveSe" class="isSchDisableDrive" style="width: 150px;"> <select id="isSchDisableDriveSe" name="isSchDisableDriveSe" class="isSchDisableDrive" style="width: 150px;">
<option value="disableDriveTarget">운행정지 대상자료</option> <option value="disableDriveTarget">운행정지 대상자료</option>
<%--<option value="includeDisableDriveSeY">기운행정지 자료 포함</option>--%>
<option value="disableDriveY">기운행정지 자료만</option> <option value="disableDriveY">기운행정지 자료만</option>
</select> </select>
@ -614,7 +613,7 @@
<button type="button" id="uptAdresFromCarLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(자망)"/>주소업데이트(자망)</button> <button type="button" id="uptAdresFromCarLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(자망)"/>주소업데이트(자망)</button>
<button type="button" id="uptAdresFromJuminLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(주민망)"/>주소업데이트(주민망)</button> <button type="button" id="uptAdresFromJuminLink_btn" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="주소업데이트(주민망)"/>주소업데이트(주민망)</button>
<button type="button" id="bundle_btn" class="btn sm gray" style="margin: 5px 0;" onclick="dialog()"><img src="/resource/images/common/search.png" alt="묶음자료생성"/>묶음자료생성</button> <button type="button" id="bundle_btn" class="btn sm gray" style="margin: 5px 0;" onclick="dialog()"><img src="/resource/images/common/search.png" alt="묶음자료생성"/>묶음자료생성</button>
<button type="button" id="filterData" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="운행정지데이터 관리"/>운행정지관리</button> <button type="button" id="disableDrive" class="btn sm gray" style="margin: 5px 0;"><img src="/resource/images/common/search.png" alt="운행정지데이터 관리"/>운행정지관리</button>
</th> </th>
</tr> </tr>
</tbody> </tbody>
@ -1098,6 +1097,7 @@ function fn_search(procFlag, obj){
,manage_no : manage_no ,manage_no : manage_no
}, },
success:function(data){ success:function(data){
console.log('is this reason?')
//요청별 결과 출력 //요청별 결과 출력
switch (procFlag) { switch (procFlag) {
case 'insert': //신규등록 case 'insert': //신규등록
@ -1371,11 +1371,12 @@ $("#report_btn").click(function(){
}); });
$('#disableDrive').click(function(){
$('#filterData').click(function(){
//운행정지여부 체크 //운행정지여부 체크
if($('#isSchDisableDrive').is(':checked') == false){ if($('#isSchDisableDrive').is(':checked') == false){
alert('운행정지 대상자료 체크가 되어있지 않습니다.\n운행정지 조건을 선택하여 조회해주세요.'); alert('운행정지 대상자료 체크가 되어있지 않습니다.\n운행정지 조건을 선택하여 조회해주세요.');
} else if ($('#div_tbody input[name="checkbox"]:checked').length == 0) {
alert('선택된 자료가 없습니다.');
} else { } else {
//다이얼로그 오픈 //다이얼로그 오픈
$("#disableDriveDialog").dialog({ $("#disableDriveDialog").dialog({
@ -1388,13 +1389,19 @@ $('#filterData').click(function(){
if($('#isSchDisableDriveSe').val() == 'disableDriveY'){ if($('#isSchDisableDriveSe').val() == 'disableDriveY'){
console.log('disableDriveY') console.log('disableDriveY')
$('#disableDriveDelete').css('display','') $('#disableDriveDelete').css('display','')
$('#disableDriveSave').css('display','none')
}else{ }else{
$('#disableDriveSave').css('display','')
$('#disableDriveDelete').css('display','none') $('#disableDriveDelete').css('display','none')
} }
}
});
$('#disableDriveDialog button').click(function(e){ $('#disableDriveDialog button').click(function(e){
console.log(e.target.id); console.log("!!!!!!!btnClick!!!!!!!!!!",e.target.id);
var arrParam = []; var arrParam = [];
$('input[name="checkbox"]:checked:not(#checkAll)').each(function(){ $('#div_tbody tbody input[name="checkbox"]:checked').each(function(){
var $row = $(this).parents('tr'); var $row = $(this).parents('tr');
var param = new Object(); var param = new Object();
param.atdrc_cd = $row.attr("atdrc_cd"); param.atdrc_cd = $row.attr("atdrc_cd");
@ -1403,12 +1410,14 @@ $('#filterData').click(function(){
param.manage_no = $row.attr("manage_no"); param.manage_no = $row.attr("manage_no");
param.vhcle_no = $row.attr("vhcle_no"); param.vhcle_no = $row.attr("vhcle_no");
arrParam.push(param); arrParam.push(param);
console.log('arrParam', arrParam);
}); });
//form 생성 //form 생성
var form = document.createElement("form"); var form = document.createElement("form");
var mode = document.createElement('input'); var mode = document.createElement("input");
mode.setAttribute('type', 'hidden'); mode.setAttribute('type', 'hidden');
mode.setAttribute('name', 'mode'); mode.setAttribute('name', 'mode');
mode.setAttribute('disableDriveAttact', 'Y')
if(e.target.id == 'disableDriveSave'){ if(e.target.id == 'disableDriveSave'){
mode.setAttribute('value', 'disableDriveSave'); mode.setAttribute('value', 'disableDriveSave');
} else { } else {
@ -1421,20 +1430,20 @@ $('#filterData').click(function(){
param.setAttribute('value', JSON.stringify(arrParam)); param.setAttribute('value', JSON.stringify(arrParam));
form.appendChild(param); form.appendChild(param);
console.log("ajax call");
$.ajax({ $.ajax({
type:"POST", type:"POST",
url:'<c:url value="/category/rev/rev0101/rev010101_proc.do"/>', url:'<c:url value="/category/rev/rev0101/rev010101_proc.do"/>',
dataType:"json", dataType:"json",
data: $(form).serialize(), data: $(form).serialize(),
success:function(data){ success:function(data){
alert('정상처리 되었습니다.'); alert('success');
$('#diaRegexRemove').dialog('close'); $('#disableDriveDialog').dialog('close');
fn_search(); fn_search();
} }
}); });
}) })
}
});
</script> </script>
Loading…
Cancel
Save