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=