From a3e97665b31a7455ab52d3d72d9eeb4b068a85f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Tue, 31 Jan 2023 10:25:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=99=B8=EC=82=AC=EA=B2=BD=EC=B0=B0=ED=98=84?= =?UTF-8?q?=ED=99=A9=20=EC=88=98=EC=A0=95=EC=9D=B4=EB=A0=A5=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatisMapper/UserInfoMapper.xml | 3 +- src/main/resources/static/js/police/police.js | 171 +++++++++--------- .../police/police/policeHistory.html | 56 +++--- 3 files changed, 118 insertions(+), 112 deletions(-) diff --git a/src/main/resources/mybatisMapper/UserInfoMapper.xml b/src/main/resources/mybatisMapper/UserInfoMapper.xml index 2dd79d97..b62ff3fb 100644 --- a/src/main/resources/mybatisMapper/UserInfoMapper.xml +++ b/src/main/resources/mybatisMapper/UserInfoMapper.xml @@ -305,7 +305,8 @@ ofc_in_date, (select item_value from code_mgt where item_cd = title_cd) as title_cd, title_in_date, - (select item_value from code_mgt where item_cd = outturn_cd) as outturn_cd, + (select item_value from code_mgt where item_cd = duty_cd) as duty_cd, + (select item_value from code_mgt where item_cd = outturn_cd) as outturn_cd, (select item_value from code_mgt where item_cd = series_cd) as series_cd, (select item_value from code_mgt where item_cd = language_cd) as language_cd from user_info_history diff --git a/src/main/resources/static/js/police/police.js b/src/main/resources/static/js/police/police.js index b6769a55..dc9da12e 100644 --- a/src/main/resources/static/js/police/police.js +++ b/src/main/resources/static/js/police/police.js @@ -1,15 +1,15 @@ $(document).on('click', '.policeTr', function (event){ - const target = event.target; - if(!(target.className === "checkBoxTd" ||$(target).parents("td").length>0)){ - const userSeq = (Number($(this).find(".userSeq").val())); - showModal(userSeq); - } + const target = event.target; + if(!(target.className === "checkBoxTd" ||$(target).parents("td").length>0)){ + const userSeq = (Number($(this).find(".userSeq").val())); + showModal(userSeq); + } }); function showModal(userSeq){ - $.ajax({ + $.ajax({ url: '/police/policeEditModal', - data: {userSeq: userSeq}, + data: {userSeq: userSeq}, type: 'GET', dataType:"html", success: function(html){ @@ -84,10 +84,10 @@ $(document).on('click', '#updateBtn', function (){ }) $(document).on('click', '#historyTab', function (){ - const userSeq = (Number($(this).data('userseq'))); + const userSeq = (Number($(this).data('userseq'))); $.ajax({ url: '/police/policeHistory', - data: {userSeq: userSeq}, + data: {userSeq: userSeq}, type: 'GET', dataType:"html", success: function(html){ @@ -101,42 +101,43 @@ $(document).on('click', '#historyTab', function (){ }) $(document).on('click', '#editTab', function (){ - const userSeq = (Number($(this).data('userseq'))); - showModal(userSeq); + const userSeq = (Number($(this).data('userseq'))); + showModal(userSeq); }) $(document).on('click', '.historyInfoTr', function (){ - $(this).find('.hisChk').prop('checked',true) - if($(this).find('.hisChk').prop('checked')){ - $('.hisChk').prop('checked',false); - $(this).find('.hisChk').prop('checked',true) - } + $(this).find('.hisChk').prop('checked',true) + if($(this).find('.hisChk').prop('checked')){ + $('.hisChk').prop('checked',false); + $(this).find('.hisChk').prop('checked',true) + } $.ajax({ url: '/police/policeHistoryView', data: { - userSeq: Number($(this).find(".userSeq").val()), - versionNo : Number($(this).find(".verNo").val()) - }, + userSeq: Number($(this).find(".userSeq").val()), + versionNo : Number($(this).find(".verNo").val()) + }, type: 'GET', dataType:"json", success: function(data){ - $('#vDicCode').val(data.dicCode); - $('#vUserId').val(data.userId); - $('#vUserNm').val(data.userNm); - $('#vPhone').val(data.phoneNo); - $('#vEmail').val(data.email); - $('#vSex').val(data.sex); - $('#vBirth').val(data.birthDate); - $('#vPoliceInDate').val(data.policeInDate); - $('#vOgCd').val(data.ogCd); - $('#vOrganInDate').val(data.organInDate); - $('#vOfcCd').val(data.ofcCd); - $('#vOfcInDate').val(data.ofcInDate); - $('#vTitleCd').val(data.titleCd); - $('#vTitleInDate').val(data.titleInDate); - $('#vOutturnCd').val(data.outturnCd); - $('#vSeriesCd').val(data.seriesCd); - $('#vLanguageCd').val(data.languageCd); + $('#vDicCode').val(data.dicCode); + $('#vUserId').val(data.userId); + $('#vUserNm').val(data.userNm); + $('#vPhone').val(data.phoneNo); + $('#vEmail').val(data.email); + $('#vSex').val(data.sex); + $('#vBirth').val(data.birthDate); + $('#vPoliceInDate').val(data.policeInDate); + $('#vOgCd').val(data.ogCd); + $('#vOrganInDate').val(data.organInDate); + $('#vOfcCd').val(data.ofcCd); + $('#vOfcInDate').val(data.ofcInDate); + $('#vTitleCd').val(data.titleCd); + $('#vTitleInDate').val(data.titleInDate); + $('#vDutyCd').val(data.dutyCd); + $('#vOutturnCd').val(data.outturnCd); + $('#vSeriesCd').val(data.seriesCd); + $('#vLanguageCd').val(data.languageCd); }, error:function(e){ ajaxErrorAction(e); @@ -145,23 +146,23 @@ $(document).on('click', '.historyInfoTr', function (){ }) $(document).on('click', '#previousTab', function (){ - const userStatus = $(this).data('userstatus'); - location.href = "/police/policeList?userStatus="+userStatus; + const userStatus = $(this).data('userstatus'); + location.href = "/police/policeList?userStatus="+userStatus; }) $(document).on('click', '#presentTab', function (){ - const userStatus = $(this).data('userstatus'); - location.href = "/police/policeList?userStatus="+userStatus; + const userStatus = $(this).data('userstatus'); + location.href = "/police/policeList?userStatus="+userStatus; }) $(document).on('click', '#notPoliceTab', function (){ - const userStatus = $(this).data('userstatus'); - location.href = "/police/policeList?userStatus="+userStatus; + const userStatus = $(this).data('userstatus'); + location.href = "/police/policeList?userStatus="+userStatus; }) $(document).on('click', '#outBtn', function (){ if($('input:checkbox[name=policeChk]:checked').length < 1){ - alert("전출대상을 선택해주세요") - return false; + alert("전출대상을 선택해주세요") + return false; } if(confirm("선택한 대상을 전출처리 하시겠습니까?")){ const checkArr = []; @@ -171,29 +172,29 @@ $(document).on('click', '#outBtn', function (){ checkArr[idx].userSeq = Number(target.parents('tr').find('.userSeq').val()); checkArr[idx].userStatus = "USC006" }) - $.ajax({ - type : 'POST', - url : "/police/policeStatusUpdate", - data : JSON.stringify(checkArr), - contentType: 'application/json', - beforeSend: function (xhr){ - xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); - }, - success : function(data) { - alert(data+"건이 전출 처리되었습니다."); - location.reload(); - }, - error : function(xhr, status) { - alert("전출처리에 실패하였습니다"); - } - }) + $.ajax({ + type : 'POST', + url : "/police/policeStatusUpdate", + data : JSON.stringify(checkArr), + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function(data) { + alert(data+"건이 전출 처리되었습니다."); + location.reload(); + }, + error : function(xhr, status) { + alert("전출처리에 실패하였습니다"); + } + }) } }) $(document).on('click', '#inBtn', function (){ if($('input:checkbox[name=policeChk]:checked').length < 1){ - alert("전입대상을 선택해주세요") - return false; + alert("전입대상을 선택해주세요") + return false; } if(confirm("선택한 대상을 전입처리 하시겠습니까?")){ const checkArr = []; @@ -203,22 +204,22 @@ $(document).on('click', '#inBtn', function (){ checkArr[idx].userSeq = Number(target.parents('tr').find('.userSeq').val()); checkArr[idx].userStatus = "USC003" }) - $.ajax({ - type : 'POST', - url : "/police/policeStatusUpdate", - data : JSON.stringify(checkArr), - contentType: 'application/json', - beforeSend: function (xhr){ - xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); - }, - success : function(data) { - alert(data+"건이 전입 처리되었습니다."); - location.reload(); - }, - error : function(xhr, status) { - alert("전입처리에 실패하였습니다"); - } - }) + $.ajax({ + type : 'POST', + url : "/police/policeStatusUpdate", + data : JSON.stringify(checkArr), + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function(data) { + alert(data+"건이 전입 처리되었습니다."); + location.reload(); + }, + error : function(xhr, status) { + alert("전입처리에 실패하였습니다"); + } + }) } }) @@ -229,12 +230,12 @@ $(document).ready( function() { }); $(document).on('click', '#goExcel', function (){ - if(confirm("엑셀로 다운로드 하시겠습니까?")){ - $('input[name=excel]').val('Y'); - $('#searchFm').submit(); - $('input[name=excel]').val(''); - }else{ - false; - } + if(confirm("엑셀로 다운로드 하시겠습니까?")){ + $('input[name=excel]').val('Y'); + $('#searchFm').submit(); + $('input[name=excel]').val(''); + }else{ + false; + } }) diff --git a/src/main/resources/templates/police/police/policeHistory.html b/src/main/resources/templates/police/police/policeHistory.html index 1b430e1d..bac20b9c 100644 --- a/src/main/resources/templates/police/police/policeHistory.html +++ b/src/main/resources/templates/police/police/policeHistory.html @@ -41,8 +41,6 @@ - - @@ -52,89 +50,95 @@
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- + +
+ +
+
+
+
- +
- +