diff --git a/src/main/java/com/dbnt/faisp/main/counterIntelligence/CounterIntelligenceController.java b/src/main/java/com/dbnt/faisp/main/counterIntelligence/CounterIntelligenceController.java index 89a7f8dd..c380c9fc 100644 --- a/src/main/java/com/dbnt/faisp/main/counterIntelligence/CounterIntelligenceController.java +++ b/src/main/java/com/dbnt/faisp/main/counterIntelligence/CounterIntelligenceController.java @@ -120,8 +120,12 @@ public class CounterIntelligenceController { @GetMapping("/ciaSaftyDemandList") public ModelAndView ciaSaftyDemandList(@AuthenticationPrincipal UserInfo loginUser, CounterIntelligenceActivity cia){ ModelAndView mav = new ModelAndView("counterIntelligence/ciaSaftyDemandList"); - + String accessAuth = authMgtService.selectAccessConfigList + (loginUser.getUserSeq(), "/counterIntelligence/ciaSaftyDemandList").get(0).getAccessAuth(); + mav.addObject("accessAuth", accessAuth); + cia.setDownOrganCdList(loginUser.getDownOrganCdList()); + cia.setWrtUserSeq(loginUser.getUserSeq()); cia.setQueryInfo(); mav.addObject("sdiList", ciService.selectCiaSaftyDemandList(cia)); cia.setContentCnt(ciService.selectCiaSaftyDemandListCnt(cia)); @@ -187,7 +191,11 @@ public class CounterIntelligenceController { @GetMapping("/ciaManageCompanyList") public ModelAndView ciaManageCompanyList(@AuthenticationPrincipal UserInfo loginUser, CounterIntelligenceActivity cia){ ModelAndView mav = new ModelAndView("counterIntelligence/ciaManageCompanyList"); - + String accessAuth = authMgtService.selectAccessConfigList + (loginUser.getUserSeq(), "/counterIntelligence/ciaManageCompanyList").get(0).getAccessAuth(); + mav.addObject("accessAuth", accessAuth); + + cia.setWrtUserSeq(loginUser.getUserSeq()); cia.setDownOrganCdList(loginUser.getDownOrganCdList()); cia.setQueryInfo(); mav.addObject("mciList", ciService.selectCiaManageCompanyList(cia)); @@ -223,7 +231,11 @@ public class CounterIntelligenceController { @GetMapping("/ciaForeignerList") public ModelAndView ciaForeignerList(@AuthenticationPrincipal UserInfo loginUser, CounterIntelligenceActivity cia){ ModelAndView mav = new ModelAndView("counterIntelligence/ciaForeignerList"); - + String accessAuth = authMgtService.selectAccessConfigList + (loginUser.getUserSeq(), "/counterIntelligence/ciaForeignerList").get(0).getAccessAuth(); + mav.addObject("accessAuth", accessAuth); + + cia.setWrtUserSeq(loginUser.getUserSeq()); cia.setDownOrganCdList(loginUser.getDownOrganCdList()); cia.setQueryInfo(); mav.addObject("fiList", ciService.selectCiaForeignerList(cia)); @@ -258,8 +270,12 @@ public class CounterIntelligenceController { @GetMapping("/ciaEduList") public ModelAndView ciaEduList(@AuthenticationPrincipal UserInfo loginUser, CounterIntelligenceActivity cia){ - ModelAndView mav = new ModelAndView("counterIntelligence/ciaEduList"); - + ModelAndView mav = new ModelAndView("counterIntelligence/ciaEduList"); + String accessAuth = authMgtService.selectAccessConfigList + (loginUser.getUserSeq(), "/counterIntelligence/ciaEduList").get(0).getAccessAuth(); + mav.addObject("accessAuth", accessAuth); + + cia.setWrtUserSeq(loginUser.getUserSeq()); cia.setDownOrganCdList(loginUser.getDownOrganCdList()); cia.setQueryInfo(); mav.addObject("eiList", ciService.selectCiaEduList(cia)); @@ -293,7 +309,8 @@ public class CounterIntelligenceController { } @PostMapping("/deleteCounterIntelligenceActivity") - public void deleteCounterIntelligenceActivity(@AuthenticationPrincipal UserInfo loginUser, @RequestBody CounterIntelligenceActivity cia){ + public void deleteCounterIntelligenceActivity(@AuthenticationPrincipal UserInfo loginUser,@RequestBody CounterIntelligenceActivity cia){ + cia.setContentStatus("DST008"); ciService.deleteCounterIntelligenceActivity(cia); } diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/MajorStatusController.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/MajorStatusController.java index 5beff042..86924985 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/MajorStatusController.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/MajorStatusController.java @@ -3,6 +3,8 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus; import com.dbnt.faisp.main.authMgt.service.AuthMgtService; +import com.dbnt.faisp.main.codeMgt.model.CodeMgt; +import com.dbnt.faisp.main.codeMgt.service.CodeMgtService; import com.dbnt.faisp.main.equip.model.Equip; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus; import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository; @@ -26,12 +28,15 @@ public class MajorStatusController { private final AuthMgtService authMgtService; private final MajorStatusService majorStatusService; + private final CodeMgtService codeMgtService; @GetMapping("/majorStatusPage") public ModelAndView majorStatus(@AuthenticationPrincipal UserInfo loginUser, MajorStatus majorStatus){ ModelAndView mav = new ModelAndView("ivsgt/majorStatus/majorStatusPage"); + mav.addObject("mstList", codeMgtService.selectCodeMgtList("MST")); + mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); mav.addObject("searchParams", majorStatus); @@ -61,6 +66,7 @@ public class MajorStatusController { } + //mav.addObject("mstList", codeMgtService.selectCodeMgtList("MST")); mav.addObject("majorStatus", majorStatus); mav.addObject("userSeq", loginUser.getUserSeq()); return mav; diff --git a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java index 86c79739..5107ee04 100644 --- a/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java +++ b/src/main/java/com/dbnt/faisp/main/ivsgtMgt/majorStatus/service/MajorStatusService.java @@ -87,17 +87,10 @@ public class MajorStatusService extends BaseService { } } + @Transactional public void deleteContent(MajorStatus majorStatus){ - - //파일삭제 - List MajorFileList = majorFileRepository.findByMajorKey(majorStatus.getMajorKey()); - if(MajorFileList != null) { - for(MajorFile file: MajorFileList){ - deleteStoredFile(new File(file.getSavePath(), file.getConvNm())); - } - } - majorFileRepository.deleteByMajorKey(majorStatus.getMajorKey()); - majorStatusRepository.deleteById(majorStatus.getMajorKey()); + majorStatus = majorStatusRepository.findById(majorStatus.getMajorKey()).orElse(null); + majorStatus.setContentStatus("DST008"); } private void deleteMajorFile(Integer majorKey, List deleteFileSeq) { diff --git a/src/main/resources/mybatisMapper/CounterIntelligenceMapper.xml b/src/main/resources/mybatisMapper/CounterIntelligenceMapper.xml index fd5c9ba0..507a11ef 100644 --- a/src/main/resources/mybatisMapper/CounterIntelligenceMapper.xml +++ b/src/main/resources/mybatisMapper/CounterIntelligenceMapper.xml @@ -135,7 +135,7 @@ select cia.ci_key, - cia.content_status, + (select item_value from code_mgt where item_cd = cia.content_status) as content_status, cia.ci_type, (select item_value from code_mgt where item_cd = mci.mgt_organ) as mgt_organ, mci.company_nm, @@ -225,6 +227,7 @@ manage_company_info mci where cia.ci_key = mci.ci_key and cia.content_status != 'DST008' + and ((cia.wrt_user_seq = #{wrtUserSeq} and cia.content_status = 'DST001') or cia.content_status = 'DST007') and cia.wrt_organ = #{wrtOrgan} @@ -252,7 +255,7 @@ select count(*) from( select cia.ci_key, - cia.content_status, + (select item_value from code_mgt where item_cd = cia.content_status) as content_status, cia.ci_type, (select item_value from code_mgt where item_cd = mci.mgt_organ) as mgt_organ, mci.company_nm, @@ -270,6 +273,7 @@ manage_company_info mci where cia.ci_key = mci.ci_key and cia.content_status != 'DST008' + and ((cia.wrt_user_seq = #{wrtUserSeq} and cia.content_status = 'DST001') or cia.content_status = 'DST007') and cia.wrt_organ = #{wrtOrgan} @@ -295,7 +299,7 @@ select cia.ci_key, - cia.content_status, + (select item_value from code_mgt where item_cd = cia.content_status) as content_status, (select item_value from code_mgt where item_cd = ei.mgt_organ) as mgt_organ, ei.edu_date, ei.edu_type, @@ -415,6 +421,7 @@ edu_info ei where cia.ci_key = ei.ci_key and cia.content_status != 'DST008' + and ((cia.wrt_user_seq = #{wrtUserSeq} and cia.content_status = 'DST001') or cia.content_status = 'DST007') and ei.mgt_organ = #{mgtOrgan} @@ -449,7 +456,7 @@ select count(*) from( select cia.ci_key, - cia.content_status, + (select item_value from code_mgt where item_cd = cia.content_status) as content_status, (select item_value from code_mgt where item_cd = ei.mgt_organ) as mgt_organ, ei.edu_date, ei.edu_type, @@ -462,6 +469,8 @@ from counter_intelligence_activity cia, edu_info ei where cia.ci_key = ei.ci_key + and cia.content_status != 'DST008' + and ((cia.wrt_user_seq = #{wrtUserSeq} and cia.content_status = 'DST001') or cia.content_status = 'DST007') and ei.mgt_organ = #{mgtOrgan} diff --git a/src/main/resources/mybatisMapper/MajorStatusMapper.xml b/src/main/resources/mybatisMapper/MajorStatusMapper.xml index 3135cfa1..bb24d6f1 100644 --- a/src/main/resources/mybatisMapper/MajorStatusMapper.xml +++ b/src/main/resources/mybatisMapper/MajorStatusMapper.xml @@ -7,6 +7,7 @@ + a.content_status <> 'DST008' and a.major_type = #{majorType} diff --git a/src/main/resources/static/js/counterIntelligence/ciaEdu.js b/src/main/resources/static/js/counterIntelligence/ciaEdu.js index 2ebbe8db..3c08dff9 100644 --- a/src/main/resources/static/js/counterIntelligence/ciaEdu.js +++ b/src/main/resources/static/js/counterIntelligence/ciaEdu.js @@ -101,3 +101,25 @@ $(document).on('click', '#excelDown', function (){ exportExcel("방첩교육 실시 현황","ciaEduTb"); }) +$(document).on('click', '#deleteBtn', function (){ + const ciKey = $(this).attr("data-cikey"); + if(confirm("삭제 하시겠습니까?")){ + $.ajax({ + type : 'POST', + url : "/counterIntelligence/deleteCounterIntelligenceActivity", + data : JSON.stringify({ciKey:ciKey}), + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function() { + alert("삭제처리 되었습니다."); + location.reload(); + }, + error : function(xhr, status) { + alert("삭제처리에 실패하였습니다"); + } + }) + } +}) + diff --git a/src/main/resources/static/js/counterIntelligence/ciaForeigner.js b/src/main/resources/static/js/counterIntelligence/ciaForeigner.js index ec71cbd9..ff2b9ab5 100644 --- a/src/main/resources/static/js/counterIntelligence/ciaForeigner.js +++ b/src/main/resources/static/js/counterIntelligence/ciaForeigner.js @@ -106,3 +106,25 @@ $(document).on('click', '#excelDown', function (){ exportExcel("외국인 커뮤니티 모니터링 현황","ciaForeignerTb"); }) +$(document).on('click', '#deleteBtn', function (){ + const ciKey = $(this).attr("data-cikey"); + if(confirm("삭제 하시겠습니까?")){ + $.ajax({ + type : 'POST', + url : "/counterIntelligence/deleteCounterIntelligenceActivity", + data : JSON.stringify({ciKey:ciKey}), + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function() { + alert("삭제처리 되었습니다."); + location.reload(); + }, + error : function(xhr, status) { + alert("삭제처리에 실패하였습니다"); + } + }) + } +}) + diff --git a/src/main/resources/static/js/counterIntelligence/ciaManageCompany.js b/src/main/resources/static/js/counterIntelligence/ciaManageCompany.js index 11e38de6..cca3f316 100644 --- a/src/main/resources/static/js/counterIntelligence/ciaManageCompany.js +++ b/src/main/resources/static/js/counterIntelligence/ciaManageCompany.js @@ -95,3 +95,25 @@ $(document).on('click', '#editBtn', function (){ $(document).on('click', '#excelDown', function (){ exportExcel("해양산업보호 관리업체 현황","mciTb"); }) + +$(document).on('click', '#deleteBtn', function (){ + const ciKey = $(this).attr("data-cikey"); + if(confirm("삭제 하시겠습니까?")){ + $.ajax({ + type : 'POST', + url : "/counterIntelligence/deleteCounterIntelligenceActivity", + data : JSON.stringify({ciKey:ciKey}), + contentType: 'application/json', + beforeSend: function (xhr){ + xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); + }, + success : function() { + alert("삭제처리 되었습니다."); + location.reload(); + }, + error : function(xhr, status) { + alert("삭제처리에 실패하였습니다"); + } + }) + } +}) diff --git a/src/main/resources/static/js/counterIntelligence/ciaSaftyDemand.js b/src/main/resources/static/js/counterIntelligence/ciaSaftyDemand.js index edf0f3b8..09193e47 100644 --- a/src/main/resources/static/js/counterIntelligence/ciaSaftyDemand.js +++ b/src/main/resources/static/js/counterIntelligence/ciaSaftyDemand.js @@ -73,7 +73,7 @@ $(document).on('click', '#deleteBtn', function (){ $.ajax({ type : 'POST', url : "/counterIntelligence/deleteCounterIntelligenceActivity", - data : {ciKey:ciKey,contentStatus:'DST008'}, + data : JSON.stringify({ciKey:ciKey}), contentType: 'application/json', beforeSend: function (xhr){ xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); diff --git a/src/main/resources/static/js/ivsgt/majorStatus.js b/src/main/resources/static/js/ivsgt/majorStatus.js index 473e6e43..63a82764 100644 --- a/src/main/resources/static/js/ivsgt/majorStatus.js +++ b/src/main/resources/static/js/ivsgt/majorStatus.js @@ -1,5 +1,10 @@ +$("#jqueryBtn").click(function(){ + $(".quiz-text").text("Javascript"); + $(".quiz-text").css('color', 'blue'); +}); + $(document).on('click', '#addMajorBtn', function (){ getEditModal(null) @@ -20,7 +25,7 @@ $(document).on('click', '.tr', function (){ // }); $(document).on('click', '#saveBtn', function (){ - saveContent("boardEditForm") + saveContent("MajorEditForm") }) $(document).on('click', '#editBtn', function (){ @@ -45,7 +50,7 @@ $(document).on('click', '#deleteMajorBtn', function (){ const majorKey = $('input[name=majorKey]').val(); console.log(majorKey); if(confirm("삭제하시겠습니까?")){ - contentFade("in"); + //contentFade("in"); $.ajax({ type : 'POST', url : "/ivsgt/deleteContent", @@ -56,10 +61,12 @@ $(document).on('click', '#deleteMajorBtn', function (){ }, success : function(data) { alert("삭제 처리되었습니다."); + //contentFade("out"); location.reload(); }, error : function(xhr, status) { alert("삭제 처리에 실패하였습니다"); + //contentFade("out"); } }) } @@ -132,12 +139,17 @@ function getViewModal(majorKey){ }); } -function saveContent(formId, majorType){ - if(contentCheck(formId)){ - if(confirm("저장하시겠습니까?")){ +function saveContent(contentStatus){ + if(confirm("저장하시겠습니까?")){ + let flag = true; + if(contentStatus === "DST007"){ + flag = contentCheck(); + } + if(flag){ contentFade("in"); - $("#content").val(""); - const formData = new FormData($("#"+formId)[0]); + const MajorEditForm = $("#MajorEditForm"); + MajorEditForm.find("contentStatus").val(contentStatus); + const formData = new FormData(MajorEditForm[0]); for(const file of files) { if(!file.isDelete) formData.append('uploadFiles', file, file.name); diff --git a/src/main/resources/templates/counterIntelligence/ciaEduList.html b/src/main/resources/templates/counterIntelligence/ciaEduList.html index 7da3b1c9..7294ed2a 100644 --- a/src/main/resources/templates/counterIntelligence/ciaEduList.html +++ b/src/main/resources/templates/counterIntelligence/ciaEduList.html @@ -72,6 +72,7 @@ + @@ -83,6 +84,7 @@ + diff --git a/src/main/resources/templates/counterIntelligence/ciaForeignerList.html b/src/main/resources/templates/counterIntelligence/ciaForeignerList.html index 3c8fbebc..23052cdf 100644 --- a/src/main/resources/templates/counterIntelligence/ciaForeignerList.html +++ b/src/main/resources/templates/counterIntelligence/ciaForeignerList.html @@ -75,6 +75,7 @@
상태 시행일자 시행관서 교육방식
+ @@ -92,6 +93,7 @@ + diff --git a/src/main/resources/templates/counterIntelligence/ciaForeignerViewModal.html b/src/main/resources/templates/counterIntelligence/ciaForeignerViewModal.html index 778be9d9..9f1228a2 100644 --- a/src/main/resources/templates/counterIntelligence/ciaForeignerViewModal.html +++ b/src/main/resources/templates/counterIntelligence/ciaForeignerViewModal.html @@ -104,7 +104,7 @@
- +
diff --git a/src/main/resources/templates/counterIntelligence/ciaManageCompanyList.html b/src/main/resources/templates/counterIntelligence/ciaManageCompanyList.html index eb00e5d4..7bcb1bac 100644 --- a/src/main/resources/templates/counterIntelligence/ciaManageCompanyList.html +++ b/src/main/resources/templates/counterIntelligence/ciaManageCompanyList.html @@ -72,7 +72,7 @@
상태 관리관서 담당관 대상커뮤니티
- + @@ -85,7 +85,7 @@ - + diff --git a/src/main/resources/templates/counterIntelligence/ciaManageCompanyViewModal.html b/src/main/resources/templates/counterIntelligence/ciaManageCompanyViewModal.html index 554e5358..f2e796d7 100644 --- a/src/main/resources/templates/counterIntelligence/ciaManageCompanyViewModal.html +++ b/src/main/resources/templates/counterIntelligence/ciaManageCompanyViewModal.html @@ -96,7 +96,7 @@
- +
diff --git a/src/main/resources/templates/counterIntelligence/ciaSaftyDemandList.html b/src/main/resources/templates/counterIntelligence/ciaSaftyDemandList.html index 13649e4d..7ad1bbd7 100644 --- a/src/main/resources/templates/counterIntelligence/ciaSaftyDemandList.html +++ b/src/main/resources/templates/counterIntelligence/ciaSaftyDemandList.html @@ -69,7 +69,7 @@
문서번호상태 관리관서 업체명 소재지
- + @@ -79,8 +79,7 @@ - - + - - - - - - - - - - - + +
문서번호상태 관서 지역특성 예상문제점
@@ -92,24 +91,9 @@ - - - - - -
diff --git a/src/main/resources/templates/counterIntelligence/ciaSaftyDemandviewModal.html b/src/main/resources/templates/counterIntelligence/ciaSaftyDemandviewModal.html index 8fbf8979..84f94cd3 100644 --- a/src/main/resources/templates/counterIntelligence/ciaSaftyDemandviewModal.html +++ b/src/main/resources/templates/counterIntelligence/ciaSaftyDemandviewModal.html @@ -4,6 +4,8 @@ + +