diff --git a/db/sql/DML.sql b/db/sql/DML.sql index 74044043..ddf63b69 100644 --- a/db/sql/DML.sql +++ b/db/sql/DML.sql @@ -29,63 +29,4 @@ END ; -CREATE DEFINER = root@`%` VIEW xit_vw_user_mastr AS -SELECT `xplatform`.`xit_gnrl_mber`.`ESNTL_ID` AS `ESNTL_ID`, - `xplatform`.`xit_gnrl_mber`.`MBER_ID` AS `USER_ID`, - `xplatform`.`xit_gnrl_mber`.`PASSWORD` AS `PASSWORD`, - `xplatform`.`xit_gnrl_mber`.`MBER_NM` AS `USER_NM`, - `xplatform`.`xit_gnrl_mber`.`ZIP` AS `USER_ZIP`, - `xplatform`.`xit_gnrl_mber`.`ADRES` AS `USER_ADRES`, - `xplatform`.`xit_gnrl_mber`.`MBER_EMAIL_ADRES` AS `USER_EMAIL`, - ' ' AS `GROUP_ID`, - 'GNR' AS `USER_SE`, - ' ' AS `ORGNZT_ID`, - ' ' AS `PSTINST_CODE`, - ' ' AS `ORGNZT_NM`, - ' ' AS `JOB_DATA_AUTHOR`, - ' ' AS `USER_MANAGE_AUTHOR`, - ' ' AS `ELCTRNSANCTN_USE_YN`, - ' ' AS `JOB_CONFM_AUTHOR_YN` -FROM `xplatform`.`xit_gnrl_mber` -UNION ALL -SELECT `a`.`ESNTL_ID` AS `ESNTL_ID`, - `a`.`USER_ID` AS `USER_ID`, - `a`.`PASSWORD` AS `PASSWORD`, - `a`.`USER_NM` AS `USER_NM`, - `a`.`ZIP` AS `ZIP`, - `a`.`HOUSE_ADRES` AS `HOUSE_ADRES`, - `a`.`EMAIL_ADRES` AS `EMAIL_ADRES`, - `a`.`GROUP_ID` AS `GROUP_ID`, - 'USR' AS `USER_SE`, - `a`.`orgnzt_id` AS `ORGNZT_ID`, - `a`.`pstinst_code` AS `PSTINST_CODE`, - (SELECT `sa`.`ORGNZT_NM` - FROM `xplatform`.`xit_orgnzt_info` `sa` - WHERE `sa`.`ORGNZT_ID` = `a`.`orgnzt_id`) AS `ORGNZT_NM`, - `b`.`JOB_DATA_AUTHOR` AS `JOB_DATA_AUTHOR`, - `b`.`USER_MANAGE_AUTHOR` AS `USER_MANAGE_AUTHOR`, - `b`.`ELCTRNSANCTN_USE_YN` AS `ELCTRNSANCTN_USE_YN`, - `b`.`JOB_CONFM_AUTHOR_YN` AS `JOB_CONFM_AUTHOR_YN` -FROM (`xplatform`.`xit_user_info` `a` LEFT JOIN `xplatform`.`xit_user_etc_option` `b` -ON (`a`.`USER_ID` = `b`.`USER_ID`)) -UNION ALL -SELECT `xplatform`.`xit_entrprs_mber`.`ESNTL_ID` AS `ESNTL_ID`, - `xplatform`.`xit_entrprs_mber`.`ENTRPRS_MBER_ID` AS `USER_ID`, - `xplatform`.`xit_entrprs_mber`.`ENTRPRS_MBER_PASSWORD` AS `ENTRPRS_MBER_PASSWORD`, - `xplatform`.`xit_entrprs_mber`.`CMPNY_NM` AS `CMPNY_NM`, - `xplatform`.`xit_entrprs_mber`.`ZIP` AS `ZIP`, - `xplatform`.`xit_entrprs_mber`.`ADRES` AS `ADRES`, - `xplatform`.`xit_entrprs_mber`.`APPLCNT_EMAIL_ADRES` AS `APPLCNT_EMAIL_ADRES`, - ' ' AS `GROUP_ID`, - 'ENT' AS `USER_SE`, - ' ' AS `ORGNZT_ID`, - ' ' AS `PSTINST_CODE`, - ' ' AS `ORGNZT_NM`, - ' ' AS `JOB_DATA_AUTHOR`, - ' ' AS `USER_MANAGE_AUTHOR`, - ' ' AS `ELCTRNSANCTN_USE_YN`, - ' ' AS `JOB_CONFM_AUTHOR_YN` -FROM `xplatform`.`xit_entrprs_mber`; - - diff --git a/src/main/java/kr/xit/fims/framework/biz/cmm/dao/XitFrameCrudMapper.java b/src/main/java/kr/xit/fims/framework/biz/cmm/dao/XitFrameCrudMapper.java index f329e583..aa63e0b6 100644 --- a/src/main/java/kr/xit/fims/framework/biz/cmm/dao/XitFrameCrudMapper.java +++ b/src/main/java/kr/xit/fims/framework/biz/cmm/dao/XitFrameCrudMapper.java @@ -103,12 +103,10 @@ public interface XitFrameCrudMapper { public int removeXitConectLog(XitConectLogVO vo) throws SQLException; - public List findXitEntrprsMbers(XitEntrprsMberVO vo) throws SQLException; - public XitEntrprsMberVO findXitEntrprsMber(XitEntrprsMberVO vo) throws SQLException; - public int addXitEntrprsMber(XitEntrprsMberVO vo) throws SQLException; - public int modifyXitEntrprsMber(XitEntrprsMberVO vo) throws SQLException; - public int removeXitEntrprsMber(XitEntrprsMberVO vo) throws SQLException; - + + + + public List findXitFileAttrbs(XitFileAttrbVO vo) throws SQLException; public XitFileAttrbVO findXitFileAttrb(XitFileAttrbVO vo) throws SQLException; @@ -122,14 +120,7 @@ public interface XitFrameCrudMapper { public int addXitFileDetailInfo(XitFileDetailInfoVO vo) throws SQLException; public int modifyXitFileDetailInfo(XitFileDetailInfoVO vo) throws SQLException; public int removeXitFileDetailInfo(XitFileDetailInfoVO vo) throws SQLException; - - - public List findXitGnrlMbers(XitGnrlMberVO vo) throws SQLException; - public XitGnrlMberVO findXitGnrlMber(XitGnrlMberVO vo) throws SQLException; - public int addXitGnrlMber(XitGnrlMberVO vo) throws SQLException; - public int modifyXitGnrlMber(XitGnrlMberVO vo) throws SQLException; - public int removeXitGnrlMber(XitGnrlMberVO vo) throws SQLException; - + public List findXitIdss(XitIdsVO vo) throws SQLException; public XitIdsVO findXitIds(XitIdsVO vo) throws SQLException; diff --git a/src/main/java/kr/xit/fims/framework/biz/cmm/service/XitFrameCrudService.java b/src/main/java/kr/xit/fims/framework/biz/cmm/service/XitFrameCrudService.java index 68b4404d..a4f23177 100644 --- a/src/main/java/kr/xit/fims/framework/biz/cmm/service/XitFrameCrudService.java +++ b/src/main/java/kr/xit/fims/framework/biz/cmm/service/XitFrameCrudService.java @@ -100,11 +100,11 @@ public interface XitFrameCrudService { public int removeXitConectLog(XitConectLogVO vo); - public List findXitEntrprsMbers(XitEntrprsMberVO vo); - public XitEntrprsMberVO findXitEntrprsMber(XitEntrprsMberVO vo); - public int addXitEntrprsMber(XitEntrprsMberVO vo); - public int modifyXitEntrprsMber(XitEntrprsMberVO vo); - public int removeXitEntrprsMber(XitEntrprsMberVO vo); + + + + + public List findXitFileAttrbs(XitFileAttrbVO vo); @@ -119,15 +119,8 @@ public interface XitFrameCrudService { public int addXitFileDetailInfo(XitFileDetailInfoVO vo); public int modifyXitFileDetailInfo(XitFileDetailInfoVO vo); public int removeXitFileDetailInfo(XitFileDetailInfoVO vo); - - - public List findXitGnrlMbers(XitGnrlMberVO vo); - public XitGnrlMberVO findXitGnrlMber(XitGnrlMberVO vo); - public int addXitGnrlMber(XitGnrlMberVO vo); - public int modifyXitGnrlMber(XitGnrlMberVO vo); - public int removeXitGnrlMber(XitGnrlMberVO vo); - - + + public List findXitIdss(XitIdsVO vo); public XitIdsVO findXitIds(XitIdsVO vo); public int addXitIds(XitIdsVO vo); diff --git a/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameCrudServiceBean.java b/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameCrudServiceBean.java index 1f82167b..1f532576 100644 --- a/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameCrudServiceBean.java +++ b/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameCrudServiceBean.java @@ -1869,167 +1869,6 @@ public class XitFrameCrudServiceBean extends AbstractServiceBean implements XitF } } - @Override - public List findXitEntrprsMbers(XitEntrprsMberVO vo) { - String table = "기업회원"; - DB_ACTION action = DB_ACTION.NR; - -// /** -// * 필수조건 확인 -// */ -// String emsg = null; -// if(XitCmmnUtil.isEmpty(vo.getEntrprs_mber_id())) -// emsg = String.format("(%s)기업회원ID(은)는 필수조건 입니다.", table); -// if(emsg!=null){ -// logger.error(emsg); -// throw new RuntimeException(emsg); -// } - - /** - * 처리 - */ - try { - List result = xitFrameCrudMapper.findXitEntrprsMbers(vo); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - - @Override - public XitEntrprsMberVO findXitEntrprsMber(XitEntrprsMberVO vo) { - String table = "기업회원"; - DB_ACTION action = DB_ACTION.R; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getEntrprsMberId())) - emsg = String.format("(%s)기업회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - XitEntrprsMberVO result = xitFrameCrudMapper.findXitEntrprsMber(vo); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - - @Override - public int addXitEntrprsMber(XitEntrprsMberVO vo) { - String table = "기업회원"; - DB_ACTION action = DB_ACTION.C; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getEntrprsMberId())) - emsg = String.format("(%s)기업회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - int result = xitFrameCrudMapper.addXitEntrprsMber(vo); - if(result<1) - throw new RuntimeException(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - - @Override - public int modifyXitEntrprsMber(XitEntrprsMberVO vo) { - String table = "기업회원"; - DB_ACTION action = DB_ACTION.U; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getEntrprsMberId())) - emsg = String.format("(%s)기업회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - int result = xitFrameCrudMapper.modifyXitEntrprsMber(vo); - if(result<1) - throw new RuntimeException(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - - @Override - public int removeXitEntrprsMber(XitEntrprsMberVO vo) { - String table = "기업회원"; - DB_ACTION action = DB_ACTION.D; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getEntrprsMberId())) - emsg = String.format("(%s)기업회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - int result = xitFrameCrudMapper.removeXitEntrprsMber(vo); - if(result<1) - throw new RuntimeException(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - @Override public List findXitFileAttrbs(XitFileAttrbVO vo) { String table = "파일속성"; @@ -2361,167 +2200,11 @@ public class XitFrameCrudServiceBean extends AbstractServiceBean implements XitF throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); } } - - @Override - public List findXitGnrlMbers(XitGnrlMberVO vo) { - String table = "일반회원"; - DB_ACTION action = DB_ACTION.NR; - -// /** -// * 필수조건 확인 -// */ -// String emsg = null; -// if(XitCmmnUtil.isEmpty(vo.getMber_id())) -// emsg = String.format("(%s)회원ID(은)는 필수조건 입니다.", table); -// if(emsg!=null){ -// logger.error(emsg); -// throw new RuntimeException(emsg); -// } - - /** - * 처리 - */ - try { - List result = xitFrameCrudMapper.findXitGnrlMbers(vo); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - @Override - public XitGnrlMberVO findXitGnrlMber(XitGnrlMberVO vo) { - String table = "일반회원"; - DB_ACTION action = DB_ACTION.R; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getMberId())) - emsg = String.format("(%s)회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - XitGnrlMberVO result = xitFrameCrudMapper.findXitGnrlMber(vo); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - @Override - public int addXitGnrlMber(XitGnrlMberVO vo) { - String table = "일반회원"; - DB_ACTION action = DB_ACTION.C; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getMberId())) - emsg = String.format("(%s)회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - int result = xitFrameCrudMapper.addXitGnrlMber(vo); - if(result<1) - throw new RuntimeException(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - @Override - public int modifyXitGnrlMber(XitGnrlMberVO vo) { - String table = "일반회원"; - DB_ACTION action = DB_ACTION.U; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getMberId())) - emsg = String.format("(%s)회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - int result = xitFrameCrudMapper.modifyXitGnrlMber(vo); - if(result<1) - throw new RuntimeException(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } - @Override - public int removeXitGnrlMber(XitGnrlMberVO vo) { - String table = "일반회원"; - DB_ACTION action = DB_ACTION.D; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getMberId())) - emsg = String.format("(%s)회원ID(은)는 필수조건 입니다.", table); - if(emsg!=null){ - logger.error(emsg); - throw new RuntimeException(emsg); - } - - /** - * 처리 - */ - try { - int result = xitFrameCrudMapper.removeXitGnrlMber(vo); - if(result<1) - throw new RuntimeException(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } catch (SQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL ERROR 발생", table, action.getKorNm()), e); - } catch (UncategorizedSQLException e) { - throw new RuntimeException(String.format("%s %s 중 SQL 부적합한 열 ERROR 발생", table, action.getKorNm()), e); - } catch (Exception e) { - throw new RuntimeException(String.format("%s %s 처리 중 SQL ERROR 발생", table, action.getKorNm()), e); - } - } + @Override public List findXitIdss(XitIdsVO vo) { diff --git a/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java b/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java index af14ce77..904356cf 100644 --- a/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java +++ b/src/main/java/kr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java @@ -81,29 +81,11 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF XitLoginVO loginVO = null; switch (user_se) { case GNR: // 일반회원 - XitGnrlMberVO userGnrVO = new XitGnrlMberVO(); - userGnrVO.setMberId(id); - userGnrVO = xitFrameCrudService.findXitGnrlMber(userGnrVO); - // "회원가입승인" 상태인지 확인 - if (XitCmmnUtil.notEmpty(userGnrVO) && "P".equals(userGnrVO.getMberSttus())) { - // XitLoginVO에 매핑 - loginVO = new XitLoginVO(); - loginVO.convertToLoginVO(userGnrVO); - } break; case ENT: // 기업회원 - XitEntrprsMberVO userEntVO = new XitEntrprsMberVO(); - userEntVO.setEntrprsMberId(id); - userEntVO = xitFrameCrudService.findXitEntrprsMber(userEntVO); - // "회원가입승인" 상태인지 확인 - if (XitCmmnUtil.notEmpty(userEntVO) && "P".equals(userEntVO.getEntrprsMberSttus())) { - // XitLoginVO에 매핑 - loginVO = new XitLoginVO(); - loginVO.convertToLoginVO(userEntVO); - } break; case USR: // 업무사용자 XitUserInfoVO userUsrVO = new XitUserInfoVO(); @@ -149,18 +131,10 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF String id = null; switch (user_se) { case GNR: // 일반회원 - XitGnrlMberVO userGnrVO = new XitGnrlMberVO(); - userGnrVO.setMberNm(name); - userGnrVO.setMberEmailAdres(email); - List listUserGnr = xitFrameCrudService.findXitGnrlMbers(userGnrVO); - id = XitCmmnUtil.isEmpty(listUserGnr) ? null : listUserGnr.get(0).getMberId(); + break; case ENT: // 기업회원 - XitEntrprsMberVO userEntVO = new XitEntrprsMberVO(); - userEntVO.setCmpnyNm(name); - userEntVO.setApplcntEmailAdres(email); - List listEntrprsMber = xitFrameCrudService.findXitEntrprsMbers(userEntVO); - id = XitCmmnUtil.isEmpty(listEntrprsMber) ? null : listEntrprsMber.get(0).getEntrprsMberId(); + break; case USR: // 업무사용자 XitUserInfoVO userUsrVO = new XitUserInfoVO(); @@ -262,16 +236,10 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF */ switch (user_se) { case GNR: // 일반회원 - XitGnrlMberVO userGnrVO = new XitGnrlMberVO(); - userGnrVO.setMberId(id); - userGnrVO.setPassword(password); - xitFrameCrudService.modifyXitGnrlMber(userGnrVO); + break; case ENT: // 기업회원 - XitEntrprsMberVO userEntVO = new XitEntrprsMberVO(); - userEntVO.setEntrprsMberId(id); - userEntVO.setEntrprsMberPassword(password); - xitFrameCrudService.modifyXitEntrprsMber(userEntVO); + break; case USR: // 업무사용자 XitUserInfoVO userUsrVO = new XitUserInfoVO(); @@ -300,18 +268,7 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF /** * 처리 */ - // 일반회원 - XitGnrlMberVO userGnrVO = new XitGnrlMberVO(); - userGnrVO.setMberId(id); - userGnrVO = xitFrameCrudService.findXitGnrlMber(userGnrVO); - if (XitCmmnUtil.notEmpty(userGnrVO)) - return 1; - // 기업회원 - XitEntrprsMberVO userEntVO = new XitEntrprsMberVO(); - userEntVO.setEntrprsMberId(id); - userEntVO = xitFrameCrudService.findXitEntrprsMber(userEntVO); - if (XitCmmnUtil.notEmpty(userEntVO)) - return 1; + // 업무사용자 XitUserInfoVO userUsrVO = new XitUserInfoVO(); userUsrVO.setUserId(id); diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/UserMgtMapper.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/UserMgtMapper.java index f0b822be..e41a5535 100644 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/UserMgtMapper.java +++ b/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/UserMgtMapper.java @@ -32,8 +32,7 @@ public interface UserMgtMapper { int insertUserInfo(final XitUserInfoVO vo); int updateUserInfo(final XitUserInfoVO vo); int deleteUserInfo(final String userId); - int deleteGnrlMber(String userId); - int deleteEntrprsMber(String userId); + diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/XitEntUserRegMngMapper.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/XitEntUserRegMngMapper.java deleted file mode 100644 index f4877e5e..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/XitEntUserRegMngMapper.java +++ /dev/null @@ -1,50 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.dao; - -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngVO; -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import java.sql.SQLException; -import java.util.List; - -/** - * - * @업무그룹명: 기업사용자등록관리 Mapper - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:33:35 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Mapper -public interface XitEntUserRegMngMapper { - - /** - *
메소드 설명: 기업사용자등록관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - public List findList(XitEntUserRegMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 기업사용자등록관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - public int findListTotCnt(XitEntUserRegMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 기업사용자등록관리 상세정보 조회
- * @param vo - * @return XitEntUserRegMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - public XitEntUserRegMngVO findView(XitEntUserRegMngVO vo) throws SQLException; - -} diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/XitGnrUserRegMngMapper.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/XitGnrUserRegMngMapper.java deleted file mode 100644 index 6895c1c5..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/dao/XitGnrUserRegMngMapper.java +++ /dev/null @@ -1,50 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.dao; - -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngVO; -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import java.sql.SQLException; -import java.util.List; - -/** - * - * @업무그룹명: 일반사용자등록관리 Mapper - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:33:35 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Mapper -public interface XitGnrUserRegMngMapper { - - /** - *
메소드 설명: 일반사용자등록관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - public List findList(XitGnrUserRegMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 일반사용자등록관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - public int findListTotCnt(XitGnrUserRegMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 일반사용자등록관리 상세정보 조회
- * @param vo - * @return XitGnrUserRegMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 26. - */ - public XitGnrUserRegMngVO findView(XitGnrUserRegMngVO vo) throws SQLException; - -} diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/XitEntUserRegMngService.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/service/XitEntUserRegMngService.java deleted file mode 100644 index c6d059be..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/XitEntUserRegMngService.java +++ /dev/null @@ -1,92 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.service; - -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngVO; - -import java.util.List; - -/** - * - * @업무그룹명: 기업사용자등록관리 Service - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:33:18 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface XitEntUserRegMngService { - - /** - *
메소드 설명: 기업사용자등록관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public List findList(XitEntUserRegMngSearchVO searchVO); - - /** - *
메소드 설명: 기업사용자등록관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public int findListTotCnt(XitEntUserRegMngSearchVO searchVO); - - /** - *
메소드 설명: 기업사용자등록관리 상세정보 조회
- * @param vo - * @return XitEntUserRegMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public XitEntUserRegMngVO findView(XitEntUserRegMngVO vo); - - /** - *
메소드 설명: 기업사용자등록관리 등록
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void addProc(XitEntUserRegMngVO vo); - - /** - *
메소드 설명: 기업사용자등록관리 수정
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void modifyProc(XitEntUserRegMngVO vo); - - /** - *
메소드 설명: 사용자 비밀번호 수정
- * @param uniqId 고유식별ID - * @param id 사용자ID - * @param oldPassword 구 비밀번호 - * @param newPassword 신규 비밀번호 - * @param newPassword2 신규 비밀번호 확인 - * @return void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 10. - */ - public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2); - - /** - *
메소드 설명: 기업사용자등록관리 삭제
- * @param id void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void removeProc(String id); - - /** - *
메소드 설명: 기업사용자등록관리 다건 삭제
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void removesProc(String ids); - -} diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/XitGnrUserRegMngService.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/service/XitGnrUserRegMngService.java deleted file mode 100644 index 9e041f53..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/XitGnrUserRegMngService.java +++ /dev/null @@ -1,92 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.service; - -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngVO; - -import java.util.List; - -/** - * - * @업무그룹명: 일반사용자등록관리 Service - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:33:18 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface XitGnrUserRegMngService { - - /** - *
메소드 설명: 일반사용자등록관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public List findList(XitGnrUserRegMngSearchVO searchVO); - - /** - *
메소드 설명: 일반사용자등록관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public int findListTotCnt(XitGnrUserRegMngSearchVO searchVO); - - /** - *
메소드 설명: 일반사용자등록관리 상세정보 조회
- * @param vo - * @return XitGnrUserRegMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public XitGnrUserRegMngVO findView(XitGnrUserRegMngVO vo); - - /** - *
메소드 설명: 일반사용자등록관리 등록
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void addProc(XitGnrUserRegMngVO vo); - - /** - *
메소드 설명: 일반사용자등록관리 수정
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void modifyProc(XitGnrUserRegMngVO vo); - - /** - *
메소드 설명: 사용자 비밀번호 수정
- * @param uniqId 고유식별ID - * @param id 사용자ID - * @param oldPassword 구 비밀번호 - * @param newPassword 신규 비밀번호 - * @param newPassword2 신규 비밀번호 확인 - * @return void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 10. - */ - public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2); - - /** - *
메소드 설명: 일반사용자등록관리 삭제
- * @param id void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void removeProc(String id); - - /** - *
메소드 설명: 일반사용자등록관리 다건 삭제
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - public void removesProc(String ids); - -} diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/UserMgtServiceBean.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/UserMgtServiceBean.java index b8de0f50..fb570b9a 100644 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/UserMgtServiceBean.java +++ b/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/UserMgtServiceBean.java @@ -145,11 +145,11 @@ public class UserMgtServiceBean extends AbstractServiceBean implements UserMgtSe //일반회원 삭제 }else if(userTy.equals("USR01")){ - mapper.deleteGnrlMber(userId); + //기업회원 삭제 }else if(userTy.equals("USR02")){ //기업회원 삭제 - mapper.deleteEntrprsMber(userId); + } } diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/XitEntUserRegMngServiceBean.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/XitEntUserRegMngServiceBean.java deleted file mode 100644 index ff570570..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/XitEntUserRegMngServiceBean.java +++ /dev/null @@ -1,384 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.service.bean; - -import cokr.xit.foundation.component.AbstractServiceBean; -import kr.xit.fims.framework.biz.cmm.XitEntrprsMberVO; -import kr.xit.fims.framework.biz.cmm.XitLoginVO; -import kr.xit.fims.framework.biz.cmm.service.XitFrameCrudService; -import kr.xit.fims.framework.biz.cmm.service.XitFrameUnitService; -import kr.xit.fims.framework.biz.mng.user.dao.XitEntUserRegMngMapper; -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngVO; -import kr.xit.fims.framework.biz.mng.user.XitUserInfoVO; -import kr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO; -import kr.xit.fims.framework.biz.mng.user.service.UserMgtService; -import kr.xit.fims.framework.biz.mng.user.service.XitEntUserRegMngService; -import kr.xit.fims.framework.core.message.XitMessageSource; -import kr.xit.fims.framework.core.utils.XitCmmnUtil; -import kr.xit.fims.framework.core.utils.XitScrtyUtil; -import org.egovframe.rte.fdl.cmmn.exception.FdlException; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.SQLException; -import java.util.List; - -@Service -public class XitEntUserRegMngServiceBean extends AbstractServiceBean implements XitEntUserRegMngService { - private static final Logger logger = LoggerFactory.getLogger(XitEntUserRegMngServiceBean.class); - - @Resource - private XitEntUserRegMngMapper xitEntUserRegMngMapper; - @Resource - private UserMgtService userMgtService; - @Resource - private XitFrameCrudService xitFrameCrudService; - @Resource - private XitFrameUnitService xitFrameUnitService; - @Resource - private XitMessageSource xitMessageSource; - @Autowired - @Qualifier("usrEsntlIdGnrService") - private EgovIdGnrService usrEsntlIdGnrService; - - @Override - public List findList(XitEntUserRegMngSearchVO searchVO) { - List result = null; - try { - result = xitEntUserRegMngMapper.findList(searchVO); - } catch (SQLException e) { - throw new RuntimeException("기업사용자등록관리 목록 조회 FAIL::", e); - } - return result; - } - - @Override - public int findListTotCnt(XitEntUserRegMngSearchVO searchVO) { - int result = 0; - try { - result = xitEntUserRegMngMapper.findListTotCnt(searchVO); - } catch (SQLException e) { - throw new RuntimeException("기업사용자등록관리 목록 총건수 조회 FAIL::", e); - } - return result; - } - - @Override - public XitEntUserRegMngVO findView(XitEntUserRegMngVO vo) { - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(vo.getUniqId())) - throw new RuntimeException("대상에 대한 열람 권한이 없습니다."); - - XitEntUserRegMngVO result = null; - try { - result = xitEntUserRegMngMapper.findView(vo); - } catch (SQLException e) { - throw new RuntimeException("기업사용자등록관리 상세정보 조회 FAIL::", e); - } - return result; - } - - @Override - public void addProc(XitEntUserRegMngVO vo) { - /** - * 필수값 설정 - */ - String esntlId = null; - try { - esntlId = usrEsntlIdGnrService.getNextStringId(); - } catch (FdlException e) { - throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage())); - } - vo.setUniqId(esntlId); //고유식별키 - XitEntrprsMberVO crudVO = convertToCrudVO(vo); - //그룹의 기본권한 조회 및 설정 - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(crudVO.getEsntlId()); - userScrtySetupVO.setMberTyCode("USR02"); - String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(crudVO.getGroupId()); - userScrtySetupVO.setAuthorCode(defaultAuthorCode); - - /** - * 처리 - */ - //사용자정보 등록 - xitFrameCrudService.addXitEntrprsMber(crudVO); - //사용자의 권한 등록 - xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO); - - } - - @Override - public void modifyProc(XitEntUserRegMngVO vo) { - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(vo.getUniqId())) - throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); - - /** - * 필수값 설정 - */ - XitEntrprsMberVO crudVO = convertToCrudVO(vo); - crudVO.setEntrprsMberPassword(null); - boolean isChangedGroupId = false; //그룹ID 변경 여부 - XitEntrprsMberVO curUserInfo = xitFrameCrudService.findXitEntrprsMber(crudVO); - if(!crudVO.getGroupId().equals(curUserInfo.getGroupId())) - isChangedGroupId = true; - /* ======================================= - * 2020.11.16. 박민규 - * 고유식별자 수정 방지 - * -사유: esntl_id의 경우 회원의 고유식별자이므로 변경 되어선 안됨. - * -작업내용: crudVO.setEsntl_id(null) 코드 추가 - ======================================= */ - String uniqId = crudVO.getEsntlId(); - crudVO.setEsntlId(null); - /* ======================================= - * 2020.11.16. 박민규 - * 고유식별자 확인 코드 추가 - * -사유: parameter 조작(CSRF)에 대한 방어 코드 - * -작업내용: 현재 사용자정보와 요청값 확인코드 추가 - * -> if(!curUserInfo.getEsntl_id().equals(uniqId)) - ======================================= */ - if(!curUserInfo.getEsntlId().equals(uniqId)) - throw new RuntimeException("사용자 고유식별값이 일치하지 않습니다."); - - - - /** - * 처리 - */ - xitFrameCrudService.modifyXitEntrprsMber(crudVO); - if(isChangedGroupId) { //그룹ID가 변경되었을 경우 - //그룹의 기본권한 조회 및 설정 - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(uniqId); - String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(crudVO.getGroupId()); - userScrtySetupVO.setAuthorCode(defaultAuthorCode); - //사용자의 권한 갱신 - if(XitCmmnUtil.isEmpty(xitFrameCrudService.findXitUserScrtySetup(userScrtySetupVO))) { - userScrtySetupVO.setMberTyCode("USR02"); - xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO); - }else { - xitFrameCrudService.modifyXitUserScrtySetup(userScrtySetupVO); - } - } - } - - @Override - public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2) { - - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(uniqId)) - throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); - XitEntUserRegMngVO vo = new XitEntUserRegMngVO(); - vo.setUniqId(uniqId); - vo = this.findView(vo); - String encryptPass = null; - String encryptNewPass = null; - try { - encryptPass = XitScrtyUtil.encryptPassword(oldPassword, id); - encryptNewPass = XitScrtyUtil.encryptPassword(newPassword, id); - } catch (Exception e) { - throw new RuntimeException(String.format("비밀번호 암호화 실패:: %s", e.getMessage())); - } - //비밀번호 동일 여부 - if (vo.getEntrprsMberPassword().equals(encryptPass)) { - //신 비밀번호/비밀번호 확인 동일 여부 - if (!newPassword.equals(newPassword2)) { - throw new RuntimeException(xitMessageSource.getMessage("fail.user.passwordUpdate2")); - } - } else { - throw new RuntimeException(xitMessageSource.getMessage("fail.user.passwordUpdate1")); - } - - - /** - * 필수값 설정 - */ - XitEntrprsMberVO crudVO = new XitEntrprsMberVO(); - crudVO.setEntrprsMberId(id); - crudVO.setEntrprsMberPassword(encryptNewPass); - - - /** - * 처리 - */ - xitFrameCrudService.modifyXitEntrprsMber(crudVO); - - } - - @Override - public void removeProc(String id) { - // TODO : Refactor 적용 - userMgtService.removeUser("", id); - } - - @Override - public void removesProc(String userIds) { - - /** - * 유효성 확인 - */ - String [] delId = userIds.split(","); - if (delId == null || (delId.length == 0)) { - throw new RuntimeException(xitMessageSource.getMessage("fail.common.delete")); - } - - /** - * 처리 - */ - String [] arrUserId = userIds.split(","); - for (int i=0; i메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. - * @return XitEntrprsMberVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 27. - */ - private XitEntrprsMberVO convertToCrudVO(XitEntUserRegMngVO vo) { - String password = null; - try { - password = XitScrtyUtil.encryptPassword(vo.getEntrprsMberPassword(), vo.getEntrprsmberId()); - } catch (Exception e) { - throw new RuntimeException(String.format("비밀번호 암호화 실패:: %s", e.getMessage())); - } - - - XitEntrprsMberVO crudVO = new XitEntrprsMberVO(); - crudVO.setEntrprsMberId(vo.getEntrprsmberId()); //기업 회원 id - crudVO.setEntrprsSeCode(vo.getEntrprsSeCode()); //기업 구분 코드 - crudVO.setBizrno (vo.getBizrno()); //사업자등록번호 - crudVO.setJurirno (vo.getJurirno()); //법인등록번호 - crudVO.setCmpnyNm(vo.getCmpnyNm()); //회사 명 - crudVO.setCxfc (vo.getCxfc()); //대표이사 - crudVO.setZip (vo.getZip()); //우편번호 - crudVO.setAdres (vo.getAdres()); //주소 - crudVO.setEntrprsMiddleTelno(vo.getEntrprsMiddleTelno()); //기업 중간 전화번호 - crudVO.setFxnum (vo.getFxnum()); //팩스번호 - crudVO.setInduty_code (vo.getIndutyCode()); //업종 코드 - crudVO.setApplcntNm(vo.getApplcntNm()); //신청인 명 - crudVO.setApplcntIhidnum(vo.getApplcntIhidnum()); //신청인 주민등록번호 - crudVO.setRegDt(vo.getRegDt()); //가입 일 - crudVO.setEntrprsMberSttus(vo.getEntrprsMberSttus()); //기업 회원 상태 - crudVO.setEntrprsMberPassword(password); //기업 회원 비밀번호 - crudVO.setEntrprsMberPasswordHint(vo.getEntrprsMberPasswordHint()); //기업 회원 비밀번호 힌트 - crudVO.setEntrprsMberPasswordCnsr(vo.getEntrprsMberPasswordCnsr()); //기업 회원 비밀번호 정답 - crudVO.setGroupId(vo.getGroupId()); //그룹 id - crudVO.setDetailAdres(vo.getDetailAdres()); //상세 주소 - crudVO.setEntrprsEndTelno(vo.getEntrprsEndTelno()); //기업 끝 전화번호 - crudVO.setArea_no (vo.getAreaNo()); //지역 번호 - crudVO.setApplcntEmailAdres(vo.getApplcntEmailAdres()); //신청자 이메일 주소 - crudVO.setEsntlId(vo.getUniqId()); //고유 id - - return crudVO; - } - - - /** - *
메소드 설명: 사용자정보 수정 권한 여부 확인
-	 * 	-보안성 강화를 위해 다음 조건을 충족 하도록 한다.
-	 * 	 :"ROLE_ADMIN 권한"의 사용자는 모든 사용자의 정보 수정이 가능해야 한다.
-	 * 	 :"ROLE_ADMIN 권한"의 사용자정보는 같은 "ROLE_ADMIN 권한"의 사용자만 수정이 가능해야 한다.
-	 * 	 :타인의 정보는 "ROLE_ADMIN 권한" 또는 "사용자관리권한"이 부여된 사용자만 수정이 가능해야 한다.
-	 * 
- * @param uniqId 고유ID - * @return boolean 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 6. 9. - */ - private boolean isUserModifyAuth(String uniqId) { - - XitLoginVO loginVO = XitCmmnUtil.getUserInfo(); - - - //본인정보인 경우 - if(loginVO.getUniqId().equals(uniqId)) { - return true; - } - //본인정보가 아닌 경우 - else { - /** - * 필수조회 - */ - //사용자(수정대상) 권한 조회 - String trgetAuthorCode = null; - XitUserScrtySetupVO vo = new XitUserScrtySetupVO(); - vo.setScrtySetupTrgetId(uniqId); - vo = xitFrameCrudService.findXitUserScrtySetup(vo); - trgetAuthorCode = vo.getAuthorCode(); - //사용자(수정자) 권한 조회 - String userAuthorCode = null; - vo = new XitUserScrtySetupVO(); - vo.setScrtySetupTrgetId(loginVO.getUniqId()); - vo = xitFrameCrudService.findXitUserScrtySetup(vo); - userAuthorCode = vo.getAuthorCode(); - - - /** - * 유효성 확인 - */ - //사용자(수정자)가 ROLE_ADMIN 권한의 사용자인 경우 - if("ROLE_ADMIN".equals(userAuthorCode)) { - return true; - }else { - //사용자(수정대상)가 ROLE_ADMIN 권한의 사용자인 경우 - if("ROLE_ADMIN".equals(trgetAuthorCode)) { - return false; - } - //사용자관리권한별 분기 - XitUserInfoVO trgetUserInfoVO = new XitUserInfoVO(); - trgetUserInfoVO.setEsntlId(uniqId); - trgetUserInfoVO = xitFrameCrudService.findXitUserInfos(trgetUserInfoVO).get(0); //사용자(수정대상) 정보 조회 - XitUserInfoVO loginUserInfoVO = new XitUserInfoVO(); - loginUserInfoVO.setEsntlId(uniqId); - loginUserInfoVO = xitFrameCrudService.findXitUserInfos(loginUserInfoVO).get(0); //사용자(수정자) 정보 조회 - switch(loginVO.getUserManageAuthor()) { - case "ALL": //모든 사용자 - return true; - case "DEPT": //자신이 속한 부서의 모든 사용자 - if(loginUserInfoVO.getPstinstCode().equals(trgetUserInfoVO.getPstinstCode())) - return true; - break; -// case "ONESELF": //본인정보만 -// return true; - case "ORGNZT": //자신이 속한 조직의 모든 사용자 - if(loginVO.getOrgnztId().equals(trgetUserInfoVO.getOrgnztId())) - return true; - break; -// case "ORGNZT_N_CHILD": //자신이 속한 조직의 모든 하위 조직 사용자(ex: 종로구청이 담당하는 조직) -// return true; - default: - return false; - } - } - - - - return false; - - } - - - - } - - - - -} diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/XitGnrUserRegMngServiceBean.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/XitGnrUserRegMngServiceBean.java deleted file mode 100644 index 19dd3046..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/service/bean/XitGnrUserRegMngServiceBean.java +++ /dev/null @@ -1,380 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.service.bean; - -import cokr.xit.foundation.component.AbstractServiceBean; -import kr.xit.fims.framework.biz.cmm.XitGnrlMberVO; -import kr.xit.fims.framework.biz.cmm.XitLoginVO; -import kr.xit.fims.framework.biz.cmm.service.XitFrameCrudService; -import kr.xit.fims.framework.biz.cmm.service.XitFrameUnitService; -import kr.xit.fims.framework.biz.mng.user.dao.XitGnrUserRegMngMapper; -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngVO; -import kr.xit.fims.framework.biz.mng.user.XitUserInfoVO; -import kr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO; -import kr.xit.fims.framework.biz.mng.user.service.UserMgtService; -import kr.xit.fims.framework.biz.mng.user.service.XitGnrUserRegMngService; -import kr.xit.fims.framework.core.message.XitMessageSource; -import kr.xit.fims.framework.core.utils.XitCmmnUtil; -import kr.xit.fims.framework.core.utils.XitScrtyUtil; -import org.egovframe.rte.fdl.cmmn.exception.FdlException; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.SQLException; -import java.util.List; - -@Service -public class XitGnrUserRegMngServiceBean extends AbstractServiceBean implements XitGnrUserRegMngService{ - private static final Logger logger = LoggerFactory.getLogger(XitGnrUserRegMngServiceBean.class); - - @Resource - private XitGnrUserRegMngMapper xitGnrUserRegMngMapper; - @Resource - private UserMgtService userMgtService; - @Resource - private XitFrameCrudService xitFrameCrudService; - @Resource - private XitFrameUnitService xitFrameUnitService; - @Resource - private XitMessageSource xitMessageSource; - @Autowired - @Qualifier("usrEsntlIdGnrService") - private EgovIdGnrService usrEsntlIdGnrService; - - @Override - public List findList(XitGnrUserRegMngSearchVO searchVO) { - List result = null; - try { - result = xitGnrUserRegMngMapper.findList(searchVO); - } catch (SQLException e) { - throw new RuntimeException("일반사용자등록관리 목록 조회 FAIL::", e); - } - return result; - } - - @Override - public int findListTotCnt(XitGnrUserRegMngSearchVO searchVO) { - int result = 0; - try { - result = xitGnrUserRegMngMapper.findListTotCnt(searchVO); - } catch (SQLException e) { - throw new RuntimeException("일반사용자등록관리 목록 총건수 조회 FAIL::", e); - } - return result; - } - - @Override - public XitGnrUserRegMngVO findView(XitGnrUserRegMngVO vo) { - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(vo.getUniqId())) - throw new RuntimeException("대상에 대한 열람 권한이 없습니다."); - - XitGnrUserRegMngVO result = null; - try { - result = xitGnrUserRegMngMapper.findView(vo); - } catch (SQLException e) { - throw new RuntimeException("일반사용자등록관리 상세정보 조회 FAIL::", e); - } - return result; - } - - @Override - public void addProc(XitGnrUserRegMngVO vo) { - /** - * 필수값 설정 - */ - String esntlId = null; - try { - esntlId = usrEsntlIdGnrService.getNextStringId(); - } catch (FdlException e) { - throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage())); - } - vo.setUniqId(esntlId); //고유식별키 - XitGnrlMberVO crudVO = this.convertToCrudVO(vo); - //그룹의 기본권한 조회 및 설정 - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(crudVO.getEsntlId()); - userScrtySetupVO.setMberTyCode("USR01"); - String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(crudVO.getGroupId()); - userScrtySetupVO.setAuthorCode(defaultAuthorCode); - - /** - * 처리 - */ - //일반회원정보 등록 - xitFrameCrudService.addXitGnrlMber(crudVO); - //사용자의 권한 등록 - xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO); - - } - - @Override - public void modifyProc(XitGnrUserRegMngVO vo) { - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(vo.getUniqId())) - throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); - - /** - * 필수값 설정 - */ - XitGnrlMberVO crudVO = convertToCrudVO(vo); - crudVO.setPassword(null); - boolean isChangedGroupId = false; //그룹ID 변경 여부 - XitGnrlMberVO curUserInfo = xitFrameCrudService.findXitGnrlMber(crudVO); - if(!crudVO.getGroupId().equals(curUserInfo.getGroupId())) - isChangedGroupId = true; - /* ======================================= - * 2020.11.16. 박민규 - * 고유식별자 수정 방지 - * -사유: esntl_id의 경우 회원의 고유식별자이므로 변경 되어선 안됨. - * -작업내용: crudVO.setEsntl_id(null) 코드 추가 - ======================================= */ - String uniqId = crudVO.getEsntlId(); - crudVO.setEsntlId(null); - /* ======================================= - * 2020.11.16. 박민규 - * 고유식별자 확인 코드 추가 - * -사유: parameter 조작(CSRF)에 대한 방어 코드 - * -작업내용: 현재 사용자정보와 요청값 확인코드 추가 - * -> if(!curUserInfo.getEsntl_id().equals(uniqId)) - ======================================= */ - if(!curUserInfo.getEsntlId().equals(uniqId)) - throw new RuntimeException("사용자 고유식별값이 일치하지 않습니다."); - - - - /** - * 처리 - */ - xitFrameCrudService.modifyXitGnrlMber(crudVO); - if(isChangedGroupId) { //그룹ID가 변경되었을 경우 - //그룹의 기본권한 조회 및 설정 - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(uniqId); - String defaultAuthorCode = xitFrameUnitService.getDefaultAuthorCode(crudVO.getGroupId()); - userScrtySetupVO.setAuthorCode(defaultAuthorCode); - //사용자의 권한 갱신 - if(XitCmmnUtil.isEmpty(xitFrameCrudService.findXitUserScrtySetup(userScrtySetupVO))) { - userScrtySetupVO.setMberTyCode("USR01"); - xitFrameCrudService.addXitUserScrtySetup(userScrtySetupVO); - }else { - xitFrameCrudService.modifyXitUserScrtySetup(userScrtySetupVO); - } - } - } - - @Override - public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2) { - - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(uniqId)) - throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); - XitGnrUserRegMngVO vo = new XitGnrUserRegMngVO(); - vo.setUniqId(uniqId); - vo = this.findView(vo); - String encryptPass = null; - String encryptNewPass = null; - try { - encryptPass = XitScrtyUtil.encryptPassword(oldPassword, id); - encryptNewPass = XitScrtyUtil.encryptPassword(newPassword, id); - } catch (Exception e) { - throw new RuntimeException(String.format("비밀번호 암호화 실패:: %s", e.getMessage())); - } - //비밀번호 동일 여부 - if (vo.getPassword().equals(encryptPass)) { - //신 비밀번호/비밀번호 확인 동일 여부 - if (!newPassword.equals(newPassword2)) { - throw new RuntimeException(xitMessageSource.getMessage("fail.user.passwordUpdate2")); - } - } else { - throw new RuntimeException(xitMessageSource.getMessage("fail.user.passwordUpdate1")); - } - - - /** - * 필수값 설정 - */ - XitGnrlMberVO crudVO = new XitGnrlMberVO(); - crudVO.setMberId(id); - crudVO.setPassword(encryptNewPass); - - - /** - * 처리 - */ - xitFrameCrudService.modifyXitGnrlMber(crudVO); - - } - - @Override - public void removeProc(String id) { - // TODO : refactoring 적용 - userMgtService.removeUser("", id); - } - - @Override - public void removesProc(String userIds) { - - /** - * 유효성 확인 - */ - String [] delId = userIds.split(","); - if (delId == null || (delId.length == 0)) { - throw new RuntimeException(xitMessageSource.getMessage("fail.common.delete")); - } - - /** - * 처리 - */ - String [] arrUserId = userIds.split(","); - for (int i=0; i메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. - * @return XitGnrlMberVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 27. - */ - private XitGnrlMberVO convertToCrudVO(XitGnrUserRegMngVO vo) { - String password = null; - try { - password = XitScrtyUtil.encryptPassword(vo.getPassword(), vo.getMberId()); - } catch (Exception e) { - throw new RuntimeException(String.format("비밀번호 암호화 실패:: %s", e.getMessage())); - } - - - XitGnrlMberVO crudVO = new XitGnrlMberVO(); - crudVO.setMberId(vo.getMberId()); //회원 id - crudVO.setPassword (password); //비밀번호 - crudVO.setPasswordHint(vo.getPasswordHint()); //비밀번호 힌트 - crudVO.setPasswordCnsr(vo.getPasswordCnsr()); //비밀번호 정답 - crudVO.setIhidnum (vo.getIhidnum()); //주민등록번호 - crudVO.setMberNm(vo.getMberNm()); //회원 명 - crudVO.setZip (vo.getZip()); //우편번호 - crudVO.setAdres (vo.getAdres()); //주소 - crudVO.setAreaNo(vo.getAreaNo()); //지역 번호 - crudVO.setMberSttus(vo.getMberSttus()); //회원 상태 - crudVO.setDetailAdres(vo.getDetailAdres()); //상세 주소 - crudVO.setEndTelno(vo.getEndTelno()); //끝 전화번호 - crudVO.setMbtlnum (vo.getMoblphonNo()); //이동전화번호 - crudVO.setGroupId(vo.getGroupId()); //그룹 id - crudVO.setMberFxnum(vo.getMberFxnum()); //회원 팩스번호 - crudVO.setMberEmailAdres(vo.getMberEmailAdres()); //회원 이메일 주소 - crudVO.setMiddleTelno(vo.getMiddleTelno()); //중간 전화번호 - crudVO.setRegDt(vo.getRegDt()); //가입 일자 - crudVO.setSexdstnCode(vo.getSexdstnCode()); //성별 코드 - crudVO.setEsntlId(vo.getUniqId()); //고유 id - - return crudVO; - } - - - /** - *
메소드 설명: 사용자정보 수정 권한 여부 확인
-	 * 	-보안성 강화를 위해 다음 조건을 충족 하도록 한다.
-	 * 	 :"ROLE_ADMIN 권한"의 사용자는 모든 사용자의 정보 수정이 가능해야 한다.
-	 * 	 :"ROLE_ADMIN 권한"의 사용자정보는 같은 "ROLE_ADMIN 권한"의 사용자만 수정이 가능해야 한다.
-	 * 	 :타인의 정보는 "ROLE_ADMIN 권한" 또는 "사용자관리권한"이 부여된 사용자만 수정이 가능해야 한다.
-	 * 
- * @param uniqId 고유ID - * @return boolean 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 6. 9. - */ - private boolean isUserModifyAuth(String uniqId) { - - XitLoginVO loginVO = XitCmmnUtil.getUserInfo(); - - - //본인정보인 경우 - if(loginVO.getUniqId().equals(uniqId)) { - return true; - } - //본인정보가 아닌 경우 - else { - /** - * 필수조회 - */ - //사용자(수정대상) 권한 조회 - String trgetAuthorCode = null; - XitUserScrtySetupVO vo = new XitUserScrtySetupVO(); - vo.setScrtySetupTrgetId(uniqId); - vo = xitFrameCrudService.findXitUserScrtySetup(vo); - trgetAuthorCode = vo.getAuthorCode(); - //사용자(수정자) 권한 조회 - String userAuthorCode = null; - vo = new XitUserScrtySetupVO(); - vo.setScrtySetupTrgetId(loginVO.getUniqId()); - vo = xitFrameCrudService.findXitUserScrtySetup(vo); - userAuthorCode = vo.getAuthorCode(); - - - /** - * 유효성 확인 - */ - //사용자(수정자)가 ROLE_ADMIN 권한의 사용자인 경우 - if("ROLE_ADMIN".equals(userAuthorCode)) { - return true; - }else { - //사용자(수정대상)가 ROLE_ADMIN 권한의 사용자인 경우 - if("ROLE_ADMIN".equals(trgetAuthorCode)) { - return false; - } - //사용자관리권한별 분기 - XitUserInfoVO trgetUserInfoVO = new XitUserInfoVO(); - trgetUserInfoVO.setEsntlId(uniqId); - trgetUserInfoVO = xitFrameCrudService.findXitUserInfos(trgetUserInfoVO).get(0); //사용자(수정대상) 정보 조회 - XitUserInfoVO loginUserInfoVO = new XitUserInfoVO(); - loginUserInfoVO.setEsntlId(uniqId); - loginUserInfoVO = xitFrameCrudService.findXitUserInfos(loginUserInfoVO).get(0); //사용자(수정자) 정보 조회 - switch(loginVO.getUserManageAuthor()) { - case "ALL": //모든 사용자 - return true; - case "DEPT": //자신이 속한 부서의 모든 사용자 - if(loginUserInfoVO.getPstinstCode().equals(trgetUserInfoVO.getPstinstCode())) - return true; - break; -// case "ONESELF": //본인정보만 -// return true; - case "ORGNZT": //자신이 속한 조직의 모든 사용자 - if(loginVO.getOrgnztId().equals(trgetUserInfoVO.getOrgnztId())) - return true; - break; -// case "ORGNZT_N_CHILD": //자신이 속한 조직의 모든 하위 조직 사용자(ex: 종로구청이 담당하는 조직) -// return true; - default: - return false; - } - } - - - - return false; - - } - - - - } - - - - -} diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/web/XitEntUserRegMngController.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/web/XitEntUserRegMngController.java deleted file mode 100644 index edaa2fbb..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/web/XitEntUserRegMngController.java +++ /dev/null @@ -1,399 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.web; - -import cokr.xit.foundation.web.AbstractController; -import kr.xit.fims.framework.biz.cmm.service.XitFrameCodeService; -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitEntUserRegMngVO; -import kr.xit.fims.framework.biz.mng.user.service.XitEntUserRegMngService; -import kr.xit.fims.framework.core.constants.FrameworkConstants; -import kr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; -import kr.xit.fims.framework.core.message.XitMessageSource; -import kr.xit.fims.framework.core.utils.XitCmmnUtil; -import kr.xit.fims.framework.core.validation.XitBeanValidator; -import kr.xit.fims.framework.support.util.AjaxUtils; -import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.ui.ModelMap; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -/** - * - * @업무그룹명: 기업사용자등록관리 Controller - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:32:51 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Controller -@RequestMapping(name = "", value = "/framework/biz/mng/usr/") -public class XitEntUserRegMngController extends AbstractController { - - private static final Logger logger = LoggerFactory.getLogger(XitEntUserRegMngController.class); - - @Resource - private XitEntUserRegMngService xitEntUserRegMngService; - @Autowired - private XitBeanValidator beanValidator; - @Resource(name = "xitMessageSource") - XitMessageSource xitMessageSource; - @Resource - private XitFrameCodeService xitFrameCodeService; - - @Value("#{prop['Globals.Xit.Pagination.PageUnit']}") - private int PAGE_UNIT; - @Value("#{prop['Globals.Xit.Pagination.PageSize']}") - private int PAGE_SIZE; - - /** - *
메소드 설명: 기업사용자등록관리 목록 페이지
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "entUserRegMng_list", method={RequestMethod.GET, RequestMethod.POST}) - public String entUserRegMng_list(@ModelAttribute("userSearchVO") XitEntUserRegMngSearchVO searchVO, ModelMap model) { - - // 내역 조회 - - searchVO.setPageUnit(PAGE_UNIT); - searchVO.setPageSize(PAGE_SIZE); - - /** pageing */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - model.addAttribute("resultList", xitEntUserRegMngService.findList(searchVO)); - - int totCnt = xitEntUserRegMngService.findListTotCnt(searchVO); - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - - //사용자상태코드를 코드정보로부터 조회 - model.addAttribute("entrprsMberSttus_result", xitFrameCodeService.findCmmnDetailCodes("XIT013"));//사용자상태코드목록 - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/usr/XitEntUserRegMng_list"; - } - /** - *
메소드 설명: 기업사용자등록관리 목록 페이지 조회
- * @return String 요청처리 후 응답객체 - * @author: 최유수 - * @date: 2020. 7. 29. - */ - @RequestMapping(name = "", value = "entUserRegMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public Map entUserRegMng_listAjax(HttpServletRequest req, @ModelAttribute("userSearchVO") XitEntUserRegMngSearchVO searchVO, ModelMap model) throws IOException, SQLException, RuntimeException { - - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageNum()>-1?searchVO.getPageNum():searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getFetchSize()>-1?searchVO.getFetchSize():searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - Map resultMap = new HashMap(); - try { - /** - * 조회 - */ - int totCnt = xitEntUserRegMngService.findListTotCnt(searchVO); - paginationInfo.setTotalRecordCount(totCnt); - /** - * 반환값 설정 - */ - /* *************************** - * tui Grid Response Set - *************************** */ - resultMap.put("result", true); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message - Map data = new HashMap(); - data.put("contents", xitEntUserRegMngService.findList(searchVO)); //[tui Grid] data-contents - Map pagination = new HashMap(); - pagination.put("pageNum", searchVO.getPageNum()); - pagination.put("totalSize", totCnt); - data.put("pagination", pagination); //[tui Grid] data-paging - resultMap.put("data", data); //[tui Grid] data - /* *************************** - * //tui Grid Response Set - *************************** */ - } catch (Exception e) { - /** - * 반환값 설정 - */ - //tui Grid Response Set - resultMap.put("result", false); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message - } - - return resultMap; - } - - - /** - *
메소드 설명: 요청 페이지로 이동 한다.
- * @param page - * @param tilesDef 타일즈 적용 Type(none: tiles 미적용) - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "entUserRegMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) - public String entUserRegMng_page(@PathVariable String cmd - , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef - , @ModelAttribute("userSearchVO") XitEntUserRegMngSearchVO searchVO - , @ModelAttribute("entrprsManageVO") XitEntUserRegMngVO vo - , @RequestParam(value="selectedId", required=false, defaultValue="") String uniqId - , @RequestParam(value="userTyForPassword", required=false, defaultValue="") String userTyForPassword - , ModelMap model - , HttpServletRequest request) { - switch (cmd) { - case "input": //등록 페이지 - /*================ - * 코드목록 조회 - ================*/ - model.addAttribute("passwordHint_result" , xitFrameCodeService.findCmmnDetailCodes("XIT022")); //패스워트힌트코드 목록 - model.addAttribute("sexdstnCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT014")); //성별구분코드 목록 - model.addAttribute("entrprsMberSttus_result" , xitFrameCodeService.findCmmnDetailCodes("XIT013")); //사용자상태코드 목록 - model.addAttribute("entrprsSeCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT026")); //기업구분코드 목록 - model.addAttribute("indutyCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT027")); //업종코드 목록 - model.addAttribute("groupId_result" , xitFrameCodeService.findGroupCodes("XIT_ORGNZT_INFO")); //그룹정보코드 목록 - break; - case "view": //수정 페이지 - case "edit": //상세 페이지 - /*================ - * 코드목록 조회 - ================*/ - model.addAttribute("passwordHint_result" , xitFrameCodeService.findCmmnDetailCodes("XIT022")); //패스워트힌트코드 목록 - model.addAttribute("sexdstnCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT014")); //성별구분코드 목록 - model.addAttribute("entrprsMberSttus_result" , xitFrameCodeService.findCmmnDetailCodes("XIT013")); //사용자상태코드 목록 - model.addAttribute("entrprsSeCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT026")); //기업구분코드 목록 - model.addAttribute("indutyCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT027")); //업종코드 목록 - model.addAttribute("groupId_result" , xitFrameCodeService.findGroupCodes("XIT_ORGNZT_INFO")); //그룹정보코드 목록 - if(XitCmmnUtil.notEmpty(uniqId)) - vo.setUniqId(uniqId); - - XitEntUserRegMngVO xitEntUserRegMngVO = xitEntUserRegMngService.findView(vo); - model.addAttribute("entrprsManageVO", xitEntUserRegMngVO); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - if(!"".equals(tilesDef)) - tilesDef = "."+tilesDef; - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/usr/XitEntUserRegMng_"+cmd+tilesDef; - - } - - - /** - *
메소드 설명: 요청 팝업 페이지 이동 한다.
- * @param page - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "entUserRegMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) - public String entUserRegMng_page_popup( - @PathVariable String cmd - , @ModelAttribute("userSearchVO") XitEntUserRegMngSearchVO searchVO - , @ModelAttribute("entrprsManageVO") XitEntUserRegMngVO vo - , ModelMap model - , @RequestParam(value="selectedId", required=false, defaultValue="") String uniqId - , @RequestParam(value="userTyForPassword", required=false, defaultValue="") String userTyForPassword - ) { - - switch (cmd) { - case "editPwd": //수정(비밀번호) 페이지 - vo.setUserTy(userTyForPassword); - model.addAttribute("entrprsManageVO", vo); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/usr/XitEntUserRegMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); - } - - - - /** - *
메소드 설명: 기업사용자등록관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "entUserRegMng_{cmd}_proc", method=RequestMethod.POST) - public void entUserRegMng_cmd_proc(@PathVariable String cmd - ,@ModelAttribute("entrprsManageVO") XitEntUserRegMngVO vo - ,@RequestParam(value="checkedIdForDel", required=false, defaultValue="") String checkedIdForDel - ,@RequestParam(value="isViewPage", required=false, defaultValue="N") String isViewPage - ,@RequestParam Map commandMap - ,BindingResult bindingResult - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - String sLocationUrl = "forward:/framework/biz/mng/usr/entUserRegMng_list"; - String message = null; - switch (cmd) { - case "insert": //등록 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("entrprsManageVO", vo, bindingResult); - if (bindingResult.hasErrors()) { -// throw new RuntimeException(xitMessageSource.getMessage("fail.common.insert")); - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/usr/entUserRegMng_input"; - break; - } - //처리 - try { - xitEntUserRegMngService.addProc(vo); - message = xitMessageSource.getMessage("success.common.insert"); - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/usr/entUserRegMng_input"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/usr/entUserRegMng_input"; - } - break; - -// case "inserts": //다건 등록 -// break; - - case "update": //수정 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("entrprsManageVO", vo, bindingResult); - if (bindingResult.hasErrors()) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/usr/entUserRegMng_edit"; - break; - } - //처리 - try { - xitEntUserRegMngService.modifyProc(vo); - message = xitMessageSource.getMessage("success.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } - break; - - case "update_pwd": //수정(비밀번호) - String oldPassword = (String) commandMap.get("oldPassword"); - String newPassword = (String) commandMap.get("newPassword"); - String newPassword2 = (String) commandMap.get("newPassword2"); - String uniqId = (String) commandMap.get("uniqId"); - - try { - xitEntUserRegMngService.modifyPwdProc(uniqId, vo.getEntrprsmberId(), oldPassword, newPassword, newPassword2); - message = xitMessageSource.getMessage("success.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } - break; - - case "delete": //삭제 - //처리 - try { - xitEntUserRegMngService.removeProc(checkedIdForDel); - message = xitMessageSource.getMessage("success.common.delete"); - break; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/entUserRegMng_view":"forward:/framework/biz/mng/usr/entUserRegMng_edit"; - } - break; - - case "deletes": //다건 삭제 - //처리 - try { - xitEntUserRegMngService.removesProc(checkedIdForDel); - message = xitMessageSource.getMessage("success.common.delete"); - } catch (RuntimeException e) { - message = e.getMessage(); - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - } - break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 -// model.addAttribute("message", message); -// return sLocationUrl; - model.addAttribute("message", message); - if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - }else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } - } -} - - diff --git a/src/main/java/kr/xit/fims/framework/biz/mng/user/web/XitGnrUserRegMngController.java b/src/main/java/kr/xit/fims/framework/biz/mng/user/web/XitGnrUserRegMngController.java deleted file mode 100644 index b7f41417..00000000 --- a/src/main/java/kr/xit/fims/framework/biz/mng/user/web/XitGnrUserRegMngController.java +++ /dev/null @@ -1,394 +0,0 @@ -package kr.xit.fims.framework.biz.mng.user.web; - -import cokr.xit.foundation.web.AbstractController; -import kr.xit.fims.framework.biz.cmm.service.XitFrameCodeService; -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngSearchVO; -import kr.xit.fims.framework.biz.mng.user.XitGnrUserRegMngVO; -import kr.xit.fims.framework.biz.mng.user.service.XitGnrUserRegMngService; -import kr.xit.fims.framework.core.constants.FrameworkConstants; -import kr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; -import kr.xit.fims.framework.core.message.XitMessageSource; -import kr.xit.fims.framework.core.utils.XitCmmnUtil; -import kr.xit.fims.framework.core.validation.XitBeanValidator; -import kr.xit.fims.framework.support.util.AjaxUtils; -import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.ui.ModelMap; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -/** - * - * @업무그룹명: 일반사용자등록관리 Controller - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:32:51 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Controller -@RequestMapping(name = "", value = "/framework/biz/mng/usr/") -public class XitGnrUserRegMngController extends AbstractController { - - private static final Logger logger = LoggerFactory.getLogger(XitGnrUserRegMngController.class); - - @Resource - private XitGnrUserRegMngService xitGnrUserRegMngService; - @Autowired - private XitBeanValidator beanValidator; - @Resource(name = "xitMessageSource") - XitMessageSource xitMessageSource; - @Resource - private XitFrameCodeService xitFrameCodeService; - - @Value("#{prop['Globals.Xit.Pagination.PageUnit']}") - private int PAGE_UNIT; - @Value("#{prop['Globals.Xit.Pagination.PageSize']}") - private int PAGE_SIZE; - - /** - *
메소드 설명: 일반사용자등록관리 목록 페이지
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "gnrUserRegMng_list", method={RequestMethod.GET, RequestMethod.POST}) - public String gnrUserRegMng_list(@ModelAttribute("userSearchVO") XitGnrUserRegMngSearchVO searchVO, ModelMap model) { - - // 내역 조회 - - searchVO.setPageUnit(PAGE_UNIT); - searchVO.setPageSize(PAGE_SIZE); - - /** pageing */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - model.addAttribute("resultList", xitGnrUserRegMngService.findList(searchVO)); - - int totCnt = xitGnrUserRegMngService.findListTotCnt(searchVO); - paginationInfo.setTotalRecordCount(totCnt); - model.addAttribute("paginationInfo", paginationInfo); - - model.addAttribute("mberSttus_result", xitFrameCodeService.findCmmnDetailCodes("XIT013"));//사용자상태코드목록 - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/usr/XitGnrUserRegMng_list"; - } - /** - *
메소드 설명: 일반사용자등록관리 목록 페이지 조회
- * @return String 요청처리 후 응답객체 - * @author: 최유수 - * @date: 2020. 7. 29. - */ - @RequestMapping(name = "", value = "gnrUserRegMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public Map gnrUserRegMng_listAjax(HttpServletRequest req, @ModelAttribute("userSearchVO") XitGnrUserRegMngSearchVO searchVO, ModelMap model) throws IOException, SQLException, RuntimeException { - - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageNum()>-1?searchVO.getPageNum():searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getFetchSize()>-1?searchVO.getFetchSize():searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - Map resultMap = new HashMap(); - try { - /** - * 조회 - */ - int totCnt = xitGnrUserRegMngService.findListTotCnt(searchVO); - paginationInfo.setTotalRecordCount(totCnt); - /** - * 반환값 설정 - */ - /* *************************** - * tui Grid Response Set - *************************** */ - resultMap.put("result", true); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message - Map data = new HashMap(); - data.put("contents", xitGnrUserRegMngService.findList(searchVO)); //[tui Grid] data-contents - Map pagination = new HashMap(); - pagination.put("pageNum", searchVO.getPageNum()); - pagination.put("totalSize", totCnt); - data.put("pagination", pagination); //[tui Grid] data-paging - resultMap.put("data", data); //[tui Grid] data - /* *************************** - * //tui Grid Response Set - *************************** */ - } catch (Exception e) { - /** - * 반환값 설정 - */ - //tui Grid Response Set - resultMap.put("result", false); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message - } - - return resultMap; - } - - - /** - *
메소드 설명: 요청 페이지로 이동 한다.
- * @param cmd - * @param tilesDef 타일즈 적용 Type(none: tiles 미적용) - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "gnrUserRegMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) - public String gnrUserRegMng_page(@PathVariable String cmd - , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef - , @ModelAttribute("userSearchVO") XitGnrUserRegMngSearchVO searchVO - , @ModelAttribute("mberManageVO") XitGnrUserRegMngVO vo - , @RequestParam(value="selectedId", required=false, defaultValue="") String uniqId - , @RequestParam(value="userTyForPassword", required=false, defaultValue="") String userTyForPassword - , ModelMap model - , HttpServletRequest request) { - switch (cmd) { - case "input": //등록 페이지 - /*================ - * 코드목록 조회 - ================*/ - model.addAttribute("passwordHint_result" , xitFrameCodeService.findCmmnDetailCodes("XIT022")); //패스워트힌트코드 목록 - model.addAttribute("sexdstnCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT014")); //성별구분코드 목록 - model.addAttribute("mberSttus_result" , xitFrameCodeService.findCmmnDetailCodes("XIT013")); //사용자상태코드 목록 - model.addAttribute("groupId_result" , xitFrameCodeService.findGroupCodes("XIT_ORGNZT_INFO")); //그룹정보코드 목록 - break; - case "view": //수정 페이지 - case "edit": //상세 페이지 - /*================ - * 코드목록 조회 - ================*/ - model.addAttribute("passwordHint_result" , xitFrameCodeService.findCmmnDetailCodes("XIT022")); //패스워트힌트코드 목록 - model.addAttribute("sexdstnCode_result" , xitFrameCodeService.findCmmnDetailCodes("XIT014")); //성별구분코드 목록 - model.addAttribute("mberSttus_result" , xitFrameCodeService.findCmmnDetailCodes("XIT013")); //사용자상태코드 목록 - model.addAttribute("groupId_result" , xitFrameCodeService.findGroupCodes("XIT_ORGNZT_INFO")); //그룹정보코드 목록 - if(XitCmmnUtil.notEmpty(uniqId)) - vo.setUniqId(uniqId); - - XitGnrUserRegMngVO xitGnrUserRegMngVO = xitGnrUserRegMngService.findView(vo); - model.addAttribute("mberManageVO", xitGnrUserRegMngVO); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - if(!"".equals(tilesDef)) - tilesDef = "."+tilesDef; - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/usr/XitGnrUserRegMng_"+cmd+tilesDef; - - } - - - /** - *
메소드 설명: 요청 팝업 페이지 이동 한다.
- * @param cmd - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "gnrUserRegMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) - public String gnrUserRegMng_page_popup( - @PathVariable String cmd - , @ModelAttribute("userSearchVO") XitGnrUserRegMngSearchVO searchVO - , @ModelAttribute("mberManageVO") XitGnrUserRegMngVO vo - , ModelMap model - , @RequestParam(value="selectedId", required=false, defaultValue="") String uniqId - , @RequestParam(value="userTyForPassword", required=false, defaultValue="") String userTyForPassword - ) { - - switch (cmd) { - case "editPwd": //수정(비밀번호) 페이지 - vo.setUserTy(userTyForPassword); - model.addAttribute("mberManageVO", vo); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/usr/XitGnrUserRegMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); - } - - - - /** - *
메소드 설명: 일반사용자등록관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 4. 8. - */ - @RequestMapping(name = "", value = "gnrUserRegMng_{cmd}_proc", method=RequestMethod.POST) - public void gnrUserRegMng_cmd_proc(@PathVariable String cmd - ,@ModelAttribute("mberManageVO") XitGnrUserRegMngVO vo - ,@RequestParam(value="checkedIdForDel", required=false, defaultValue="") String checkedIdForDel - ,@RequestParam(value="isViewPage", required=false, defaultValue="N") String isViewPage - ,@RequestParam Map commandMap - ,BindingResult bindingResult - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - String sLocationUrl = "forward:/framework/biz/mng/usr/gnrUserRegMng_list"; - String message = null; - switch (cmd) { - case "insert": //등록 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("mberManageVO", vo, bindingResult); - if (bindingResult.hasErrors()) { -// throw new RuntimeException(xitMessageSource.getMessage("fail.common.insert")); - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/usr/gnrUserRegMng_input"; - break; - } - //처리 - try { - xitGnrUserRegMngService.addProc(vo); - message = xitMessageSource.getMessage("success.common.insert"); - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/usr/gnrUserRegMng_input"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/usr/gnrUserRegMng_input"; - } - break; - -// case "inserts": //다건 등록 -// break; - - case "update": //수정 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("mberManageVO", vo, bindingResult); - if (bindingResult.hasErrors()) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - break; - } - //처리 - try { - xitGnrUserRegMngService.modifyProc(vo); - message = xitMessageSource.getMessage("success.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } - break; - - case "update_pwd": //수정(비밀번호) - String oldPassword = (String) commandMap.get("oldPassword"); - String newPassword = (String) commandMap.get("newPassword"); - String newPassword2 = (String) commandMap.get("newPassword2"); - String uniqId = (String) commandMap.get("uniqId"); - - try { - xitGnrUserRegMngService.modifyPwdProc(uniqId, vo.getMberId(), oldPassword, newPassword, newPassword2); - message = xitMessageSource.getMessage("success.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } - break; - - case "delete": //삭제 - //처리 - try { - xitGnrUserRegMngService.removeProc(checkedIdForDel); - message = xitMessageSource.getMessage("success.common.delete"); - break; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - sLocationUrl = "Y".equals(isViewPage)?"forward:/framework/biz/mng/usr/gnrUserRegMng_view":"forward:/framework/biz/mng/usr/gnrUserRegMng_edit"; - } - break; - - case "deletes": //다건 삭제 - //처리 - try { - xitGnrUserRegMngService.removesProc(checkedIdForDel); - message = xitMessageSource.getMessage("success.common.delete"); - } catch (RuntimeException e) { - message = e.getMessage(); - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - } - break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 -// model.addAttribute("message", message); -// return sLocationUrl; - model.addAttribute("message", message); - if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - }else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } - } -} - - diff --git a/src/main/resources/sql/mapper/framework/cmm/XitFrameCrud-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/cmm/XitFrameCrud-mysql-mapper.xml index 0a22df3d..25dd452c 100644 --- a/src/main/resources/sql/mapper/framework/cmm/XitFrameCrud-mysql-mapper.xml +++ b/src/main/resources/sql/mapper/framework/cmm/XitFrameCrud-mysql-mapper.xml @@ -1028,188 +1028,6 @@ - - - - - - /** addXitEntrprsMber */ - /** 기업회원 등록 */ - INSERT INTO XIT_ENTRPRS_MBER( - ENTRPRS_MBER_ID - ,ENTRPRS_SE_CODE - ,BIZRNO - ,JURIRNO - ,CMPNY_NM - ,CXFC - ,ZIP - ,ADRES - ,ENTRPRS_MIDDLE_TELNO - ,FXNUM - ,INDUTY_CODE - ,APPLCNT_NM - ,APPLCNT_IHIDNUM - ,REG_DT - ,ENTRPRS_MBER_STTUS - ,ENTRPRS_MBER_PASSWORD - ,ENTRPRS_MBER_PASSWORD_HINT - ,ENTRPRS_MBER_PASSWORD_CNSR - ,GROUP_ID - ,DETAIL_ADRES - ,ENTRPRS_END_TELNO - ,AREA_NO - ,APPLCNT_EMAIL_ADRES - ,ESNTL_ID - )VALUES( - #{entrprs_mber_id } - ,#{entrprs_se_code } - ,#{bizrno } - ,#{jurirno } - ,#{cmpny_nm } - ,#{cxfc } - ,#{zip } - ,#{adres } - ,#{entrprs_middle_telno } - ,#{fxnum } - ,#{induty_code } - ,#{applcnt_nm } - ,#{applcnt_ihidnum } - ,NOW() - ,#{entrprs_mber_sttus } - ,#{entrprs_mber_password } - ,#{entrprs_mber_password_hint} - ,#{entrprs_mber_password_cnsr} - ,#{group_id } - ,#{detail_adres } - ,#{entrprs_end_telno } - ,#{area_no } - ,#{applcnt_email_adres } - ,#{esntl_id } - ) - - - /** modifyXitEntrprsMber */ - /** 기업회원 수정 */ - UPDATE XIT_ENTRPRS_MBER - SET - ESNTL_ID = IFNULL(#{esntl_id}, ESNTL_ID) - ,ENTRPRS_SE_CODE = #{entrprs_se_code } - ,BIZRNO = #{bizrno } - ,JURIRNO = #{jurirno } - ,CMPNY_NM = #{cmpny_nm } - ,CXFC = #{cxfc } - ,ZIP = #{zip } - ,ADRES = #{adres } - ,ENTRPRS_MIDDLE_TELNO = #{entrprs_middle_telno } - ,FXNUM = #{fxnum } - ,INDUTY_CODE = #{induty_code } - ,APPLCNT_NM = #{applcnt_nm } - ,APPLCNT_IHIDNUM = #{applcnt_ihidnum } - ,ENTRPRS_MBER_STTUS = #{entrprs_mber_sttus } - ,ENTRPRS_MBER_PASSWORD = #{entrprs_mber_password } - ,ENTRPRS_MBER_PASSWORD_HINT = #{entrprs_mber_password_hint} - ,ENTRPRS_MBER_PASSWORD_CNSR = #{entrprs_mber_password_cnsr} - ,GROUP_ID = #{group_id } - ,DETAIL_ADRES = #{detail_adres } - ,ENTRPRS_END_TELNO = #{entrprs_end_telno } - ,AREA_NO = #{area_no } - ,APPLCNT_EMAIL_ADRES = #{applcnt_email_adres } - WHERE 1=1 - AND ENTRPRS_MBER_ID = #{entrprs_mber_id} - - - /** removeXitEntrprsMber */ - /** 기업회원 삭제 */ - DELETE FROM XIT_ENTRPRS_MBER - WHERE 1=1 - AND ENTRPRS_MBER_ID = #{entrprs_mber_id} - - - - - - /** findXitGnrlMbers */ - /** 일반회원 다건 조회 */ - SELECT MBER_ID - ,PASSWORD - ,PASSWORD_HINT - ,PASSWORD_CNSR - ,IHIDNUM - ,MBER_NM - ,ZIP - ,ADRES - ,AREA_NO - ,MBER_STTUS - ,DETAIL_ADRES - ,END_TELNO - ,MBTLNUM - ,GROUP_ID - ,MBER_FXNUM - ,MBER_EMAIL_ADRES - ,MIDDLE_TELNO - ,REG_DT - ,SEXDSTN_CODE - ,ESNTL_ID - FROM XIT_GNRL_MBER - WHERE 1=1 - AND MBER_ID = #{mber_id } - AND PASSWORD = #{password } - AND PASSWORD_HINT = #{password_hint } - AND PASSWORD_CNSR = #{password_cnsr } - AND IHIDNUM = #{ihidnum } - AND MBER_NM = #{mber_nm } - AND ZIP = #{zip } - AND ADRES = #{adres } - AND AREA_NO = #{area_no } - AND MBER_STTUS = #{mber_sttus } - AND DETAIL_ADRES = #{detail_adres } - AND END_TELNO = #{end_telno } - AND MBTLNUM = #{mbtlnum } - AND GROUP_ID = #{group_id } - AND MBER_FXNUM = #{mber_fxnum } - AND MBER_EMAIL_ADRES = #{mber_email_adres} - AND MIDDLE_TELNO = #{middle_telno } - AND SEXDSTN_CODE = #{sexdstn_code } - AND ESNTL_ID = #{esntl_id } - - - - /** addXitGnrlMber */ - /** 일반회원 등록 */ - INSERT INTO XIT_GNRL_MBER( - MBER_ID - ,PASSWORD - ,PASSWORD_HINT - ,PASSWORD_CNSR - ,IHIDNUM - ,MBER_NM - ,ZIP - ,ADRES - ,AREA_NO - ,MBER_STTUS - ,DETAIL_ADRES - ,END_TELNO - ,MBTLNUM - ,GROUP_ID - ,MBER_FXNUM - ,MBER_EMAIL_ADRES - ,MIDDLE_TELNO - ,REG_DT - ,SEXDSTN_CODE - ,ESNTL_ID - )VALUES( - #{mber_id } - ,#{password } - ,#{password_hint } - ,#{password_cnsr } - ,#{ihidnum } - ,#{mber_nm } - ,#{zip } - ,#{adres } - ,#{area_no } - ,#{mber_sttus } - ,#{detail_adres } - ,#{end_telno } - ,#{mbtlnum } - ,#{group_id } - ,#{mber_fxnum } - ,#{mber_email_adres} - ,#{middle_telno } - ,NOW() - ,#{sexdstn_code } - ,#{esntl_id } - ) - - - /** modifyXitGnrlMber */ - /** 일반회원 수정 */ - UPDATE XIT_GNRL_MBER - SET - ESNTL_ID = IFNULL(#{esntl_id }, ESNTL_ID) - ,PASSWORD = #{password } - ,PASSWORD_HINT = #{password_hint } - ,PASSWORD_CNSR = #{password_cnsr } - ,IHIDNUM = #{ihidnum } - ,MBER_NM = #{mber_nm } - ,ZIP = #{zip } - ,ADRES = #{adres } - ,AREA_NO = #{area_no } - ,MBER_STTUS = #{mber_sttus } - ,DETAIL_ADRES = #{detail_adres } - ,END_TELNO = #{end_telno } - ,MBTLNUM = #{mbtlnum } - ,GROUP_ID = #{group_id } - ,MBER_FXNUM = #{mber_fxnum } - ,MBER_EMAIL_ADRES = #{mber_email_adres} - ,MIDDLE_TELNO = #{middle_telno } - ,SEXDSTN_CODE = #{sexdstn_code } - WHERE 1=1 - AND MBER_ID = #{mber_id} - - - /** removeXitGnrlMber */ - /** 일반회원 삭제 */ - DELETE FROM XIT_GNRL_MBER - WHERE 1=1 - AND MBER_ID = #{mber_id} - - + diff --git a/src/main/resources/sql/mapper/framework/mng/auth/auth-by-user-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/mng/auth/auth-by-user-mysql-mapper.xml index 165bf611..5db31e78 100644 --- a/src/main/resources/sql/mapper/framework/mng/auth/auth-by-user-mysql-mapper.xml +++ b/src/main/resources/sql/mapper/framework/mng/auth/auth-by-user-mysql-mapper.xml @@ -15,18 +15,6 @@ , IF(uss.scrty_setup_trget_id IS NULL, 'N', 'Y') AS regYn , esntl_id AS uniqId FROM ( - SELECT mber_id USER_ID - , mber_nm USER_NM - , group_id - , esntl_id - FROM xit_gnrl_mber - UNION ALL - SELECT entrprs_mber_id user_id - , cmpny_nm user_nm - , group_id - , esntl_id - FROM xit_entrprs_mber - UNION ALL SELECT user_id , user_nm user_nm , group_id diff --git a/src/main/resources/sql/mapper/framework/mng/usr/XitEntUserRegMng-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/mng/usr/XitEntUserRegMng-mysql-mapper.xml deleted file mode 100644 index e699d5e9..00000000 --- a/src/main/resources/sql/mapper/framework/mng/usr/XitEntUserRegMng-mysql-mapper.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - SELECT LIST.* FROM( - - - - ) LIST LIMIT #{firstIndex}, #{recordCountPerPage} - - - - - SELECT - A.ESNTL_ID AS "uniqId" - ,'USR02' AS "userTy" - ,A.ENTRPRS_MBER_ID AS "userId" - ,A.CMPNY_NM AS "cmpnyNm" - ,A.APPLCNT_NM AS "userNm" - ,A.APPLCNT_EMAIL_ADRES AS "emailAdres" - ,A.AREA_NO AS "areaNo" - ,A.ENTRPRS_MIDDLE_TELNO AS "middleTelno" - ,A.ENTRPRS_END_TELNO AS "endTelno" - ,'' AS "mbtlnum" - ,A.GROUP_ID AS "groupId" - ,A.ENTRPRS_MBER_STTUS AS "sttus" - ,A.REG_DT AS "regDt" - ,(SELECT CODE_VAL FROM tb_cmn_code WHERE USE_YN = 'Y' AND GRP_ID = 'XIT013' AND CODE = A.ENTRPRS_MBER_STTUS) AS "userSttusCode" - - - FROM XIT_ENTRPRS_MBER A - - - - AND A.ENTRPRS_MBER_STTUS LIKE #{sbscrbSttus} - - - - - AND A.ENTRPRS_MBER_ID LIKE #{searchKeyword} - - - AND A.APPLCNT_NM LIKE CONCAT('%',#{searchKeyword},'%') - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/sql/mapper/framework/mng/usr/XitGnrUserRegMng-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/mng/usr/XitGnrUserRegMng-mysql-mapper.xml deleted file mode 100644 index bf5f86d1..00000000 --- a/src/main/resources/sql/mapper/framework/mng/usr/XitGnrUserRegMng-mysql-mapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - SELECT LIST.* FROM( - - - - ) LIST LIMIT #{firstIndex}, #{recordCountPerPage} - - - - - SELECT - A.ESNTL_ID AS "uniqId" - ,'USR01' AS "userTy" - ,A.MBER_ID AS "userId" - ,A.MBER_NM AS "userNm" - ,A.MBER_EMAIL_ADRES AS "emailAdres" - ,A.AREA_NO AS "areaNo" - ,A.MIDDLE_TELNO AS "middleTelno" - ,A.END_TELNO AS "endTelno" - ,A.MBTLNUM AS "mbtlnum" - ,A.GROUP_ID AS "groupId" - ,A.MBER_STTUS AS "sttus" - ,A.REG_DT AS "regDt" - ,(SELECT CODE_VAL FROM tb_cmn_code WHERE USE_YN = 'Y' AND GRP_ID = 'XIT013' AND CODE = A.MBER_STTUS) AS "userSttusCode" - - - - FROM XIT_GNRL_MBER A - - - - AND A.MBER_STTUS LIKE #{sbscrbSttus} - - - - - AND A.MBER_ID LIKE #{searchKeyword} - - - AND A.MBER_NM LIKE CONCAT('%',#{searchKeyword},'%') - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/sql/mapper/framework/mng/usr/user-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/mng/usr/user-mysql-mapper.xml index 22754588..ffdf15b1 100644 --- a/src/main/resources/sql/mapper/framework/mng/usr/user-mysql-mapper.xml +++ b/src/main/resources/sql/mapper/framework/mng/usr/user-mysql-mapper.xml @@ -186,28 +186,6 @@ - - - /* user-mysql-mapper|deleteGnrlMber-일반사용자정보 삭제|julim */ - DELETE - FROM xit_gnrl_mber - WHERE mber_id = #{userId} - - - - - - - /* user-mysql-mapper|delectEntrprsMber-기업사용자정보 삭제|julim */ - DELETE - FROM xit_entrprs_mber - WHERE entrprs_mber_id = #{userId} - -