From 6ad73d846442e0e9c2dec2724a3d1f832b630a46 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Tue, 1 Nov 2022 03:38:35 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=97=85=EB=AC=B4=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20=EB=93=B1=EB=A1=9D=20=EC=A7=84=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/cmm/model/XitUserInfoVO.java | 1 + .../mng/menu/web/ProgramMgtController.java | 1 - .../user/service/impl/UserMgtServiceImpl.java | 23 ++++-- .../biz/mng/user/web/UserMgtController.java | 15 ++-- .../exception/BizRuntimeException.java | 9 +++ .../message/com/message-common_ko.properties | 4 +- .../framework/mng/usr/XitUserRegMng.xml | 7 +- .../biz/mng/menu/mngProgramMgtPopup.jsp | 3 +- .../framework/biz/mng/usr/mngUserMgtForm.jsp | 25 +----- .../framework/biz/mng/usr/mngUserMgtPopup.jsp | 76 ++++++++++++------- 10 files changed, 90 insertions(+), 74 deletions(-) diff --git a/src/main/java/kr/xit/framework/biz/cmm/model/XitUserInfoVO.java b/src/main/java/kr/xit/framework/biz/cmm/model/XitUserInfoVO.java index e0941d36..200e1b61 100644 --- a/src/main/java/kr/xit/framework/biz/cmm/model/XitUserInfoVO.java +++ b/src/main/java/kr/xit/framework/biz/cmm/model/XitUserInfoVO.java @@ -33,6 +33,7 @@ public class XitUserInfoVO extends XitUserEtcOptionVO{ protected String orgnztId; //조직 id protected String userNm; //사용자 명 protected String password; //비밀번호 + protected String password2; //비밀번호 protected String emplNo; //사원 번호 protected String ihidnum; //주민등록번호 protected String sexdstnCode; //성별 코드 diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/web/ProgramMgtController.java b/src/main/java/kr/xit/framework/biz/mng/menu/web/ProgramMgtController.java index ed7820ea..c3c68e43 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/web/ProgramMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/web/ProgramMgtController.java @@ -73,7 +73,6 @@ public class ProgramMgtController { mav.addObject("progrmMngVO", programMngService.findProgram(progrmFileNm)); mav.addObject("pageTitle", "프로그램 정보 변경"); } - return mav; } diff --git a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/UserMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/user/service/impl/UserMgtServiceImpl.java index 6717012b..7ac79ca4 100644 --- a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/UserMgtServiceImpl.java +++ b/src/main/java/kr/xit/framework/biz/mng/user/service/impl/UserMgtServiceImpl.java @@ -59,26 +59,35 @@ public class UserMgtServiceImpl implements UserMgtService { try { vo.setUniqId(idgenService.getNextStringId()); } catch (FdlException e) { - throw BizRuntimeException.create(MessageKey.CMM_INSERT_FAIL); + throw BizRuntimeException.message(e.getMessage()); } + vo.setUniqId(vo.getUniqId()); //고유식별키 + vo.setUserId(vo.getEmplyrId()); //사용자 id + vo.setUserNm(vo.getEmplyrNm()); //사용자 명 + try { + vo.setPassword(XitScrtyUtil.encryptPassword(vo.getPassword(), vo.getEmplyrId())); + } catch (Exception e) { + throw BizRuntimeException.message(String.format("비밀번호 암호화 실패:: %s", e.getMessage())); + } + vo.setEsntlId(vo.getUniqId()); - /* - XitUserInfoVO userInfoVO = convertToCrudVO(vo); + //XitUserInfoVO userInfoVO = convertToCrudVO(vo); //그룹의 기본권한 조회 및 설정 XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(userInfoVO.getEsntlId()); + userScrtySetupVO.setScrtySetupTrgetId(vo.getEsntlId()); userScrtySetupVO.setMberTyCode("USR03"); - String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(userInfoVO.getGroupId()); + String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(vo.getGroupId()); userScrtySetupVO.setAuthorCode(defaultAuthorCode); //사용자 기타옵션 기본값 설정 XitUserEtcOptionVO userEtcOptionVO = new XitUserEtcOptionVO(); - userEtcOptionVO.setUserId(userInfoVO.getUserId()); + userEtcOptionVO.setUserId(vo.getUserId()); userEtcOptionVO.setJobDataAuthor("ONESELF"); //업무 데이터 권한 userEtcOptionVO.setUserManageAuthor("ONESELF"); //사용자 관리 권한 + /* //사용자정보 등록 - xitFrameCrudService.addXitUserInfo(userInfoVO); + xitFrameCrudService.addXitUserInfo(vo); //사용자의 권한 등록 xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO); //사용자 기타 옵션 관리 diff --git a/src/main/java/kr/xit/framework/biz/mng/user/web/UserMgtController.java b/src/main/java/kr/xit/framework/biz/mng/user/web/UserMgtController.java index 8a313637..26c2edd9 100644 --- a/src/main/java/kr/xit/framework/biz/mng/user/web/UserMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/user/web/UserMgtController.java @@ -86,7 +86,6 @@ public class UserMgtController { mav.addObject("userInfoVO", service.findUser(uniqId)); mav.addObject("pageTitle", "사용자 정보 변정"); } - return mav; } @@ -104,26 +103,26 @@ public class UserMgtController { @PostMapping(value = "/addUser") public ModelAndView addUser( - @ModelAttribute final XitUserInfoVO userInfoVO + @ModelAttribute final XitUserInfoVO vo ,final BindingResult bindingResult){ ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - ValidationError.of("userInfoVO", userInfoVO, bindingResult); - - //service.addUser(userManageVO); + ValidationError.of("userInfoVO", vo, bindingResult); + service.addUser(vo); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); + return mav; } @PostMapping(value = "/modifyUser") public ModelAndView modifyUser( - @ModelAttribute final XitUserInfoVO userInfoVO + @ModelAttribute final XitUserInfoVO vo ,final BindingResult bindingResult){ ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - ValidationError.of("userInfoVO", userInfoVO, bindingResult); + ValidationError.of("userInfoVO", vo, bindingResult); - service.modifyUser(userInfoVO); + service.modifyUser(vo); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS); return mav; } diff --git a/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java b/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java index 68960b4e..76888014 100644 --- a/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java +++ b/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java @@ -7,6 +7,7 @@ import org.springframework.validation.BindingResult; import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.JBeanRegistry; +import kr.xit.framework.support.util.constants.MessageKey; /** * 비지니스 로직 처리 도중 예외 사항에 대해서 다국어 메시지 처리를 해야 할 상황일 때 이에 대한 @@ -61,6 +62,14 @@ public class BizRuntimeException extends RuntimeException { return ex; } + public static BizRuntimeException message(String message) { + BizRuntimeException ex = new BizRuntimeException(); + ex.setCode(MessageKey.CMM_FAIL); + ex.setMessage(message); + ex.setArguments(null); + return ex; + } + public static BizRuntimeException create(String errorCode, String message) { BizRuntimeException ex = new BizRuntimeException(); ex.setCode(errorCode); diff --git a/src/main/resources/message/com/message-common_ko.properties b/src/main/resources/message/com/message-common_ko.properties index ca94d344..1461d2b7 100644 --- a/src/main/resources/message/com/message-common_ko.properties +++ b/src/main/resources/message/com/message-common_ko.properties @@ -252,8 +252,8 @@ sym.ems.content = \uBC1C\uC2E0\uB0B4\uC6A9 errors.prefix=
errors.suffix=

-errors.required=[[{0}] ]\uC740(\uB294) \uD544\uC218 \uC785\uB825\uAC12\uC785\uB2C8\uB2E4. -errors.minlength=[[{0}] ]\uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4. +errors.required=[{0}]\uC740(\uB294) \uD544\uC218 \uC785\uB825\uAC12\uC785\uB2C8\uB2E4. +errors.minlength=[{0}]\uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4. errors.maxlength=[{0}] \uC740(\uB294) {1}\uC790 \uC774\uC0C1 \uC785\uB825\uD560\uC218 \uC5C6\uC2B5\uB2C8\uB2E4. errors.invalid=[{0}] \uC740(\uB294) \uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uAC12\uC785\uB2C8\uB2E4. errors.minInteger=[{0}] \uC740(\uB294) \uC720\uD6A8\uD55C \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4. 1 \uC774\uC0C1\uC758 \uAC12\uC744 \uC785\uB825\uD574\uC57C \uD569\uB2C8\uB2E4. diff --git a/src/main/resources/validator/framework/mng/usr/XitUserRegMng.xml b/src/main/resources/validator/framework/mng/usr/XitUserRegMng.xml index 8354e483..0d8612e1 100644 --- a/src/main/resources/validator/framework/mng/usr/XitUserRegMng.xml +++ b/src/main/resources/validator/framework/mng/usr/XitUserRegMng.xml @@ -26,10 +26,11 @@ 50 - - + + --> diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtPopup.jsp index a42cc2cf..e5b6fb8a 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtPopup.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/menu/mngProgramMgtPopup.jsp @@ -1,5 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%> +<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> @@ -64,7 +65,7 @@ - + diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtForm.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtForm.jsp index d7053b11..6c87aaec 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtForm.jsp @@ -56,7 +56,7 @@ * Global Variable **************************************************************************/ let GRID = null; - var callBackSearch = () => fnProgramMgt.search(); + var callBackSearch = () => fnUserMgt.search(); /* ******************************* @@ -173,29 +173,6 @@ GRID.reloadData(); } - ,add : function(){ - } - - ,modify : function(){ - } - - ,remove : function(){ - $.ajax({ - url : "/framework/biz/mng/usr/UserRegMng_deletes_proc.do", - data : $("#frmSearch").serialize(), - type : "post", - dataType : "json", - success : function(data) { - alert(data.resp.message); - fnUserMgt.search(); - window.close(); - }, - error: function(){ - - } - }); - } - ,validate : function(flag){ switch(flag){ case 'delete' : diff --git a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtPopup.jsp b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtPopup.jsp index c6e013ef..d24e3a4a 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtPopup.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/biz/mng/usr/mngUserMgtPopup.jsp @@ -1,11 +1,12 @@ <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/WEB-INF/jsp/framework/taglibs.jsp"%> +<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> - + <%--@elvariable id="userInfoVO" type=""--%> - +<%-- --%> @@ -35,14 +36,14 @@ - + - + @@ -52,7 +53,24 @@ - + + + + + + + + + + +<%-- --%> + + + + + + + @@ -64,7 +82,7 @@ --%> - + @@ -74,13 +92,13 @@ - + - + @@ -109,7 +127,7 @@ --%> - + @@ -118,15 +136,15 @@ - - + + - - + + @@ -139,14 +157,14 @@ - - + + - + @@ -156,20 +174,20 @@ - - 주소 + + - (우편번호 검색) + 우편번호검색(우편번호 검색) - + @@ -179,8 +197,8 @@ - - + + @@ -193,10 +211,10 @@ - + - + <%-- @@ -245,7 +263,7 @@ } ,add: () => { - if(validateUserInfoVO(document.getElementById('userInfoVO'))) return; + if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return; if(confirm("등록 하시겠습니까?")){ cmmAjax({ @@ -260,7 +278,7 @@ } ,modify: () => { - if(validateUserInfoVO(document.getElementById('userInfoVO'))) return; + if(!validateUserInfoVO(document.getElementById('userInfoVO'))) return; if(confirm("변경 하시겠습니까?")){ cmmAjax({ @@ -307,9 +325,11 @@ $('#addrSearch').on('click', () => CmmPopup.zipPopup()); - $('#btnSave').on('click', () => fnUserMgtPopup.modify()); + $('#btnRegist').on('click', () => fnUserMgtPopup.add()); + + $('#btnModify').on('click', () => fnUserMgtPopup.modify()); - $('#btnRemove').on('click', () => fnUserMgtPopup.removeData()); + $('#btnRemove').on('click', () => fnUserMgtPopup.remove()); $('#btnPwdChg').on('click', () => { var params = "";