From 2c275c8e20b02d716442bca0fdc9fcd38a170682 Mon Sep 17 00:00:00 2001 From: myname Date: Tue, 30 Jan 2024 12:03:39 +0900 Subject: [PATCH] =?UTF-8?q?2024-01-30=2012:03=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=EA=B6=8C=ED=95=9C=20=EC=88=98=EC=A0=95(=EC=B0=BE?= =?UTF-8?q?=EA=B5=90=20=EA=B4=80=EB=A6=AC=EC=9E=90=20=EB=8B=B4=EB=8B=B9?= =?UTF-8?q?=EC=97=85=EB=AC=B4=EC=B6=94=EA=B0=80=20=EA=B0=80=EB=8A=A5,=20?= =?UTF-8?q?=EA=B8=B0=EC=86=8C=EC=9C=A0=EC=98=88=EA=B4=80=ED=95=A0=20?= =?UTF-8?q?=EB=8B=B4=EB=8B=B9=EC=97=85=EB=AC=B4=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EgovUserManageServiceImpl.java | 38 +++++++++---- .../uss/umt/web/EgovUserManageController.java | 55 +++++++++++++++++-- .../sec/rgm/EgovAuthorGroup_SQL_Tibero.xml | 1 + .../let/uss/umt/EgovUserManage_SQL_Tibero.xml | 3 +- .../jsp/cmm/uss/umt/EgovUserInsert.jsp | 17 +++++- .../jsp/cmm/uss/umt/EgovUserManage.jsp | 13 ++++- .../jsp/cmm/uss/umt/EgovUserSelectUpdt.jsp | 31 ++++++++++- 7 files changed, 137 insertions(+), 21 deletions(-) diff --git a/src/main/java/kcc/let/uss/umt/service/impl/EgovUserManageServiceImpl.java b/src/main/java/kcc/let/uss/umt/service/impl/EgovUserManageServiceImpl.java index aa429bd9..35ae9da6 100644 --- a/src/main/java/kcc/let/uss/umt/service/impl/EgovUserManageServiceImpl.java +++ b/src/main/java/kcc/let/uss/umt/service/impl/EgovUserManageServiceImpl.java @@ -119,35 +119,53 @@ public class EgovUserManageServiceImpl extends EgovAbstractServiceImpl implement userManageVO.setUniqId(uniqId); String pass = "1"; - if("ROLE_ADMIN".equals(userManageVO.getAuthorCode()) || "ROLE_VISIT".equals(userManageVO.getAuthorCode())){ + if( + "ROLE_ADMIN".equals(userManageVO.getAuthorCode()) //최고관리자 + || "ROLE_VISIT".equals(userManageVO.getAuthorCode()) //찾교 관리자 + || "ROLE_ADR_JRSDC".equals(userManageVO.getAuthorCode()) //기소유예관할 + ){ + //관리자 //패스워드 암호화 pass = EgovFileScrty.encryptPassword(userManageVO.getPassword(), userManageVO.getEmplyrId()); userManageVO.setPassword(pass); }else { + //관리자 이외 userManageVO.setPassword(pass); } userManageVO.setEmplyrSttusCode("P"); //강제승인 String result = ""; - if( !("ROLE_ADMIN".equals(userManageVO.getAuthorCode()) - || "ROLE_VISIT".equals(userManageVO.getAuthorCode()) )) { + if( + "ROLE_ADMIN".equals(userManageVO.getAuthorCode()) //최고관리자 + || "ROLE_VISIT".equals(userManageVO.getAuthorCode()) //찾교 관리자 + || "ROLE_ADR_JRSDC".equals(userManageVO.getAuthorCode()) //기소유예관할 + + ) { + + //관리자 + result = userManageDAO.insertUser(userManageVO); - result = userManageDAO.insertUser_GNR(userManageVO); }else { - result = userManageDAO.insertUser(userManageVO); + //관리자 이외 + result = userManageDAO.insertUser_GNR(userManageVO); } AuthorGroup authorGroup = new AuthorGroup(); //사용자별권한관리에 등록해줌 authorGroup.setUniqId(uniqId); authorGroup.setAuthorCode(userManageVO.getAuthorCode()); //authorGroup.setAuthorCode("ROLE_ADMIN"); - if(!"ROLE_ADMIN".equals(userManageVO.getAuthorCode()) - || !"ROLE_VISIT".equals(userManageVO.getAuthorCode())){ - - authorGroup.setMberTyCode("GNR"); + if( + "ROLE_ADMIN".equals(userManageVO.getAuthorCode()) //최고 관리자 + || "ROLE_VISIT".equals(userManageVO.getAuthorCode()) //찾교 관리자 + || "ROLE_ADR_JRSDC".equals(userManageVO.getAuthorCode()) //기소유예관할 + + ) { + authorGroup.setMberTyCode("USR"); //관리자 + }else { - authorGroup.setMberTyCode("USR"); + authorGroup.setMberTyCode("GNR"); //사용자 + //authorGroup.setMberTyCode("USR"); //관리자 } egovAuthorGroupService.insertAuthorGroup(authorGroup); return result; diff --git a/src/main/java/kcc/let/uss/umt/web/EgovUserManageController.java b/src/main/java/kcc/let/uss/umt/web/EgovUserManageController.java index b36b259b..f40232a5 100644 --- a/src/main/java/kcc/let/uss/umt/web/EgovUserManageController.java +++ b/src/main/java/kcc/let/uss/umt/web/EgovUserManageController.java @@ -213,8 +213,9 @@ public class EgovUserManageController { List resultList = userManageService.selectUserList(userSearchVO) ; model.addAttribute("resultList", resultList); //paginationInfo.setTotalRecordCount( resultList.size()> 0 ? ((Long)((EgovMap)resultList.get(0)).get("totCnt")).intValue() : 0); - int i_resultList = resultList.size(); - + //int i_resultList = resultList.size(); + int i_resultList = Integer.parseInt(String.valueOf(((EgovMap)resultList.get(0)).get("totCnt"))); + //int i_resultList = ((Long)((EgovMap)resultList.get(0)).get("totCnt")).intValue(); /* if (i_resultList>0) { String g_resultList = ((EgovMap)resultList.get(0)).get("totCnt").toString(); @@ -222,6 +223,7 @@ public class EgovUserManageController { */ //paginationInfo.setTotalRecordCount( resultList.size()> 0 ? ((int)((EgovMap)resultList.get(0)).get("totCnt")) : 0); + paginationInfo.setTotalRecordCount(i_resultList); model.addAttribute("paginationInfo", paginationInfo); @@ -230,13 +232,14 @@ public class EgovUserManageController { vo.setCodeId("COM038"); model.addAttribute("emplyrSttusCode_result", cmmUseService.selectCmmCodeDetail(vo));//사용자상태코드목록 - //권한조회 + //권한조회 AuthorManageVO authorManageVO = new AuthorManageVO(); authorManageVO.setFirstIndex(0); authorManageVO.setLastIndex(10); authorManageVO.setRecordCountPerPage(10); authorManageVO.setAuthorManageList(egovAuthorManageService.selectAuthorList(authorManageVO)); model.addAttribute("authorList", authorManageVO.getAuthorManageList()); + if("/uss/umt/user/EgovUserManageMenuAjax.do".equals(request.getServletPath())) { return "cmm/uss/umt/EgovUserManageMenuAjax"; @@ -471,7 +474,11 @@ public class EgovUserManageController { * @throws Exception */ @RequestMapping("/uss/umt/user/EgovUserInsert.do") - public String insertUser(@ModelAttribute("userManageVO") UserManageVO userManageVO, BindingResult bindingResult, Model model , RedirectAttributes redirectAttributes) throws Exception { + public String insertUser(@ModelAttribute("userManageVO") UserManageVO userManageVO + , BindingResult bindingResult, Model model + , RedirectAttributes redirectAttributes + , HttpServletRequest request + ) throws Exception { if (!EgovDoubleSubmitHelper.checkAndSaveToken("someKey")) { return "redirect:/uss/umt/user/EgovUserManage.do"; } @@ -520,6 +527,19 @@ public class EgovUserManageController { return "cmm/uss/umt/EgovUserInsert"; }else{ try{ + userManageVO = this._findUserWork(userManageVO, request); + /* + _findWork + String s_authorCode = request.getParameter("authorCode"); + String[] s_arr = request.getParameterValues("userWork"); + + if ("ROLE_ADR_JRSDC".equals(s_authorCode)) { //기소유예관할인 경우 + userManageVO.setUserWork(s_arr[1]); + }else { + userManageVO.setUserWork(s_arr[0].replaceAll(","+s_arr[1], "")); + } + */ + userManageService.insertUser(userManageVO); redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("success.common.insert")); }catch(Exception e){ @@ -771,11 +791,14 @@ public class EgovUserManageController { */ @RequestMapping(value= {"/uss/umt/user/EgovUserSelectUpdt.do", "/uss/umt/user/EgovUserSelectUpdtAjax.do"}) public String updateUser(@ModelAttribute("userManageVO") UserManageVO userManageVO, - HttpSession session, HttpServletRequest request , + HttpSession session, + HttpServletRequest request , BindingResult bindingResult, RedirectAttributes redirectAttributes, Model model) throws Exception { + userManageVO = this._findUserWork(userManageVO, request); + /* String s_authorCode = request.getParameter("authorCode"); String[] s_arr = request.getParameterValues("userWork"); @@ -784,6 +807,7 @@ public class EgovUserManageController { }else { userManageVO.setUserWork(s_arr[0].replaceAll(","+s_arr[1], "")); } + */ /* @@ -2185,4 +2209,25 @@ public class EgovUserManageController { return modelAndView; } + + private UserManageVO _findUserWork( + UserManageVO p_userManageVO, + HttpServletRequest p_request + )throws Exception{ + + String s_authorCode = p_request.getParameter("authorCode"); + String[] s_arr = p_request.getParameterValues("userWork"); + + if ("ROLE_ADR_JRSDC".equals(s_authorCode)) { //기소유예관할인 경우 + p_userManageVO.setUserWork(s_arr[1]); + }else if ("ROLE_VISIT".equals(s_authorCode)) { //찾교 담당자인 경우 + p_userManageVO.setUserWork(s_arr[2]); + }else { + p_userManageVO.setUserWork(s_arr[0]); + + //p_userManageVO.setUserWork(s_arr[0].replaceAll(","+s_arr[1], "")); + } + + return p_userManageVO; + } } \ No newline at end of file diff --git a/src/main/resources/egovframework/sqlmap/let/sec/rgm/EgovAuthorGroup_SQL_Tibero.xml b/src/main/resources/egovframework/sqlmap/let/sec/rgm/EgovAuthorGroup_SQL_Tibero.xml index 42769bf3..8388a26a 100644 --- a/src/main/resources/egovframework/sqlmap/let/sec/rgm/EgovAuthorGroup_SQL_Tibero.xml +++ b/src/main/resources/egovframework/sqlmap/let/sec/rgm/EgovAuthorGroup_SQL_Tibero.xml @@ -71,6 +71,7 @@ + /* authorGroupDAO.insertAuthorGroup */ - + /* userManageDAO.insertUser_S 운영자 */ INSERT INTO LETTNEMPLYRINFO ( ESNTL_ID , @@ -290,6 +290,7 @@ ) --> + /* userManageDAO.insertUser_GNR 일반사용자 */ INSERT INTO lettngnrlmber ( diff --git a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserInsert.jsp b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserInsert.jsp index f76c44db..622fa3fe 100644 --- a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserInsert.jsp +++ b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserInsert.jsp @@ -88,12 +88,20 @@ function authorChange(obj) { $("#rank2").attr('disabled', false); } - if (obj.options[obj.selectedIndex].value=='ROLE_ADR_JRSDC'){ + if (obj.options[obj.selectedIndex].value=='ROLE_ADR_JRSDC'){ //기소유예검찰담당자 $('#userWork_case1').hide(); $('#userWork_case2').show(); + $('#userWork_case3').hide(); + + }else if (obj.options[obj.selectedIndex].value=='ROLE_VISIT'){ //찾교담당자 + $('#userWork_case1').hide(); + $('#userWork_case2').hide(); + $('#userWork_case3').show(); + }else{ $('#userWork_case1').show(); - $('#userWork_case2').hide(); + $('#userWork_case2').hide(); + $('#userWork_case3').hide(); } } @@ -439,7 +447,10 @@ function wrapWindowByMask(){
-
+ +
+ +
diff --git a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserManage.jsp b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserManage.jsp index 690abf0e..91a7cde5 100644 --- a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserManage.jsp +++ b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserManage.jsp @@ -18,6 +18,7 @@ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <%@ taglib prefix="double-submit" uri="http://www.egovframe.go.kr/tags/double-submit/jsp" %> +<%@ taglib prefix="ve" uri="/WEB-INF/tlds/kcc_tld.tld"%> @@ -250,7 +251,17 @@ function userListExcelDownload(){ - + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserSelectUpdt.jsp b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserSelectUpdt.jsp index 4eef932e..e3a469de 100644 --- a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserSelectUpdt.jsp +++ b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovUserSelectUpdt.jsp @@ -74,7 +74,9 @@ $( document ).ready(function(){ $("#rank1").attr('disabled', true); $("#rank2").attr('disabled', false); } - + + _chgAuthorSelect("${userManageVO.authorCode}"); + /* if("${userManageVO.authorCode}" == "ROLE_ADR_JRSDC"){ $('#userWork_case1').hide(); $('#userWork_case2').show(); @@ -82,6 +84,7 @@ $( document ).ready(function(){ $('#userWork_case1').show(); $('#userWork_case2').hide(); } + */ }); function setOrgDepth_01(){ @@ -336,6 +339,8 @@ function authorChange(obj) { //alert(obj.options[obj.selectedIndex].value); + _chgAuthorSelect(obj.options[obj.selectedIndex].value); + /* if (obj.options[obj.selectedIndex].value=='ROLE_ADR_JRSDC'){ $('#userWork_case1').hide(); $('#userWork_case2').show(); @@ -343,8 +348,29 @@ function authorChange(obj) { $('#userWork_case1').show(); $('#userWork_case2').hide(); } + */ } + +//권한에 따라서 담당업무를 변경한다. +function _chgAuthorSelect(p_obj_selectedIndex){ + if (p_obj_selectedIndex=='ROLE_ADR_JRSDC'){ //기소유예검찰담당자 + $('#userWork_case1').hide(); + $('#userWork_case2').show(); + $('#userWork_case3').hide(); + + }else if (p_obj_selectedIndex=='ROLE_VISIT'){ //찾교담당자 + $('#userWork_case1').hide(); + $('#userWork_case2').hide(); + $('#userWork_case3').show(); + + }else{ + $('#userWork_case1').show(); + $('#userWork_case2').hide(); + $('#userWork_case3').hide(); + } +} + @@ -467,6 +493,9 @@ function authorChange(obj) {
+
+ +