From 80c88f6897c0ae97b91905933fd73be0436a401a Mon Sep 17 00:00:00 2001 From: minuk926 Date: Tue, 15 Nov 2022 18:32:42 +0900 Subject: [PATCH] =?UTF-8?q?refactor-java=20naming=20rule=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Ec0100Mapper.java => IEc0100Mapper.java} | 2 +- .../{Ec0200Mapper.java => IEc0200Mapper.java} | 2 +- .../{Ec0300Mapper.java => IEc0300Mapper.java} | 2 +- .../{Ec0400Mapper.java => IEc0400Mapper.java} | 2 +- .../{Ec0500Mapper.java => IEc0500Mapper.java} | 2 +- .../fims/biz/ec/service/Ec0100Service.java | 22 +- .../fims/biz/ec/service/Ec0200Service.java | 22 +- .../fims/biz/ec/service/Ec0300Service.java | 22 +- .../fims/biz/ec/service/Ec0400Service.java | 22 +- .../fims/biz/ec/service/Ec0500Service.java | 22 +- .../fims/biz/ec/service/IEc0100Service.java | 11 + .../fims/biz/ec/service/IEc0200Service.java | 11 + .../fims/biz/ec/service/IEc0300Service.java | 11 + .../fims/biz/ec/service/IEc0400Service.java | 11 + .../fims/biz/ec/service/IEc0500Service.java | 11 + .../ec/service/impl/Ec0100ServiceImpl.java | 27 -- .../ec/service/impl/Ec0200ServiceImpl.java | 27 -- .../ec/service/impl/Ec0300ServiceImpl.java | 27 -- .../ec/service/impl/Ec0400ServiceImpl.java | 27 -- .../ec/service/impl/Ec0500ServiceImpl.java | 27 -- .../xit/fims/biz/ec/web/Ec0100Controler.java | 4 +- .../xit/fims/biz/ec/web/Ec0200Controler.java | 4 +- .../xit/fims/biz/ec/web/Ec0300Controler.java | 4 +- .../xit/fims/biz/ec/web/Ec0400Controler.java | 4 +- .../xit/fims/biz/ec/web/Ec0500Controler.java | 4 +- .../SendRqstMngMapper.java | 2 +- .../StatsBySignTalkByYearMapper.java | 2 +- .../service/impl/SendRqstMngServiceImpl.java | 2 +- .../StatsBySignTalkByYearServiceImpl.java | 2 +- .../{Rt0100Mapper.java => IRt0100Mapper.java} | 2 +- .../{Rt0200Mapper.java => IRt0200Mapper.java} | 2 +- .../{Rt0300Mapper.java => IRt0300Mapper.java} | 2 +- .../{Rt0400Mapper.java => IRt0400Mapper.java} | 2 +- .../{Rt0500Mapper.java => IRt0500Mapper.java} | 2 +- .../fims/biz/rt/service/IRt0100Service.java | 11 + .../fims/biz/rt/service/IRt0200Service.java | 17 + .../fims/biz/rt/service/IRt0300Service.java | 11 + .../fims/biz/rt/service/IRt0400Service.java | 11 + .../fims/biz/rt/service/IRt0500Service.java | 11 + .../fims/biz/rt/service/Rt0100Service.java | 22 +- .../fims/biz/rt/service/Rt0200Service.java | 48 +- .../fims/biz/rt/service/Rt0300Service.java | 22 +- .../fims/biz/rt/service/Rt0400Service.java | 22 +- .../fims/biz/rt/service/Rt0500Service.java | 22 +- .../rt/service/impl/Rt0100ServiceImpl.java | 27 -- .../rt/service/impl/Rt0200ServiceImpl.java | 51 --- .../rt/service/impl/Rt0300ServiceImpl.java | 27 -- .../rt/service/impl/Rt0400ServiceImpl.java | 27 -- .../rt/service/impl/Rt0500ServiceImpl.java | 27 -- .../xit/fims/biz/rt/web/Rt0100Controller.java | 4 +- .../xit/fims/biz/rt/web/Rt0200Controller.java | 4 +- .../xit/fims/biz/rt/web/Rt0300Controler.java | 4 +- .../xit/fims/biz/rt/web/Rt0400Controler.java | 4 +- .../xit/fims/biz/rt/web/Rt0500Controler.java | 4 +- .../{SampleMapper.java => ISampleMapper.java} | 2 +- .../biz/sample/service/ISampleService.java | 11 + .../biz/sample/service/SampleService.java | 23 +- .../service/impl/SampleServiceImpl.java | 27 -- .../fims/biz/sample/web/SampleController.java | 4 +- ...cheBbsMapper.java => ICacheBbsMapper.java} | 3 +- ...eCodeMapper.java => ICacheCodeMapper.java} | 2 +- ...eMenuMapper.java => ICacheMenuMapper.java} | 4 +- .../biz/cache/service/CacheService.java | 184 +++++--- .../biz/cache/service/ICacheService.java | 64 +++ .../cache/service/impl/CacheServiceImpl.java | 139 ------ .../cmm/web/XitFrameAnonymousController.java | 4 +- ...tMapper.java => IAuthAuthorMgtMapper.java} | 2 +- ...tMapper.java => IAuthByUserMgtMapper.java} | 2 +- ...pMgtMapper.java => IAuthGrpMgtMapper.java} | 2 +- ...pper.java => IAuthHierarchyMgtMapper.java} | 4 +- ...MgtMapper.java => IAuthRoleMgtMapper.java} | 2 +- .../auth/service/AuthAuthorMgtService.java | 132 ++++-- .../auth/service/AuthByUserMgtService.java | 72 ++- .../mng/auth/service/AuthGrpMgtService.java | 157 ++++++- .../auth/service/AuthHierarchyMgtService.java | 258 ++++++++++- .../mng/auth/service/AuthRoleMgtService.java | 99 ++-- .../auth/service/IAuthAuthorMgtService.java | 42 ++ .../auth/service/IAuthByUserMgtService.java | 25 + .../mng/auth/service/IAuthGrpMgtService.java | 29 ++ .../service/IAuthHierarchyMgtService.java | 26 ++ .../mng/auth/service/IAuthRoleMgtService.java | 65 +++ .../impl/AuthAuthorMgtServiceImpl.java | 112 ----- .../impl/AuthByUserMgtServiceImpl.java | 69 --- .../service/impl/AuthGrpMgtServiceImpl.java | 149 ------ .../impl/AuthHierarchyMgtServiceImpl.java | 252 ---------- .../service/impl/AuthRoleMgtServiceImpl.java | 60 --- .../mng/auth/web/AuthAuthorMgtController.java | 4 +- .../mng/auth/web/AuthByUserMgtController.java | 4 +- .../mng/auth/web/AuthGrpMgtController.java | 4 +- .../auth/web/AuthHierarchyMgtController.java | 8 +- .../mng/auth/web/AuthRoleMgtController.java | 4 +- .../mapper/ICodeClassificationMgtMapper.java | 49 ++ .../service/CodeClassificationMgtService.java | 140 ++++++ .../ICodeClassificationMgtService.java | 79 ++++ .../web/CodeClassificationMgtController.java | 343 ++++++++++++++ .../mng/code/web/XitClCodeMngController.java | 2 +- ...tMapper.java => IMenuByRoleMgtMapper.java} | 2 +- ...MenuMgtMapper.java => IMenuMgtMapper.java} | 2 +- ...mMgtMapper.java => IProgramMgtMapper.java} | 2 +- .../menu/service/IMenuByRoleMgtService.java | 23 + .../biz/mng/menu/service/IMenuMgtService.java | 76 +++ .../mng/menu/service/IProgramMgtService.java | 43 ++ .../menu/service/MenuByRoleMgtService.java | 59 ++- .../biz/mng/menu/service/MenuMgtService.java | 432 ++++++++++++++++-- .../mng/menu/service/ProgramMgtService.java | 90 ++-- .../impl/MenuByRoleMgtServiceImpl.java | 52 --- .../menu/service/impl/MenuMgtServiceImpl.java | 429 ----------------- .../service/impl/ProgramMgtServiceImpl.java | 67 --- .../mng/menu/web/MenuByRoleMgtController.java | 4 +- .../biz/mng/menu/web/MenuMgtController.java | 5 +- .../mng/menu/web/ProgramMgtController.java | 8 +- ...UserMgtMapper.java => IUserMgtMapper.java} | 2 +- .../biz/mng/user/service/IUserMgtService.java | 64 +++ .../biz/mng/user/service/UserMgtService.java | 338 ++++++++++++-- .../user/service/impl/UserMgtServiceImpl.java | 332 -------------- .../impl/XitEntUserRegMngServiceImpl.java | 4 +- .../impl/XitGnrUserRegMngServiceImpl.java | 4 +- .../biz/mng/user/web/UserMgtController.java | 4 +- .../framework/support/util/JBeanRegistry.java | 6 +- .../sqlmapper/biz/ec/ec0100-mysql-mapper.xml | 2 +- .../sqlmapper/biz/ec/ec0200-mysql-mapper.xml | 2 +- .../sqlmapper/biz/ec/ec0300-mysql-mapper.xml | 2 +- .../sqlmapper/biz/ec/ec0400-mysql-mapper.xml | 2 +- .../sqlmapper/biz/ec/ec0500-mysql-mapper.xml | 2 +- .../sqlmapper/biz/rt/rt0100-mysql-mapper.xml | 2 +- .../sqlmapper/biz/rt/rt0200-mysql-mapper.xml | 2 +- .../sqlmapper/biz/rt/rt0300-mysql-mapper.xml | 2 +- .../sqlmapper/biz/rt/rt0400-mysql-mapper.xml | 2 +- .../sqlmapper/biz/rt/rt0500-mysql-mapper.xml | 2 +- .../cache/cacheboard-mysql-mapper.xml | 2 +- .../cache/cachecode-mysql-mapper.xml | 2 +- .../cache/cachemenu-mysql-mapper.xml | 2 +- .../mng/auth/auth-author-mysql-mapper.xml | 2 +- .../mng/auth/auth-by-user-mysql-mapper.xml | 2 +- .../mng/auth/auth-grp-mysql-mapper.xml | 2 +- .../mng/auth/auth-hierarchy-mysql-mapper.xml | 2 +- .../mng/auth/auth-role-mysql-mapper.xml | 2 +- .../code/code-classification-mysql-mapper.xml | 77 ++++ .../mng/menu/menu-by-role-mysql-mapper.xml | 2 +- .../framework/mng/menu/menu-mysql-mapper.xml | 2 +- .../mng/menu/program-mysql-mapper.xml | 2 +- .../framework/mng/usr/user-mysql-mapper.xml | 2 +- .../mng/code/mngCodeClassificationMgtForm.jsp | 270 +++++++++++ 143 files changed, 3383 insertions(+), 2443 deletions(-) rename src/main/java/kr/xit/fims/biz/ec/mapper/{Ec0100Mapper.java => IEc0100Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/ec/mapper/{Ec0200Mapper.java => IEc0200Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/ec/mapper/{Ec0300Mapper.java => IEc0300Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/ec/mapper/{Ec0400Mapper.java => IEc0400Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/ec/mapper/{Ec0500Mapper.java => IEc0500Mapper.java} (90%) create mode 100644 src/main/java/kr/xit/fims/biz/ec/service/IEc0100Service.java create mode 100644 src/main/java/kr/xit/fims/biz/ec/service/IEc0200Service.java create mode 100644 src/main/java/kr/xit/fims/biz/ec/service/IEc0300Service.java create mode 100644 src/main/java/kr/xit/fims/biz/ec/service/IEc0400Service.java create mode 100644 src/main/java/kr/xit/fims/biz/ec/service/IEc0500Service.java delete mode 100644 src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0100ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0200ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0300ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0400ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0500ServiceImpl.java rename src/main/java/kr/xit/fims/biz/ens/adm/{service => mapper}/SendRqstMngMapper.java (92%) rename src/main/java/kr/xit/fims/biz/ens/adm/{service => mapper}/StatsBySignTalkByYearMapper.java (91%) rename src/main/java/kr/xit/fims/biz/rt/mapper/{Rt0100Mapper.java => IRt0100Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/rt/mapper/{Rt0200Mapper.java => IRt0200Mapper.java} (95%) rename src/main/java/kr/xit/fims/biz/rt/mapper/{Rt0300Mapper.java => IRt0300Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/rt/mapper/{Rt0400Mapper.java => IRt0400Mapper.java} (90%) rename src/main/java/kr/xit/fims/biz/rt/mapper/{Rt0500Mapper.java => IRt0500Mapper.java} (90%) create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/IRt0100Service.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/IRt0200Service.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/IRt0300Service.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/IRt0400Service.java create mode 100644 src/main/java/kr/xit/fims/biz/rt/service/IRt0500Service.java delete mode 100644 src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0100ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0200ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0300ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0400ServiceImpl.java delete mode 100644 src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0500ServiceImpl.java rename src/main/java/kr/xit/fims/biz/sample/mapper/{SampleMapper.java => ISampleMapper.java} (91%) create mode 100644 src/main/java/kr/xit/fims/biz/sample/service/ISampleService.java delete mode 100644 src/main/java/kr/xit/fims/biz/sample/service/impl/SampleServiceImpl.java rename src/main/java/kr/xit/framework/biz/cache/mapper/{CacheBbsMapper.java => ICacheBbsMapper.java} (81%) rename src/main/java/kr/xit/framework/biz/cache/mapper/{CacheCodeMapper.java => ICacheCodeMapper.java} (89%) rename src/main/java/kr/xit/framework/biz/cache/mapper/{CacheMenuMapper.java => ICacheMenuMapper.java} (79%) create mode 100644 src/main/java/kr/xit/framework/biz/cache/service/ICacheService.java delete mode 100644 src/main/java/kr/xit/framework/biz/cache/service/impl/CacheServiceImpl.java rename src/main/java/kr/xit/framework/biz/mng/auth/mapper/{AuthAuthorMgtMapper.java => IAuthAuthorMgtMapper.java} (98%) rename src/main/java/kr/xit/framework/biz/mng/auth/mapper/{AuthByUserMgtMapper.java => IAuthByUserMgtMapper.java} (94%) rename src/main/java/kr/xit/framework/biz/mng/auth/mapper/{AuthGrpMgtMapper.java => IAuthGrpMgtMapper.java} (96%) rename src/main/java/kr/xit/framework/biz/mng/auth/mapper/{AuthHierarchyMgtMapper.java => IAuthHierarchyMgtMapper.java} (82%) rename src/main/java/kr/xit/framework/biz/mng/auth/mapper/{AuthRoleMgtMapper.java => IAuthRoleMgtMapper.java} (96%) create mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthByUserMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthHierarchyMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthAuthorMgtServiceImpl.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthByUserMgtServiceImpl.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthGrpMgtServiceImpl.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthHierarchyMgtServiceImpl.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthRoleMgtServiceImpl.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeClassificationMgtMapper.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/code/service/CodeClassificationMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/code/service/ICodeClassificationMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/code/web/CodeClassificationMgtController.java rename src/main/java/kr/xit/framework/biz/mng/menu/mapper/{MenuByRoleMgtMapper.java => IMenuByRoleMgtMapper.java} (92%) rename src/main/java/kr/xit/framework/biz/mng/menu/mapper/{MenuMgtMapper.java => IMenuMgtMapper.java} (98%) rename src/main/java/kr/xit/framework/biz/mng/menu/mapper/{ProgramMgtMapper.java => IProgramMgtMapper.java} (95%) create mode 100644 src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuByRoleMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java create mode 100644 src/main/java/kr/xit/framework/biz/mng/menu/service/IProgramMgtService.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuByRoleMgtServiceImpl.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuMgtServiceImpl.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMgtServiceImpl.java rename src/main/java/kr/xit/framework/biz/mng/user/mapper/{UserMgtMapper.java => IUserMgtMapper.java} (98%) create mode 100644 src/main/java/kr/xit/framework/biz/mng/user/service/IUserMgtService.java delete mode 100644 src/main/java/kr/xit/framework/biz/mng/user/service/impl/UserMgtServiceImpl.java create mode 100644 src/main/resources/sqlmapper/framework/mng/code/code-classification-mysql-mapper.xml create mode 100644 src/main/webapp/WEB-INF/jsp/framework/biz/mng/code/mngCodeClassificationMgtForm.jsp diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0100Mapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0100Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/ec/mapper/Ec0100Mapper.java rename to src/main/java/kr/xit/fims/biz/ec/mapper/IEc0100Mapper.java index 4318665a..621a1032 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0100Mapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0100Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Ec0100Mapper { +public interface IEc0100Mapper { List> selectEc0100List(Map paraMap, RowBounds rowBounds); Map selectEc0100(); diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0200Mapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0200Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/ec/mapper/Ec0200Mapper.java rename to src/main/java/kr/xit/fims/biz/ec/mapper/IEc0200Mapper.java index 3028c007..a01fbed9 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0200Mapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0200Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Ec0200Mapper { +public interface IEc0200Mapper { List> selectEc0200List(Map paraMap, RowBounds rowBounds); Map selectEc0200(); diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0300Mapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0300Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/ec/mapper/Ec0300Mapper.java rename to src/main/java/kr/xit/fims/biz/ec/mapper/IEc0300Mapper.java index 2d9eda3a..471a9f3d 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0300Mapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0300Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Ec0300Mapper { +public interface IEc0300Mapper { List> selectEc0300List(Map paraMap, RowBounds rowBounds); Map selectEc0300(); diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0400Mapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0400Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/ec/mapper/Ec0400Mapper.java rename to src/main/java/kr/xit/fims/biz/ec/mapper/IEc0400Mapper.java index 82f11a69..7ca6c8a9 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0400Mapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0400Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Ec0400Mapper { +public interface IEc0400Mapper { List> selectEc0400List(Map paraMap, RowBounds rowBounds); Map selectEc0400(); diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0500Mapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0500Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/ec/mapper/Ec0500Mapper.java rename to src/main/java/kr/xit/fims/biz/ec/mapper/IEc0500Mapper.java index 122f0235..68e6a1c8 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/Ec0500Mapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEc0500Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Ec0500Mapper { +public interface IEc0500Mapper { List> selectEc0500List(Map paraMap, RowBounds rowBounds); Map selectEc0500(); diff --git a/src/main/java/kr/xit/fims/biz/ec/service/Ec0100Service.java b/src/main/java/kr/xit/fims/biz/ec/service/Ec0100Service.java index 046d5e59..1a44d4c3 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/Ec0100Service.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/Ec0100Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Ec0100Service { - List> findEc0100List(Map paraMap, RowBounds pagingInfo); - Map findEc0100(String keyField); +import kr.xit.fims.biz.ec.mapper.IEc0100Mapper; +import kr.xit.fims.biz.ec.service.IEc0100Service; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Service +public class Ec0100Service implements IEc0100Service { + private final IEc0100Mapper mapper; + + @Override + public List> findEc0100List(Map paraMap, RowBounds rowBounds) { + return mapper.selectEc0100List(paraMap, rowBounds); + } + + @Override + public Map findEc0100(String keyField) { + return mapper.selectEc0100(); + } } diff --git a/src/main/java/kr/xit/fims/biz/ec/service/Ec0200Service.java b/src/main/java/kr/xit/fims/biz/ec/service/Ec0200Service.java index 678e7c5a..396fa6d6 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/Ec0200Service.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/Ec0200Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Ec0200Service { - List> findEc0200List(Map paraMap, RowBounds pagingInfo); - Map findEc0200(); +import kr.xit.fims.biz.ec.mapper.IEc0200Mapper; +import kr.xit.fims.biz.ec.service.IEc0200Service; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Service +public class Ec0200Service implements IEc0200Service { + private final IEc0200Mapper mapper; + + @Override + public List> findEc0200List(Map paraMap, RowBounds rowBounds) { + return mapper.selectEc0200List(paraMap, rowBounds); + } + + @Override + public Map findEc0200() { + return mapper.selectEc0200(); + } } diff --git a/src/main/java/kr/xit/fims/biz/ec/service/Ec0300Service.java b/src/main/java/kr/xit/fims/biz/ec/service/Ec0300Service.java index f359b86a..df0f0607 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/Ec0300Service.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/Ec0300Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Ec0300Service { - List> findEc0300List(Map paraMap, RowBounds pagingInfo); - Map findEc0300(); +import kr.xit.fims.biz.ec.mapper.IEc0300Mapper; +import kr.xit.fims.biz.ec.service.IEc0300Service; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Service +public class Ec0300Service implements IEc0300Service { + private final IEc0300Mapper mapper; + + @Override + public List> findEc0300List(Map paraMap, RowBounds rowBounds) { + return mapper.selectEc0300List(paraMap, rowBounds); + } + + @Override + public Map findEc0300() { + return mapper.selectEc0300(); + } } diff --git a/src/main/java/kr/xit/fims/biz/ec/service/Ec0400Service.java b/src/main/java/kr/xit/fims/biz/ec/service/Ec0400Service.java index 0342b85d..672d6f6a 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/Ec0400Service.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/Ec0400Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Ec0400Service { - List> findEc0400List(Map paraMap, RowBounds pagingInfo); - Map findEc0400(); +import kr.xit.fims.biz.ec.mapper.IEc0400Mapper; +import kr.xit.fims.biz.ec.service.IEc0400Service; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Service +public class Ec0400Service implements IEc0400Service { + private final IEc0400Mapper mapper; + + @Override + public List> findEc0400List(Map paraMap, RowBounds rowBounds) { + return mapper.selectEc0400List(paraMap, rowBounds); + } + + @Override + public Map findEc0400() { + return mapper.selectEc0400(); + } } diff --git a/src/main/java/kr/xit/fims/biz/ec/service/Ec0500Service.java b/src/main/java/kr/xit/fims/biz/ec/service/Ec0500Service.java index ec35d8e4..1902c9b5 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/Ec0500Service.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/Ec0500Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Ec0500Service { - List> findEc0500List(Map paraMap, RowBounds pagingInfo); - Map findEc0500(); +import kr.xit.fims.biz.ec.mapper.IEc0500Mapper; +import kr.xit.fims.biz.ec.service.IEc0500Service; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Service +public class Ec0500Service implements IEc0500Service { + private final IEc0500Mapper mapper; + + @Override + public List> findEc0500List(Map paraMap, RowBounds rowBounds) { + return mapper.selectEc0500List(paraMap, rowBounds); + } + + @Override + public Map findEc0500() { + return mapper.selectEc0500(); + } } diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEc0100Service.java b/src/main/java/kr/xit/fims/biz/ec/service/IEc0100Service.java new file mode 100644 index 00000000..6662363b --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEc0100Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.ec.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IEc0100Service { + List> findEc0100List(Map paraMap, RowBounds pagingInfo); + Map findEc0100(String keyField); +} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEc0200Service.java b/src/main/java/kr/xit/fims/biz/ec/service/IEc0200Service.java new file mode 100644 index 00000000..96634cf0 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEc0200Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.ec.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IEc0200Service { + List> findEc0200List(Map paraMap, RowBounds pagingInfo); + Map findEc0200(); +} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEc0300Service.java b/src/main/java/kr/xit/fims/biz/ec/service/IEc0300Service.java new file mode 100644 index 00000000..906502f9 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEc0300Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.ec.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IEc0300Service { + List> findEc0300List(Map paraMap, RowBounds pagingInfo); + Map findEc0300(); +} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEc0400Service.java b/src/main/java/kr/xit/fims/biz/ec/service/IEc0400Service.java new file mode 100644 index 00000000..fef726c0 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEc0400Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.ec.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IEc0400Service { + List> findEc0400List(Map paraMap, RowBounds pagingInfo); + Map findEc0400(); +} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEc0500Service.java b/src/main/java/kr/xit/fims/biz/ec/service/IEc0500Service.java new file mode 100644 index 00000000..99fdff67 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEc0500Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.ec.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IEc0500Service { + List> findEc0500List(Map paraMap, RowBounds pagingInfo); + Map findEc0500(); +} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0100ServiceImpl.java b/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0100ServiceImpl.java deleted file mode 100644 index e24e6885..00000000 --- a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0100ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.ec.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.ec.mapper.Ec0100Mapper; -import kr.xit.fims.biz.ec.service.Ec0100Service; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -@Service -public class Ec0100ServiceImpl implements Ec0100Service { - private final Ec0100Mapper mapper; - - @Override - public List> findEc0100List(Map paraMap, RowBounds rowBounds) { - return mapper.selectEc0100List(paraMap, rowBounds); - } - - @Override - public Map findEc0100(String keyField) { - return mapper.selectEc0100(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0200ServiceImpl.java b/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0200ServiceImpl.java deleted file mode 100644 index 9c45b3a0..00000000 --- a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0200ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.ec.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.ec.mapper.Ec0200Mapper; -import kr.xit.fims.biz.ec.service.Ec0200Service; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -@Service -public class Ec0200ServiceImpl implements Ec0200Service { - private final Ec0200Mapper mapper; - - @Override - public List> findEc0200List(Map paraMap, RowBounds rowBounds) { - return mapper.selectEc0200List(paraMap, rowBounds); - } - - @Override - public Map findEc0200() { - return mapper.selectEc0200(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0300ServiceImpl.java b/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0300ServiceImpl.java deleted file mode 100644 index ca89f2e0..00000000 --- a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0300ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.ec.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.ec.mapper.Ec0300Mapper; -import kr.xit.fims.biz.ec.service.Ec0300Service; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -@Service -public class Ec0300ServiceImpl implements Ec0300Service { - private final Ec0300Mapper mapper; - - @Override - public List> findEc0300List(Map paraMap, RowBounds rowBounds) { - return mapper.selectEc0300List(paraMap, rowBounds); - } - - @Override - public Map findEc0300() { - return mapper.selectEc0300(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0400ServiceImpl.java b/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0400ServiceImpl.java deleted file mode 100644 index 611aeb59..00000000 --- a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0400ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.ec.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.ec.mapper.Ec0400Mapper; -import kr.xit.fims.biz.ec.service.Ec0400Service; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -@Service -public class Ec0400ServiceImpl implements Ec0400Service { - private final Ec0400Mapper mapper; - - @Override - public List> findEc0400List(Map paraMap, RowBounds rowBounds) { - return mapper.selectEc0400List(paraMap, rowBounds); - } - - @Override - public Map findEc0400() { - return mapper.selectEc0400(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0500ServiceImpl.java b/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0500ServiceImpl.java deleted file mode 100644 index 369976a7..00000000 --- a/src/main/java/kr/xit/fims/biz/ec/service/impl/Ec0500ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.ec.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.ec.mapper.Ec0500Mapper; -import kr.xit.fims.biz.ec.service.Ec0500Service; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -@Service -public class Ec0500ServiceImpl implements Ec0500Service { - private final Ec0500Mapper mapper; - - @Override - public List> findEc0500List(Map paraMap, RowBounds rowBounds) { - return mapper.selectEc0500List(paraMap, rowBounds); - } - - @Override - public Map findEc0500() { - return mapper.selectEc0500(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/ec/web/Ec0100Controler.java b/src/main/java/kr/xit/fims/biz/ec/web/Ec0100Controler.java index 3bc2147c..b75884a3 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/Ec0100Controler.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/Ec0100Controler.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.fims.biz.cmm.FimsConst; -import kr.xit.fims.biz.ec.service.Ec0100Service; +import kr.xit.fims.biz.ec.service.IEc0100Service; import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; @@ -24,7 +24,7 @@ import lombok.AllArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/ec") public class Ec0100Controler { - private final Ec0100Service service; + private final IEc0100Service service; @GetMapping(value = "/ec0100Form") public void ec0100Form(){ diff --git a/src/main/java/kr/xit/fims/biz/ec/web/Ec0200Controler.java b/src/main/java/kr/xit/fims/biz/ec/web/Ec0200Controler.java index 6121a967..aeb06255 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/Ec0200Controler.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/Ec0200Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.ec.service.Ec0200Service; +import kr.xit.fims.biz.ec.service.IEc0200Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.AllArgsConstructor; @@ -17,7 +17,7 @@ import lombok.AllArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/ec") public class Ec0200Controler { - private final Ec0200Service service; + private final IEc0200Service service; @GetMapping(value = "/ec0200Form") public void ec0200Form(){ diff --git a/src/main/java/kr/xit/fims/biz/ec/web/Ec0300Controler.java b/src/main/java/kr/xit/fims/biz/ec/web/Ec0300Controler.java index ee8b2079..eeaa5477 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/Ec0300Controler.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/Ec0300Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.ec.service.Ec0300Service; +import kr.xit.fims.biz.ec.service.IEc0300Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.AllArgsConstructor; @@ -17,7 +17,7 @@ import lombok.AllArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/ec") public class Ec0300Controler { - private final Ec0300Service service; + private final IEc0300Service service; @GetMapping(value = "/ec0300Form") public void ec0300Form(){ diff --git a/src/main/java/kr/xit/fims/biz/ec/web/Ec0400Controler.java b/src/main/java/kr/xit/fims/biz/ec/web/Ec0400Controler.java index b319cdc4..48733fa0 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/Ec0400Controler.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/Ec0400Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.ec.service.Ec0400Service; +import kr.xit.fims.biz.ec.service.IEc0400Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.AllArgsConstructor; @@ -17,7 +17,7 @@ import lombok.AllArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/ec") public class Ec0400Controler { - private final Ec0400Service service; + private final IEc0400Service service; @GetMapping(value = "/ec0400Form") public void ec0400Form(){ diff --git a/src/main/java/kr/xit/fims/biz/ec/web/Ec0500Controler.java b/src/main/java/kr/xit/fims/biz/ec/web/Ec0500Controler.java index 6eaf6531..5ad01435 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/Ec0500Controler.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/Ec0500Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.ec.service.Ec0500Service; +import kr.xit.fims.biz.ec.service.IEc0500Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.AllArgsConstructor; @@ -17,7 +17,7 @@ import lombok.AllArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/ec") public class Ec0500Controler { - private final Ec0500Service service; + private final IEc0500Service service; @GetMapping(value = "/ec0500Form") public void ec0500Form(){ diff --git a/src/main/java/kr/xit/fims/biz/ens/adm/service/SendRqstMngMapper.java b/src/main/java/kr/xit/fims/biz/ens/adm/mapper/SendRqstMngMapper.java similarity index 92% rename from src/main/java/kr/xit/fims/biz/ens/adm/service/SendRqstMngMapper.java rename to src/main/java/kr/xit/fims/biz/ens/adm/mapper/SendRqstMngMapper.java index 0868d58a..da58daf6 100644 --- a/src/main/java/kr/xit/fims/biz/ens/adm/service/SendRqstMngMapper.java +++ b/src/main/java/kr/xit/fims/biz/ens/adm/mapper/SendRqstMngMapper.java @@ -1,4 +1,4 @@ -package kr.xit.fims.biz.ens.adm.service; +package kr.xit.fims.biz.ens.adm.mapper; import java.sql.SQLException; import java.util.List; diff --git a/src/main/java/kr/xit/fims/biz/ens/adm/service/StatsBySignTalkByYearMapper.java b/src/main/java/kr/xit/fims/biz/ens/adm/mapper/StatsBySignTalkByYearMapper.java similarity index 91% rename from src/main/java/kr/xit/fims/biz/ens/adm/service/StatsBySignTalkByYearMapper.java rename to src/main/java/kr/xit/fims/biz/ens/adm/mapper/StatsBySignTalkByYearMapper.java index 7bd2cd67..d00a1342 100644 --- a/src/main/java/kr/xit/fims/biz/ens/adm/service/StatsBySignTalkByYearMapper.java +++ b/src/main/java/kr/xit/fims/biz/ens/adm/mapper/StatsBySignTalkByYearMapper.java @@ -1,4 +1,4 @@ -package kr.xit.fims.biz.ens.adm.service; +package kr.xit.fims.biz.ens.adm.mapper; import java.util.List; diff --git a/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/SendRqstMngServiceImpl.java b/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/SendRqstMngServiceImpl.java index 6bfb8e0f..4888c682 100644 --- a/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/SendRqstMngServiceImpl.java +++ b/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/SendRqstMngServiceImpl.java @@ -7,7 +7,7 @@ import org.springframework.stereotype.Service; import kr.xit.fims.biz.ens.adm.model.SendRqstMngSearchVO; import kr.xit.fims.biz.ens.adm.model.SendRqstMngVO; -import kr.xit.fims.biz.ens.adm.service.SendRqstMngMapper; +import kr.xit.fims.biz.ens.adm.mapper.SendRqstMngMapper; import kr.xit.fims.biz.ens.adm.service.SendRqstMngService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/StatsBySignTalkByYearServiceImpl.java b/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/StatsBySignTalkByYearServiceImpl.java index 283758b1..5efc888b 100644 --- a/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/StatsBySignTalkByYearServiceImpl.java +++ b/src/main/java/kr/xit/fims/biz/ens/adm/service/impl/StatsBySignTalkByYearServiceImpl.java @@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; import kr.xit.fims.biz.ens.adm.model.StatsBySignTalkByYearSearchVO; import kr.xit.fims.biz.ens.adm.model.StatsBySignTalkByYearVO; -import kr.xit.fims.biz.ens.adm.service.StatsBySignTalkByYearMapper; +import kr.xit.fims.biz.ens.adm.mapper.StatsBySignTalkByYearMapper; import kr.xit.fims.biz.ens.adm.service.StatsBySignTalkByYearService; @Service diff --git a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0100Mapper.java b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0100Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/rt/mapper/Rt0100Mapper.java rename to src/main/java/kr/xit/fims/biz/rt/mapper/IRt0100Mapper.java index f553ea1d..0efbdec1 100644 --- a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0100Mapper.java +++ b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0100Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Rt0100Mapper { +public interface IRt0100Mapper { List> selectRt0100List(Map paraMap, RowBounds rowBounds); Map selectRt0100(); diff --git a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0200Mapper.java b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0200Mapper.java similarity index 95% rename from src/main/java/kr/xit/fims/biz/rt/mapper/Rt0200Mapper.java rename to src/main/java/kr/xit/fims/biz/rt/mapper/IRt0200Mapper.java index 8bb704f3..ed9d22d5 100644 --- a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0200Mapper.java +++ b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0200Mapper.java @@ -10,7 +10,7 @@ import kr.xit.fims.biz.rt.model.Rt0200VO; import org.apache.ibatis.session.RowBounds; @Mapper -public interface Rt0200Mapper { +public interface IRt0200Mapper { // 목록조회 List> selectRt0200List(final Map paraMap); diff --git a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0300Mapper.java b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0300Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/rt/mapper/Rt0300Mapper.java rename to src/main/java/kr/xit/fims/biz/rt/mapper/IRt0300Mapper.java index 2e45d242..8f2ff36c 100644 --- a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0300Mapper.java +++ b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0300Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Rt0300Mapper { +public interface IRt0300Mapper { List> selectRt0300List(Map paraMap, RowBounds rowBounds); Map selectRt0300(); diff --git a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0400Mapper.java b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0400Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/rt/mapper/Rt0400Mapper.java rename to src/main/java/kr/xit/fims/biz/rt/mapper/IRt0400Mapper.java index 74f7110d..08642abd 100644 --- a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0400Mapper.java +++ b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0400Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Rt0400Mapper { +public interface IRt0400Mapper { List> selectRt0400List(Map paraMap, RowBounds rowBounds); Map selectRt0400(); diff --git a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0500Mapper.java b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0500Mapper.java similarity index 90% rename from src/main/java/kr/xit/fims/biz/rt/mapper/Rt0500Mapper.java rename to src/main/java/kr/xit/fims/biz/rt/mapper/IRt0500Mapper.java index 4eea89f5..d34b725f 100644 --- a/src/main/java/kr/xit/fims/biz/rt/mapper/Rt0500Mapper.java +++ b/src/main/java/kr/xit/fims/biz/rt/mapper/IRt0500Mapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface Rt0500Mapper { +public interface IRt0500Mapper { List> selectRt0500List(Map paraMap, RowBounds rowBounds); Map selectRt0500(); diff --git a/src/main/java/kr/xit/fims/biz/rt/service/IRt0100Service.java b/src/main/java/kr/xit/fims/biz/rt/service/IRt0100Service.java new file mode 100644 index 00000000..c54df6cf --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/IRt0100Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.rt.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IRt0100Service { + List> findRt0100List(Map paraMap, RowBounds pagingInfo); + Map findRt0100(); +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/IRt0200Service.java b/src/main/java/kr/xit/fims/biz/rt/service/IRt0200Service.java new file mode 100644 index 00000000..58f15115 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/IRt0200Service.java @@ -0,0 +1,17 @@ +package kr.xit.fims.biz.rt.service; + + +import kr.xit.fims.biz.rt.model.Rt0200SearchVO; +import kr.xit.fims.biz.rt.model.Rt0200VO; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IRt0200Service { + public List> findRt0200List(final Map paraMap, final RowBounds rowBounds); + public List> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds); + + Rt0200VO findRt0200(final String regltId); +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/IRt0300Service.java b/src/main/java/kr/xit/fims/biz/rt/service/IRt0300Service.java new file mode 100644 index 00000000..99c9a505 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/IRt0300Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.rt.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IRt0300Service { + List> findRt0300List(Map paraMap, RowBounds pagingInfo); + Map findRt0300(); +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/IRt0400Service.java b/src/main/java/kr/xit/fims/biz/rt/service/IRt0400Service.java new file mode 100644 index 00000000..9f593676 --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/IRt0400Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.rt.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IRt0400Service { + List> findRt0400List(Map paraMap, RowBounds pagingInfo); + Map findRt0400(); +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/IRt0500Service.java b/src/main/java/kr/xit/fims/biz/rt/service/IRt0500Service.java new file mode 100644 index 00000000..236a173b --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/rt/service/IRt0500Service.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.rt.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface IRt0500Service { + List> findRt0500List(Map paraMap, RowBounds pagingInfo); + Map findRt0500(); +} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/Rt0100Service.java b/src/main/java/kr/xit/fims/biz/rt/service/Rt0100Service.java index c7a0123b..c78464f9 100644 --- a/src/main/java/kr/xit/fims/biz/rt/service/Rt0100Service.java +++ b/src/main/java/kr/xit/fims/biz/rt/service/Rt0100Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Rt0100Service { - List> findRt0100List(Map paraMap, RowBounds pagingInfo); - Map findRt0100(); +import kr.xit.fims.biz.rt.mapper.IRt0100Mapper; +import kr.xit.fims.biz.rt.service.IRt0100Service; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Service +public class Rt0100Service implements IRt0100Service { + private final IRt0100Mapper mapper; + + @Override + public List> findRt0100List(Map paraMap, RowBounds rowBounds) { + return mapper.selectRt0100List(paraMap, rowBounds); + } + + @Override + public Map findRt0100() { + return mapper.selectRt0100(); + } } diff --git a/src/main/java/kr/xit/fims/biz/rt/service/Rt0200Service.java b/src/main/java/kr/xit/fims/biz/rt/service/Rt0200Service.java index c6c894c2..6d517b63 100644 --- a/src/main/java/kr/xit/fims/biz/rt/service/Rt0200Service.java +++ b/src/main/java/kr/xit/fims/biz/rt/service/Rt0200Service.java @@ -1,17 +1,51 @@ package kr.xit.fims.biz.rt.service; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; + +import kr.xit.fims.biz.rt.mapper.IRt0200Mapper; import kr.xit.fims.biz.rt.model.Rt0200SearchVO; import kr.xit.fims.biz.rt.model.Rt0200VO; +import kr.xit.fims.biz.rt.service.IRt0200Service; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Service +public class Rt0200Service implements IRt0200Service { + + private final IRt0200Mapper mapper; + + @Override + public List> findRt0200List(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectRt0200List(paraMap, rowBounds); + } + + @Override + public List> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds) { + return mapper.selectRt0200List(vo, rowBounds); + } + + @Override + public Rt0200VO findRt0200(final String regltId) { + return mapper.selectRt0200(regltId); + } + + public void addProc(final Rt0200VO vo) { + + } + + public void modifyProc(final Rt0200VO vo) { + + } + + public void removeProc(final Rt0200VO vo) { + + } -import java.util.List; -import java.util.Map; -import org.apache.ibatis.session.RowBounds; -public interface Rt0200Service { - public List> findRt0200List(final Map paraMap, final RowBounds rowBounds); - public List> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds); - Rt0200VO findRt0200(final String regltId); } diff --git a/src/main/java/kr/xit/fims/biz/rt/service/Rt0300Service.java b/src/main/java/kr/xit/fims/biz/rt/service/Rt0300Service.java index 3e08fb0e..a3cc61e0 100644 --- a/src/main/java/kr/xit/fims/biz/rt/service/Rt0300Service.java +++ b/src/main/java/kr/xit/fims/biz/rt/service/Rt0300Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Rt0300Service { - List> findRt0300List(Map paraMap, RowBounds pagingInfo); - Map findRt0300(); +import kr.xit.fims.biz.rt.mapper.IRt0300Mapper; +import kr.xit.fims.biz.rt.service.IRt0300Service; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Service +public class Rt0300Service implements IRt0300Service { + private final IRt0300Mapper mapper; + + @Override + public List> findRt0300List(Map paraMap, RowBounds rowBounds) { + return mapper.selectRt0300List(paraMap, rowBounds); + } + + @Override + public Map findRt0300() { + return mapper.selectRt0300(); + } } diff --git a/src/main/java/kr/xit/fims/biz/rt/service/Rt0400Service.java b/src/main/java/kr/xit/fims/biz/rt/service/Rt0400Service.java index b02ff834..8da42072 100644 --- a/src/main/java/kr/xit/fims/biz/rt/service/Rt0400Service.java +++ b/src/main/java/kr/xit/fims/biz/rt/service/Rt0400Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Rt0400Service { - List> findRt0400List(Map paraMap, RowBounds pagingInfo); - Map findRt0400(); +import kr.xit.fims.biz.rt.mapper.IRt0400Mapper; +import kr.xit.fims.biz.rt.service.IRt0400Service; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Service +public class Rt0400Service implements IRt0400Service { + private final IRt0400Mapper mapper; + + @Override + public List> findRt0400List(Map paraMap, RowBounds rowBounds) { + return mapper.selectRt0400List(paraMap, rowBounds); + } + + @Override + public Map findRt0400() { + return mapper.selectRt0400(); + } } diff --git a/src/main/java/kr/xit/fims/biz/rt/service/Rt0500Service.java b/src/main/java/kr/xit/fims/biz/rt/service/Rt0500Service.java index 0a978e4a..b685df85 100644 --- a/src/main/java/kr/xit/fims/biz/rt/service/Rt0500Service.java +++ b/src/main/java/kr/xit/fims/biz/rt/service/Rt0500Service.java @@ -4,8 +4,24 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface Rt0500Service { - List> findRt0500List(Map paraMap, RowBounds pagingInfo); - Map findRt0500(); +import kr.xit.fims.biz.rt.mapper.IRt0500Mapper; +import kr.xit.fims.biz.rt.service.IRt0500Service; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Service +public class Rt0500Service implements IRt0500Service { + private final IRt0500Mapper mapper; + + @Override + public List> findRt0500List(Map paraMap, RowBounds rowBounds) { + return mapper.selectRt0500List(paraMap, rowBounds); + } + + @Override + public Map findRt0500() { + return mapper.selectRt0500(); + } } diff --git a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0100ServiceImpl.java b/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0100ServiceImpl.java deleted file mode 100644 index a68a59ec..00000000 --- a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0100ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.rt.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.rt.mapper.Rt0100Mapper; -import kr.xit.fims.biz.rt.service.Rt0100Service; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class Rt0100ServiceImpl implements Rt0100Service { - private final Rt0100Mapper mapper; - - @Override - public List> findRt0100List(Map paraMap, RowBounds rowBounds) { - return mapper.selectRt0100List(paraMap, rowBounds); - } - - @Override - public Map findRt0100() { - return mapper.selectRt0100(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0200ServiceImpl.java b/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0200ServiceImpl.java deleted file mode 100644 index 8fb37e63..00000000 --- a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0200ServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package kr.xit.fims.biz.rt.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.rt.mapper.Rt0200Mapper; -import kr.xit.fims.biz.rt.model.Rt0200SearchVO; -import kr.xit.fims.biz.rt.model.Rt0200VO; -import kr.xit.fims.biz.rt.service.Rt0200Service; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class Rt0200ServiceImpl implements Rt0200Service { - - private final Rt0200Mapper mapper; - - @Override - public List> findRt0200List(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectRt0200List(paraMap, rowBounds); - } - - @Override - public List> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds) { - return mapper.selectRt0200List(vo, rowBounds); - } - - @Override - public Rt0200VO findRt0200(final String regltId) { - return mapper.selectRt0200(regltId); - } - - public void addProc(final Rt0200VO vo) { - - } - - public void modifyProc(final Rt0200VO vo) { - - } - - public void removeProc(final Rt0200VO vo) { - - } - - - - -} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0300ServiceImpl.java b/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0300ServiceImpl.java deleted file mode 100644 index 1c389a9a..00000000 --- a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0300ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.rt.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.rt.mapper.Rt0300Mapper; -import kr.xit.fims.biz.rt.service.Rt0300Service; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class Rt0300ServiceImpl implements Rt0300Service { - private final Rt0300Mapper mapper; - - @Override - public List> findRt0300List(Map paraMap, RowBounds rowBounds) { - return mapper.selectRt0300List(paraMap, rowBounds); - } - - @Override - public Map findRt0300() { - return mapper.selectRt0300(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0400ServiceImpl.java b/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0400ServiceImpl.java deleted file mode 100644 index 7683bb31..00000000 --- a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0400ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.rt.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.rt.mapper.Rt0400Mapper; -import kr.xit.fims.biz.rt.service.Rt0400Service; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class Rt0400ServiceImpl implements Rt0400Service { - private final Rt0400Mapper mapper; - - @Override - public List> findRt0400List(Map paraMap, RowBounds rowBounds) { - return mapper.selectRt0400List(paraMap, rowBounds); - } - - @Override - public Map findRt0400() { - return mapper.selectRt0400(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0500ServiceImpl.java b/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0500ServiceImpl.java deleted file mode 100644 index fcbb4c91..00000000 --- a/src/main/java/kr/xit/fims/biz/rt/service/impl/Rt0500ServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.rt.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.fims.biz.rt.mapper.Rt0500Mapper; -import kr.xit.fims.biz.rt.service.Rt0500Service; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class Rt0500ServiceImpl implements Rt0500Service { - private final Rt0500Mapper mapper; - - @Override - public List> findRt0500List(Map paraMap, RowBounds rowBounds) { - return mapper.selectRt0500List(paraMap, rowBounds); - } - - @Override - public Map findRt0500() { - return mapper.selectRt0500(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/rt/web/Rt0100Controller.java b/src/main/java/kr/xit/fims/biz/rt/web/Rt0100Controller.java index 4440cbb9..0ee1e21d 100644 --- a/src/main/java/kr/xit/fims/biz/rt/web/Rt0100Controller.java +++ b/src/main/java/kr/xit/fims/biz/rt/web/Rt0100Controller.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.rt.service.Rt0100Service; +import kr.xit.fims.biz.rt.service.IRt0100Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.RequiredArgsConstructor; @@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/rt") public class Rt0100Controller { - private final Rt0100Service service; + private final IRt0100Service service; @GetMapping(value = "/rt0100Form") public void rt0100Form(){ diff --git a/src/main/java/kr/xit/fims/biz/rt/web/Rt0200Controller.java b/src/main/java/kr/xit/fims/biz/rt/web/Rt0200Controller.java index b43a6dc4..8e01363b 100644 --- a/src/main/java/kr/xit/fims/biz/rt/web/Rt0200Controller.java +++ b/src/main/java/kr/xit/fims/biz/rt/web/Rt0200Controller.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.rt.service.Rt0200Service; +import kr.xit.fims.biz.rt.service.IRt0200Service; import kr.xit.framework.biz.cache.util.CacheServiceUtils; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; @@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j; @RequestMapping("/fims/biz/rt") public class Rt0200Controller { - private final Rt0200Service service; + private final IRt0200Service service; /** *
메소드 설명: 메인 페이지
diff --git a/src/main/java/kr/xit/fims/biz/rt/web/Rt0300Controler.java b/src/main/java/kr/xit/fims/biz/rt/web/Rt0300Controler.java index a9b51d7e..6d417651 100644 --- a/src/main/java/kr/xit/fims/biz/rt/web/Rt0300Controler.java +++ b/src/main/java/kr/xit/fims/biz/rt/web/Rt0300Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.rt.service.Rt0300Service; +import kr.xit.fims.biz.rt.service.IRt0300Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.RequiredArgsConstructor; @@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/rt") public class Rt0300Controler { - private final Rt0300Service service; + private final IRt0300Service service; @GetMapping(value = "/rt0300Form") public void rt0300Form(){ diff --git a/src/main/java/kr/xit/fims/biz/rt/web/Rt0400Controler.java b/src/main/java/kr/xit/fims/biz/rt/web/Rt0400Controler.java index ae323acf..ef0b353e 100644 --- a/src/main/java/kr/xit/fims/biz/rt/web/Rt0400Controler.java +++ b/src/main/java/kr/xit/fims/biz/rt/web/Rt0400Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.rt.service.Rt0400Service; +import kr.xit.fims.biz.rt.service.IRt0400Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.RequiredArgsConstructor; @@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/rt") public class Rt0400Controler { - private final Rt0400Service service; + private final IRt0400Service service; @GetMapping(value = "/rt0400Form") public void rt0400Form(){ diff --git a/src/main/java/kr/xit/fims/biz/rt/web/Rt0500Controler.java b/src/main/java/kr/xit/fims/biz/rt/web/Rt0500Controler.java index e7d8308a..18be4cfc 100644 --- a/src/main/java/kr/xit/fims/biz/rt/web/Rt0500Controler.java +++ b/src/main/java/kr/xit/fims/biz/rt/web/Rt0500Controler.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.fims.biz.rt.service.Rt0500Service; +import kr.xit.fims.biz.rt.service.IRt0500Service; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; import lombok.RequiredArgsConstructor; @@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/rt") public class Rt0500Controler { - private final Rt0500Service service; + private final IRt0500Service service; @GetMapping(value = "/rt0500Form") public void rt0500Form(){ diff --git a/src/main/java/kr/xit/fims/biz/sample/mapper/SampleMapper.java b/src/main/java/kr/xit/fims/biz/sample/mapper/ISampleMapper.java similarity index 91% rename from src/main/java/kr/xit/fims/biz/sample/mapper/SampleMapper.java rename to src/main/java/kr/xit/fims/biz/sample/mapper/ISampleMapper.java index 537a0b17..d2fa82e6 100644 --- a/src/main/java/kr/xit/fims/biz/sample/mapper/SampleMapper.java +++ b/src/main/java/kr/xit/fims/biz/sample/mapper/ISampleMapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface SampleMapper { +public interface ISampleMapper { List> selectSampleList(Map paraMap, RowBounds rowBounds); Map selectSample(); diff --git a/src/main/java/kr/xit/fims/biz/sample/service/ISampleService.java b/src/main/java/kr/xit/fims/biz/sample/service/ISampleService.java new file mode 100644 index 00000000..50ea470d --- /dev/null +++ b/src/main/java/kr/xit/fims/biz/sample/service/ISampleService.java @@ -0,0 +1,11 @@ +package kr.xit.fims.biz.sample.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +public interface ISampleService { + List> findSampleList(Map paraMap, RowBounds pagingInfo); + Map findSample(); +} diff --git a/src/main/java/kr/xit/fims/biz/sample/service/SampleService.java b/src/main/java/kr/xit/fims/biz/sample/service/SampleService.java index 4f1dcd3c..533cd5c8 100644 --- a/src/main/java/kr/xit/fims/biz/sample/service/SampleService.java +++ b/src/main/java/kr/xit/fims/biz/sample/service/SampleService.java @@ -4,8 +4,25 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; -public interface SampleService { - List> findSampleList(Map paraMap, RowBounds pagingInfo); - Map findSample(); +import kr.xit.fims.biz.sample.mapper.ISampleMapper; +import kr.xit.fims.biz.sample.service.ISampleService; +import kr.xit.fims.biz.sample.service.SampleService; +import lombok.AllArgsConstructor; + +@AllArgsConstructor +@Service +public class SampleService implements ISampleService { + private final ISampleMapper mapper; + + @Override + public List> findSampleList(Map paraMap, RowBounds rowBounds) { + return mapper.selectSampleList(paraMap, rowBounds); + } + + @Override + public Map findSample() { + return mapper.selectSample(); + } } diff --git a/src/main/java/kr/xit/fims/biz/sample/service/impl/SampleServiceImpl.java b/src/main/java/kr/xit/fims/biz/sample/service/impl/SampleServiceImpl.java deleted file mode 100644 index f9d51a07..00000000 --- a/src/main/java/kr/xit/fims/biz/sample/service/impl/SampleServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package kr.xit.fims.biz.sample.service.impl; - -import java.util.List; -import java.util.Map; - -import kr.xit.fims.biz.sample.mapper.SampleMapper; -import kr.xit.fims.biz.sample.service.SampleService; -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import lombok.AllArgsConstructor; - -@AllArgsConstructor -@Service -public class SampleServiceImpl implements SampleService { - private final SampleMapper mapper; - - @Override - public List> findSampleList(Map paraMap, RowBounds rowBounds) { - return mapper.selectSampleList(paraMap, rowBounds); - } - - @Override - public Map findSample() { - return mapper.selectSample(); - } -} diff --git a/src/main/java/kr/xit/fims/biz/sample/web/SampleController.java b/src/main/java/kr/xit/fims/biz/sample/web/SampleController.java index e22a22d9..fa3c0638 100644 --- a/src/main/java/kr/xit/fims/biz/sample/web/SampleController.java +++ b/src/main/java/kr/xit/fims/biz/sample/web/SampleController.java @@ -2,7 +2,7 @@ package kr.xit.fims.biz.sample.web; import java.util.Map; -import kr.xit.fims.biz.sample.service.SampleService; +import kr.xit.fims.biz.sample.service.ISampleService; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -17,7 +17,7 @@ import lombok.AllArgsConstructor; @Controller @RequestMapping(value = "/fims/biz/sample") public class SampleController { - private final SampleService sampleService; + private final ISampleService sampleService; @GetMapping(value = "/sampleForm") public void sampleForm(){ diff --git a/src/main/java/kr/xit/framework/biz/cache/mapper/CacheBbsMapper.java b/src/main/java/kr/xit/framework/biz/cache/mapper/ICacheBbsMapper.java similarity index 81% rename from src/main/java/kr/xit/framework/biz/cache/mapper/CacheBbsMapper.java rename to src/main/java/kr/xit/framework/biz/cache/mapper/ICacheBbsMapper.java index bab69e06..4b4add5f 100644 --- a/src/main/java/kr/xit/framework/biz/cache/mapper/CacheBbsMapper.java +++ b/src/main/java/kr/xit/framework/biz/cache/mapper/ICacheBbsMapper.java @@ -6,11 +6,10 @@ import java.util.Map; import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; -import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngSearchVO; import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO; @Mapper -public interface CacheBbsMapper { +public interface ICacheBbsMapper { List> selectLatestBbsList(final Map paraMap, final RowBounds rowBounds); List selectBaseBbsList(final Map paraMap); } diff --git a/src/main/java/kr/xit/framework/biz/cache/mapper/CacheCodeMapper.java b/src/main/java/kr/xit/framework/biz/cache/mapper/ICacheCodeMapper.java similarity index 89% rename from src/main/java/kr/xit/framework/biz/cache/mapper/CacheCodeMapper.java rename to src/main/java/kr/xit/framework/biz/cache/mapper/ICacheCodeMapper.java index 2b4470ec..cb43e7ad 100644 --- a/src/main/java/kr/xit/framework/biz/cache/mapper/CacheCodeMapper.java +++ b/src/main/java/kr/xit/framework/biz/cache/mapper/ICacheCodeMapper.java @@ -6,7 +6,7 @@ import java.util.Map; import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface CacheCodeMapper { +public interface ICacheCodeMapper { List> selectCodes(final String codeId); List> selectComboCodes(final Map map); } diff --git a/src/main/java/kr/xit/framework/biz/cache/mapper/CacheMenuMapper.java b/src/main/java/kr/xit/framework/biz/cache/mapper/ICacheMenuMapper.java similarity index 79% rename from src/main/java/kr/xit/framework/biz/cache/mapper/CacheMenuMapper.java rename to src/main/java/kr/xit/framework/biz/cache/mapper/ICacheMenuMapper.java index 90fdbf57..fe7edd47 100644 --- a/src/main/java/kr/xit/framework/biz/cache/mapper/CacheMenuMapper.java +++ b/src/main/java/kr/xit/framework/biz/cache/mapper/ICacheMenuMapper.java @@ -3,12 +3,10 @@ package kr.xit.framework.biz.cache.mapper; import java.util.List; import java.util.Map; -import org.apache.ibatis.session.RowBounds; - import egovframework.rte.psl.dataaccess.mapper.Mapper; @Mapper -public interface CacheMenuMapper { +public interface ICacheMenuMapper { List> selectMenuListByUser(final String uniqId); List> selectMenuListByAuthorCode(final String authorCode); diff --git a/src/main/java/kr/xit/framework/biz/cache/service/CacheService.java b/src/main/java/kr/xit/framework/biz/cache/service/CacheService.java index 61442287..44c77fb4 100644 --- a/src/main/java/kr/xit/framework/biz/cache/service/CacheService.java +++ b/src/main/java/kr/xit/framework/biz/cache/service/CacheService.java @@ -1,65 +1,135 @@ package kr.xit.framework.biz.cache.service; +import java.util.HashMap; import java.util.List; import java.util.Map; -import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngSearchVO; +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import kr.xit.framework.biz.cache.mapper.ICacheBbsMapper; +import kr.xit.framework.biz.cache.service.ICacheService; +import kr.xit.framework.biz.cache.mapper.ICacheCodeMapper; +import kr.xit.framework.biz.cache.mapper.ICacheMenuMapper; import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO; +import kr.xit.framework.support.mybatis.MybatisUtils; + +@Service +public class CacheService implements ICacheService { + @Resource + private ICacheCodeMapper codeMapper; + @Resource + private ICacheMenuMapper menuMapper; + @Resource + private ICacheBbsMapper bbsMapper; + + @Value("#{prop['Globals.Xit.RollingNotiBbsId']}") + private String notiBbsId; + + @Value("#{prop['Globals.Xit.Bbs.parntsSntncNo']}") + private String parntsSntncNo; + + @Value("#{prop['Globals.Xit.Bbs.useAt']}") + private String useAt; + + + // --------------------------------------------------------------------------------------------------------- + // Common code + // --------------------------------------------------------------------------------------------------------- + @Cacheable(cacheNames="codeCache", key = "#codeId") + @Override + public List> findCodes(final String codeId) { + return codeMapper.selectCodes(codeId); + } + + @Cacheable(cacheNames="codeComboCache", key = "#codeId + #type") + @Override + public List> findComboCodes(final String codeId, final String type) { + Map map = new HashMap<>(); + map.put("codeId", codeId); + map.put("type", type); + return codeMapper.selectComboCodes(map); + } + + @Override + @CacheEvict(cacheNames="codeCache", allEntries = true) + public void evictAllCodeCache() { + } + + @Override + @CacheEvict(cacheNames="codeCache", key = "#codeId") + public void evictCodeCache(final String codeId) { + } + // --------------------------------------------------------------------------------------------------------- + + + // --------------------------------------------------------------------------------------------------------- + // Menu + // --------------------------------------------------------------------------------------------------------- + @Cacheable(cacheNames="menuCache", key = "#uniqId") + @Override + public List> findMenuListByUser(final String uniqId) { + return menuMapper.selectMenuListByUser(uniqId); + } + + @Cacheable(cacheNames="menuCache", key = "#authorCode") + @Override + public List> findMenuListByAuthorCode(final String authorCode) { + return menuMapper.selectMenuListByAuthorCode(authorCode); + } + + @Override + @CacheEvict(cacheNames="menuCache", allEntries = true) + public void evictAllMenuCache() { + } + + @Override + @CacheEvict(cacheNames="menuCache", key = "#key") + public void evictMenuCache(final String key) { + } + // --------------------------------------------------------------------------------------------------------- + + + + // --------------------------------------------------------------------------------------------------------- + // BBS + // --------------------------------------------------------------------------------------------------------- + @Override + @Cacheable(cacheNames="latestBbsCache") + public List> findLatestBbsList() { + Map paraMap = new HashMap<>(); + paraMap.put("bbsId", this.notiBbsId); + paraMap.put("parntsSntncNo", this.parntsSntncNo); + paraMap.put("useAt", this.useAt); + paraMap.put("page", 1); + paraMap.put("perPage", 10); + return bbsMapper.selectLatestBbsList(paraMap, MybatisUtils.getPagingInfo(paraMap)); + } + + @Override + @Cacheable(cacheNames="baseBbsCache", key = "#paraMap") + public List findBaseBbsList(final Map paraMap) { + return bbsMapper.selectBaseBbsList(paraMap); + } + + @Override + @CacheEvict(cacheNames="latestBbsCache", allEntries = true) + public void evictLatestBbsList() { + } + + @Override + @CacheEvict(cacheNames="baseBbsCache", allEntries = true) + public void evictBaseBbsList(){ + } + + // --------------------------------------------------------------------------------------------------------------- + + + + -public interface CacheService { - - /** - * 코드 그룹 아이디로 모든 코드 목록을 Map 타입으로 조회한다. - * @param codeId - * @return List - */ - List> findCodes(final String codeId); - - /** - * 코드 그룹 아이디로 모든 코드 목록을 Map 타입으로 조회한다. - * @param codeId - * @return List - */ - List> findComboCodes(final String codeId, final String type); - - /** - * 코드 캐시 Evict - */ - void evictAllCodeCache(); - - /** - * 코드 캐시 Evict - */ - void evictCodeCache(final String codeId); - - - - /** - * 사용자별 메뉴 조회 - * @param uniqId - * @return List - */ - List> findMenuListByUser(final String uniqId); - /** - * 궘한별 메뉴 조회 - * @param authorCode - * @return List - */ - List> findMenuListByAuthorCode(final String authorCode); - /** - * 메뉴 캐시 Evict - */ - void evictAllMenuCache(); - - /** - * 메뉴 캐시 Evict - */ - void evictMenuCache(final String userId); - - - - List> findLatestBbsList(); - List findBaseBbsList(final Map paraMap); - void evictLatestBbsList(); - void evictBaseBbsList(); } diff --git a/src/main/java/kr/xit/framework/biz/cache/service/ICacheService.java b/src/main/java/kr/xit/framework/biz/cache/service/ICacheService.java new file mode 100644 index 00000000..7eaf23f3 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/cache/service/ICacheService.java @@ -0,0 +1,64 @@ +package kr.xit.framework.biz.cache.service; + +import java.util.List; +import java.util.Map; + +import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO; + +public interface ICacheService { + + /** + * 코드 그룹 아이디로 모든 코드 목록을 Map 타입으로 조회한다. + * @param codeId + * @return List + */ + List> findCodes(final String codeId); + + /** + * 코드 그룹 아이디로 모든 코드 목록을 Map 타입으로 조회한다. + * @param codeId + * @return List + */ + List> findComboCodes(final String codeId, final String type); + + /** + * 코드 캐시 Evict + */ + void evictAllCodeCache(); + + /** + * 코드 캐시 Evict + */ + void evictCodeCache(final String codeId); + + + + /** + * 사용자별 메뉴 조회 + * @param uniqId + * @return List + */ + List> findMenuListByUser(final String uniqId); + /** + * 궘한별 메뉴 조회 + * @param authorCode + * @return List + */ + List> findMenuListByAuthorCode(final String authorCode); + /** + * 메뉴 캐시 Evict + */ + void evictAllMenuCache(); + + /** + * 메뉴 캐시 Evict + */ + void evictMenuCache(final String userId); + + + + List> findLatestBbsList(); + List findBaseBbsList(final Map paraMap); + void evictLatestBbsList(); + void evictBaseBbsList(); +} diff --git a/src/main/java/kr/xit/framework/biz/cache/service/impl/CacheServiceImpl.java b/src/main/java/kr/xit/framework/biz/cache/service/impl/CacheServiceImpl.java deleted file mode 100644 index 76663e77..00000000 --- a/src/main/java/kr/xit/framework/biz/cache/service/impl/CacheServiceImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -package kr.xit.framework.biz.cache.service.impl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.context.ApplicationContext; -import org.springframework.stereotype.Service; - -import kr.xit.framework.biz.cache.mapper.CacheBbsMapper; -import kr.xit.framework.biz.cache.service.CacheService; -import kr.xit.framework.biz.cache.mapper.CacheCodeMapper; -import kr.xit.framework.biz.cache.mapper.CacheMenuMapper; -import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngSearchVO; -import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO; -import kr.xit.framework.support.mybatis.MybatisUtils; -import kr.xit.framework.support.util.JBeanRegistry; -import lombok.AllArgsConstructor; - -@Service -public class CacheServiceImpl implements CacheService { - @Resource - private CacheCodeMapper codeMapper; - @Resource - private CacheMenuMapper menuMapper; - @Resource - private CacheBbsMapper bbsMapper; - - @Value("#{prop['Globals.Xit.RollingNotiBbsId']}") - private String notiBbsId; - - @Value("#{prop['Globals.Xit.Bbs.parntsSntncNo']}") - private String parntsSntncNo; - - @Value("#{prop['Globals.Xit.Bbs.useAt']}") - private String useAt; - - - // --------------------------------------------------------------------------------------------------------- - // Common code - // --------------------------------------------------------------------------------------------------------- - @Cacheable(cacheNames="codeCache", key = "#codeId") - @Override - public List> findCodes(final String codeId) { - return codeMapper.selectCodes(codeId); - } - - @Cacheable(cacheNames="codeComboCache", key = "#codeId + #type") - @Override - public List> findComboCodes(final String codeId, final String type) { - Map map = new HashMap<>(); - map.put("codeId", codeId); - map.put("type", type); - return codeMapper.selectComboCodes(map); - } - - @Override - @CacheEvict(cacheNames="codeCache", allEntries = true) - public void evictAllCodeCache() { - } - - @Override - @CacheEvict(cacheNames="codeCache", key = "#codeId") - public void evictCodeCache(final String codeId) { - } - // --------------------------------------------------------------------------------------------------------- - - - // --------------------------------------------------------------------------------------------------------- - // Menu - // --------------------------------------------------------------------------------------------------------- - @Cacheable(cacheNames="menuCache", key = "#uniqId") - @Override - public List> findMenuListByUser(final String uniqId) { - return menuMapper.selectMenuListByUser(uniqId); - } - - @Cacheable(cacheNames="menuCache", key = "#authorCode") - @Override - public List> findMenuListByAuthorCode(final String authorCode) { - return menuMapper.selectMenuListByAuthorCode(authorCode); - } - - @Override - @CacheEvict(cacheNames="menuCache", allEntries = true) - public void evictAllMenuCache() { - } - - @Override - @CacheEvict(cacheNames="menuCache", key = "#key") - public void evictMenuCache(final String key) { - } - // --------------------------------------------------------------------------------------------------------- - - - - // --------------------------------------------------------------------------------------------------------- - // BBS - // --------------------------------------------------------------------------------------------------------- - @Override - @Cacheable(cacheNames="latestBbsCache") - public List> findLatestBbsList() { - Map paraMap = new HashMap<>(); - paraMap.put("bbsId", this.notiBbsId); - paraMap.put("parntsSntncNo", this.parntsSntncNo); - paraMap.put("useAt", this.useAt); - paraMap.put("page", 1); - paraMap.put("perPage", 10); - return bbsMapper.selectLatestBbsList(paraMap, MybatisUtils.getPagingInfo(paraMap)); - } - - @Override - @Cacheable(cacheNames="baseBbsCache", key = "#paraMap") - public List findBaseBbsList(final Map paraMap) { - return bbsMapper.selectBaseBbsList(paraMap); - } - - @Override - @CacheEvict(cacheNames="latestBbsCache", allEntries = true) - public void evictLatestBbsList() { - } - - @Override - @CacheEvict(cacheNames="baseBbsCache", allEntries = true) - public void evictBaseBbsList(){ - } - - // --------------------------------------------------------------------------------------------------------------- - - - - - -} diff --git a/src/main/java/kr/xit/framework/biz/cmm/web/XitFrameAnonymousController.java b/src/main/java/kr/xit/framework/biz/cmm/web/XitFrameAnonymousController.java index 16113f47..f8e61d91 100644 --- a/src/main/java/kr/xit/framework/biz/cmm/web/XitFrameAnonymousController.java +++ b/src/main/java/kr/xit/framework/biz/cmm/web/XitFrameAnonymousController.java @@ -31,7 +31,7 @@ import kr.xit.framework.biz.mng.user.model.XitUserRegMngSearchVO; import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO; import kr.xit.framework.biz.mng.user.service.XitEntUserRegMngService; import kr.xit.framework.biz.mng.user.service.XitGnrUserRegMngService; -import kr.xit.framework.biz.mng.user.service.UserMgtService; +import kr.xit.framework.biz.mng.user.service.IUserMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.USER_SE; @@ -62,7 +62,7 @@ public class XitFrameAnonymousController { @Resource private XitEntUserRegMngService xitEntUserRegMngService; @Resource - private UserMgtService xitUserRegMngService; + private IUserMgtService xitUserRegMngService; @Resource private XitFrameUnitService xitFrameUnitService; @Autowired diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthAuthorMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthAuthorMgtMapper.java similarity index 98% rename from src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthAuthorMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthAuthorMgtMapper.java index 5a597193..dd183432 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthAuthorMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthAuthorMgtMapper.java @@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface AuthAuthorMgtMapper { +public interface IAuthAuthorMgtMapper { /** diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthByUserMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthByUserMgtMapper.java similarity index 94% rename from src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthByUserMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthByUserMgtMapper.java index 79386d9e..912b9763 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthByUserMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthByUserMgtMapper.java @@ -19,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface AuthByUserMgtMapper { +public interface IAuthByUserMgtMapper { List selectAuthUsers(final Map paraMap, final RowBounds rowBounds); XitAuthUsrMngVO selectAuthUser(final T t); } diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthGrpMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java similarity index 96% rename from src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthGrpMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java index b0e6b3d8..6a89e968 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthGrpMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthGrpMgtMapper.java @@ -19,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface AuthGrpMgtMapper { +public interface IAuthGrpMgtMapper { List selectAuthorGroupInfos(final Map paraMap, final RowBounds rowBounds); XitAuthorGroupInfoVO selectAuthorGroupInfo(final String groupId); diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthHierarchyMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthHierarchyMgtMapper.java similarity index 82% rename from src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthHierarchyMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthHierarchyMgtMapper.java index 13d28ad4..34085537 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthHierarchyMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthHierarchyMgtMapper.java @@ -1,13 +1,11 @@ package kr.xit.framework.biz.mng.auth.mapper; -import java.sql.SQLException; import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; import egovframework.rte.psl.dataaccess.mapper.Mapper; -import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; /** @@ -21,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface AuthHierarchyMgtMapper { +public interface IAuthHierarchyMgtMapper { List selectAuthHierarchies(final Map paraMap, final RowBounds rowBounds); } diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthRoleMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthRoleMgtMapper.java similarity index 96% rename from src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthRoleMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthRoleMgtMapper.java index 2f18a75b..aa8e9d4c 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/mapper/AuthRoleMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/mapper/IAuthRoleMgtMapper.java @@ -19,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface AuthRoleMgtMapper { +public interface IAuthRoleMgtMapper { /** diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java index 8bfe38a5..b57b2904 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthAuthorMgtService.java @@ -2,41 +2,111 @@ package kr.xit.framework.biz.mng.auth.service; import java.util.List; import java.util.Map; +import java.util.Objects; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO; +import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; +import kr.xit.framework.biz.mng.auth.mapper.IAuthAuthorMgtMapper; +import kr.xit.framework.biz.mng.auth.service.IAuthAuthorMgtService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; -/** - * - * @업무그룹명: 권한관리 Service - * @설명: - * @최초작성일: 2020. 4. 16. 오전 9:38:56 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface AuthAuthorMgtService { - - - /** - *
메소드 설명: 권한관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - List findAuthAuthors(final Map paraMap, final RowBounds rowBounds); - List findAuthAuthors(final Map paraMap); - - XitAuthorInfoVO findAuthAuthor(final String authorCode); - void addAuthAuthor(final XitAuthorInfoVO vo); - void modifyAuthAuthor(final XitAuthorInfoVO vo); - void removeAuthAuthor(final String authorCode); - - - List findAuthRoleGrantList(final Map paraMap); - void saveAuthRoleGrantList(final Map paraMap); +@RequiredArgsConstructor +@Slf4j +@Service +public class AuthAuthorMgtService implements IAuthAuthorMgtService { + private final IAuthAuthorMgtMapper mapper; + + /** 부모 권한코드 */ + private static final String PARNTS_AUTHOR = "ROLE_USER"; + /** 자녀 권한코드 */ + private static final String CHLDRN_AUTHOR = "ROLE_ADMIN"; + + + @Override + public List findAuthAuthors(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectAuthorInfos(paraMap, rowBounds); + } + + @Override + public List findAuthAuthors(final Map paraMap) { + return mapper.selectAuthorInfos(paraMap); + } + + @Override + public XitAuthorInfoVO findAuthAuthor(final String authorCode) { + return mapper.selectAuthorInfo(authorCode); + } + + /* ===================================================== + * 2020.05.21 박민규 + * 신규권한 등록프로세스 주석 및 수정 + * -사유: egovFrame의 권한계층은 부모~자녀 순으로 "익명사용자->사용자->관리자"로 기본제공 되며 + * 부모권한에 부여된 ROLE을 자녀가 상속받는 개념이다. + * 다만 기본제공되는 권한계층을 사용 시 카페의 "관리자>매니저>정회원>준회원>비회원"과 같은 권한계층 관리에 적합하기에 + * 업체별(또는 부서별)로 권한그룹을 별도 관리 해야하는 경우에 적합하지 않다. + * -작업내용: 기본제공되는 "익명사용자->사용자->관리자" 관리구조에서 사용자와 관리자 그룹 사이에 신규권한그룹을 삽입하여 + * "익명사용자->사용자->신규권한1/신규권한2/...->관리자"로 권한계층을 구성하여 + * n개의 신규그룹은 "사용자"에게서 기본적인 ROLE을 상속받고 + * n개의 신규그룹의 ROLE을 "관리자"가 상속받도록 한다. + * AS-IS: "익명사용자->사용자->관리자"의 권한계층에 삽입되지 않아 상위권한(PARENT)의 ROLE을 승계받지 못 함. + * TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자"순의 상하관계를 가지게 되므로 신규권한그룹도 상위권한(PARENT)의 ROLE을 승계 받음. + ===================================================== */ + + @Override + public void addAuthAuthor(final XitAuthorInfoVO vo){ + //권한정보 Insert + mapper.insertAuthorInfo(vo); + + //계층구조생성 + XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); + //부모관계 생성 + roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR); + roleSclsrtRescueVO.setChldrnRole(vo.getAuthorCode()); + mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO); + //자녀관계 생성 + roleSclsrtRescueVO.setParntsRole(vo.getAuthorCode()); + roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR); + mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO); + } + + @Override + public void modifyAuthAuthor(final XitAuthorInfoVO vo){ + mapper.updateAuthorInfo(vo); + } + public void removeAuthAuthor(final String authorCode){ + //계층구조 삭제 + XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); + roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR); + roleSclsrtRescueVO.setChldrnRole(authorCode); + mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO); + //자녀관계 제거 + roleSclsrtRescueVO.setParntsRole(authorCode); + roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR); + mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO); + + mapper.deleteAuthorInfo(authorCode); + } + + @Override + public List findAuthRoleGrantList(final Map paraMap) { + return mapper.selectAuthRoleGrantList(paraMap); + } + + @Override + public void saveAuthRoleGrantList(final Map paraMap) { + List> mapList = (List>)paraMap.get("grantData"); + + mapList.forEach(map -> { + map.put("authorCode", paraMap.get("authorCode")); + if(Objects.equals(map.get("regYn"), "N")) + mapper.deleteRoleGrant(map); + else + mapper.saveRoleGrant(map); + }); + } } diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthByUserMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthByUserMgtService.java index 97524e8c..63056263 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthByUserMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthByUserMgtService.java @@ -2,24 +2,66 @@ package kr.xit.framework.biz.mng.auth.service; import java.util.List; import java.util.Map; +import java.util.Objects; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; +import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; +import kr.xit.framework.biz.mng.auth.mapper.IAuthByUserMgtMapper; import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; +import kr.xit.framework.biz.mng.user.mapper.IUserMgtMapper; +import kr.xit.framework.biz.mng.user.service.IUserMgtService; +import kr.xit.framework.core.utils.XitCmmnUtil; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Service +public class AuthByUserMgtService implements IAuthByUserMgtService { + + private final IAuthByUserMgtMapper mapper; + + private final IUserMgtMapper userMapper; + + private final IAuthGrpMgtService authGrpMgtService; + private final IUserMgtService userMgtService; + + @Override + public List findAuthUsers(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectAuthUsers(paraMap, rowBounds); + } + + @Override + public void saveAuthUserList(List> paraList) { + String sessionUniqId = XitCmmnUtil.getUserInfo().getUniqId(); + paraList.forEach(map -> { + //유효성확인 + authGrpMgtService.isCheckUserForCanChange(sessionUniqId, String.valueOf(map.get("authorCode"))); + + XitUserScrtySetupVO vo = new XitUserScrtySetupVO(); + vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId"))); + vo.setMberTyCode(String.valueOf(map.get("mberTyCode"))); + vo.setAuthorCode(String.valueOf(map.get("authorCode"))); + + if(Objects.equals("N", map.get("regYn"))){ + userMapper.insertUserScrtySetup(vo); + }else{ + userMapper.updateUserScrtySetup(vo); + } + }); + } + + @Override + public void removeAuthUserList(List> paraList) { + + //삭제 시 사용자의 권한을 소속 그룹의 권한 또는 Defualt 권한으로 설정 + paraList.forEach(map -> { + XitUserScrtySetupVO vo = new XitUserScrtySetupVO(); + vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId"))); + vo.setMberTyCode(String.valueOf(map.get("mberTyCode"))); + vo.setAuthorCode(userMgtService.getDefaultAuthorCode(String.valueOf(map.get("groupId")))); + userMapper.updateUserScrtySetup(vo); + }); + } -/** - * - * @업무그룹명: 사용자별권한관리 Service - * @설명: - * @최초작성일: 2020. 4. 16. 오전 9:38:56 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface AuthByUserMgtService { - - List findAuthUsers(final Map paraMap, final RowBounds rowBounds); - void saveAuthUserList(final List> paraList); - void removeAuthUserList(final List> paraList); } diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java index 346d17b8..53edf9e3 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthGrpMgtService.java @@ -4,26 +4,145 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; +import egovframework.rte.fdl.cmmn.exception.FdlException; +import egovframework.rte.fdl.idgnr.EgovIdGnrService; +import kr.xit.framework.biz.mng.auth.mapper.IAuthAuthorMgtMapper; +import kr.xit.framework.biz.mng.auth.mapper.IAuthGrpMgtMapper; import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; +import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; +import kr.xit.framework.biz.mng.user.mapper.IUserMgtMapper; +import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.support.exception.BizRuntimeException; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; -/** - * - * @업무그룹명: 사용자그룹관리 Service - * @설명: - * @최초작성일: 2020. 4. 16. 오전 9:38:56 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface AuthGrpMgtService { - - List findAuthGrps(final Map paraMap, final RowBounds rowBounds); - XitAuthorGroupInfoVO findAuthGrp(final String groupId); - void addAuthGrp(final XitAuthorGroupInfoVO vo); - void modifyAuthGrp(final XitAuthorGroupInfoVO vo); - void removeAuthGrp(final String authorCode); - - void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode); +@RequiredArgsConstructor +@Slf4j +@Service +public class AuthGrpMgtService implements IAuthGrpMgtService { + + private final IAuthGrpMgtMapper mapper; + private final IAuthAuthorMgtMapper authAuthorMgtMapper; + private final IUserMgtMapper userMgtMapper; + + @Qualifier("groupIdGnrService") + private final EgovIdGnrService groupIdGnrService; + + @Override + public List findAuthGrps(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectAuthorGroupInfos(paraMap, rowBounds); + } + + @Override + public XitAuthorGroupInfoVO findAuthGrp(final String groupId) { + return mapper.selectAuthorGroupInfo(groupId); + } + + @Override + public void addAuthGrp(final XitAuthorGroupInfoVO vo) { + // 유효성 확인 + this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode()); + + try { + vo.setGroupId(groupIdGnrService.getNextStringId()); + } catch (FdlException e) { + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage()); + } + mapper.insertAuthorGroupInfo(vo); + } + + @Override + public void modifyAuthGrp(final XitAuthorGroupInfoVO vo) { + // 유효성 확인 + this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode()); + + mapper.updateAuthorGroupInfo(vo); + } + + @Override + public void removeAuthGrp(final String groupId) { + mapper.deleteAuthorGroupInfo(groupId); + } + + public void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode) { + //사용자보안설정 조회 + XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); + userScrtySetupVO.setScrtySetupTrgetId(uniqId); + List listUserScrtySetupVO = userMgtMapper.selectUserScrtySetups(userScrtySetupVO); + String userAuthorCode = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthorCode(); + + if(!this.isCheckUserAuthorCodeForCanChange(userAuthorCode, trgetAuthorCode)) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");; + } + + + private boolean isCheckUserAuthorCodeForCanChange(final String userAuthorCode, final String trgetAuthorCode) { + //역할(권한)계층구조 데이터 목록 조회 + List listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null); + //역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환 + if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) { + log.debug("Do not use a RoleSclsrtRescue Data !!"); + return true; + }else { + //사용자의 권한 정보가 없을 때(비정상적인 루트로 등록한 사용자 계정으로 판단) + if(XitCmmnUtil.isEmpty(userAuthorCode)) { + log.debug("This user is have not UserScrtySetup Data !!"); + return false; + } + } + boolean isExists = false; + //사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인 + for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) { + if(item.getParntsRole().equals(userAuthorCode)) { + isExists = true; + break; + } + } + //사용자 권한이 최상위 권한이면 true 반환 + if(!isExists) + for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) { + if(item.getChldrnRole().equals(userAuthorCode)) { + log.debug("This user is Top-Level Author !!"); + return true; + } + } + //사용자의 역할(권한)정보가 없으면 false 반환 + if(!isExists) { + log.debug("This user is have not RoleSclsrtRescue Data !!"); + return false; + } + + + /** + * 상위권한 여부 확인 + * + */ + return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true; + } + + private boolean isHighAuthor(final List list, final String authorCode, final String highAuthorCode) { + boolean result = false; + + for (XitRoleSclsrtRescueVO item : list) { + // 상위 권한으로 확인 되었으면 stop + if (result) + break; + // 권한코드가 일치하지 않으면 skip + if (!item.getParntsRole().equals(authorCode)) + continue; + + if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면 + result = true; + } else { // 상위 권한과 일치하지 않으면 재호출 + result = this.isHighAuthor(list, item.getChldrnRole(), highAuthorCode); + } + } + + return result; + } } diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthHierarchyMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthHierarchyMgtService.java index 6a673b11..8ae39257 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthHierarchyMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/AuthHierarchyMgtService.java @@ -1,26 +1,252 @@ package kr.xit.framework.biz.mng.auth.service; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; +import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; +import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; +import kr.xit.framework.biz.mng.auth.mapper.IAuthAuthorMgtMapper; +import kr.xit.framework.biz.mng.auth.mapper.IAuthHierarchyMgtMapper; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; +import kr.xit.framework.biz.mng.auth.service.IAuthHierarchyMgtService; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.support.exception.BizRuntimeException; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.RequiredArgsConstructor; -/** - * - * @업무그룹명: 권한계층관리 Service - * @설명: - * @최초작성일: 2020. 11. 2. 오전 9:38:56 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface AuthHierarchyMgtService { - - List findAuthHierarchies(final Map paraMap, final RowBounds pagingInfo); - XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo); - - void saveAuthHierarchy(final XitAuthHierarchyMngVO vo); +@RequiredArgsConstructor +@Service +public class AuthHierarchyMgtService implements IAuthHierarchyMgtService { + + private final IAuthHierarchyMgtMapper mapper; + + private final IAuthAuthorMgtMapper authAuthorMgtMapper; + + @Override + public List findAuthHierarchies(final Map paraMap, final RowBounds rowBounds) { + List voList = mapper.selectAuthHierarchies(paraMap, rowBounds); + //권한구조 설정 + + if(XitCmmnUtil.notEmpty(voList)) { + for(XitAuthHierarchyMngVO vo : voList) { + String strAuthorRescueCode = this.getStrAuthHierarchy(vo.getAuthorCode()); + vo.setAuthorRescueCode(strAuthorRescueCode); + vo.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode)); + } + } + return voList; + } + + @Override + public XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo) { + XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO(); + + List listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); + if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) + return result; + + + String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole()); + topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim(); + String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode); + result.setAuthorRescueCode(strAuthorRescueCode); + + return result; + } + + + public void saveAuthHierarchy(final XitAuthHierarchyMngVO vo) { + if(XitCmmnUtil.isEmpty(vo.getAuthorCode())) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "권한코드는 필수조건 입니다."); + + String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록 + + /** + * 유효성 확인 + * -최상위 부모는 반드시 한개 이어야 한다. + * -최하위 자녀(최고관리자)는 반드시 한개 이어야 한다. + */ + if(arrAuthorCodeGrp[0].split(";").length>1) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최상위 부모는 한개만 설정 가능 합니다."); + // 최하위 자녀 갯수 확인 + if(arrAuthorCodeGrp[arrAuthorCodeGrp.length-1].split(";").length>1) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최하위 자녀는 한개만 설정 가능 합니다."); + // 다중상속 구간 갯수 확인 + int cnt = 0; + for(String authorCodeGrp : arrAuthorCodeGrp) { + if(authorCodeGrp.split(";").length > 1) + cnt++; + } + if(cnt > 1) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"다중상속은 하나의 구간만 설정 가능 합니다."); + + //권한계층구조 일괄 제거 + authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO()); + //권한계층 데이터 등록 + for(int i=0; i메소드 설명: 권한의 권한계층 구조를 문자열로 반환 한다. + * @param authorCode + * @return String 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 11. 2. + */ + private String getStrAuthHierarchy(final String authorCode) { + LinkedHashMap mParnts = new LinkedHashMap(); + LinkedHashMap mChldrn = new LinkedHashMap(); + + + List list = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); + this.getAuthHierarchy(list, authorCode, false, mParnts); + this.getAuthHierarchy(list, authorCode, true, mChldrn); + + StringBuffer sb = new StringBuffer(); + Iterator it = mParnts.keySet().iterator(); + while(it.hasNext()) { + sb.append(mParnts.get(it.next())).append(" > "); + } + sb.append(authorCode).append(" > "); + it = mChldrn.keySet().iterator(); + while(it.hasNext()) { + sb.append(mChldrn.get(it.next())).append(" > "); + } + + String result = sb.toString().trim(); + return result.substring(0, result.length()-2); + } + + /** + *
메소드 설명: 권한코드의 권한구조상의 상/하위 권한을 resultMap(LinkedHashMap)에 담아 반환 한다.
+ * @param list 역할계층구조 목록 데이터 + * @param authorCode 권한코드 + * @param isChldrnSearch 상위권한 탐색 여부(true: 상위권한 탐색, false: 하위권한 탐색) + * @param resultMap 응답객체 + * @return void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 11. 2. + */ + private void getAuthHierarchy(final List list, final String authorCode, final boolean isChldrnSearch, final LinkedHashMap resultMap) { + + for (XitRoleSclsrtRescueVO item : list) { + + if(isChldrnSearch) { + // 권한코드가 일치하지 않으면 skip + if (!item.getParntsRole().equals(authorCode)) + continue; + + //권한코드 Set + if(resultMap.containsKey(authorCode)) { + //동일한 값이면 담지 않음 + if(resultMap.get(authorCode).equals(item.getChldrnRole())) + continue; + + resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrnRole()); + }else { + //동일한 값이 있으면 담지 않음 + Iterator it = resultMap.values().iterator(); + boolean isExists = false; + LOOP: + while(it.hasNext()) { + String[] values = it.next().split(","); + for(int j=0; j listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null); + Map mAuthorInfo = new HashMap(); + for(XitAuthorInfoVO item : listAuthorInfoVO) { + mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm()); + } + + StringBuffer sb = new StringBuffer(); + String[] items = strAuthorRescueCode.split(">"); + for(int i=0; i0) + sb.append(" > "); + + String[] arrAuthorCode = item.split(","); + for(int j=0; j메소드 설명: 롤관리 목록 조회 - * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - List findAuthRoles(final Map paraMap, final RowBounds rowBounds); - - /** - *
메소드 설명: 롤관리 상세정보 조회
- * @param vo - * @return XitAuthRuleMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - XitRoleInfoVO findAuthRole(final String roleCode); - - /** - *
메소드 설명: 롤관리 등록
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - void addAuthRole(final XitRoleInfoVO vo); - - /** - *
메소드 설명: 롤관리 수정
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - void modifyAuthRole(final XitRoleInfoVO vo); - - /** - *
메소드 설명: 롤관리 삭제
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - void removeAuthRole(final String roleCode); + @Override + public List findAuthRoles(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectAuthRoles(paraMap, rowBounds); + } + @Override + public XitRoleInfoVO findAuthRole(final String roleCode) { + return mapper.selectAuthRole(roleCode); + } + + @Override + public void addAuthRole(final XitRoleInfoVO vo) { + String roleTyp = vo.getRoleTy(); + if("method".equals(roleTyp)) roleTyp = "mtd"; + else if("pointcut".equals(roleTyp)) roleTyp = "pct"; + else roleTyp = "web"; + try { + vo.setRoleCode(roleTyp.concat("-").concat(groupIdGnrService.getNextStringId())); + } catch (FdlException e) { + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage()); + } + mapper.insertAuthRole(vo); + } + + @Override + public void modifyAuthRole(final XitRoleInfoVO vo) { + mapper.updateAuthRole(vo); + } + + @Override + public void removeAuthRole(final String roleCode) { + mapper.deleteAuthRole(roleCode); + } } diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java new file mode 100644 index 00000000..4c04e4a7 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthAuthorMgtService.java @@ -0,0 +1,42 @@ +package kr.xit.framework.biz.mng.auth.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; +import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO; + +/** + * + * @업무그룹명: 권한관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IAuthAuthorMgtService { + + + /** + *
메소드 설명: 권한관리 목록 조회
+ * @param searchVO + * @return List 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + List findAuthAuthors(final Map paraMap, final RowBounds rowBounds); + List findAuthAuthors(final Map paraMap); + + XitAuthorInfoVO findAuthAuthor(final String authorCode); + void addAuthAuthor(final XitAuthorInfoVO vo); + void modifyAuthAuthor(final XitAuthorInfoVO vo); + void removeAuthAuthor(final String authorCode); + + + List findAuthRoleGrantList(final Map paraMap); + void saveAuthRoleGrantList(final Map paraMap); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthByUserMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthByUserMgtService.java new file mode 100644 index 00000000..17f35834 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthByUserMgtService.java @@ -0,0 +1,25 @@ +package kr.xit.framework.biz.mng.auth.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; + +/** + * + * @업무그룹명: 사용자별권한관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IAuthByUserMgtService { + + List findAuthUsers(final Map paraMap, final RowBounds rowBounds); + void saveAuthUserList(final List> paraList); + void removeAuthUserList(final List> paraList); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java new file mode 100644 index 00000000..1cd47331 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthGrpMgtService.java @@ -0,0 +1,29 @@ +package kr.xit.framework.biz.mng.auth.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; + +/** + * + * @업무그룹명: 사용자그룹관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IAuthGrpMgtService { + + List findAuthGrps(final Map paraMap, final RowBounds rowBounds); + XitAuthorGroupInfoVO findAuthGrp(final String groupId); + void addAuthGrp(final XitAuthorGroupInfoVO vo); + void modifyAuthGrp(final XitAuthorGroupInfoVO vo); + void removeAuthGrp(final String authorCode); + + void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthHierarchyMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthHierarchyMgtService.java new file mode 100644 index 00000000..8abdde32 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthHierarchyMgtService.java @@ -0,0 +1,26 @@ +package kr.xit.framework.biz.mng.auth.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; + +/** + * + * @업무그룹명: 권한계층관리 Service + * @설명: + * @최초작성일: 2020. 11. 2. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IAuthHierarchyMgtService { + + List findAuthHierarchies(final Map paraMap, final RowBounds pagingInfo); + XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo); + + void saveAuthHierarchy(final XitAuthHierarchyMngVO vo); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java new file mode 100644 index 00000000..67ac9c6f --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/auth/service/IAuthRoleMgtService.java @@ -0,0 +1,65 @@ +package kr.xit.framework.biz.mng.auth.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO; + +/** + * + * @업무그룹명: 롤관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IAuthRoleMgtService { + + + /** + *
메소드 설명: 롤관리 목록 조회
+ * @param searchVO + * @return List 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + List findAuthRoles(final Map paraMap, final RowBounds rowBounds); + + /** + *
메소드 설명: 롤관리 상세정보 조회
+ * @param vo + * @return XitAuthRuleMngVO 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + XitRoleInfoVO findAuthRole(final String roleCode); + + /** + *
메소드 설명: 롤관리 등록
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + void addAuthRole(final XitRoleInfoVO vo); + + /** + *
메소드 설명: 롤관리 수정
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + void modifyAuthRole(final XitRoleInfoVO vo); + + /** + *
메소드 설명: 롤관리 삭제
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + void removeAuthRole(final String roleCode); + +} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthAuthorMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthAuthorMgtServiceImpl.java deleted file mode 100644 index 7a266a9a..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthAuthorMgtServiceImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -package kr.xit.framework.biz.mng.auth.service.impl; - -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; -import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO; -import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; -import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper; -import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@RequiredArgsConstructor -@Slf4j -@Service -public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService { - private final AuthAuthorMgtMapper mapper; - - /** 부모 권한코드 */ - private static final String PARNTS_AUTHOR = "ROLE_USER"; - /** 자녀 권한코드 */ - private static final String CHLDRN_AUTHOR = "ROLE_ADMIN"; - - - @Override - public List findAuthAuthors(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectAuthorInfos(paraMap, rowBounds); - } - - @Override - public List findAuthAuthors(final Map paraMap) { - return mapper.selectAuthorInfos(paraMap); - } - - @Override - public XitAuthorInfoVO findAuthAuthor(final String authorCode) { - return mapper.selectAuthorInfo(authorCode); - } - - /* ===================================================== - * 2020.05.21 박민규 - * 신규권한 등록프로세스 주석 및 수정 - * -사유: egovFrame의 권한계층은 부모~자녀 순으로 "익명사용자->사용자->관리자"로 기본제공 되며 - * 부모권한에 부여된 ROLE을 자녀가 상속받는 개념이다. - * 다만 기본제공되는 권한계층을 사용 시 카페의 "관리자>매니저>정회원>준회원>비회원"과 같은 권한계층 관리에 적합하기에 - * 업체별(또는 부서별)로 권한그룹을 별도 관리 해야하는 경우에 적합하지 않다. - * -작업내용: 기본제공되는 "익명사용자->사용자->관리자" 관리구조에서 사용자와 관리자 그룹 사이에 신규권한그룹을 삽입하여 - * "익명사용자->사용자->신규권한1/신규권한2/...->관리자"로 권한계층을 구성하여 - * n개의 신규그룹은 "사용자"에게서 기본적인 ROLE을 상속받고 - * n개의 신규그룹의 ROLE을 "관리자"가 상속받도록 한다. - * AS-IS: "익명사용자->사용자->관리자"의 권한계층에 삽입되지 않아 상위권한(PARENT)의 ROLE을 승계받지 못 함. - * TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자"순의 상하관계를 가지게 되므로 신규권한그룹도 상위권한(PARENT)의 ROLE을 승계 받음. - ===================================================== */ - - @Override - public void addAuthAuthor(final XitAuthorInfoVO vo){ - //권한정보 Insert - mapper.insertAuthorInfo(vo); - - //계층구조생성 - XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); - //부모관계 생성 - roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR); - roleSclsrtRescueVO.setChldrnRole(vo.getAuthorCode()); - mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO); - //자녀관계 생성 - roleSclsrtRescueVO.setParntsRole(vo.getAuthorCode()); - roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR); - mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO); - } - - @Override - public void modifyAuthAuthor(final XitAuthorInfoVO vo){ - mapper.updateAuthorInfo(vo); - } - public void removeAuthAuthor(final String authorCode){ - //계층구조 삭제 - XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO(); - roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR); - roleSclsrtRescueVO.setChldrnRole(authorCode); - mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO); - //자녀관계 제거 - roleSclsrtRescueVO.setParntsRole(authorCode); - roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR); - mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO); - - mapper.deleteAuthorInfo(authorCode); - } - - @Override - public List findAuthRoleGrantList(final Map paraMap) { - return mapper.selectAuthRoleGrantList(paraMap); - } - - @Override - public void saveAuthRoleGrantList(final Map paraMap) { - List> mapList = (List>)paraMap.get("grantData"); - - mapList.forEach(map -> { - map.put("authorCode", paraMap.get("authorCode")); - if(Objects.equals(map.get("regYn"), "N")) - mapper.deleteRoleGrant(map); - else - mapper.saveRoleGrant(map); - }); - } -} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthByUserMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthByUserMgtServiceImpl.java deleted file mode 100644 index 2ac54dd0..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthByUserMgtServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -package kr.xit.framework.biz.mng.auth.service.impl; - -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; -import kr.xit.framework.biz.mng.auth.mapper.AuthByUserMgtMapper; -import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO; -import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService; -import kr.xit.framework.biz.mng.auth.service.AuthByUserMgtService; -import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper; -import kr.xit.framework.biz.mng.user.service.UserMgtService; -import kr.xit.framework.core.utils.XitCmmnUtil; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class AuthByUserMgtServiceImpl implements AuthByUserMgtService { - - private final AuthByUserMgtMapper mapper; - - private final UserMgtMapper userMapper; - - private final AuthGrpMgtService authGrpMgtService; - private final UserMgtService userMgtService; - - @Override - public List findAuthUsers(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectAuthUsers(paraMap, rowBounds); - } - - @Override - public void saveAuthUserList(List> paraList) { - String sessionUniqId = XitCmmnUtil.getUserInfo().getUniqId(); - paraList.forEach(map -> { - //유효성확인 - authGrpMgtService.isCheckUserForCanChange(sessionUniqId, String.valueOf(map.get("authorCode"))); - - XitUserScrtySetupVO vo = new XitUserScrtySetupVO(); - vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId"))); - vo.setMberTyCode(String.valueOf(map.get("mberTyCode"))); - vo.setAuthorCode(String.valueOf(map.get("authorCode"))); - - if(Objects.equals("N", map.get("regYn"))){ - userMapper.insertUserScrtySetup(vo); - }else{ - userMapper.updateUserScrtySetup(vo); - } - }); - } - - @Override - public void removeAuthUserList(List> paraList) { - - //삭제 시 사용자의 권한을 소속 그룹의 권한 또는 Defualt 권한으로 설정 - paraList.forEach(map -> { - XitUserScrtySetupVO vo = new XitUserScrtySetupVO(); - vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId"))); - vo.setMberTyCode(String.valueOf(map.get("mberTyCode"))); - vo.setAuthorCode(userMgtService.getDefaultAuthorCode(String.valueOf(map.get("groupId")))); - userMapper.updateUserScrtySetup(vo); - }); - } - -} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthGrpMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthGrpMgtServiceImpl.java deleted file mode 100644 index 91b0be09..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthGrpMgtServiceImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -package kr.xit.framework.biz.mng.auth.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import egovframework.rte.fdl.cmmn.exception.FdlException; -import egovframework.rte.fdl.idgnr.EgovIdGnrService; -import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper; -import kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper; -import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; -import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; -import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService; -import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper; -import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; -import kr.xit.framework.core.utils.XitCmmnUtil; -import kr.xit.framework.support.exception.BizRuntimeException; -import kr.xit.framework.support.util.constants.MessageKey; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@RequiredArgsConstructor -@Slf4j -@Service -public class AuthGrpMgtServiceImpl implements AuthGrpMgtService { - - private final AuthGrpMgtMapper mapper; - private final AuthAuthorMgtMapper authAuthorMgtMapper; - private final UserMgtMapper userMgtMapper; - - @Qualifier("groupIdGnrService") - private final EgovIdGnrService groupIdGnrService; - - @Override - public List findAuthGrps(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectAuthorGroupInfos(paraMap, rowBounds); - } - - @Override - public XitAuthorGroupInfoVO findAuthGrp(final String groupId) { - return mapper.selectAuthorGroupInfo(groupId); - } - - @Override - public void addAuthGrp(final XitAuthorGroupInfoVO vo) { - // 유효성 확인 - this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode()); - - try { - vo.setGroupId(groupIdGnrService.getNextStringId()); - } catch (FdlException e) { - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage()); - } - mapper.insertAuthorGroupInfo(vo); - } - - @Override - public void modifyAuthGrp(final XitAuthorGroupInfoVO vo) { - // 유효성 확인 - this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode()); - - mapper.updateAuthorGroupInfo(vo); - } - - @Override - public void removeAuthGrp(final String groupId) { - mapper.deleteAuthorGroupInfo(groupId); - } - - public void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode) { - //사용자보안설정 조회 - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(uniqId); - List listUserScrtySetupVO = userMgtMapper.selectUserScrtySetups(userScrtySetupVO); - String userAuthorCode = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthorCode(); - - if(!this.isCheckUserAuthorCodeForCanChange(userAuthorCode, trgetAuthorCode)) - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");; - } - - - private boolean isCheckUserAuthorCodeForCanChange(final String userAuthorCode, final String trgetAuthorCode) { - //역할(권한)계층구조 데이터 목록 조회 - List listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null); - //역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환 - if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) { - log.debug("Do not use a RoleSclsrtRescue Data !!"); - return true; - }else { - //사용자의 권한 정보가 없을 때(비정상적인 루트로 등록한 사용자 계정으로 판단) - if(XitCmmnUtil.isEmpty(userAuthorCode)) { - log.debug("This user is have not UserScrtySetup Data !!"); - return false; - } - } - boolean isExists = false; - //사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인 - for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) { - if(item.getParntsRole().equals(userAuthorCode)) { - isExists = true; - break; - } - } - //사용자 권한이 최상위 권한이면 true 반환 - if(!isExists) - for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) { - if(item.getChldrnRole().equals(userAuthorCode)) { - log.debug("This user is Top-Level Author !!"); - return true; - } - } - //사용자의 역할(권한)정보가 없으면 false 반환 - if(!isExists) { - log.debug("This user is have not RoleSclsrtRescue Data !!"); - return false; - } - - - /** - * 상위권한 여부 확인 - * - */ - return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true; - } - - private boolean isHighAuthor(final List list, final String authorCode, final String highAuthorCode) { - boolean result = false; - - for (XitRoleSclsrtRescueVO item : list) { - // 상위 권한으로 확인 되었으면 stop - if (result) - break; - // 권한코드가 일치하지 않으면 skip - if (!item.getParntsRole().equals(authorCode)) - continue; - - if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면 - result = true; - } else { // 상위 권한과 일치하지 않으면 재호출 - result = this.isHighAuthor(list, item.getChldrnRole(), highAuthorCode); - } - } - - return result; - } -} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthHierarchyMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthHierarchyMgtServiceImpl.java deleted file mode 100644 index c83a485c..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/auth/service/impl/AuthHierarchyMgtServiceImpl.java +++ /dev/null @@ -1,252 +0,0 @@ -package kr.xit.framework.biz.mng.auth.service.impl; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; -import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO; -import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper; -import kr.xit.framework.biz.mng.auth.mapper.AuthHierarchyMgtMapper; -import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; -import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService; -import kr.xit.framework.core.utils.XitCmmnUtil; -import kr.xit.framework.support.exception.BizRuntimeException; -import kr.xit.framework.support.util.constants.MessageKey; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService { - - private final AuthHierarchyMgtMapper mapper; - - private final AuthAuthorMgtMapper authAuthorMgtMapper; - - @Override - public List findAuthHierarchies(final Map paraMap, final RowBounds rowBounds) { - List voList = mapper.selectAuthHierarchies(paraMap, rowBounds); - //권한구조 설정 - - if(XitCmmnUtil.notEmpty(voList)) { - for(XitAuthHierarchyMngVO vo : voList) { - String strAuthorRescueCode = this.getStrAuthHierarchy(vo.getAuthorCode()); - vo.setAuthorRescueCode(strAuthorRescueCode); - vo.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode)); - } - } - return voList; - } - - @Override - public XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo) { - XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO(); - - List listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); - if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) - return result; - - - String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole()); - topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim(); - String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode); - result.setAuthorRescueCode(strAuthorRescueCode); - - return result; - } - - - public void saveAuthHierarchy(final XitAuthHierarchyMngVO vo) { - if(XitCmmnUtil.isEmpty(vo.getAuthorCode())) - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "권한코드는 필수조건 입니다."); - - String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록 - - /** - * 유효성 확인 - * -최상위 부모는 반드시 한개 이어야 한다. - * -최하위 자녀(최고관리자)는 반드시 한개 이어야 한다. - */ - if(arrAuthorCodeGrp[0].split(";").length>1) - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최상위 부모는 한개만 설정 가능 합니다."); - // 최하위 자녀 갯수 확인 - if(arrAuthorCodeGrp[arrAuthorCodeGrp.length-1].split(";").length>1) - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최하위 자녀는 한개만 설정 가능 합니다."); - // 다중상속 구간 갯수 확인 - int cnt = 0; - for(String authorCodeGrp : arrAuthorCodeGrp) { - if(authorCodeGrp.split(";").length > 1) - cnt++; - } - if(cnt > 1) - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"다중상속은 하나의 구간만 설정 가능 합니다."); - - //권한계층구조 일괄 제거 - authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO()); - //권한계층 데이터 등록 - for(int i=0; i메소드 설명: 권한의 권한계층 구조를 문자열로 반환 한다. - * @param authorCode - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 11. 2. - */ - private String getStrAuthHierarchy(final String authorCode) { - LinkedHashMap mParnts = new LinkedHashMap(); - LinkedHashMap mChldrn = new LinkedHashMap(); - - - List list = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO()); - this.getAuthHierarchy(list, authorCode, false, mParnts); - this.getAuthHierarchy(list, authorCode, true, mChldrn); - - StringBuffer sb = new StringBuffer(); - Iterator it = mParnts.keySet().iterator(); - while(it.hasNext()) { - sb.append(mParnts.get(it.next())).append(" > "); - } - sb.append(authorCode).append(" > "); - it = mChldrn.keySet().iterator(); - while(it.hasNext()) { - sb.append(mChldrn.get(it.next())).append(" > "); - } - - String result = sb.toString().trim(); - return result.substring(0, result.length()-2); - } - - /** - *
메소드 설명: 권한코드의 권한구조상의 상/하위 권한을 resultMap(LinkedHashMap)에 담아 반환 한다.
- * @param list 역할계층구조 목록 데이터 - * @param authorCode 권한코드 - * @param isChldrnSearch 상위권한 탐색 여부(true: 상위권한 탐색, false: 하위권한 탐색) - * @param resultMap 응답객체 - * @return void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 11. 2. - */ - private void getAuthHierarchy(final List list, final String authorCode, final boolean isChldrnSearch, final LinkedHashMap resultMap) { - - for (XitRoleSclsrtRescueVO item : list) { - - if(isChldrnSearch) { - // 권한코드가 일치하지 않으면 skip - if (!item.getParntsRole().equals(authorCode)) - continue; - - //권한코드 Set - if(resultMap.containsKey(authorCode)) { - //동일한 값이면 담지 않음 - if(resultMap.get(authorCode).equals(item.getChldrnRole())) - continue; - - resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrnRole()); - }else { - //동일한 값이 있으면 담지 않음 - Iterator it = resultMap.values().iterator(); - boolean isExists = false; - LOOP: - while(it.hasNext()) { - String[] values = it.next().split(","); - for(int j=0; j listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null); - Map mAuthorInfo = new HashMap(); - for(XitAuthorInfoVO item : listAuthorInfoVO) { - mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm()); - } - - StringBuffer sb = new StringBuffer(); - String[] items = strAuthorRescueCode.split(">"); - for(int i=0; i0) - sb.append(" > "); - - String[] arrAuthorCode = item.split(","); - for(int j=0; j findAuthRoles(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectAuthRoles(paraMap, rowBounds); - } - - @Override - public XitRoleInfoVO findAuthRole(final String roleCode) { - return mapper.selectAuthRole(roleCode); - } - - @Override - public void addAuthRole(final XitRoleInfoVO vo) { - String roleTyp = vo.getRoleTy(); - if("method".equals(roleTyp)) roleTyp = "mtd"; - else if("pointcut".equals(roleTyp)) roleTyp = "pct"; - else roleTyp = "web"; - try { - vo.setRoleCode(roleTyp.concat("-").concat(groupIdGnrService.getNextStringId())); - } catch (FdlException e) { - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage()); - } - mapper.insertAuthRole(vo); - } - - @Override - public void modifyAuthRole(final XitRoleInfoVO vo) { - mapper.updateAuthRole(vo); - } - - @Override - public void removeAuthRole(final String roleCode) { - mapper.deleteAuthRole(roleCode); - } -} diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java index 0240e542..0532f391 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthAuthorMgtController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; -import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService; +import kr.xit.framework.biz.mng.auth.service.IAuthAuthorMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; @@ -39,7 +39,7 @@ import lombok.RequiredArgsConstructor; @RequestMapping("/framework/biz/mng/auth") public class AuthAuthorMgtController { - private final AuthAuthorMgtService service; + private final IAuthAuthorMgtService service; /** diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthByUserMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthByUserMgtController.java index 9559ddca..044d76d5 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthByUserMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthByUserMgtController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.cache.util.CacheServiceUtils; -import kr.xit.framework.biz.mng.auth.service.AuthByUserMgtService; +import kr.xit.framework.biz.mng.auth.service.IAuthByUserMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; @@ -35,7 +35,7 @@ import lombok.RequiredArgsConstructor; @RequestMapping("/framework/biz/mng/auth") public class AuthByUserMgtController { - private final AuthByUserMgtService service; + private final IAuthByUserMgtService service; /** diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java index a75dcacd..8e00abed 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthGrpMgtController.java @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; -import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService; +import kr.xit.framework.biz.mng.auth.service.IAuthGrpMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; @@ -35,7 +35,7 @@ import lombok.RequiredArgsConstructor; @RequestMapping("/framework/biz/mng/auth") public class AuthGrpMgtController { - private final AuthGrpMgtService service; + private final IAuthGrpMgtService service; /** *
메소드 설명: 사용자그룹관리 목록 페이지
diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthHierarchyMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthHierarchyMgtController.java index 0867153f..25f7b80b 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthHierarchyMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthHierarchyMgtController.java @@ -20,8 +20,8 @@ import egovframework.rte.fdl.security.securedobject.EgovSecuredObjectService; import egovframework.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager; import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO; -import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService; -import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService; +import kr.xit.framework.biz.mng.auth.service.IAuthAuthorMgtService; +import kr.xit.framework.biz.mng.auth.service.IAuthHierarchyMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.exception.BizRuntimeException; @@ -46,8 +46,8 @@ import lombok.RequiredArgsConstructor; @RequestMapping("/framework/biz/mng/auth") public class AuthHierarchyMgtController { - private final AuthHierarchyMgtService service; - private final AuthAuthorMgtService authAuthorMgtService; + private final IAuthHierarchyMgtService service; + private final IAuthAuthorMgtService authAuthorMgtService; private final EgovSecuredObjectService egovSecuredObjectService; private final RoleHierarchyImpl roleHierarchyImpl; diff --git a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java index 3c590ba4..74a03775 100644 --- a/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/auth/web/AuthRoleMgtController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO; -import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService; +import kr.xit.framework.biz.mng.auth.service.IAuthRoleMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; @@ -37,7 +37,7 @@ import lombok.RequiredArgsConstructor; @RequestMapping("/framework/biz/mng/auth") public class AuthRoleMgtController { - private final AuthRoleMgtService service; + private final IAuthRoleMgtService service; /** *
메소드 설명: 롤관리 목록 페이지
diff --git a/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeClassificationMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeClassificationMgtMapper.java new file mode 100644 index 00000000..395c6f9a --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/mapper/ICodeClassificationMgtMapper.java @@ -0,0 +1,49 @@ +package kr.xit.framework.biz.mng.code.mapper; + +import java.sql.SQLException; +import java.util.List; + +import egovframework.rte.psl.dataaccess.mapper.Mapper; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; + +/** + * + * @업무그룹명: 분류코드관리 Mapper + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:07 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +@Mapper +public interface ICodeClassificationMgtMapper { + + /** + *
메소드 설명: 분류코드관리 목록 조회
+ * @param searchVO + * @return List 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public List findList(XitClCodeMngSearchVO searchVO) throws SQLException; + + /** + *
메소드 설명: 분류코드관리 목록 총건수 조회
+ * @param searchVO + * @return int 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public int findListTotCnt(XitClCodeMngSearchVO searchVO) throws SQLException; + + /** + *
메소드 설명: 분류코드관리 상세정보 조회
+ * @param vo + * @return XitClCodeMngVO 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public XitClCodeMngVO findView(XitClCodeMngVO vo) throws SQLException; +} diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/CodeClassificationMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeClassificationMgtService.java new file mode 100644 index 00000000..8dbfa83a --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/CodeClassificationMgtService.java @@ -0,0 +1,140 @@ +package kr.xit.framework.biz.mng.code.service; + +import java.sql.SQLException; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import egovframework.rte.fdl.idgnr.EgovIdGnrService; +import kr.xit.framework.biz.cmm.model.XitCmmnClCodeVO; +import kr.xit.framework.biz.cmm.service.XitFrameCrudService; +import kr.xit.framework.biz.mng.code.mapper.ICodeClassificationMgtMapper; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; +import kr.xit.framework.core.message.XitMessageSource; + +@Service +public class CodeClassificationMgtService implements ICodeClassificationMgtService { + + @Resource + private ICodeClassificationMgtMapper mapper; + @Resource + private XitFrameCrudService xitFrameCrudService; + @Resource(name="groupIdGnrService") + private EgovIdGnrService idgenService; + @Resource + private XitMessageSource xitMessageSource; + + @Override + public List findList(XitClCodeMngSearchVO searchVO) { + List result = null; + try { + result = mapper.findList(searchVO); + } catch (SQLException e) { + throw new RuntimeException("분류코드관리 목록 조회 FAIL::", e); + } + return result; + } + + @Override + public int findListTotCnt(XitClCodeMngSearchVO searchVO) { + int result = 0; + try { + result = mapper.findListTotCnt(searchVO); + } catch (SQLException e) { + throw new RuntimeException("분류코드관리 목록 총건수 조회 FAIL::", e); + } + return result; + } + + @Override + public XitClCodeMngVO findView(XitClCodeMngVO vo) { + XitClCodeMngVO result = null; + try { + result = mapper.findView(vo); + } catch (SQLException e) { + throw new RuntimeException("분류코드관리 상세정보 조회 FAIL::", e); + } + return result; + } + + @Override + public void addProc(XitClCodeMngVO vo) { + /** + * 필수값 설정 + */ + XitCmmnClCodeVO cmmnClCodeVO = convertToCrudVO(vo); + cmmnClCodeVO.setFrst_register_id(vo.getFrstRegisterId()); + + /** + * 처리 + */ + xitFrameCrudService.addXitCmmnClCode(cmmnClCodeVO); + + } + + @Override + public void modifyProc(XitClCodeMngVO vo) { + /** + * 필수값 설정 + */ + XitCmmnClCodeVO cmmnClCodeVO = convertToCrudVO(vo); + cmmnClCodeVO.setLast_updusr_id(vo.getLastUpdusrId()); + + /** + * 처리 + */ + xitFrameCrudService.modifyXitCmmnClCode(cmmnClCodeVO); + } + + @Override + public void removeProc(XitClCodeMngVO vo) { + /** + * 필수값 설정 + */ + XitCmmnClCodeVO cmmnClCodeVO = new XitCmmnClCodeVO(); + cmmnClCodeVO.setCl_code(vo.getClCode()); + cmmnClCodeVO.setLast_updusr_id(vo.getLastUpdusrId()); + cmmnClCodeVO.setUse_at("N"); + + /** + * 처리 + */ + xitFrameCrudService.modifyXitCmmnClCode(cmmnClCodeVO); + } + + @Override + public void removesProc(String ids, String userId) { + /** + * 처리 + */ + String [] clCodes = ids.split(";"); + for(int i=0; i + * 메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. + * + * + * @return XitCmmnClCodeVO 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + private XitCmmnClCodeVO convertToCrudVO(XitClCodeMngVO vo) { + XitCmmnClCodeVO crudVO = new XitCmmnClCodeVO(); + crudVO.setCl_code (vo.getClCode()); //분류 코드 + crudVO.setCl_code_nm (vo.getClCodeNm()); //분류 코드 명 + crudVO.setCl_code_dc (vo.getClCodeDc()); //분류 코드 설명 + crudVO.setUse_at (vo.getUseAt()); //사용 여부 + + return crudVO; + } +} diff --git a/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeClassificationMgtService.java b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeClassificationMgtService.java new file mode 100644 index 00000000..87a6aace --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/service/ICodeClassificationMgtService.java @@ -0,0 +1,79 @@ +package kr.xit.framework.biz.mng.code.service; + +import java.util.List; + +import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; + +/** + * + * @업무그룹명: 분류코드관리 Service + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:38:56 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface ICodeClassificationMgtService { + + + /** + *
메소드 설명: 분류코드관리 목록 조회
+ * @param searchVO + * @return List 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public List findList(XitClCodeMngSearchVO searchVO); + + /** + *
메소드 설명: 분류코드관리 목록 총건수 조회
+ * @param searchVO + * @return int 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public int findListTotCnt(XitClCodeMngSearchVO searchVO); + + /** + *
메소드 설명: 분류코드관리 상세정보 조회
+ * @param vo + * @return XitClCodeMngVO 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public XitClCodeMngVO findView(XitClCodeMngVO vo); + + /** + *
메소드 설명: 분류코드관리 등록
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void addProc(XitClCodeMngVO vo); + + /** + *
메소드 설명: 분류코드관리 수정
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void modifyProc(XitClCodeMngVO vo); + + /** + *
메소드 설명: 분류코드관리 삭제
+ * @param vo void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void removeProc(XitClCodeMngVO vo); + + /** + *
메소드 설명: 분류코드관리 다건 삭제
+ * @param ids void 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + public void removesProc(String ids, String userId); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/code/web/CodeClassificationMgtController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeClassificationMgtController.java new file mode 100644 index 00000000..ad0ca6e9 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/CodeClassificationMgtController.java @@ -0,0 +1,343 @@ +package kr.xit.framework.biz.mng.code.web; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +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.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.support.SessionStatus; + +import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; +import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; +import kr.xit.framework.biz.cmm.model.XitLoginVO; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO; +import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO; +import kr.xit.framework.biz.mng.code.service.ICodeClassificationMgtService; +import kr.xit.framework.core.constants.FrameworkConstants; +import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; +import kr.xit.framework.core.message.XitMessageSource; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.core.validation.XitBeanValidator; +import kr.xit.framework.support.util.AjaxUtils; + +/** + * + * @업무그룹명: 분류코드관리 Controller + * @설명: + * @최초작성일: 2020. 4. 16. 오전 9:39:52 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +@Controller +@RequestMapping("/framework/biz/mng/code") +public class CodeClassificationMgtController { + + @Resource + private ICodeClassificationMgtService service; + @Autowired + private XitBeanValidator beanValidator; + @Resource(name = "xitMessageSource") + XitMessageSource xitMessageSource; + + @RequestMapping(value = "/mngCodeClassificationMgtForm") + public void mngCodeClassificationMgtForm() { + } + + + + + + + + + + + + + + + + + + + + + + + + + + /** + *
메소드 설명: 분류코드 관리 페이지 조회
+ * @return String 요청처리 후 응답객체 + * @author: 김동규 + * @date: 2020. 7. 31. + */ + @RequestMapping(value = "ClCodeMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) + @ResponseBody + public Map ClCodeMng_listAjax(@ModelAttribute("searchVO") XitClCodeMngSearchVO searchVO, ModelMap model) { + + /** paging */ + PaginationInfo paginationInfo = new PaginationInfo(); + paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex()); + paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():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 = service.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", service.findList(searchVO)); //[tui Grid] data-contents + Map pagination = new HashMap(); + pagination.put("page", searchVO.getPage()); + pagination.put("totalCount", 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. 16. + */ + @RequestMapping(value = "ClCodeMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) + public String ClCodeMng_page(@PathVariable String cmd + , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef + , @ModelAttribute("cmmnClCode") XitClCodeMngVO vo + , @ModelAttribute XitClCodeMngSearchVO searchVO + , ModelMap model) { + switch (cmd) { + case "input": //등록 페이지 + break; + case "edit": //수정 페이지 + case "view": //상세 페이지 + model.addAttribute("cmmnClCode", service.findView(vo)); + model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); + break; + default: + throw new RuntimeException("유효하지 않은 요청 입니다."); + } + + + if(!"".equals(tilesDef)) + tilesDef = "."+tilesDef; + return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitClCodeMng_"+cmd+tilesDef; + + } + + + /** + *
메소드 설명: 요청 팝업 페이지 이동 한다.
+ * @param page + * @param model + * @return String 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 16. + */ + @RequestMapping(value = "ClCodeMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) + public String ClCodeMng_page_popup(@PathVariable String cmd + , @ModelAttribute("cmmnClCode") XitClCodeMngVO vo + , @ModelAttribute XitClCodeMngSearchVO searchVO + , ModelMap model) { + switch (cmd) { + case "": // + break; + default: + throw new RuntimeException("유효하지 않은 요청 입니다."); + } + + + return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitClCodeMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); + } + + + + /** + *
메소드 설명: 분류코드관리 CUD 처리
+ * @return String 요청처리 후 응답객체 + * @author: 박민규 + * @throws IOException + * @throws ServletException + * @date: 2020. 4. 16. + */ + @RequestMapping(value = "ClCodeMng_{cmd}_proc", method=RequestMethod.POST) + public void ClCodeMng_cmd_proc(@PathVariable String cmd + ,@ModelAttribute("vo") XitClCodeMngVO vo + ,@ModelAttribute("searchVO") XitClCodeMngSearchVO searchVO + ,@RequestParam(value="clCodes", required=false, defaultValue="") String clCodes + ,BindingResult bindingResult + ,SessionStatus status + ,Model model + ,HttpServletRequest request + ,HttpServletResponse response + ) throws ServletException, IOException { + + /** + * 처리 분기 + */ + XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); + String sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_list"; + String message = null; + switch (cmd) { + case "insert": //등록 + //유효성 확인 + //2020.11.24. 주석처리 + beanValidator.validate(vo, bindingResult); +// beanValidator.validate("cmmnClCode", vo, bindingResult); + if (bindingResult.hasErrors()) { + message = xitMessageSource.getMessage("fail.common.insert"); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input"; + break; + } + //처리 + try { + vo.setFrstRegisterId(loginVO.getUniqId()); + service.addProc(vo); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.insert"); + } catch (RuntimeException e) { + message = e.getMessage(); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input"; + } catch (Exception e) { + message = xitMessageSource.getMessage("fail.common.insert"); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input"; + } + break; + +// case "inserts": //다건 등록 +// break; + + case "update": //수정 + //유효성 확인 + //2020.11.24. 주석처리 + beanValidator.validate(vo, bindingResult); +// beanValidator.validate("cmmnClCode", vo, bindingResult); + if (bindingResult.hasErrors()) { + message = xitMessageSource.getMessage("fail.common.update"); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit"; + break; + } + //처리 + try { + vo.setLastUpdusrId(loginVO.getUniqId()); + service.modifyProc(vo); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.update"); + } catch (RuntimeException e) { + message = e.getMessage(); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit"; + } catch (Exception e) { + message = xitMessageSource.getMessage("fail.common.update"); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit"; + } + break; + + case "delete": //삭제 + //처리 + try { + vo.setLastUpdusrId(loginVO.getUniqId()); + service.removeProc(vo); + status.setComplete(); + message = xitMessageSource.getMessage("success.common.delete"); + break; + } catch (RuntimeException e) { + message = e.getMessage(); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit"; + } catch (Exception e) { + message = xitMessageSource.getMessage("fail.common.delete"); + sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit"; + } + break; + + case "deletes": //다건 삭제 + //처리 + try { + service.removesProc(clCodes, loginVO.getUniqId()); + status.setComplete(); + 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/framework/biz/mng/code/web/XitClCodeMngController.java b/src/main/java/kr/xit/framework/biz/mng/code/web/XitClCodeMngController.java index 021f99b0..172804fb 100644 --- a/src/main/java/kr/xit/framework/biz/mng/code/web/XitClCodeMngController.java +++ b/src/main/java/kr/xit/framework/biz/mng/code/web/XitClCodeMngController.java @@ -46,7 +46,7 @@ import kr.xit.framework.support.util.AjaxUtils; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Controller -@RequestMapping("/framework/biz/mng/code/") +@RequestMapping("/framework/biz/mng/ccode/") public class XitClCodeMngController { @Resource diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/MenuByRoleMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuByRoleMgtMapper.java similarity index 92% rename from src/main/java/kr/xit/framework/biz/mng/menu/mapper/MenuByRoleMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuByRoleMgtMapper.java index 04b9d128..742922e9 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/MenuByRoleMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuByRoleMgtMapper.java @@ -7,7 +7,7 @@ import kr.xit.framework.biz.cmm.model.XitMenuCreatDtlsVO; import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO; @Mapper -public interface MenuByRoleMgtMapper { +public interface IMenuByRoleMgtMapper { List selectRoleInfos(T t); diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/MenuMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java similarity index 98% rename from src/main/java/kr/xit/framework/biz/mng/menu/mapper/MenuMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java index 50b3db2b..60f7fab6 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/MenuMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IMenuMgtMapper.java @@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface MenuMgtMapper { +public interface IMenuMgtMapper { List selectMenuInfos(final T t, final RowBounds rowBounds); List selectMenuInfos(final T t); diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IProgramMgtMapper.java similarity index 95% rename from src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/menu/mapper/IProgramMgtMapper.java index fc9b9e47..0fec4c98 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/mapper/ProgramMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/mapper/IProgramMgtMapper.java @@ -8,7 +8,7 @@ import egovframework.rte.psl.dataaccess.mapper.Mapper; import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; @Mapper -public interface ProgramMgtMapper { +public interface IProgramMgtMapper { /** *
메소드 설명: 프로그램관리 목록 조회
diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuByRoleMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuByRoleMgtService.java new file mode 100644 index 00000000..c38cb58e --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuByRoleMgtService.java @@ -0,0 +1,23 @@ +package kr.xit.framework.biz.mng.menu.service; + +import java.util.List; +import java.util.Map; + +import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO; + +/** + * + * @업무그룹명: 메뉴생성관리 Service + * @설명: + * @최초작성일: 2020. 3. 26. 오전 10:07:11 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IMenuByRoleMgtService { + + List findRoleInfos(T t); + List findMenuInfoByRoleList(T t); + void saveMenuByRoleList(Map paraMap); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java new file mode 100644 index 00000000..5e28c1ba --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/IMenuMgtService.java @@ -0,0 +1,76 @@ +package kr.xit.framework.biz.mng.menu.service; + +import java.io.FileInputStream; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; +import kr.xit.framework.biz.mng.menu.model.MenuListMngVO; + +/** + * + * @업무그룹명: 메뉴목록관리 Service + * @설명: + * @최초작성일: 2020. 3. 26. 오전 10:07:11 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IMenuMgtService { + + /** + *
메소드 설명: 메뉴목록관리 목록 조회
+ * @param paraMap + * @return List 요청처리 후 응답객체 + * @author: 최정민 + * @date: 2022. 10. 18. + */ + List findMenus(final Map paraMap, final RowBounds rowBounds); + + void addMenu(final XitMenuInfoVO vo); + void modifyMenu(final XitMenuInfoVO vo); + void removeMenu(final String menuNo); + + + + + + + + + + + + + + + + + + /** + *
메소드 설명: 메뉴일괄초기화
+	 * 	-메뉴목록 테이블, 프로그램목록 테이블 전체 삭제
+	 * 
+ * @return boolean 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 3. 27. + */ + public boolean menuBndeAllDelete() throws Exception; + + /** + *
메소드 설명: 메뉴일괄등록 프로세스
+ * @param vo + * @param inputStream + * @return + * @throws Exception String 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 3. 27. + */ + public String addsProc(MenuListMngVO vo, FileInputStream inputStream) throws Exception; + + + +} diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/IProgramMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/IProgramMgtService.java new file mode 100644 index 00000000..0d1c8d00 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/IProgramMgtService.java @@ -0,0 +1,43 @@ +package kr.xit.framework.biz.mng.menu.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; + +/** + * + * @업무그룹명: 프로그램관리 Service + * @설명: + * @최초작성일: 2020. 3. 26. 오전 10:07:11 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IProgramMgtService { + + /** + *
메소드 설명: 프로그램 목록 조회
+ */ + List findPrograms(final Map paraMap, final RowBounds rowBounds); + + /** + *
메소드 설명: 프로그램 상세정보 조회
+ */ + ProgramMngVO findProgram(final String progrmFileNm); + + /** + *
메소드 설명: 프로그램 등록
+ */ + int addProgram(final ProgramMngVO vo); + + /** + *
메소드 설명: 프로그램 변경
+ */ + int modifyProgram(final ProgramMngVO vo); + + int removeProgram(final String programFileNm); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuByRoleMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuByRoleMgtService.java index a183f8e2..fbf24580 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuByRoleMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuByRoleMgtService.java @@ -3,21 +3,50 @@ package kr.xit.framework.biz.mng.menu.service; import java.util.List; import java.util.Map; +import org.springframework.stereotype.Service; + +import kr.xit.framework.biz.cmm.model.XitMenuCreatDtlsVO; +import kr.xit.framework.biz.mng.menu.mapper.IMenuByRoleMgtMapper; import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO; +import kr.xit.framework.biz.mng.menu.service.IMenuByRoleMgtService; +import lombok.RequiredArgsConstructor; + +; + +@RequiredArgsConstructor +@Service +public class MenuByRoleMgtService implements IMenuByRoleMgtService { + + private final IMenuByRoleMgtMapper mapper; + + @Override + public List findRoleInfos(T t) { + return mapper.selectRoleInfos(t); + } + + @Override + public List findMenuInfoByRoleList(T t) { + return mapper.selectMenuInfoByRoleList(t); + } + + @Override + public void saveMenuByRoleList(Map paraMap) { + String authorCode = String.valueOf(paraMap.get("authorCode")); + @SuppressWarnings("unchecked") + List menuNoList = (List)paraMap.get("menuNoList"); + + // 해당 권한의 메뉴 삭제 + mapper.deleteMenuCreatDtls(authorCode); -/** - * - * @업무그룹명: 메뉴생성관리 Service - * @설명: - * @최초작성일: 2020. 3. 26. 오전 10:07:11 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface MenuByRoleMgtService { - - List findRoleInfos(T t); - List findMenuInfoByRoleList(T t); - void saveMenuByRoleList(Map paraMap); + // 메뉴 등록 + menuNoList.forEach((menuNo) -> { + mapper.insertMenuCreatDtls( + XitMenuCreatDtlsVO + .builder() + .authorCode(authorCode) + .menuNo(menuNo) + .build() + ); + }); + } } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java index 4a2a89e2..1b289b83 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/MenuMgtService.java @@ -5,36 +5,73 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; -import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; -import kr.xit.framework.biz.mng.menu.model.MenuListMngSearchVO; +import egovframework.rte.fdl.excel.EgovExcelService; +import kr.xit.framework.biz.cmm.model.ProgrmListVO; +import kr.xit.framework.biz.mng.menu.mapper.IMenuMgtMapper; +import kr.xit.framework.biz.mng.menu.mapper.IProgramMgtMapper; import kr.xit.framework.biz.mng.menu.model.MenuListMngVO; +import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; +import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; +import kr.xit.framework.biz.mng.menu.service.IMenuMgtService; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.support.exception.BizRuntimeException; +import kr.xit.framework.support.util.Checks; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; -/** - * - * @업무그룹명: 메뉴목록관리 Service - * @설명: - * @최초작성일: 2020. 3. 26. 오전 10:07:11 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface MenuMgtService { +@Slf4j +@RequiredArgsConstructor +@Service +public class MenuMgtService implements IMenuMgtService { + private final IMenuMgtMapper mapper; + private final IProgramMgtMapper programMngMapper; + @Qualifier("egovExcelService") + private final EgovExcelService egovExcelService; - /** - *
메소드 설명: 메뉴목록관리 목록 조회
- * @param paraMap - * @return List 요청처리 후 응답객체 - * @author: 최정민 - * @date: 2022. 10. 18. - */ - List findMenus(final Map paraMap, final RowBounds rowBounds); - - void addMenu(final XitMenuInfoVO vo); - void modifyMenu(final XitMenuInfoVO vo); - void removeMenu(final String menuNo); + @Override + public List findMenus(final Map paraMap, final RowBounds rowBounds) { + + return mapper.selectMenuInfos(paraMap, rowBounds); + } + + @Override + public void addMenu(final XitMenuInfoVO vo) { + // 메뉴 등록 여부 + if(Checks.isNotEmpty(mapper.selectMenuInfo(XitMenuInfoVO.builder() + .menuNo(vo.getMenuNo()) + .build()))) + throw BizRuntimeException.create(MessageKey.DUP_ERR_MSG); + + // 프로그램 존재 여부 + if(Checks.isEmpty(programMngMapper.selectProgram(ProgramMngVO.builder() + .progrmFileNm(vo.getProgrmFileNm()) + .build()))) + throw BizRuntimeException.create(MessageKey.NOT_FOUND_MSG); + + mapper.insertMenuInfo(vo); + } + + @Override + public void modifyMenu(final XitMenuInfoVO vo) { + mapper.updateMenuInfo(vo); + } + + @Override + public void removeMenu(final String menuNo) { + // 참조하는 메뉴 조회 + if(mapper.selectMenuInfos(XitMenuInfoVO.builder().upperMenuNo(menuNo).build()).size() > 0) + throw BizRuntimeException.create("fail.common.delete.upperMenuExist"); + mapper.deleteMenuInfo(menuNo); + } @@ -50,28 +87,343 @@ public interface MenuMgtService { + + + @Override + public boolean menuBndeAllDelete() throws Exception { + //if(!deleteAllProgrmDtls()){return false;} // 프로그램변경요청 테이블 + if (!deleteAllMenuCreatDtlsList()) { + return false; + } // 메뉴정보생성내역 테이블 + if (!deleteAllMenuList()) { + return false; + } // 메뉴정보 테이블 + if (!deleteAllProgrm()) { + return false; + } // 프로그램목록 테이블 + return true; + } + + + /** + * 메뉴정보 전체데이터 초기화 + * @return boolean + * @exception Exception + */ + private boolean deleteAllMenuList() throws Exception { + //mapper.deleteMenuInfo(null); + return true; + } /** - *
메소드 설명: 메뉴일괄초기화
-	 * 	-메뉴목록 테이블, 프로그램목록 테이블 전체 삭제
-	 * 
- * @return boolean 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 27. + * 메뉴정보생성내역 전체데이터 초기화 + * @return boolean + * @exception Exception + */ + private boolean deleteAllMenuCreatDtlsList() throws Exception { + mapper.deleteAllMenuCreatDtlsList(); + return true; + } + + /** + * 프로그램 정보 전체데이타 초기화 + * @return boolean + * @exception Exception + */ + private boolean deleteAllProgrm() { + //programMngMapper.deleteProgram(null); + return true; + } + + /** + * 프로그램변경내역 정보 전체데이타 초기화 + * @return boolean + * @exception Exception */ - public boolean menuBndeAllDelete() throws Exception; + private boolean deleteAllProgrmDtls() { + //programMngMapper.deleteAllProgrmDtls(); + return true; + } + + @Override + public String addsProc(MenuListMngVO vo, FileInputStream inputStream) throws Exception { + + String message = addsProc(inputStream); + String sMessage = null; + + switch (Integer.parseInt(message)) { + case 99: + log.debug("프로그램목록/메뉴정보테이블 데이타 존재오류 - 초기화 하신 후 다시 처리하세요."); + sMessage = "프로그램목록/메뉴정보테이블 데이타 존재오류 - 초기화 하신 후 다시 처리하세요."; + break; + case 90: + log.debug("파일존재하지 않음."); + sMessage = "파일존재하지 않음."; + break; + case 91: + log.debug("프로그램시트의 cell 갯수 오류."); + sMessage = "프로그램시트의 cell 갯수 오류."; + break; + case 92: + log.debug("메뉴정보시트의 cell 갯수 오류."); + sMessage = "메뉴정보시트의 cell 갯수 오류."; + break; + case 93: + log.debug("엑셀 시트갯수 오류."); + sMessage = "엑셀 시트갯수 오류."; + break; + case 95: + log.debug("메뉴정보 입력시 에러."); + sMessage = "메뉴정보 입력시 에러."; + break; + case 96: + log.debug("프로그램목록입력시 에러."); + sMessage = "프로그램목록입력시 에러."; + break; + default: + log.debug("일괄배치처리 완료."); + sMessage = "일괄배치처리 완료."; + break; + } + log.debug(message); + return sMessage; + } /** - *
메소드 설명: 메뉴일괄등록 프로세스
- * @param vo - * @param inputStream - * @return - * @throws Exception String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 3. 27. + * 메뉴목록_프로그램목록 일괄생성 + * @param inputStream InputStream + * @return String + * @exception Exception */ - public String addsProc(MenuListMngVO vo, FileInputStream inputStream) throws Exception; + private String addsProc(FileInputStream inputStream) throws Exception { + boolean success = false; + String requestValue = null; + //char FILE_SEPARATOR = File.separatorChar; + int progrmSheetRowCnt = 0; + int menuSheetRowCnt = 0; + //String xlsFile = null; + try { + /* + 오류 메세지 정보 + message = "99"; //프로그램목록테이블 데이타 존재오류. + message = "99"; //메뉴정보테이블 데이타 존재오류. + message = "90"; //파일존재하지 않음. + message = "91"; //프로그램시트의 cell 갯수 오류 + message = "92"; //메뉴정보시트의 cell 갯수 오류 + message = "93"; //엑셀 시트갯수 오류 + message = "95"; //메뉴정보 입력시 에러 + message = "96"; //프로그램목록입력시 에러 + message = "0"; //일괄배치처리 완료 + */ + //List listProgrmListVO = xitFrameCrudService.findXitProgrmLists(new ProgrmListVO()); + List listProgrmListVO = programMngMapper.selectPrograms(new ProgrmListVO()); + if (XitCmmnUtil.notEmpty(listProgrmListVO) && listProgrmListVO.size() > 1) { + return requestValue = "99"; + } //프로그램목록테이블 데이타 존재오류. + //List listMenuInfoVO = xitFrameCrudService.findXitMenuInfos(new XitMenuInfoVO()); + List listMenuInfoVO = mapper.selectMenuInfos(null); + if (XitCmmnUtil.notEmpty(listMenuInfoVO) && listMenuInfoVO.size() > 1) { + return requestValue = "99"; + } //메뉴정보테이블 데이타 존재오류. + Workbook hssfWB = egovExcelService.loadWorkbook(inputStream); + //log.debug("hssfWB:::::"+hssfWB); + // 엑셀 파일 시트 갯수 확인 sheet = 2 첫번째시트 = 프로그램목록 두번째시트 = 메뉴목록 + if (hssfWB.getNumberOfSheets() == 2) { + Sheet progrmSheet = hssfWB.getSheetAt(0); //프로그램목록 시트 가져오기 + Sheet menuSheet = hssfWB.getSheetAt(1); //메뉴정보 시트 가져오기 + Row progrmRow = progrmSheet.getRow(1); //프로그램 row 가져오기 + Row menuRow = menuSheet.getRow(1); //메뉴정보 row 가져오기 + progrmSheetRowCnt = progrmRow.getPhysicalNumberOfCells(); //프로그램 cell Cnt + menuSheetRowCnt = menuRow.getPhysicalNumberOfCells(); //메뉴정보 cell Cnt + + // 프로그램 시트 파일 데이타 검증 cell = 5개 + if (progrmSheetRowCnt != 5) { + return requestValue = "91"; //프로그램시트의 cell 갯수 오류 + } + + // 메뉴목록 시트 파일 데이타 검증 cell = 8개 + if (menuSheetRowCnt != 8) { + return requestValue = "92"; //메뉴정보시트의 cell 갯수 오류 + } + + /* sheet1번 = 프로그램목록 , sheet2번 = 메뉴정보 */ + success = progrmRegist(progrmSheet); + if (success) { + success = menuRegist(menuSheet); + if (success) { + return requestValue = "0"; // 일괄배치처리 완료 + } else { + deleteAllMenuCreatDtlsList(); + deleteAllMenuList(); +// deleteAllProgrmDtls(); //2020.04.09 박민규-프로그램변경내역 테이블이 없어 주석처리 + deleteAllProgrm(); + return requestValue = "95"; // 메뉴정보 입력시 에러 + } + } else { +// deleteAllProgrmDtls(); //2020.04.09 박민규-프로그램변경내역 테이블이 없어 주석처리 + deleteAllProgrm(); + return requestValue = "96"; // 프로그램목록입력시 에러 + } + } else { + return requestValue = "93"; // 엑셀 시트갯수 오류 + } + + } catch (Exception e) { + log.debug("{}", e); + + requestValue = "99"; + } + return requestValue; + } + /** + * 프로그램목록 일괄등록 + * @param progrmSheet HSSFSheet + * @return boolean + * @exception Exception + */ + private boolean progrmRegist(Sheet progrmSheet) throws Exception { + int count = 0; + boolean success = false; + try { + int rows = progrmSheet.getPhysicalNumberOfRows(); //행 갯수 가져오기 + for (int j = 1; j < rows; j++) { //row 루프 + ProgramMngVO vo = new ProgramMngVO(); + Row row = progrmSheet.getRow(j); //row 가져오기 + if (row != null) { + //int cells=row.getPhysicalNumberOfCells(); //cell 갯수 가져오기 + + Cell cell = null; + cell = row.getCell(0); //프로그램명 + if (cell != null) { + vo.setProgrmFileNm("" + cell.getStringCellValue()); + } + cell = row.getCell(1); //프로그램한글명 + if (cell != null) { + vo.setProgrmKoreanNm("" + cell.getStringCellValue()); + } + cell = row.getCell(2); //프로그램저장경로 + if (cell != null) { + vo.setProgrmStrePath("" + cell.getStringCellValue()); + } + cell = row.getCell(3); //프로그램 URL + if (cell != null) { + vo.setURL("" + cell.getStringCellValue()); + } + cell = row.getCell(4); //프로그램설명 + if (cell != null) { + vo.setProgrmDc("" + cell.getStringCellValue()); + } + } + if (insertProgrm(vo)) { + count++; + } + } + if (count == rows - 1) { + success = true; + } else { + success = false; + } + } catch (Exception e) { + log.debug("{}", e); + + success = false; + } + return success; + } + /** + * 메뉴정보 일괄등록 + * @param menuSheet HSSFSheet + * @return boolean + * @exception Exception + */ + private boolean menuRegist(Sheet menuSheet) throws Exception { + boolean success = false; + int count = 0; + try { + int rows = menuSheet.getPhysicalNumberOfRows(); //행 갯수 가져오기 + for (int j = 1; j < rows; j++) { //row 루프 + XitMenuInfoVO vo = new XitMenuInfoVO(); + Row row = menuSheet.getRow(j); //row 가져오기 + if (row != null) { + //int cells=row.getPhysicalNumberOfCells(); //cell 갯수 가져오기 + Cell cell = null; + cell = row.getCell(0); //메뉴번호 + if (cell != null) { + Double doubleCell = new Double(cell.getNumericCellValue()); + //vo.setMenuNo(Integer.parseInt("" + doubleCell.longValue())); + vo.setMenuNo("" + doubleCell.longValue()); + } + cell = row.getCell(1); //메뉴순서 + if (cell != null) { + Double doubleCell = new Double(cell.getNumericCellValue()); + //vo.setMenuOrdr(Integer.parseInt("" + doubleCell.longValue())); + vo.setMenuOrdr("" + doubleCell.longValue()); + } + cell = row.getCell(2); //메뉴명 + if (cell != null) { + vo.setMenuNm("" + cell.getStringCellValue()); + } + cell = row.getCell(3); //상위메뉴번호 + if (cell != null) { + Double doubleCell = new Double(cell.getNumericCellValue()); + //vo.setUpperMenuNo(Integer.parseInt("" + doubleCell.longValue())); + vo.setUpperMenuNo("" + doubleCell.longValue()); + } + cell = row.getCell(4); //메뉴설명 + if (cell != null) { + vo.setMenuDc("" + cell.getStringCellValue()); + } + cell = row.getCell(5); //관련이미지경로 + if (cell != null) { + vo.setRelateImagePath("" + cell.getStringCellValue()); + } + cell = row.getCell(6); //관련이미지명 + if (cell != null) { + vo.setRelateImageNm("" + cell.getStringCellValue()); + } + cell = row.getCell(7); //프로그램파일명 + if (cell != null) { + vo.setProgrmFileNm("" + cell.getStringCellValue()); + } + } + try { + this.addMenu(vo); + if (true) { + count++; + } + } catch (Exception e) { + throw e; + } + } + if (count == rows - 1) { + success = true; + } else { + + } + } catch (Exception e) { + log.debug("{}", e); + + success = false; + + } + return success; + } + + + /** + * 프로그램 정보를 등록 + * @param vo ProgrmManageVO + * @return boolean + * @exception Exception + */ + private boolean insertProgrm(ProgramMngVO vo) throws Exception { + //if(XitCmmnUtil.isEmpty(programMngService.findProgram(vo))) + // programMngService.addProc(vo); + //else + // programMngService.modifyProc(vo); + return true; + } } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMgtService.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMgtService.java index 53db4c6f..0e633b4d 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/service/ProgramMgtService.java @@ -4,40 +4,64 @@ import java.util.List; import java.util.Map; import org.apache.ibatis.session.RowBounds; +import org.springframework.stereotype.Service; +import kr.xit.framework.biz.mng.menu.mapper.IProgramMgtMapper; import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; +import kr.xit.framework.biz.mng.menu.service.IProgramMgtService; +import kr.xit.framework.core.constants.FrameworkConstants; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.support.exception.BizRuntimeException; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; -/** - * - * @업무그룹명: 프로그램관리 Service - * @설명: - * @최초작성일: 2020. 3. 26. 오전 10:07:11 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface ProgramMgtService { - - /** - *
메소드 설명: 프로그램 목록 조회
- */ - List findPrograms(final Map paraMap, final RowBounds rowBounds); - - /** - *
메소드 설명: 프로그램 상세정보 조회
- */ - ProgramMngVO findProgram(final String progrmFileNm); - - /** - *
메소드 설명: 프로그램 등록
- */ - int addProgram(final ProgramMngVO vo); - - /** - *
메소드 설명: 프로그램 변경
- */ - int modifyProgram(final ProgramMngVO vo); - - int removeProgram(final String programFileNm); +@Slf4j +@RequiredArgsConstructor +@Service +public class ProgramMgtService implements IProgramMgtService { + + private final IProgramMgtMapper mapper; + + @Override + public List findPrograms(final Map paraMap, final RowBounds rowBounds) { + return mapper.selectPrograms(paraMap, rowBounds); + } + + @Override + public ProgramMngVO findProgram(final String progrmFileNm) { + return mapper.selectProgram(progrmFileNm); + } + + @Override + public int addProgram(final ProgramMngVO vo) { + return mapper.insertProgram(vo); + + } + + @Override + public int modifyProgram(final ProgramMngVO vo) { + String table = "프로그램목록"; + FrameworkConstants.DB_ACTION action = FrameworkConstants.DB_ACTION.U; + + /** + * 필수조건 확인 + */ + String emsg = null; + if(XitCmmnUtil.isEmpty(vo.getProgrmFileNm())) + emsg = String.format("(%s)프로그램파일명(은)는 필수조건 입니다.", table); + if(emsg!=null){ + log.error(emsg); + throw BizRuntimeException.create(emsg); + } + + int result = mapper.updateProgram(vo); + if(result<1) throw BizRuntimeException.create(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); + return result; + } + + @Override + public int removeProgram(final String programFileNm) { + return mapper.deleteProgram(programFileNm); + + } } diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuByRoleMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuByRoleMgtServiceImpl.java deleted file mode 100644 index 244c5660..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuByRoleMgtServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -package kr.xit.framework.biz.mng.menu.service.impl; - -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Service; - -import kr.xit.framework.biz.cmm.model.XitMenuCreatDtlsVO; -import kr.xit.framework.biz.mng.menu.mapper.MenuByRoleMgtMapper; -import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO; -import kr.xit.framework.biz.mng.menu.service.MenuByRoleMgtService; -import lombok.RequiredArgsConstructor; - -; - -@RequiredArgsConstructor -@Service -public class MenuByRoleMgtServiceImpl implements MenuByRoleMgtService { - - private final MenuByRoleMgtMapper mapper; - - @Override - public List findRoleInfos(T t) { - return mapper.selectRoleInfos(t); - } - - @Override - public List findMenuInfoByRoleList(T t) { - return mapper.selectMenuInfoByRoleList(t); - } - - @Override - public void saveMenuByRoleList(Map paraMap) { - String authorCode = String.valueOf(paraMap.get("authorCode")); - @SuppressWarnings("unchecked") - List menuNoList = (List)paraMap.get("menuNoList"); - - // 해당 권한의 메뉴 삭제 - mapper.deleteMenuCreatDtls(authorCode); - - // 메뉴 등록 - menuNoList.forEach((menuNo) -> { - mapper.insertMenuCreatDtls( - XitMenuCreatDtlsVO - .builder() - .authorCode(authorCode) - .menuNo(menuNo) - .build() - ); - }); - } -} diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuMgtServiceImpl.java deleted file mode 100644 index c6328979..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/MenuMgtServiceImpl.java +++ /dev/null @@ -1,429 +0,0 @@ -package kr.xit.framework.biz.mng.menu.service.impl; - -import java.io.FileInputStream; -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import egovframework.rte.fdl.excel.EgovExcelService; -import kr.xit.framework.biz.cmm.model.ProgrmListVO; -import kr.xit.framework.biz.mng.menu.mapper.MenuMgtMapper; -import kr.xit.framework.biz.mng.menu.mapper.ProgramMgtMapper; -import kr.xit.framework.biz.mng.menu.model.MenuListMngVO; -import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; -import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; -import kr.xit.framework.biz.mng.menu.service.MenuMgtService; -import kr.xit.framework.core.utils.XitCmmnUtil; -import kr.xit.framework.support.exception.BizRuntimeException; -import kr.xit.framework.support.util.Checks; -import kr.xit.framework.support.util.constants.MessageKey; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@RequiredArgsConstructor -@Service -public class MenuMgtServiceImpl implements MenuMgtService { - private final MenuMgtMapper mapper; - private final ProgramMgtMapper programMngMapper; - @Qualifier("egovExcelService") - private final EgovExcelService egovExcelService; - - @Override - public List findMenus(final Map paraMap, final RowBounds rowBounds) { - - return mapper.selectMenuInfos(paraMap, rowBounds); - } - - @Override - public void addMenu(final XitMenuInfoVO vo) { - // 메뉴 등록 여부 - if(Checks.isNotEmpty(mapper.selectMenuInfo(XitMenuInfoVO.builder() - .menuNo(vo.getMenuNo()) - .build()))) - throw BizRuntimeException.create(MessageKey.DUP_ERR_MSG); - - // 프로그램 존재 여부 - if(Checks.isEmpty(programMngMapper.selectProgram(ProgramMngVO.builder() - .progrmFileNm(vo.getProgrmFileNm()) - .build()))) - throw BizRuntimeException.create(MessageKey.NOT_FOUND_MSG); - - mapper.insertMenuInfo(vo); - } - - @Override - public void modifyMenu(final XitMenuInfoVO vo) { - mapper.updateMenuInfo(vo); - } - - @Override - public void removeMenu(final String menuNo) { - // 참조하는 메뉴 조회 - if(mapper.selectMenuInfos(XitMenuInfoVO.builder().upperMenuNo(menuNo).build()).size() > 0) - throw BizRuntimeException.create("fail.common.delete.upperMenuExist"); - - mapper.deleteMenuInfo(menuNo); - } - - - - - - - - - - - - - - - - - - @Override - public boolean menuBndeAllDelete() throws Exception { - //if(!deleteAllProgrmDtls()){return false;} // 프로그램변경요청 테이블 - if (!deleteAllMenuCreatDtlsList()) { - return false; - } // 메뉴정보생성내역 테이블 - if (!deleteAllMenuList()) { - return false; - } // 메뉴정보 테이블 - if (!deleteAllProgrm()) { - return false; - } // 프로그램목록 테이블 - return true; - } - - - /** - * 메뉴정보 전체데이터 초기화 - * @return boolean - * @exception Exception - */ - private boolean deleteAllMenuList() throws Exception { - //mapper.deleteMenuInfo(null); - return true; - } - - /** - * 메뉴정보생성내역 전체데이터 초기화 - * @return boolean - * @exception Exception - */ - private boolean deleteAllMenuCreatDtlsList() throws Exception { - mapper.deleteAllMenuCreatDtlsList(); - return true; - } - - /** - * 프로그램 정보 전체데이타 초기화 - * @return boolean - * @exception Exception - */ - private boolean deleteAllProgrm() { - //programMngMapper.deleteProgram(null); - return true; - } - - /** - * 프로그램변경내역 정보 전체데이타 초기화 - * @return boolean - * @exception Exception - */ - private boolean deleteAllProgrmDtls() { - //programMngMapper.deleteAllProgrmDtls(); - return true; - } - - @Override - public String addsProc(MenuListMngVO vo, FileInputStream inputStream) throws Exception { - - String message = addsProc(inputStream); - String sMessage = null; - - switch (Integer.parseInt(message)) { - case 99: - log.debug("프로그램목록/메뉴정보테이블 데이타 존재오류 - 초기화 하신 후 다시 처리하세요."); - sMessage = "프로그램목록/메뉴정보테이블 데이타 존재오류 - 초기화 하신 후 다시 처리하세요."; - break; - case 90: - log.debug("파일존재하지 않음."); - sMessage = "파일존재하지 않음."; - break; - case 91: - log.debug("프로그램시트의 cell 갯수 오류."); - sMessage = "프로그램시트의 cell 갯수 오류."; - break; - case 92: - log.debug("메뉴정보시트의 cell 갯수 오류."); - sMessage = "메뉴정보시트의 cell 갯수 오류."; - break; - case 93: - log.debug("엑셀 시트갯수 오류."); - sMessage = "엑셀 시트갯수 오류."; - break; - case 95: - log.debug("메뉴정보 입력시 에러."); - sMessage = "메뉴정보 입력시 에러."; - break; - case 96: - log.debug("프로그램목록입력시 에러."); - sMessage = "프로그램목록입력시 에러."; - break; - default: - log.debug("일괄배치처리 완료."); - sMessage = "일괄배치처리 완료."; - break; - } - log.debug(message); - return sMessage; - } - - /** - * 메뉴목록_프로그램목록 일괄생성 - * @param inputStream InputStream - * @return String - * @exception Exception - */ - private String addsProc(FileInputStream inputStream) throws Exception { - boolean success = false; - String requestValue = null; - //char FILE_SEPARATOR = File.separatorChar; - int progrmSheetRowCnt = 0; - int menuSheetRowCnt = 0; - //String xlsFile = null; - try { - /* - 오류 메세지 정보 - message = "99"; //프로그램목록테이블 데이타 존재오류. - message = "99"; //메뉴정보테이블 데이타 존재오류. - message = "90"; //파일존재하지 않음. - message = "91"; //프로그램시트의 cell 갯수 오류 - message = "92"; //메뉴정보시트의 cell 갯수 오류 - message = "93"; //엑셀 시트갯수 오류 - message = "95"; //메뉴정보 입력시 에러 - message = "96"; //프로그램목록입력시 에러 - message = "0"; //일괄배치처리 완료 - */ - //List listProgrmListVO = xitFrameCrudService.findXitProgrmLists(new ProgrmListVO()); - List listProgrmListVO = programMngMapper.selectPrograms(new ProgrmListVO()); - if (XitCmmnUtil.notEmpty(listProgrmListVO) && listProgrmListVO.size() > 1) { - return requestValue = "99"; - } //프로그램목록테이블 데이타 존재오류. - //List listMenuInfoVO = xitFrameCrudService.findXitMenuInfos(new XitMenuInfoVO()); - List listMenuInfoVO = mapper.selectMenuInfos(null); - if (XitCmmnUtil.notEmpty(listMenuInfoVO) && listMenuInfoVO.size() > 1) { - return requestValue = "99"; - } //메뉴정보테이블 데이타 존재오류. - Workbook hssfWB = egovExcelService.loadWorkbook(inputStream); - //log.debug("hssfWB:::::"+hssfWB); - // 엑셀 파일 시트 갯수 확인 sheet = 2 첫번째시트 = 프로그램목록 두번째시트 = 메뉴목록 - if (hssfWB.getNumberOfSheets() == 2) { - Sheet progrmSheet = hssfWB.getSheetAt(0); //프로그램목록 시트 가져오기 - Sheet menuSheet = hssfWB.getSheetAt(1); //메뉴정보 시트 가져오기 - Row progrmRow = progrmSheet.getRow(1); //프로그램 row 가져오기 - Row menuRow = menuSheet.getRow(1); //메뉴정보 row 가져오기 - progrmSheetRowCnt = progrmRow.getPhysicalNumberOfCells(); //프로그램 cell Cnt - menuSheetRowCnt = menuRow.getPhysicalNumberOfCells(); //메뉴정보 cell Cnt - - // 프로그램 시트 파일 데이타 검증 cell = 5개 - if (progrmSheetRowCnt != 5) { - return requestValue = "91"; //프로그램시트의 cell 갯수 오류 - } - - // 메뉴목록 시트 파일 데이타 검증 cell = 8개 - if (menuSheetRowCnt != 8) { - return requestValue = "92"; //메뉴정보시트의 cell 갯수 오류 - } - - /* sheet1번 = 프로그램목록 , sheet2번 = 메뉴정보 */ - success = progrmRegist(progrmSheet); - if (success) { - success = menuRegist(menuSheet); - if (success) { - return requestValue = "0"; // 일괄배치처리 완료 - } else { - deleteAllMenuCreatDtlsList(); - deleteAllMenuList(); -// deleteAllProgrmDtls(); //2020.04.09 박민규-프로그램변경내역 테이블이 없어 주석처리 - deleteAllProgrm(); - return requestValue = "95"; // 메뉴정보 입력시 에러 - } - } else { -// deleteAllProgrmDtls(); //2020.04.09 박민규-프로그램변경내역 테이블이 없어 주석처리 - deleteAllProgrm(); - return requestValue = "96"; // 프로그램목록입력시 에러 - } - } else { - return requestValue = "93"; // 엑셀 시트갯수 오류 - } - - } catch (Exception e) { - log.debug("{}", e); - - requestValue = "99"; - } - return requestValue; - } - - /** - * 프로그램목록 일괄등록 - * @param progrmSheet HSSFSheet - * @return boolean - * @exception Exception - */ - private boolean progrmRegist(Sheet progrmSheet) throws Exception { - int count = 0; - boolean success = false; - try { - int rows = progrmSheet.getPhysicalNumberOfRows(); //행 갯수 가져오기 - for (int j = 1; j < rows; j++) { //row 루프 - ProgramMngVO vo = new ProgramMngVO(); - Row row = progrmSheet.getRow(j); //row 가져오기 - if (row != null) { - //int cells=row.getPhysicalNumberOfCells(); //cell 갯수 가져오기 - - Cell cell = null; - cell = row.getCell(0); //프로그램명 - if (cell != null) { - vo.setProgrmFileNm("" + cell.getStringCellValue()); - } - cell = row.getCell(1); //프로그램한글명 - if (cell != null) { - vo.setProgrmKoreanNm("" + cell.getStringCellValue()); - } - cell = row.getCell(2); //프로그램저장경로 - if (cell != null) { - vo.setProgrmStrePath("" + cell.getStringCellValue()); - } - cell = row.getCell(3); //프로그램 URL - if (cell != null) { - vo.setURL("" + cell.getStringCellValue()); - } - cell = row.getCell(4); //프로그램설명 - if (cell != null) { - vo.setProgrmDc("" + cell.getStringCellValue()); - } - } - if (insertProgrm(vo)) { - count++; - } - } - if (count == rows - 1) { - success = true; - } else { - success = false; - } - } catch (Exception e) { - log.debug("{}", e); - - success = false; - } - return success; - } - - /** - * 메뉴정보 일괄등록 - * @param menuSheet HSSFSheet - * @return boolean - * @exception Exception - */ - private boolean menuRegist(Sheet menuSheet) throws Exception { - boolean success = false; - int count = 0; - try { - int rows = menuSheet.getPhysicalNumberOfRows(); //행 갯수 가져오기 - for (int j = 1; j < rows; j++) { //row 루프 - XitMenuInfoVO vo = new XitMenuInfoVO(); - Row row = menuSheet.getRow(j); //row 가져오기 - if (row != null) { - //int cells=row.getPhysicalNumberOfCells(); //cell 갯수 가져오기 - Cell cell = null; - cell = row.getCell(0); //메뉴번호 - if (cell != null) { - Double doubleCell = new Double(cell.getNumericCellValue()); - //vo.setMenuNo(Integer.parseInt("" + doubleCell.longValue())); - vo.setMenuNo("" + doubleCell.longValue()); - } - cell = row.getCell(1); //메뉴순서 - if (cell != null) { - Double doubleCell = new Double(cell.getNumericCellValue()); - //vo.setMenuOrdr(Integer.parseInt("" + doubleCell.longValue())); - vo.setMenuOrdr("" + doubleCell.longValue()); - } - cell = row.getCell(2); //메뉴명 - if (cell != null) { - vo.setMenuNm("" + cell.getStringCellValue()); - } - cell = row.getCell(3); //상위메뉴번호 - if (cell != null) { - Double doubleCell = new Double(cell.getNumericCellValue()); - //vo.setUpperMenuNo(Integer.parseInt("" + doubleCell.longValue())); - vo.setUpperMenuNo("" + doubleCell.longValue()); - } - cell = row.getCell(4); //메뉴설명 - if (cell != null) { - vo.setMenuDc("" + cell.getStringCellValue()); - } - cell = row.getCell(5); //관련이미지경로 - if (cell != null) { - vo.setRelateImagePath("" + cell.getStringCellValue()); - } - cell = row.getCell(6); //관련이미지명 - if (cell != null) { - vo.setRelateImageNm("" + cell.getStringCellValue()); - } - cell = row.getCell(7); //프로그램파일명 - if (cell != null) { - vo.setProgrmFileNm("" + cell.getStringCellValue()); - } - } - try { - this.addMenu(vo); - if (true) { - count++; - } - } catch (Exception e) { - throw e; - } - } - if (count == rows - 1) { - success = true; - } else { - - } - } catch (Exception e) { - log.debug("{}", e); - - success = false; - - } - return success; - } - - - /** - * 프로그램 정보를 등록 - * @param vo ProgrmManageVO - * @return boolean - * @exception Exception - */ - private boolean insertProgrm(ProgramMngVO vo) throws Exception { - //if(XitCmmnUtil.isEmpty(programMngService.findProgram(vo))) - // programMngService.addProc(vo); - //else - // programMngService.modifyProc(vo); - return true; - } - -} diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMgtServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMgtServiceImpl.java deleted file mode 100644 index d9ddf856..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/menu/service/impl/ProgramMgtServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package kr.xit.framework.biz.mng.menu.service.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.stereotype.Service; - -import kr.xit.framework.biz.mng.menu.mapper.ProgramMgtMapper; -import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; -import kr.xit.framework.biz.mng.menu.service.ProgramMgtService; -import kr.xit.framework.core.constants.FrameworkConstants; -import kr.xit.framework.core.utils.XitCmmnUtil; -import kr.xit.framework.support.exception.BizRuntimeException; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@RequiredArgsConstructor -@Service -public class ProgramMgtServiceImpl implements ProgramMgtService { - - private final ProgramMgtMapper mapper; - - @Override - public List findPrograms(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectPrograms(paraMap, rowBounds); - } - - @Override - public ProgramMngVO findProgram(final String progrmFileNm) { - return mapper.selectProgram(progrmFileNm); - } - - @Override - public int addProgram(final ProgramMngVO vo) { - return mapper.insertProgram(vo); - - } - - @Override - public int modifyProgram(final ProgramMngVO vo) { - String table = "프로그램목록"; - FrameworkConstants.DB_ACTION action = FrameworkConstants.DB_ACTION.U; - - /** - * 필수조건 확인 - */ - String emsg = null; - if(XitCmmnUtil.isEmpty(vo.getProgrmFileNm())) - emsg = String.format("(%s)프로그램파일명(은)는 필수조건 입니다.", table); - if(emsg!=null){ - log.error(emsg); - throw BizRuntimeException.create(emsg); - } - - int result = mapper.updateProgram(vo); - if(result<1) throw BizRuntimeException.create(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm())); - return result; - } - - @Override - public int removeProgram(final String programFileNm) { - return mapper.deleteProgram(programFileNm); - - } -} diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuByRoleMgtController.java b/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuByRoleMgtController.java index cd2889d9..3f7b8459 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuByRoleMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuByRoleMgtController.java @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO; -import kr.xit.framework.biz.mng.menu.service.MenuByRoleMgtService; +import kr.xit.framework.biz.mng.menu.service.IMenuByRoleMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.util.AjaxMessageMapRenderer; @@ -23,7 +23,7 @@ import lombok.RequiredArgsConstructor; @RequestMapping(value = "/framework/biz/mng/menu") public class MenuByRoleMgtController { - private final MenuByRoleMgtService service; + private final IMenuByRoleMgtService service; @GetMapping(value = "/mngMenuByRoleMgtForm") public void mngMenuByRoleMgtForm() { diff --git a/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java b/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java index 5871324d..59155ac0 100644 --- a/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java +++ b/src/main/java/kr/xit/framework/biz/mng/menu/web/MenuMgtController.java @@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO; -import kr.xit.framework.biz.mng.menu.service.MenuMgtService; +import kr.xit.framework.biz.mng.menu.service.IMenuMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.core.utils.XitCmmnUtil; @@ -30,7 +30,6 @@ import kr.xit.framework.core.utils.attachfile.XitAttachFileVO; import kr.xit.framework.support.mybatis.MybatisUtils; import kr.xit.framework.support.util.AjaxMessageMapRenderer; import kr.xit.framework.support.util.AjaxUtils; -import kr.xit.framework.support.util.Checks; import kr.xit.framework.support.util.ValidationError; import kr.xit.framework.support.util.constants.MessageKey; import lombok.RequiredArgsConstructor; @@ -51,7 +50,7 @@ import lombok.extern.slf4j.Slf4j; @RequiredArgsConstructor @RequestMapping(value = "/framework/biz/mng/menu") public class MenuMgtController { - private final MenuMgtService service; + private final IMenuMgtService service; /** 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 3e3bcf93..6e065214 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 @@ -2,21 +2,17 @@ package kr.xit.framework.biz.mng.menu.web; import java.util.Map; -import org.apache.poi.ss.formula.functions.T; import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.Mapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; -import kr.xit.framework.biz.mng.menu.model.ProgramMngSearchVO; import kr.xit.framework.biz.mng.menu.model.ProgramMngVO; -import kr.xit.framework.biz.mng.menu.service.ProgramMgtService; +import kr.xit.framework.biz.mng.menu.service.IProgramMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.support.mybatis.MybatisUtils; @@ -42,7 +38,7 @@ import lombok.extern.slf4j.Slf4j; @Controller @RequestMapping(value = "/framework/biz/mng/menu") public class ProgramMgtController { - private final ProgramMgtService service; + private final IProgramMgtService service; /** *
메소드 설명: 프로그램관리 목록 페이지
diff --git a/src/main/java/kr/xit/framework/biz/mng/user/mapper/UserMgtMapper.java b/src/main/java/kr/xit/framework/biz/mng/user/mapper/IUserMgtMapper.java similarity index 98% rename from src/main/java/kr/xit/framework/biz/mng/user/mapper/UserMgtMapper.java rename to src/main/java/kr/xit/framework/biz/mng/user/mapper/IUserMgtMapper.java index afdc5518..c035f55d 100644 --- a/src/main/java/kr/xit/framework/biz/mng/user/mapper/UserMgtMapper.java +++ b/src/main/java/kr/xit/framework/biz/mng/user/mapper/IUserMgtMapper.java @@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; * @version 1.0 Copyright(c) XIT All rights reserved. */ @Mapper -public interface UserMgtMapper { +public interface IUserMgtMapper { /** *
메소드 설명: 사용자등록관리 목록 조회
diff --git a/src/main/java/kr/xit/framework/biz/mng/user/service/IUserMgtService.java b/src/main/java/kr/xit/framework/biz/mng/user/service/IUserMgtService.java new file mode 100644 index 00000000..6237d031 --- /dev/null +++ b/src/main/java/kr/xit/framework/biz/mng/user/service/IUserMgtService.java @@ -0,0 +1,64 @@ +package kr.xit.framework.biz.mng.user.service; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.session.RowBounds; + +import kr.xit.framework.biz.mng.user.model.XitUserEtcOptionVO; +import kr.xit.framework.biz.mng.user.model.XitUserInfoVO; +import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; + +/** + * + * @업무그룹명: 사용자등록관리 Service + * @설명: + * @최초작성일: 2020. 4. 8. 오후 3:33:18 + * @최초작성자: 박민규 + * @author (주)엑스아이티 개발팀 + * @since 2002. 2. 2. + * @version 1.0 Copyright(c) XIT All rights reserved. + */ +public interface IUserMgtService { + + /** + *
메소드 설명: 사용자등록관리 목록 조회
+ * @param searchVO + * @return List 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 4. 8. + */ + List findUsers(final Map paraMap, final RowBounds rowBounds); + XitUserInfoVO findUser(final String uniqId); + + void addUser(final XitUserInfoVO userInfoVO); + void modifyUser(final XitUserInfoVO userInfoVO); + void removeUser(final String userTy, final String uniqId); + + String getDefaultAuthorCode(final String groupId); + + + int addUserScrtySetup(final XitUserScrtySetupVO vo); + int addXitUserEtcOption(final XitUserEtcOptionVO 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); +} diff --git a/src/main/java/kr/xit/framework/biz/mng/user/service/UserMgtService.java b/src/main/java/kr/xit/framework/biz/mng/user/service/UserMgtService.java index f44d3527..a49532f8 100644 --- a/src/main/java/kr/xit/framework/biz/mng/user/service/UserMgtService.java +++ b/src/main/java/kr/xit/framework/biz/mng/user/service/UserMgtService.java @@ -2,63 +2,331 @@ package kr.xit.framework.biz.mng.user.service; import java.util.List; import java.util.Map; +import java.util.Objects; import org.apache.ibatis.session.RowBounds; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Service; +import egovframework.rte.fdl.cmmn.exception.FdlException; +import egovframework.rte.fdl.idgnr.EgovIdGnrService; +import kr.xit.framework.biz.cmm.model.XitLoginVO; import kr.xit.framework.biz.mng.user.model.XitUserEtcOptionVO; import kr.xit.framework.biz.mng.user.model.XitUserInfoVO; import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; +import kr.xit.framework.biz.cmm.service.XitFrameCrudService; +import kr.xit.framework.biz.mng.auth.mapper.IAuthGrpMgtMapper; +import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; +import kr.xit.framework.biz.mng.user.mapper.IUserMgtMapper; +import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO; +import kr.xit.framework.biz.mng.user.service.IUserMgtService; +import kr.xit.framework.core.message.XitMessageSource; +import kr.xit.framework.core.utils.XitCmmnUtil; +import kr.xit.framework.core.utils.XitScrtyUtil; +import kr.xit.framework.support.exception.BizRuntimeException; +import kr.xit.framework.support.util.Checks; +import kr.xit.framework.support.util.constants.MessageKey; +import lombok.RequiredArgsConstructor; -/** - * - * @업무그룹명: 사용자등록관리 Service - * @설명: - * @최초작성일: 2020. 4. 8. 오후 3:33:18 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface UserMgtService { +@RequiredArgsConstructor +@Service +public class UserMgtService implements IUserMgtService { + private final IUserMgtMapper mapper; + private final IAuthGrpMgtMapper authGrpMgtMapper; + private final XitFrameCrudService xitFrameCrudService; + private final XitMessageSource xitMessageSource; + @Qualifier("usrEsntlIdGnrService") + private final EgovIdGnrService usrEsntlIdGnrService; - /** - *
메소드 설명: 사용자등록관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 8. - */ - List findUsers(final Map paraMap, final RowBounds rowBounds); - XitUserInfoVO findUser(final String uniqId); + @Override + public List findUsers(final Map paraMap, RowBounds rowBounds) { + return mapper.selectUsers(paraMap, rowBounds); + } + + @Override + public XitUserInfoVO findUser(final String uniqId) { + // TODO : 적용 체크 + if(!this.isUserModifyAuth(uniqId)) + throw new RuntimeException("대상에 대한 열람 권한이 없습니다."); + return mapper.selectUser(uniqId); + } + + + @Override + public void addUser(final XitUserInfoVO vo) { + try { + vo.setUniqId(usrEsntlIdGnrService.getNextStringId()); + } catch (FdlException e) { + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, 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.create(MessageKey.CUSTOM_MSG, String.format("비밀번호 암호화 실패:: %s", e.getMessage())); + } + vo.setEsntlId(vo.getUniqId()); + + mapper.insertUserInfo(vo); + + // 사용자 권한 + XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); + userScrtySetupVO.setScrtySetupTrgetId(vo.getEsntlId()); + userScrtySetupVO.setMberTyCode("USR03"); + userScrtySetupVO.setAuthorCode(this.getDefaultAuthorCode(vo.getGroupId())); + mapper.insertUserScrtySetup(userScrtySetupVO); + + // 기타 option + XitUserEtcOptionVO userEtcOptionVO = new XitUserEtcOptionVO(); + userEtcOptionVO.setUserId(vo.getUserId()); + userEtcOptionVO.setJobDataAuthor("ONESELF"); //업무 데이터 권한 + userEtcOptionVO.setUserManageAuthor("ONESELF"); //사용자 관리 권한 + mapper.insertUserEtcOption(userEtcOptionVO); + } + + @Override + public void modifyUser(final XitUserInfoVO vo) { + + // TODO : 적용 체크 + if(!this.isUserModifyAuth(vo.getUniqId())) + throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); + + vo.setUserId(vo.getEmplyrId()); //사용자 id + vo.setUserNm(vo.getEmplyrNm()); //사용자 명 + vo.setEsntlId(vo.getUniqId()); + + Map userInfoCheckMap = mapper.selectCheckUserInfo(vo.getUserId()); + if(Checks.isEmpty(userInfoCheckMap) || !Objects.equals(vo.getEsntlId(), userInfoCheckMap.get("esntl_id"))) + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "사용자 고유식별값이 일치하지 않습니다."); - void addUser(final XitUserInfoVO userInfoVO); - void modifyUser(final XitUserInfoVO userInfoVO); - void removeUser(final String userTy, final String uniqId); + // 변경이력 등록 and 사용자 정보 변경 + mapper.insertUserInfoChangeDtls(vo.getUserId()); + mapper.updateUserInfo(vo); - String getDefaultAuthorCode(final String groupId); + //그룹ID가 변경되었을 경우 사용자의 권한 갱신 + if(!Objects.equals(vo.getGroupId(), userInfoCheckMap.get("group_id"))) { + XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); + userScrtySetupVO.setScrtySetupTrgetId(vo.getUniqId()); + userScrtySetupVO.setAuthorCode(this.getDefaultAuthorCode(vo.getGroupId())); + if(Checks.isEmpty(mapper.selectUserScrtySetup(userScrtySetupVO.getScrtySetupTrgetId()))) { + userScrtySetupVO.setMberTyCode("USR03"); + mapper.insertUserScrtySetup(userScrtySetupVO); + }else { + mapper.updateUserScrtySetup(userScrtySetupVO); + } + } + } + @Override + public void removeUser(final String userTy, final String userId) { - int addUserScrtySetup(final XitUserScrtySetupVO vo); - int addXitUserEtcOption(final XitUserEtcOptionVO vo); + //업무사용자 삭제 + if (userTy.equals("USR03")){ + Map userInfoCheckMap = mapper.selectCheckUserInfo(userId); + String scrtySetupTrgetId = String.valueOf(userInfoCheckMap.get("esntl_id")); + //사용자보안설정 삭제 + if(Checks.isNotEmpty(mapper.selectUserScrtySetup(scrtySetupTrgetId))) { + mapper.deleteUserScrtySetup(scrtySetupTrgetId); + } + //사용자정보변경내역 전체 삭제 + mapper.deleteUserInfoChangeDtlsList(userId); + //업무사용자(직원)삭제 + mapper.deleteUserInfo(userId); + //일반회원 삭제 + }else if(userTy.equals("USR01")){ + mapper.deleteGnrlMber(userId); + //기업회원 삭제 + }else if(userTy.equals("USR02")){ //기업회원 삭제 + mapper.deleteEntrprsMber(userId); + } + } + /** + *
+	 * 메소드 설명: 그룹의 기본 권한을 반환 한다.
+	 * 	-그룹 아이디가 빈(Empty) 값이면 "일반사용자(ROLE_USER)" 권한 반환
+	 * 	-그룹 아이디에 대한 그룹정보가 없으면 "일반사용자(ROLE_USER)" 권한 반환
+	 * 	-그룹의 권한코드 설정 값이 빈(Empty) 값이면 "일반사용자(ROLE_USER)" 권한 반환
+	 * 	-그룹의 권한코드 설정 값이 있으면 해당 권한코드 반환
+	 * 
+ * + * @param groupId 그룹 ID + * @return String 요청처리 후 응답객체 + * @author: 박민규 + * @date: 2020. 10. 30. + */ + @Override + public String getDefaultAuthorCode(final String groupId) { + if(Checks.isEmpty(groupId)) return "ROLE_USER"; + + XitAuthorGroupInfoVO vo = authGrpMgtMapper.selectAuthorGroupInfo(groupId); + // 권한 설정 + if (Checks.isEmpty(vo)) + return "ROLE_USER"; + else { + if (Checks.isEmpty(vo.getAuthorCode())) + return "ROLE_USER"; + else + return vo.getAuthorCode(); + } + } + @Override + public int addUserScrtySetup(final XitUserScrtySetupVO vo) { + return mapper.insertUserScrtySetup(vo); + } + @Override + public int addXitUserEtcOption(final XitUserEtcOptionVO vo) { + return mapper.insertUserEtcOption(vo); + } /** - *
메소드 설명: 사용자 비밀번호 수정
- * @param uniqId 고유식별ID - * @param id 사용자ID - * @param oldPassword 구 비밀번호 - * @param newPassword 신규 비밀번호 - * @param newPassword2 신규 비밀번호 확인 - * @return void 요청처리 후 응답객체 + *
메소드 설명: 사용자정보 수정 권한 여부 확인
+	 * 	-보안성 강화를 위해 다음 조건을 충족 하도록 한다.
+	 * 	 :"ROLE_ADMIN 권한"의 사용자는 모든 사용자의 정보 수정이 가능해야 한다.
+	 * 	 :"ROLE_ADMIN 권한"의 사용자정보는 같은 "ROLE_ADMIN 권한"의 사용자만 수정이 가능해야 한다.
+	 * 	 :타인의 정보는 "ROLE_ADMIN 권한" 또는 "사용자관리권한"이 부여된 사용자만 수정이 가능해야 한다.
+	 * 
+ * @param uniqId 고유ID + * @return boolean 요청처리 후 응답객체 * @author: 박민규 - * @date: 2020. 4. 10. + * @date: 2020. 6. 9. */ - public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2); + private boolean isUserModifyAuth(String uniqId) { + XitLoginVO loginSessionVO = XitCmmnUtil.getUserInfo(); + + //본인정보인 경우 + if(loginSessionVO.getUniqId().equals(uniqId)) { + return true; + + }else { + //사용자(수정대상) 권한 조회 + XitUserScrtySetupVO scrtyVO = mapper.selectUserScrtySetup(uniqId); + String tgtAuthorCode = scrtyVO.getAuthorCode(); + + //사용자(수정자) 권한 조회 + scrtyVO = mapper.selectUserScrtySetup(loginSessionVO.getUniqId());; + String userAuthorCode = scrtyVO.getAuthorCode(); + + //사용자(수정자)가 ROLE_ADMIN 권한의 사용자인 경우 + if("ROLE_ADMIN".equals(userAuthorCode)) { + return true; + }else { + //사용자(수정대상)가 ROLE_ADMIN 권한의 사용자인 경우 + if("ROLE_ADMIN".equals(tgtAuthorCode)) { + return false; + } + + XitUserInfoVO tgtUserVO = mapper.selectUser(uniqId); + //Map tgtUserMap = mapper.selectCheckUserInfo(tgtUserVO.getEmplyrId()); + + //사용자관리권한별 분기 + XitUserInfoVO loginUserVO = mapper.selectUser(loginSessionVO.getUniqId()); + //Map loginUserMap = mapper.selectCheckUserInfo(loginUserVO.getEmplyrId()); + + //사용자(수정자) 정보 조회 + switch(loginSessionVO.getUserManageAuthor()) { + case "ALL": //모든 사용자 + return true; + case "DEPT": //자신이 속한 부서의 모든 사용자 + if(loginUserVO.getPstinstCode().equals(tgtUserVO.getPstinstCode())) + return true; + break; + case "ORGNZT": //자신이 속한 조직의 모든 사용자 + if(loginSessionVO.getOrgnztId().equals(tgtUserVO.getOrgnztId())) + return true; + break; + default: + return false; + } + } + return false; + } + } + + + + + + + + + + + + + + + + + + + + + @Override + public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2) { + + /** + * 유효성 확인 + */ + if(!this.isUserModifyAuth(uniqId)) + throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); + XitUserRegMngVO vo = new XitUserRegMngVO(); + 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")); + } + + + /** + * 필수값 설정 + */ + XitUserInfoVO xitUserInfoVO = new XitUserInfoVO(); + xitUserInfoVO.setUserId(id); + xitUserInfoVO.setPassword(encryptNewPass); + + + /** + * 처리 + */ + xitFrameCrudService.modifyXitUserInfo(xitUserInfoVO); + + } + + + + + + + + + + + + + + } 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 deleted file mode 100644 index c693e50e..00000000 --- a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/UserMgtServiceImpl.java +++ /dev/null @@ -1,332 +0,0 @@ -package kr.xit.framework.biz.mng.user.service.impl; - -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import org.apache.ibatis.session.RowBounds; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import egovframework.rte.fdl.cmmn.exception.FdlException; -import egovframework.rte.fdl.idgnr.EgovIdGnrService; -import kr.xit.framework.biz.cmm.model.XitLoginVO; -import kr.xit.framework.biz.mng.user.model.XitUserEtcOptionVO; -import kr.xit.framework.biz.mng.user.model.XitUserInfoVO; -import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO; -import kr.xit.framework.biz.cmm.service.XitFrameCrudService; -import kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper; -import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO; -import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper; -import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO; -import kr.xit.framework.biz.mng.user.service.UserMgtService; -import kr.xit.framework.core.message.XitMessageSource; -import kr.xit.framework.core.utils.XitCmmnUtil; -import kr.xit.framework.core.utils.XitScrtyUtil; -import kr.xit.framework.support.exception.BizRuntimeException; -import kr.xit.framework.support.util.Checks; -import kr.xit.framework.support.util.constants.MessageKey; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -@Service -public class UserMgtServiceImpl implements UserMgtService { - private final UserMgtMapper mapper; - private final AuthGrpMgtMapper authGrpMgtMapper; - private final XitFrameCrudService xitFrameCrudService; - private final XitMessageSource xitMessageSource; - @Qualifier("usrEsntlIdGnrService") - private final EgovIdGnrService usrEsntlIdGnrService; - - @Override - public List findUsers(final Map paraMap, RowBounds rowBounds) { - return mapper.selectUsers(paraMap, rowBounds); - } - - @Override - public XitUserInfoVO findUser(final String uniqId) { - // TODO : 적용 체크 - if(!this.isUserModifyAuth(uniqId)) - throw new RuntimeException("대상에 대한 열람 권한이 없습니다."); - return mapper.selectUser(uniqId); - } - - - @Override - public void addUser(final XitUserInfoVO vo) { - try { - vo.setUniqId(usrEsntlIdGnrService.getNextStringId()); - } catch (FdlException e) { - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, 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.create(MessageKey.CUSTOM_MSG, String.format("비밀번호 암호화 실패:: %s", e.getMessage())); - } - vo.setEsntlId(vo.getUniqId()); - - mapper.insertUserInfo(vo); - - // 사용자 권한 - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(vo.getEsntlId()); - userScrtySetupVO.setMberTyCode("USR03"); - userScrtySetupVO.setAuthorCode(this.getDefaultAuthorCode(vo.getGroupId())); - mapper.insertUserScrtySetup(userScrtySetupVO); - - // 기타 option - XitUserEtcOptionVO userEtcOptionVO = new XitUserEtcOptionVO(); - userEtcOptionVO.setUserId(vo.getUserId()); - userEtcOptionVO.setJobDataAuthor("ONESELF"); //업무 데이터 권한 - userEtcOptionVO.setUserManageAuthor("ONESELF"); //사용자 관리 권한 - mapper.insertUserEtcOption(userEtcOptionVO); - } - - @Override - public void modifyUser(final XitUserInfoVO vo) { - - // TODO : 적용 체크 - if(!this.isUserModifyAuth(vo.getUniqId())) - throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); - - vo.setUserId(vo.getEmplyrId()); //사용자 id - vo.setUserNm(vo.getEmplyrNm()); //사용자 명 - vo.setEsntlId(vo.getUniqId()); - - Map userInfoCheckMap = mapper.selectCheckUserInfo(vo.getUserId()); - if(Checks.isEmpty(userInfoCheckMap) || !Objects.equals(vo.getEsntlId(), userInfoCheckMap.get("esntl_id"))) - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "사용자 고유식별값이 일치하지 않습니다."); - - // 변경이력 등록 and 사용자 정보 변경 - mapper.insertUserInfoChangeDtls(vo.getUserId()); - mapper.updateUserInfo(vo); - - //그룹ID가 변경되었을 경우 사용자의 권한 갱신 - if(!Objects.equals(vo.getGroupId(), userInfoCheckMap.get("group_id"))) { - XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO(); - userScrtySetupVO.setScrtySetupTrgetId(vo.getUniqId()); - userScrtySetupVO.setAuthorCode(this.getDefaultAuthorCode(vo.getGroupId())); - - if(Checks.isEmpty(mapper.selectUserScrtySetup(userScrtySetupVO.getScrtySetupTrgetId()))) { - userScrtySetupVO.setMberTyCode("USR03"); - mapper.insertUserScrtySetup(userScrtySetupVO); - }else { - mapper.updateUserScrtySetup(userScrtySetupVO); - } - } - } - @Override - public void removeUser(final String userTy, final String userId) { - - //업무사용자 삭제 - if (userTy.equals("USR03")){ - Map userInfoCheckMap = mapper.selectCheckUserInfo(userId); - String scrtySetupTrgetId = String.valueOf(userInfoCheckMap.get("esntl_id")); - - //사용자보안설정 삭제 - if(Checks.isNotEmpty(mapper.selectUserScrtySetup(scrtySetupTrgetId))) { - mapper.deleteUserScrtySetup(scrtySetupTrgetId); - } - //사용자정보변경내역 전체 삭제 - mapper.deleteUserInfoChangeDtlsList(userId); - //업무사용자(직원)삭제 - mapper.deleteUserInfo(userId); - - //일반회원 삭제 - }else if(userTy.equals("USR01")){ - mapper.deleteGnrlMber(userId); - - //기업회원 삭제 - }else if(userTy.equals("USR02")){ //기업회원 삭제 - mapper.deleteEntrprsMber(userId); - } - } - - /** - *
-	 * 메소드 설명: 그룹의 기본 권한을 반환 한다.
-	 * 	-그룹 아이디가 빈(Empty) 값이면 "일반사용자(ROLE_USER)" 권한 반환
-	 * 	-그룹 아이디에 대한 그룹정보가 없으면 "일반사용자(ROLE_USER)" 권한 반환
-	 * 	-그룹의 권한코드 설정 값이 빈(Empty) 값이면 "일반사용자(ROLE_USER)" 권한 반환
-	 * 	-그룹의 권한코드 설정 값이 있으면 해당 권한코드 반환
-	 * 
- * - * @param groupId 그룹 ID - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 10. 30. - */ - @Override - public String getDefaultAuthorCode(final String groupId) { - if(Checks.isEmpty(groupId)) return "ROLE_USER"; - - XitAuthorGroupInfoVO vo = authGrpMgtMapper.selectAuthorGroupInfo(groupId); - // 권한 설정 - if (Checks.isEmpty(vo)) - return "ROLE_USER"; - else { - if (Checks.isEmpty(vo.getAuthorCode())) - return "ROLE_USER"; - else - return vo.getAuthorCode(); - } - } - - - @Override - public int addUserScrtySetup(final XitUserScrtySetupVO vo) { - return mapper.insertUserScrtySetup(vo); - } - - @Override - public int addXitUserEtcOption(final XitUserEtcOptionVO vo) { - return mapper.insertUserEtcOption(vo); - } - - - /** - *
메소드 설명: 사용자정보 수정 권한 여부 확인
-	 * 	-보안성 강화를 위해 다음 조건을 충족 하도록 한다.
-	 * 	 :"ROLE_ADMIN 권한"의 사용자는 모든 사용자의 정보 수정이 가능해야 한다.
-	 * 	 :"ROLE_ADMIN 권한"의 사용자정보는 같은 "ROLE_ADMIN 권한"의 사용자만 수정이 가능해야 한다.
-	 * 	 :타인의 정보는 "ROLE_ADMIN 권한" 또는 "사용자관리권한"이 부여된 사용자만 수정이 가능해야 한다.
-	 * 
- * @param uniqId 고유ID - * @return boolean 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 6. 9. - */ - private boolean isUserModifyAuth(String uniqId) { - XitLoginVO loginSessionVO = XitCmmnUtil.getUserInfo(); - - //본인정보인 경우 - if(loginSessionVO.getUniqId().equals(uniqId)) { - return true; - - }else { - //사용자(수정대상) 권한 조회 - XitUserScrtySetupVO scrtyVO = mapper.selectUserScrtySetup(uniqId); - String tgtAuthorCode = scrtyVO.getAuthorCode(); - - //사용자(수정자) 권한 조회 - scrtyVO = mapper.selectUserScrtySetup(loginSessionVO.getUniqId());; - String userAuthorCode = scrtyVO.getAuthorCode(); - - //사용자(수정자)가 ROLE_ADMIN 권한의 사용자인 경우 - if("ROLE_ADMIN".equals(userAuthorCode)) { - return true; - }else { - //사용자(수정대상)가 ROLE_ADMIN 권한의 사용자인 경우 - if("ROLE_ADMIN".equals(tgtAuthorCode)) { - return false; - } - - XitUserInfoVO tgtUserVO = mapper.selectUser(uniqId); - //Map tgtUserMap = mapper.selectCheckUserInfo(tgtUserVO.getEmplyrId()); - - //사용자관리권한별 분기 - XitUserInfoVO loginUserVO = mapper.selectUser(loginSessionVO.getUniqId()); - //Map loginUserMap = mapper.selectCheckUserInfo(loginUserVO.getEmplyrId()); - - //사용자(수정자) 정보 조회 - switch(loginSessionVO.getUserManageAuthor()) { - case "ALL": //모든 사용자 - return true; - case "DEPT": //자신이 속한 부서의 모든 사용자 - if(loginUserVO.getPstinstCode().equals(tgtUserVO.getPstinstCode())) - return true; - break; - case "ORGNZT": //자신이 속한 조직의 모든 사용자 - if(loginSessionVO.getOrgnztId().equals(tgtUserVO.getOrgnztId())) - return true; - break; - default: - return false; - } - } - return false; - } - } - - - - - - - - - - - - - - - - - - - - - @Override - public void modifyPwdProc(String uniqId, String id, String oldPassword, String newPassword, String newPassword2) { - - /** - * 유효성 확인 - */ - if(!this.isUserModifyAuth(uniqId)) - throw new RuntimeException("대상에 대한 수정 권한이 없습니다."); - XitUserRegMngVO vo = new XitUserRegMngVO(); - 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")); - } - - - /** - * 필수값 설정 - */ - XitUserInfoVO xitUserInfoVO = new XitUserInfoVO(); - xitUserInfoVO.setUserId(id); - xitUserInfoVO.setPassword(encryptNewPass); - - - /** - * 처리 - */ - xitFrameCrudService.modifyXitUserInfo(xitUserInfoVO); - - } - - - - - - - - - - - - - - -} diff --git a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitEntUserRegMngServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitEntUserRegMngServiceImpl.java index ad7e4480..acbe1a4c 100644 --- a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitEntUserRegMngServiceImpl.java +++ b/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitEntUserRegMngServiceImpl.java @@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.user.mapper.XitEntUserRegMngMapper; import kr.xit.framework.biz.mng.user.model.XitEntUserRegMngSearchVO; import kr.xit.framework.biz.mng.user.model.XitEntUserRegMngVO; import kr.xit.framework.biz.mng.user.service.XitEntUserRegMngService; -import kr.xit.framework.biz.mng.user.service.UserMgtService; +import kr.xit.framework.biz.mng.user.service.IUserMgtService; import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.utils.XitCmmnUtil; import kr.xit.framework.core.utils.XitScrtyUtil; @@ -33,7 +33,7 @@ public class XitEntUserRegMngServiceImpl implements XitEntUserRegMngService { @Resource private XitEntUserRegMngMapper xitEntUserRegMngMapper; @Resource - private UserMgtService userMgtService; + private IUserMgtService userMgtService; @Resource private XitFrameCrudService xitFrameCrudService; @Resource diff --git a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitGnrUserRegMngServiceImpl.java b/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitGnrUserRegMngServiceImpl.java index 98389404..9b0b6676 100644 --- a/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitGnrUserRegMngServiceImpl.java +++ b/src/main/java/kr/xit/framework/biz/mng/user/service/impl/XitGnrUserRegMngServiceImpl.java @@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.user.mapper.XitGnrUserRegMngMapper; import kr.xit.framework.biz.mng.user.model.XitGnrUserRegMngSearchVO; import kr.xit.framework.biz.mng.user.model.XitGnrUserRegMngVO; import kr.xit.framework.biz.mng.user.service.XitGnrUserRegMngService; -import kr.xit.framework.biz.mng.user.service.UserMgtService; +import kr.xit.framework.biz.mng.user.service.IUserMgtService; import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.utils.XitCmmnUtil; import kr.xit.framework.core.utils.XitScrtyUtil; @@ -33,7 +33,7 @@ public class XitGnrUserRegMngServiceImpl implements XitGnrUserRegMngService{ @Resource private XitGnrUserRegMngMapper xitGnrUserRegMngMapper; @Resource - private UserMgtService userMgtService; + private IUserMgtService userMgtService; @Resource private XitFrameCrudService xitFrameCrudService; @Resource 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 bc1eff75..0749d6f9 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 @@ -25,7 +25,7 @@ import org.springframework.web.servlet.ModelAndView; import kr.xit.framework.biz.mng.user.model.XitUserInfoVO; import kr.xit.framework.biz.mng.user.model.XitUserRegMngSearchVO; import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO; -import kr.xit.framework.biz.mng.user.service.UserMgtService; +import kr.xit.framework.biz.mng.user.service.IUserMgtService; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.model.ResultResponse; @@ -52,7 +52,7 @@ import lombok.RequiredArgsConstructor; @RequestMapping("/framework/biz/mng/usr") public class UserMgtController { - private final UserMgtService service; + private final IUserMgtService service; @GetMapping(value = "/mngUserMgtForm") public void mngUserMgtForm() { diff --git a/src/main/java/kr/xit/framework/support/util/JBeanRegistry.java b/src/main/java/kr/xit/framework/support/util/JBeanRegistry.java index b0d063d2..42c16355 100644 --- a/src/main/java/kr/xit/framework/support/util/JBeanRegistry.java +++ b/src/main/java/kr/xit/framework/support/util/JBeanRegistry.java @@ -3,7 +3,7 @@ package kr.xit.framework.support.util; import org.springframework.context.MessageSource; import org.springframework.context.support.MessageSourceAccessor; -import kr.xit.framework.biz.cache.service.CacheService; +import kr.xit.framework.biz.cache.service.ICacheService; import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.validation.XitBeanValidator; @@ -33,7 +33,7 @@ public class JBeanRegistry { return (XitMessageSource)SpringUtils.getBean(XitMessageSource.class); } - public static CacheService getCacheService() { - return (CacheService)SpringUtils.getBean(CacheService.class); + public static ICacheService getCacheService() { + return (ICacheService)SpringUtils.getBean(ICacheService.class); } } diff --git a/src/main/resources/sqlmapper/biz/ec/ec0100-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/ec/ec0100-mysql-mapper.xml index 6a45ccb6..7cffc803 100644 --- a/src/main/resources/sqlmapper/biz/ec/ec0100-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/ec/ec0100-mysql-mapper.xml @@ -1,7 +1,7 @@ - + /* ec0200-mysql-mapper|selectEc0200List-|julim */ diff --git a/src/main/resources/sqlmapper/biz/ec/ec0300-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/ec/ec0300-mysql-mapper.xml index dc48e6f1..75e3e57b 100644 --- a/src/main/resources/sqlmapper/biz/ec/ec0300-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/ec/ec0300-mysql-mapper.xml @@ -1,7 +1,7 @@ - + /* ec0400-mysql-mapper|selectEc0400List-|julim */ diff --git a/src/main/resources/sqlmapper/biz/ec/ec0500-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/ec/ec0500-mysql-mapper.xml index f9b24007..bac8cca8 100644 --- a/src/main/resources/sqlmapper/biz/ec/ec0500-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/ec/ec0500-mysql-mapper.xml @@ -1,7 +1,7 @@ - + /* rt0100-mysql-mapper|selectRt0100List-|julim */ diff --git a/src/main/resources/sqlmapper/biz/rt/rt0200-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/rt/rt0200-mysql-mapper.xml index 2f19cb18..91a8f954 100644 --- a/src/main/resources/sqlmapper/biz/rt/rt0200-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/rt/rt0200-mysql-mapper.xml @@ -1,7 +1,7 @@ - + + + SELECT LIST.* FROM( + + + + ) LIST LIMIT #{firstIndex}, #{recordCountPerPage} + + + + + SELECT A.CL_CODE AS "clCode" + , A.CL_CODE_NM AS "clCodeNm" + , A.CL_CODE_DC AS "clCodeDc" + , A.USE_AT AS "useAt" + + + FROM XIT_CMMN_CL_CODE A + + + + AND A.CL_CODE = #{searchKeyword} + + + AND A.CL_CODE_NM LIKE CONCAT('%',#{searchKeyword},'%') + + + AND A.USE_AT = 'Y' + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/sqlmapper/framework/mng/menu/menu-by-role-mysql-mapper.xml b/src/main/resources/sqlmapper/framework/mng/menu/menu-by-role-mysql-mapper.xml index 44fd99e0..fb359518 100644 --- a/src/main/resources/sqlmapper/framework/mng/menu/menu-by-role-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/framework/mng/menu/menu-by-role-mysql-mapper.xml @@ -1,7 +1,7 @@ - + + +
+ + 등록 + +
+ + + +
+ + +