diff --git a/src/main/java/com/dbnt/faisp/equip/EquipController.java b/src/main/java/com/dbnt/faisp/equip/EquipController.java index f4705ce6..ea5d8d9f 100644 --- a/src/main/java/com/dbnt/faisp/equip/EquipController.java +++ b/src/main/java/com/dbnt/faisp/equip/EquipController.java @@ -48,8 +48,13 @@ public class EquipController { } @GetMapping("/equipEditModal") - public ModelAndView equipEditModal() { + public ModelAndView equipEditModal(@AuthenticationPrincipal UserInfo loginUser) { ModelAndView mav = new ModelAndView("equip/equipEditModal"); + //메뉴권한 확인 + String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/equipStatus").get(0).getAccessAuth(); + mav.addObject("mgtOrganList", loginUser.getDownOrganCdList()); + mav.addObject("userOrgan", loginUser.getOgCd()); + mav.addObject("accessAuth", accessAuth); return mav; } @@ -65,7 +70,6 @@ public class EquipController { @PostMapping("/saveEquip") public void saveEquip(@AuthenticationPrincipal UserInfo loginUser,Equip equip, MultipartHttpServletRequest request){ equip.setWrtNm(loginUser.getUserId()); - equip.setMgtOrgan(loginUser.getOgCd()); equip.setWrtOrgan(loginUser.getOgCd()); equip.setWrtDt(LocalDateTime.now()); equipService.saveEquip(equip,request); diff --git a/src/main/java/com/dbnt/faisp/equip/service/EquipService.java b/src/main/java/com/dbnt/faisp/equip/service/EquipService.java index 330c3997..cf229d68 100644 --- a/src/main/java/com/dbnt/faisp/equip/service/EquipService.java +++ b/src/main/java/com/dbnt/faisp/equip/service/EquipService.java @@ -145,7 +145,7 @@ public class EquipService { Equip equipTmp = new Equip(); equipTmp.setEquKey(dbEquip.getEquKey()); equipTmp.setVersionNo(dbEquip.getVersionNo()+1); - equipTmp.setMgtOrgan(dbEquip.getMgtOrgan()); + equipTmp.setMgtOrgan(equip.getMgtOrgan()); equipTmp.setEquType(equip.getEquType()); equipTmp.setDetailType(equip.getDetailType()); equipTmp.setStoredYear(equip.getStoredYear()); diff --git a/src/main/resources/mybatisMapper/EquipMapper.xml b/src/main/resources/mybatisMapper/EquipMapper.xml index 21888f62..b751584b 100644 --- a/src/main/resources/mybatisMapper/EquipMapper.xml +++ b/src/main/resources/mybatisMapper/EquipMapper.xml @@ -347,21 +347,14 @@ select (select item_value from code_mgt cm where cm.item_cd = el.equ_type) as equ_type, (select item_value from code_mgt cm where cm.item_cd = el.detail_type) as detail_name, detail_type, - case - when oc.organ_type = 'OGC001' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - when oc.organ_type = 'OGC002' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - else (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ ) - end as sosok, - case - when oc.organ_type = 'OGC003' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - else null - end as detail_sosok, + (select item_value from code_mgt where item_cd = wrt_organ) as sosok, + (select item_value from code_mgt where item_cd = ofc_cd ) as detail_sosok, el_contents, wrt_nm, - wrt_dt + el.wrt_dt from equ_log el, - organ_config oc - where el.wrt_organ = oc.organ_cd + user_info ui + where el.wrt_nm = ui.user_id and wrt_organ in #{item} @@ -376,21 +369,14 @@ select (select item_value from code_mgt cm where cm.item_cd = el.equ_type) as equ_type, (select item_value from code_mgt cm where cm.item_cd = el.detail_type) as detail_name, detail_type, - case - when oc.organ_type = 'OGC001' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - when oc.organ_type = 'OGC002' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - else (select item_value from code_mgt cm where cm.item_cd = oc.parent_organ ) - end as sosok, - case - when oc.organ_type = 'OGC003' then (select item_value from code_mgt cm where cm.item_cd = oc.organ_cd ) - else null - end as detail_sosok, + (select item_value from code_mgt where item_cd = wrt_organ) as sosok, + (select item_value from code_mgt where item_cd = ofc_cd ) as detail_sosok, el_contents, wrt_nm, - wrt_dt + el.wrt_dt from equ_log el, - organ_config oc - where el.wrt_organ = oc.organ_cd + user_info ui + where el.wrt_nm = ui.user_id and wrt_organ in #{item} diff --git a/src/main/resources/static/js/equip/equip.js b/src/main/resources/static/js/equip/equip.js index 66060ab0..16711814 100644 --- a/src/main/resources/static/js/equip/equip.js +++ b/src/main/resources/static/js/equip/equip.js @@ -54,6 +54,11 @@ $(document).on('change', '#equType', function (){ }); $(document).on('click', '#saveEquip', function (){ + if($('#mgtOrgan').val() == ''){ + alert("관리처를 선택해주세요."); + $('#mgtOrgan').focus(); + return false; + } if($('#equType').val() == ''){ alert("분류를 선택해주세요."); $('#equType').focus(); @@ -70,6 +75,7 @@ $(document).on('click', '#saveEquip', function (){ return false; } if(confirm("저장하시겠습니까?")){ + document.getElementById("mgtOrgan").disabled = false; let ajaxUrl = "/equip/saveEquip"; const formData = new FormData($("#equipEditForm")[0]); contentFade("in"); @@ -142,12 +148,18 @@ function deleteImg(equKey,versionNo){ } $(document).on('click', '#updateEquip', function (){ + if($('#mMgtOrgan').val() == ''){ + alert("관리처를 선택해주세요."); + $('#mMgtOrgan').focus(); + return false; + } if($('#mItemQty').val() == ''){ alert("수량을 입력해주세요."); $('#mItemQty').focus(); return false; } if(confirm("수정하시겠습니까?")){ + document.getElementById("mMgtOrgan").disabled = false; let ajaxUrl = "/equip/updateEquip"; const formData = new FormData($("#equipModifyForm")[0]); contentFade("in"); diff --git a/src/main/resources/templates/equip/equipEditModal.html b/src/main/resources/templates/equip/equipEditModal.html index 1daa3c12..dd338322 100644 --- a/src/main/resources/templates/equip/equipEditModal.html +++ b/src/main/resources/templates/equip/equipEditModal.html @@ -12,7 +12,14 @@
- +
diff --git a/src/main/resources/templates/equip/equipLogList.html b/src/main/resources/templates/equip/equipLogList.html index 0c27d5ae..33933c1e 100644 --- a/src/main/resources/templates/equip/equipLogList.html +++ b/src/main/resources/templates/equip/equipLogList.html @@ -34,17 +34,6 @@
-
- -
-
- -
@@ -58,21 +47,21 @@ - - + + - - - + + + diff --git a/src/main/resources/templates/equip/equipModifyModal.html b/src/main/resources/templates/equip/equipModifyModal.html index 232d5a02..5edf8fff 100644 --- a/src/main/resources/templates/equip/equipModifyModal.html +++ b/src/main/resources/templates/equip/equipModifyModal.html @@ -14,7 +14,12 @@
- +
소속세부소속 분류 세부분류관서부서 수정자 수정내용 수정일시