From 3c3b5efa1a60fef1132acfd4d2f0a2294b780049 Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 28 May 2024 10:02:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EA=B5=B0=EA=B5=AC,=20=EB=B6=80?= =?UTF-8?q?=EC=84=9C=20=EA=B4=80=EB=A6=AC=20=EA=B4=80=EB=A0=A8=20=EC=86=8C?= =?UTF-8?q?=EC=8A=A4=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/applib/ogdp/OgdpQuery.java | 58 ++++ .../ogdp/OgdpSigungu.java} | 4 +- .../ogdp/dao/CmmnOgdpMapper.java} | 101 +------ .../applib/ogdp/dao/DefaultOgdpMapper.java | 96 +++++++ .../xit/applib/ogdp/service/OgdpService.java | 41 +++ .../ogdp/service/bean/CmmnOgdpBean.java | 82 ++++++ .../ogdp/service/bean/DefaultOgdpBean.java | 78 ++++++ .../service/bean/DefaultOgdpServiceBean.java | 42 +++ .../java/cokr/xit/fims/MainController.java | 12 +- .../cokr/xit/fims/base/CodeController.java | 8 +- .../cokr/xit/fims/base/UserController.java | 22 +- .../xit/fims/cmmn/service/bean/StngBean.java | 16 +- .../xit/fims/cmmn/web/LinkController.java | 8 +- .../xit/fims/crdn/web/Crdn05Controller.java | 8 +- .../xit/fims/cvlc/web/Cvlc01Controller.java | 8 +- .../service/bean/OpnnSbmsnServiceBean.java | 5 - .../xit/fims/excl/web/Excl02Controller.java | 8 +- .../xit/fims/mngt/dao/FimsOgdpMapper.java | 47 ++++ .../xit/fims/mngt/service/OgdpService.java | 61 ----- .../fims/mngt/service/bean/FimsOgdpBean.java | 38 +++ .../service/bean/FimsOgdpServiceBean.java | 53 ++++ .../xit/fims/mngt/service/bean/OgdpBean.java | 133 ---------- .../mngt/service/bean/OgdpServiceBean.java | 68 ----- .../xit/fims/mngt/web/Mngt01Controller.java | 12 +- .../xit/fims/mngt/web/Mngt03Controller.java | 37 ++- .../xit/fims/mngt/web/Mngt04Controller.java | 43 ++- .../fims/nxrp/service/bean/NisIndivBean.java | 11 +- .../sndb/service/bean/SvbtcServiceBean.java | 5 - .../xit/fims/sndb/web/Sndb01Controller.java | 10 +- .../bean/IntegrationSearchServiceBean.java | 4 - .../xit/fims/sprt/web/Sprt01Controller.java | 24 +- .../{ogdp-mapper.xml => fims-ogdp-mapper.xml} | 250 ++---------------- .../sql/mapper/ogdp/cmmn-ogdp-mapper.xml | 174 ++++++++++++ .../sql/mapper/ogdp/default-ogdp-mapper.xml | 108 ++++++++ 34 files changed, 963 insertions(+), 712 deletions(-) create mode 100644 src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java rename src/main/java/cokr/xit/{fims/mngt/FimsSigungu.java => applib/ogdp/OgdpSigungu.java} (84%) rename src/main/java/cokr/xit/{fims/mngt/dao/OgdpMapper.java => applib/ogdp/dao/CmmnOgdpMapper.java} (55%) create mode 100644 src/main/java/cokr/xit/applib/ogdp/dao/DefaultOgdpMapper.java create mode 100644 src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java create mode 100644 src/main/java/cokr/xit/applib/ogdp/service/bean/CmmnOgdpBean.java create mode 100644 src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpBean.java create mode 100644 src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpServiceBean.java create mode 100644 src/main/java/cokr/xit/fims/mngt/dao/FimsOgdpMapper.java delete mode 100644 src/main/java/cokr/xit/fims/mngt/service/OgdpService.java create mode 100644 src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java create mode 100644 src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpServiceBean.java delete mode 100644 src/main/java/cokr/xit/fims/mngt/service/bean/OgdpBean.java delete mode 100644 src/main/java/cokr/xit/fims/mngt/service/bean/OgdpServiceBean.java rename src/main/resources/sql/mapper/fims/mngt/{ogdp-mapper.xml => fims-ogdp-mapper.xml} (53%) create mode 100644 src/main/resources/sql/mapper/ogdp/cmmn-ogdp-mapper.xml create mode 100644 src/main/resources/sql/mapper/ogdp/default-ogdp-mapper.xml diff --git a/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java b/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java new file mode 100644 index 00000000..91d3defe --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java @@ -0,0 +1,58 @@ +package cokr.xit.applib.ogdp; + +import cokr.xit.foundation.component.QueryRequest; + +public class OgdpQuery extends QueryRequest { + private static final long serialVersionUID = 1L; + + private String sggCd; // 시군구 코드 + private String deptCd; // 부서 코드 + private String instCd; // 기관 코드 + private String useYn; // 사용 여부 + private String delYn; // 삭제 여부 + + public String getSggCd() { + return ifEmpty(sggCd, () -> null); + } + + public T setSggCd(String sggCd) { + this.sggCd = sggCd; + return self(); + } + + public String getDeptCd() { + return ifEmpty(deptCd, () -> null); + } + + public T setDeptCd(String deptCd) { + this.deptCd = deptCd; + return self(); + } + + public String getInstCd() { + return ifEmpty(instCd, () -> null); + } + + public T setInstCd(String instCd) { + this.instCd = instCd; + return self(); + } + + public String getUseYn() { + return ifEmpty(useYn, () -> null); + } + + public T setUseYn(String useYn) { + this.useYn = useYn; + return self(); + } + + public String getDelYn() { + return ifEmpty(delYn, () -> null); + } + + public T setDelYn(String delYn) { + this.delYn = delYn; + return self(); + } +} diff --git a/src/main/java/cokr/xit/fims/mngt/FimsSigungu.java b/src/main/java/cokr/xit/applib/ogdp/OgdpSigungu.java similarity index 84% rename from src/main/java/cokr/xit/fims/mngt/FimsSigungu.java rename to src/main/java/cokr/xit/applib/ogdp/OgdpSigungu.java index 474698e1..397b03cd 100644 --- a/src/main/java/cokr/xit/fims/mngt/FimsSigungu.java +++ b/src/main/java/cokr/xit/applib/ogdp/OgdpSigungu.java @@ -1,4 +1,4 @@ -package cokr.xit.fims.mngt; +package cokr.xit.applib.ogdp; import cokr.xit.base.user.Sigungu; import lombok.Getter; @@ -10,7 +10,7 @@ import lombok.Setter; */ @Getter @Setter -public class FimsSigungu extends Sigungu { +public class OgdpSigungu extends Sigungu { /** * 상징 파일 경로 diff --git a/src/main/java/cokr/xit/fims/mngt/dao/OgdpMapper.java b/src/main/java/cokr/xit/applib/ogdp/dao/CmmnOgdpMapper.java similarity index 55% rename from src/main/java/cokr/xit/fims/mngt/dao/OgdpMapper.java rename to src/main/java/cokr/xit/applib/ogdp/dao/CmmnOgdpMapper.java index ea037406..f4668190 100644 --- a/src/main/java/cokr/xit/fims/mngt/dao/OgdpMapper.java +++ b/src/main/java/cokr/xit/applib/ogdp/dao/CmmnOgdpMapper.java @@ -1,28 +1,17 @@ -package cokr.xit.fims.mngt.dao; +package cokr.xit.applib.ogdp.dao; import java.util.List; import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FimsDepartment; -import cokr.xit.fims.mngt.FimsSigungu; +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.OgdpSigungu; import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; -/** 소속 정보 DAO -* -*

상세 설명: -* -*

-* ============ 변경 이력 ============
-* 2023-09-15	leebj 최초 작성
-* ================================
-* 
-*/ -@Mapper("ogdpMapper") -public interface OgdpMapper extends AbstractMapper { +@Mapper("cmmnOgdpMapper") +public interface CmmnOgdpMapper extends AbstractMapper { /**모든 기관,부서 목록을 반환한다.
* @param @@ -77,7 +66,7 @@ public interface OgdpMapper extends AbstractMapper { *
  • 그렇지 않으면 false
  • * */ - default boolean updateSgg(FimsSigungu sgg) { + default boolean updateSgg(OgdpSigungu sgg) { return sgg != null && updateSgg(params().set("sgg", sgg)) == 1; } @@ -85,13 +74,15 @@ public interface OgdpMapper extends AbstractMapper { * @param req 시군구 조회 조건 * @return 시군구 객체 목록 */ - List selectSggs(CmmnQuery req); + List selectSggs(OgdpQuery req); /**지정한 조건에 따라 시군구 객체를 반환한다. * @param req 시군구 조회 조건 * @return 시군구 객체 */ - default DataObject selectSggInfo(CmmnQuery req) { + default DataObject selectSggInfo(OgdpQuery req) { + + // 사용 여부 확인 if (req.getUseYn() == null) { req.setUseYn("Y"); @@ -106,77 +97,6 @@ public interface OgdpMapper extends AbstractMapper { return (!sggs.isEmpty() || sggs.size() == 1) ? sggs.get(0) : null; } - - - - /**지정한 조건에 따라 부서 목록을 조회하여 반환한다.
    - * @param req 부서 조회 조건 - * @return 부서 목록 - */ - List selectDeptList(CmmnQuery req); - - /**지정한 조건에 따라 부서 객체들을 반환한다. - * @param req 부서 조회 조건 - * @return 부서 객체 목록 - */ - List selectDepts(CmmnQuery req); - - /**지정한 조건에 따라 부서 객체를 반환한다. - * @param req 부서 조회 조건 - * @return 부서 객체 - */ - default DataObject selectDeptInfo(CmmnQuery req) { - - // 기본 정렬 - if (req.getOrderBy() == null) { - req.setOrderBy("D.DEPT_CD DESC"); - } - - List depts = selectDepts(req); - - return !depts.isEmpty() ? depts.get(0) : null; - } - - /**부서 정보를 등록한다. - * @param params 파라미터 - *
    • "dept" - 부서 정보
    • - *
    • "currentUser" - 현재 접속한 사용자
    • - *
    - * @return 저장된 정보수 - */ - int insertDept(Map params); - - /**부서 정보를 등록한다. - * @param dept 부서 - * @return 저장 여부 - *
    • 저장됐으면 true
    • - *
    • 그렇지 않으면 false
    • - *
    - */ - default boolean insert(FimsDepartment dept) { - return dept != null && insertDept(params().set("dept", dept)) == 1; - } - - /**부서 정보를 수정한다. - * @param params 파라미터 - *
    • "dept" - 부서 정보
    • - *
    • "currentUser" - 현재 접속한 사용자
    • - *
    - * @return 저장된 정보수 - */ - int updateDept(Map params); - - /**부서 정보를 수정한다. - * @param dept 부서 - * @return 저장 여부 - *
    • 저장됐으면 true
    • - *
    • 그렇지 않으면 false
    • - *
    - */ - default boolean update(FimsDepartment dept) { - return dept != null && updateDept(params().set("dept", dept)) == 1; - } - /**부서 사용여부를 변경한다. * @param params 파라미터 *
    • "deptCds" - 부서 코드 목록
    • @@ -197,5 +117,4 @@ public interface OgdpMapper extends AbstractMapper { int effected = setStatus(params); return effected; } - } diff --git a/src/main/java/cokr/xit/applib/ogdp/dao/DefaultOgdpMapper.java b/src/main/java/cokr/xit/applib/ogdp/dao/DefaultOgdpMapper.java new file mode 100644 index 00000000..605aa467 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/dao/DefaultOgdpMapper.java @@ -0,0 +1,96 @@ +package cokr.xit.applib.ogdp.dao; + +import java.util.List; +import java.util.Map; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.base.user.Department; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +/** 소속 정보 DAO +* +*

      상세 설명: +* +*

      +* ============ 변경 이력 ============
      +* 2023-09-15	leebj 최초 작성
      +* ================================
      +* 
      +*/ +@Mapper("defaultOgdpMapper") +public interface DefaultOgdpMapper extends AbstractMapper { + + /**지정한 조건에 따라 부서 목록을 조회하여 반환한다.
      + * @param req 부서 조회 조건 + * @return 부서 목록 + */ + List selectDeptList(OgdpQuery req); + + /**지정한 조건에 따라 부서 객체들을 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 목록 + */ + List selectDepts(OgdpQuery req); + + /**지정한 조건에 따라 부서 객체를 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 + */ + default DataObject selectDeptInfo(OgdpQuery req) { + + // 기본 정렬 + if (req.getOrderBy() == null) { + req.setOrderBy("D.DEPT_CD DESC"); + } + + List depts = selectDepts(req); + + return !depts.isEmpty() ? depts.get(0) : null; + } + + /**부서 정보를 등록한다. + * @param params 파라미터 + *
      • "dept" - 부서 정보
      • + *
      • "currentUser" - 현재 접속한 사용자
      • + *
      + * @return 저장된 정보수 + */ + int insertDept(Map params); + + /**부서 정보를 등록한다. + * @param dept 부서 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + default boolean insert(Department dept) { + return dept != null && insertDept(params().set("dept", dept)) == 1; + } + + /**부서 정보를 수정한다. + * @param params 파라미터 + *
      • "dept" - 부서 정보
      • + *
      • "currentUser" - 현재 접속한 사용자
      • + *
      + * @return 저장된 정보수 + */ + int updateDept(Map params); + + /**부서 정보를 수정한다. + * @param dept 부서 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + default boolean update(Department dept) { + return dept != null && updateDept(params().set("dept", dept)) == 1; + } + + + +} diff --git a/src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java b/src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java new file mode 100644 index 00000000..ffc2b230 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java @@ -0,0 +1,41 @@ +package cokr.xit.applib.ogdp.service; + +import java.util.List; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.base.user.Department; +import cokr.xit.foundation.data.DataObject; + +public interface OgdpService { + + /**지정한 조건에 따라 부서 목록을 조회하여 반환한다. + * @param req 부서 정보 조회 조건 + * @return 부서 목록 + */ + List getDeptList(OgdpQuery req); + + /**지정한 조건에 따라 부서 객체를 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 + */ + DataObject getDeptInfo(OgdpQuery req); + + /**부서 정보를 등록한다. + * @param dept 부서 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + String create(Department dept); + + /**부서 정보를 수정한다. + * @param dept 부서 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + String update(Department dept); + +} diff --git a/src/main/java/cokr/xit/applib/ogdp/service/bean/CmmnOgdpBean.java b/src/main/java/cokr/xit/applib/ogdp/service/bean/CmmnOgdpBean.java new file mode 100644 index 00000000..af5c1db8 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/service/bean/CmmnOgdpBean.java @@ -0,0 +1,82 @@ +package cokr.xit.applib.ogdp.service.bean; + +import java.util.Map; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.OgdpSigungu; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; +import cokr.xit.foundation.UserInfo; +import cokr.xit.foundation.component.AbstractBean; +import cokr.xit.foundation.data.DataObject; + +@Component("cmmnOgdpBean") +public class CmmnOgdpBean extends AbstractBean { + + @Resource(name="cmmnOgdpMapper") + private CmmnOgdpMapper cmmnOgdpMapper; + + + /**userInfo 객체에 해당 사용자가 소속된 시군구,기관,부서 정보를 저장한다. + * @param userInfo 사용자 정보 + * @return + */ + public void initUserInfo(UserInfo userInfo) { + + DataObject ogdpInfo = cmmnOgdpMapper.selectOgdpInfoOfUser(userInfo.getId()); + + Map infoMap = userInfo.getInfo(); + if(ogdpInfo == null) { + infoMap.put("sggCd", ""); + infoMap.put("sggNm", ""); + infoMap.put("instCd", ""); + infoMap.put("instNm", ""); + infoMap.put("deptCd", ""); + infoMap.put("deptNm", ""); + } else { + infoMap.put("sggCd", ogdpInfo.string("SGG_CD")); + infoMap.put("sggNm", ogdpInfo.string("SGG_NM")); + infoMap.put("instCd", ogdpInfo.string("INST_CD")); + infoMap.put("instNm", ogdpInfo.string("INST_NM")); + infoMap.put("deptCd", ogdpInfo.string("DEPT_CD")); + infoMap.put("deptNm", ogdpInfo.string("DEPT_NM")); + } + + userInfo.setInfo(infoMap); + } + + /**시군구 정보를 수정한다. + * @param sgg 시군구 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + public boolean updateSgg(OgdpSigungu sgg) { + return cmmnOgdpMapper.updateSgg(sgg); + } + + /**지정한 조건에 따라 시군구 객체를 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 + */ + public DataObject getSggInfo(OgdpQuery req) { + return cmmnOgdpMapper.selectSggInfo(req); + } + + /**부서 정보를 삭제한다. + * @param deptCds 부서 코드 목록 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + public boolean remove(String... deptCds) { + return cmmnOgdpMapper.setStatus("N", deptCds) > 0 ? true : false; + } + + +} diff --git a/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpBean.java b/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpBean.java new file mode 100644 index 00000000..1b5ffba0 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpBean.java @@ -0,0 +1,78 @@ +package cokr.xit.applib.ogdp.service.bean; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; +import cokr.xit.applib.ogdp.dao.DefaultOgdpMapper; +import cokr.xit.base.user.Department; +import cokr.xit.base.user.dao.UserMapper; +import cokr.xit.foundation.component.AbstractBean; +import cokr.xit.foundation.data.DataObject; + +@Component("defaultOgdpBean") +public class DefaultOgdpBean extends AbstractBean { + + @Resource(name="cmmnOgdpMapper") + CmmnOgdpMapper cmmnOgdpMapper; + + @Resource(name = "defaultOgdpMapper") + private DefaultOgdpMapper defaultOgdpMapper; + + @Resource(name = "userMapper") + private UserMapper userMapper; + + + /**지정한 조건에 따라 부서 목록을 조회하여 반환한다. + * @param req 부서 조회 조건 + * @return 부서 목록 + */ + public List getDeptList(OgdpQuery req) { + return defaultOgdpMapper.selectDeptList(req); + } + + /**지정한 조건에 따라 부서 객체들을 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 목록 + */ + public List getDepts(OgdpQuery req) { + return defaultOgdpMapper.selectDepts(req); + } + + /**지정한 조건에 따라 부서 객체를 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 + */ + public DataObject getDeptInfo(OgdpQuery req) { + return defaultOgdpMapper.selectDeptInfo(req); + } + + /**부서 정보를 등록한다. + * @param dept 부서 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + public boolean create(Department dept) { + + return defaultOgdpMapper.insert(dept); + } + + /**부서 정보를 수정한다. + * @param dept 부서 + * @return 저장 여부 + *
      • 저장됐으면 true
      • + *
      • 그렇지 않으면 false
      • + *
      + */ + public boolean update(Department dept) { + return defaultOgdpMapper.update(dept); + } + + +} diff --git a/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpServiceBean.java b/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpServiceBean.java new file mode 100644 index 00000000..d6697626 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpServiceBean.java @@ -0,0 +1,42 @@ +package cokr.xit.applib.ogdp.service.bean; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.service.OgdpService; +import cokr.xit.base.user.Department; +import cokr.xit.foundation.component.AbstractServiceBean; +import cokr.xit.foundation.data.DataObject; + +@Service("defaultOgdpService") +public class DefaultOgdpServiceBean extends AbstractServiceBean implements OgdpService { + + @Resource(name = "defaultOgdpBean") + private DefaultOgdpBean defaultOgdpBean; + + @Override + public List getDeptList(OgdpQuery req) { + return defaultOgdpBean.getDeptList(req); + } + + @Override + public DataObject getDeptInfo(OgdpQuery req) { + return defaultOgdpBean.getDeptInfo(req); + } + + @Override + public String create(Department dept) { + return defaultOgdpBean.create(dept) ? "[S]" : "[F]"; + } + + @Override + public String update(Department dept) { + return defaultOgdpBean.update(dept) ? "[S]" : "[F]"; + } + + +} diff --git a/src/main/java/cokr/xit/fims/MainController.java b/src/main/java/cokr/xit/fims/MainController.java index 4e8d6e97..0a76a324 100644 --- a/src/main/java/cokr/xit/fims/MainController.java +++ b/src/main/java/cokr/xit/fims/MainController.java @@ -10,9 +10,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.service.UserService; -import cokr.xit.fims.mngt.dao.OgdpMapper; import cokr.xit.fims.task.TaskRequestMappingHandlerMapping; import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.web.AbstractController; @@ -24,8 +24,8 @@ public class MainController extends AbstractController { @Autowired private TaskRequestMappingHandlerMapping requestHandlers; - @Resource(name="ogdpMapper") - OgdpMapper ogdpMapper; + @Resource(name="cmmnOgdpMapper") + CmmnOgdpMapper cmmnOgdpMapper; @Resource(name="userService") private UserService userService; @@ -39,12 +39,12 @@ public class MainController extends AbstractController { public ModelAndView signupPage(String institute) { ModelAndView mav = new ModelAndView("fims/user/user-info"); - mav.addObject("allOgdpList", ogdpMapper.selectAllOgdpList()); + mav.addObject("allOgdpList", cmmnOgdpMapper.selectAllOgdpList()); DataObject params = new DataObject(); params.set("anonymous", "Y"); params.set("institute", institute); - List ableOgdpList = ogdpMapper.selectAbleOgdpList(params); + List ableOgdpList = cmmnOgdpMapper.selectAbleOgdpList(params); mav.addObject("ableOgdpList", ableOgdpList); mav.addObject("userInfo", "{}"); @@ -71,7 +71,7 @@ public class MainController extends AbstractController { @RequestMapping(name="기관 목록", value="/instList.do") public ModelAndView instList(String account, String institute) { - List instList = ogdpMapper.selectAllInstList(); + List instList = cmmnOgdpMapper.selectAllInstList(); return new ModelAndView("jsonView") .addObject("instList", instList); } diff --git a/src/main/java/cokr/xit/fims/base/CodeController.java b/src/main/java/cokr/xit/fims/base/CodeController.java index 31516281..356edfab 100644 --- a/src/main/java/cokr/xit/fims/base/CodeController.java +++ b/src/main/java/cokr/xit/fims/base/CodeController.java @@ -10,10 +10,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.service.CodeQuery; import cokr.xit.base.code.service.bean.CodeBean; import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -26,8 +26,8 @@ public class CodeController extends cokr.xit.base.code.web.CodeController { @Resource(name = "taskBean") private TaskBean taskBean; - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @RequestMapping(name="모든 업무구분코드 조회",value="/getAllTaskSeCd.do") public ModelAndView getAllTaskSeCd() { @@ -52,7 +52,7 @@ public class CodeController extends cokr.xit.base.code.web.CodeController { mav.addObject("sggHasTask", "Y"); } else { - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); String sggCd = (String)userInfo.getInfo().get("sggCd"); diff --git a/src/main/java/cokr/xit/fims/base/UserController.java b/src/main/java/cokr/xit/fims/base/UserController.java index e44a651e..d0fbfbfb 100644 --- a/src/main/java/cokr/xit/fims/base/UserController.java +++ b/src/main/java/cokr/xit/fims/base/UserController.java @@ -8,14 +8,14 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.service.CodeQuery; import cokr.xit.base.code.service.bean.CodeBean; import cokr.xit.base.security.SecuredUserInfo; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.service.UserService; import cokr.xit.fims.cmmn.service.bean.StngBean; -import cokr.xit.fims.mngt.dao.OgdpMapper; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.foundation.data.DataObject; @Controller @@ -30,11 +30,11 @@ public class UserController extends cokr.xit.base.user.web.UserController ableOgdpList = ogdpMapper.selectAbleOgdpList(params); + List ableOgdpList = cmmnOgdpMapper.selectAbleOgdpList(params); mav.addObject("ableOgdpList", ableOgdpList); return mav; @@ -65,7 +65,7 @@ public class UserController extends cokr.xit.base.user.web.UserController ableOgdpList = ogdpMapper.selectAbleOgdpList(params); + List ableOgdpList = cmmnOgdpMapper.selectAbleOgdpList(params); mav.addObject("ableOgdpList", ableOgdpList); return mav; diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java index 57b4f960..bfb33c51 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java @@ -9,6 +9,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.service.CodeQuery; import cokr.xit.base.code.service.bean.CodeBean; @@ -16,7 +17,6 @@ import cokr.xit.base.security.Authority; import cokr.xit.base.security.SecuredUserInfo; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.dao.StngMapper; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.component.AbstractBean; @@ -27,8 +27,8 @@ public class StngBean extends AbstractBean { @Resource(name = "codeBean") private CodeBean codeBean; - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @Resource(name = "stngMapper") private StngMapper stngMapper; @@ -49,14 +49,14 @@ public class StngBean extends AbstractBean { if(userInfo.getInstitute().equals("default")) { return new DataObject(); } - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); return stngMapper.selectDeptStng((String)userInfo.getInfo().get("deptCd")); } else if(type.equals("sgg")){ UserInfo userInfo = currentUser(); if(userInfo.getInstitute().equals("default")) { return new DataObject(); } - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); return stngMapper.selectSggStng((String)userInfo.getInfo().get("sggCd")); } else { return null; @@ -71,7 +71,7 @@ public class StngBean extends AbstractBean { public boolean updateDtbnActno(String dtbnBankNm, String dtbnActno) { Map params = new HashMap(); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); params.put("mdfr", userInfo.getId()); params.put("deptCd", (String)userInfo.getInfo().get("deptCd")); params.put("dtbnBankNm", dtbnBankNm); @@ -99,7 +99,7 @@ public class StngBean extends AbstractBean { } else if(isAdmin) { //관리자 Map info = userInfo.getInfo(); if(info == null || info.get("sggCd") == null || info.get("sggCd").equals("")) { - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); } availableTaskList = taskBean.getTasks((new CmmnQuery()).setSggCd((String)userInfo.getInfo().get("sggCd")).setUseYn("Y")) @@ -182,7 +182,7 @@ public class StngBean extends AbstractBean { SecuredUserInfo userInfo = currentUser(); Map info = userInfo.getInfo(); if(info == null || info.get("sggCd") == null || info.get("sggCd").equals("")) { - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); } List taskSeCdListForSgg = taskBean.getTasks((new CmmnQuery()).setSggCd((String)userInfo.getInfo().get("sggCd")).setUseYn("Y")) diff --git a/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java b/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java index 312fc783..ea3c2cc6 100644 --- a/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java +++ b/src/main/java/cokr/xit/fims/cmmn/web/LinkController.java @@ -6,10 +6,10 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.fims.cmmn.dao.ExtrStngMapper; import cokr.xit.fims.cmmn.service.LinkService; import cokr.xit.fims.cmmn.service.bean.LinkBean; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.web.AbstractController; @@ -24,8 +24,8 @@ public class LinkController extends AbstractController { @Resource(name = "linkService") private LinkService linkService; - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @Resource(name = "extrStngMapper") private ExtrStngMapper extrStngMapper; @@ -36,7 +36,7 @@ public class LinkController extends AbstractController { boolean saved = false; UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); String sggCd = (String) userInfo.getInfo().get("sggCd"); System.out.println("파라미터 : "+ param); diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index 98d404f1..e6b605f5 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.web.FileInfoFactory; @@ -42,7 +43,6 @@ import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnStngService; import cokr.xit.fims.crdn.service.ImportService; import cokr.xit.fims.crdn.service.bean.CrdnStngBean; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.task.Task; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -95,8 +95,8 @@ public class Crdn05Controller extends ApplicationController { @Resource(name="crdnStngMapper") private CrdnStngMapper crdnStngMapper; - @Resource(name="ogdpBean") - protected OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @Resource(name = "stngBean") private StngBean stngBean; @@ -481,7 +481,7 @@ public class Crdn05Controller extends ApplicationController { boolean saved = false; UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); crdn.setSggCd((String)userInfo.getInfo().get("sggCd")); crdn.setCrdnRegSeCd("01"); diff --git a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java index a3d9258f..ce3121c0 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import cokr.xit.applib.Print; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -37,7 +38,6 @@ import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.cvlc.service.CrdnCvlcptService; import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptMainBean; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.task.Task; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -82,8 +82,8 @@ public class Cvlc01Controller extends ApplicationController { @Resource(name = "fileBean") private FileBean fileBean; - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @Resource(name = "crdnCvlcptMainBean") private CrdnCvlcptMainBean crdnCvlcptMainBean; @@ -221,7 +221,7 @@ public class Cvlc01Controller extends ApplicationController { FimsPrintOption printOption = new FimsPrintOption(); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); diff --git a/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java b/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java index 65e7afb7..626cae61 100644 --- a/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java +++ b/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java @@ -10,7 +10,6 @@ import cokr.xit.base.file.FileInfo; import cokr.xit.fims.excl.LevyExclQuery; import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.excl.service.OpnnSbmsnService; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.data.DataObject; @@ -31,10 +30,6 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm @Resource(name = "opnnSbmsnBean") protected OpnnSbmsnBean opnnSbmsnBean; - /* Bean */ - @Resource(name="ogdpBean") - protected OgdpBean ogdpBean; - @Override public List getOpnnSbmsnList(LevyExclQuery req) { return opnnSbmsnBean.getOpnnSbmsnList(req); diff --git a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java index 257269e4..1e5d16d8 100644 --- a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java +++ b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java @@ -15,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import cokr.xit.applib.Print; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -35,7 +36,6 @@ import cokr.xit.fims.excl.OpnnDlbrMbr; import cokr.xit.fims.excl.OpnnSbmsn; import cokr.xit.fims.excl.service.OpnnDlbrMbrService; import cokr.xit.fims.excl.service.OpnnSbmsnService; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.task.Task; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -89,8 +89,8 @@ public class Excl02Controller extends ApplicationController { @Resource(name="stngBean") private StngBean stngBean; - @Resource(name="ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; /**의견제출 대장 관리 메인화면(fims/excl/excl02/010-main)을 연다. * @@ -374,7 +374,7 @@ public class Excl02Controller extends ApplicationController { @RequestMapping(name="의견제출 심의의결서 출력", value=METHOD_URL.makeDlbrDecsnFileFromHwpFormat) public ModelAndView makeDlbrDecsnFileFromHwpFormat(LevyExclQuery req) { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); diff --git a/src/main/java/cokr/xit/fims/mngt/dao/FimsOgdpMapper.java b/src/main/java/cokr/xit/fims/mngt/dao/FimsOgdpMapper.java new file mode 100644 index 00000000..bda5b87e --- /dev/null +++ b/src/main/java/cokr/xit/fims/mngt/dao/FimsOgdpMapper.java @@ -0,0 +1,47 @@ +package cokr.xit.fims.mngt.dao; + +import java.util.List; +import java.util.Map; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.fims.mngt.FimsDepartment; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +@Mapper("fimsOgdpMapper") +public interface FimsOgdpMapper extends AbstractMapper { + + default DataObject selectDeptInfo(OgdpQuery req) { + // 기본 정렬 + if (req.getOrderBy() == null) { + req.setOrderBy("D.DEPT_CD DESC"); + } + + List depts = selectDepts(req); + + return !depts.isEmpty() ? depts.get(0) : null; + }; + + /**지정한 조건에 따라 부서 객체들을 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 목록 + */ + List selectDepts(OgdpQuery req); + + List selectDeptList(OgdpQuery query); + + default boolean insertDept(FimsDepartment dept) { + return dept != null && insertDept(params().set("dept", dept)) == 1; + }; + + int insertDept(Map params); + + default boolean updateDept(FimsDepartment dept) { + return dept != null && updateDept(params().set("dept", dept)) == 1; + } + + int updateDept(Map params); + +} diff --git a/src/main/java/cokr/xit/fims/mngt/service/OgdpService.java b/src/main/java/cokr/xit/fims/mngt/service/OgdpService.java deleted file mode 100644 index 7d4e7d81..00000000 --- a/src/main/java/cokr/xit/fims/mngt/service/OgdpService.java +++ /dev/null @@ -1,61 +0,0 @@ -package cokr.xit.fims.mngt.service; - -import java.util.List; - -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FimsDepartment; -import cokr.xit.fims.mngt.FimsSigungu; -import cokr.xit.foundation.data.DataObject; - -public interface OgdpService { - - String updateSgg(FimsSigungu sgg); - - DataObject getSggInfo(CmmnQuery req); - - - /**지정한 조건에 따라 부서 목록을 조회하여 반환한다. - * @param req 부서 정보 조회 조건 - * @return 부서 목록 - */ - List getDeptList(CmmnQuery req); - - /**지정한 조건에 따라 부서 객체들을 반환한다. - * @param req 부서 정보 조회 조건 - * @return 부서 객체 목록 - */ - List getDepts(CmmnQuery req); - - /**지정한 조건에 따라 부서 객체를 반환한다. - * @param req 부서 조회 조건 - * @return 부서 객체 - */ - DataObject getDeptInfo(CmmnQuery req); - - /**부서 정보를 등록한다. - * @param dept 부서 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - String create(FimsDepartment dept); - - /**부서 정보를 수정한다. - * @param dept 부서 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - String update(FimsDepartment dept); - - /**부서 정보를 삭제한다. - * @param deptCds 부서 코드 목록 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - String remove(String... deptCds); -} diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java new file mode 100644 index 00000000..378cb780 --- /dev/null +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java @@ -0,0 +1,38 @@ +package cokr.xit.fims.mngt.service.bean; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; +import cokr.xit.fims.mngt.FimsDepartment; +import cokr.xit.fims.mngt.dao.FimsOgdpMapper; +import cokr.xit.foundation.data.DataObject; + +@Component("fimsOgdpBean") +public class FimsOgdpBean extends CmmnOgdpBean { + + @Resource(name = "fimsOgdpMapper") + private FimsOgdpMapper fimsOgdpMapper; + + public DataObject getDeptInfo(OgdpQuery query) { + return fimsOgdpMapper.selectDeptInfo(query); + } + + public List getDeptList(OgdpQuery query) { + return fimsOgdpMapper.selectDeptList(query); + } + + + public boolean createFimsDept(FimsDepartment dept) { + return fimsOgdpMapper.insertDept(dept); + } + + public boolean updateFimsDept(FimsDepartment dept) { + return fimsOgdpMapper.updateDept(dept); + } + +} diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpServiceBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpServiceBean.java new file mode 100644 index 00000000..b7dafba6 --- /dev/null +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpServiceBean.java @@ -0,0 +1,53 @@ +package cokr.xit.fims.mngt.service.bean; + + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.service.OgdpService; +import cokr.xit.base.user.Department; +import cokr.xit.fims.mngt.FimsDepartment; +import cokr.xit.foundation.component.AbstractServiceBean; +import cokr.xit.foundation.data.DataObject; + + +@Service("fimsOgdpService") +public class FimsOgdpServiceBean extends AbstractServiceBean implements OgdpService { + + @Resource(name="fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; + + @Override + public List getDeptList(OgdpQuery query) { + return fimsOgdpBean.getDeptList(query); + } + + @Override + public DataObject getDeptInfo(OgdpQuery query) { + return fimsOgdpBean.getDeptInfo(query); + } + + + @Override + public String create(Department dept) { + if(dept instanceof FimsDepartment) { + FimsDepartment fdept = (FimsDepartment) dept; + return fimsOgdpBean.createFimsDept(fdept) ? "[S]" : "[F]"; + } + return "[F]"; + } + + @Override + public String update(Department dept) { + if(dept instanceof FimsDepartment) { + FimsDepartment fdept = (FimsDepartment) dept; + return fimsOgdpBean.updateFimsDept(fdept) ? "[S]" : "[F]"; + } + return "[F]"; + } + +} diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/OgdpBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/OgdpBean.java deleted file mode 100644 index 0cca739f..00000000 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/OgdpBean.java +++ /dev/null @@ -1,133 +0,0 @@ -package cokr.xit.fims.mngt.service.bean; - -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Component; - -import cokr.xit.base.user.dao.UserMapper; -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FimsDepartment; -import cokr.xit.fims.mngt.FimsSigungu; -import cokr.xit.fims.mngt.dao.OgdpMapper; -import cokr.xit.foundation.UserInfo; -import cokr.xit.foundation.component.AbstractBean; -import cokr.xit.foundation.data.DataObject; - -@Component("ogdpBean") -public class OgdpBean extends AbstractBean { - - @Resource(name = "ogdpMapper") - private OgdpMapper ogdpMapper; - - @Resource(name = "userMapper") - private UserMapper userMapper; - - /**userInfo 객체에 해당 사용자가 소속된 시군구,기관,부서 정보를 저장한다. - * @param userInfo 사용자 정보 - * @return - */ - public void initUserInfo(UserInfo userInfo) { - - DataObject ogdpInfo = ogdpMapper.selectOgdpInfoOfUser(userInfo.getId()); - - Map infoMap = userInfo.getInfo(); - if(ogdpInfo == null) { - infoMap.put("sggCd", ""); - infoMap.put("sggNm", ""); - infoMap.put("instCd", ""); - infoMap.put("instNm", ""); - infoMap.put("deptCd", ""); - infoMap.put("deptNm", ""); - } else { - infoMap.put("sggCd", ogdpInfo.string("SGG_CD")); - infoMap.put("sggNm", ogdpInfo.string("SGG_NM")); - infoMap.put("instCd", ogdpInfo.string("INST_CD")); - infoMap.put("instNm", ogdpInfo.string("INST_NM")); - infoMap.put("deptCd", ogdpInfo.string("DEPT_CD")); - infoMap.put("deptNm", ogdpInfo.string("DEPT_NM")); - } - - userInfo.setInfo(infoMap); - } - - /**시군구 정보를 수정한다. - * @param sgg 시군구 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - public boolean updateSgg(FimsSigungu sgg) { - return ogdpMapper.updateSgg(sgg); - } - - /**지정한 조건에 따라 시군구 객체를 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 - */ - public DataObject getSggInfo(CmmnQuery req) { - return ogdpMapper.selectSggInfo(req); - } - - - - /**지정한 조건에 따라 부서 목록을 조회하여 반환한다. - * @param req 부서 조회 조건 - * @return 부서 목록 - */ - public List getDeptList(CmmnQuery req) { - return ogdpMapper.selectDeptList(req); - } - - /**지정한 조건에 따라 부서 객체들을 반환한다. - * @param req 부서 조회 조건 - * @return 부서 객체 목록 - */ - public List getDepts(CmmnQuery req) { - return ogdpMapper.selectDepts(req); - } - - /**지정한 조건에 따라 부서 객체를 반환한다. - * @param req 부서 조회 조건 - * @return 부서 객체 - */ - public DataObject getDeptInfo(CmmnQuery req) { - return ogdpMapper.selectDeptInfo(req); - } - - /**부서 정보를 등록한다. - * @param dept 부서 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - public boolean create(FimsDepartment dept) { - return ogdpMapper.insert(dept); - } - - /**부서 정보를 수정한다. - * @param dept 부서 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - public boolean update(FimsDepartment dept) { - return ogdpMapper.update(dept); - } - - /**부서 정보를 삭제한다. - * @param deptCds 부서 코드 목록 - * @return 저장 여부 - *
      • 저장됐으면 true
      • - *
      • 그렇지 않으면 false
      • - *
      - */ - public boolean remove(String... deptCds) { - return ogdpMapper.setStatus("N", deptCds) > 0 ? true : false; - } -} diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/OgdpServiceBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/OgdpServiceBean.java deleted file mode 100644 index 4e5e7e3a..00000000 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/OgdpServiceBean.java +++ /dev/null @@ -1,68 +0,0 @@ -package cokr.xit.fims.mngt.service.bean; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FimsDepartment; -import cokr.xit.fims.mngt.FimsSigungu; -import cokr.xit.fims.mngt.service.OgdpService; -import cokr.xit.foundation.component.AbstractServiceBean; -import cokr.xit.foundation.data.DataObject; - -@Service("ogdpService") -public class OgdpServiceBean extends AbstractServiceBean implements OgdpService { - - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; - - @Override - public String updateSgg(FimsSigungu sgg) { - return ogdpBean.updateSgg(sgg) ? "[S]" : "[F]"; - } - - @Override - public DataObject getSggInfo(CmmnQuery req) { - return ogdpBean.getSggInfo(req); - } - - - @Override - public List getDeptList(CmmnQuery req) { - return ogdpBean.getDeptList(req); - } - - @Override - public List getDepts(CmmnQuery req) { - return ogdpBean.getDepts(req); - } - - @Override - public DataObject getDeptInfo(CmmnQuery req) { - return ogdpBean.getDeptInfo(req); - } - - @Override - public String create(FimsDepartment dept) { - return ogdpBean.create(dept) ? "[S]" : "[F]"; - } - - @Override - public String update(FimsDepartment dept) { - return ogdpBean.update(dept) ? "[S]" : "[F]"; - } - - @Override - public String remove(String... deptCds) { - boolean result = ogdpBean.remove(deptCds); - if(result) { - return "[S]"; - } else { - return "[F]"; - } - - } -} diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java index 4a63ce33..894a02fd 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java @@ -8,11 +8,12 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; +import cokr.xit.applib.ogdp.dao.DefaultOgdpMapper; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.mngt.Ntc; import cokr.xit.fims.mngt.NtcQuery; -import cokr.xit.fims.mngt.dao.OgdpMapper; import cokr.xit.fims.mngt.service.NtcService; import cokr.xit.foundation.data.DataObject; @@ -40,8 +41,11 @@ public class Mngt01Controller extends ApplicationController { @Resource(name="ntcService") private NtcService ntcService; - @Resource(name = "ogdpMapper") - private OgdpMapper ogdpMapper; + @Resource(name="cmmnOgdpMapper") + CmmnOgdpMapper cmmnOgdpMapper; + + @Resource(name = "defaultOgdpMapper") + private DefaultOgdpMapper defaultOgdpMapper; /** 공지사항 메인화면을 연다. * @return fims/mngt/mngt01010-main @@ -96,7 +100,7 @@ public class Mngt01Controller extends ApplicationController { } mav.addObject("ntcInfo", json ? info : toJson(info)); - List allSggList = ogdpMapper.selectAllSggList(); + List allSggList = cmmnOgdpMapper.selectAllSggList(); mav.addObject("sggList", allSggList); return mav; diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java index 4927deda..613e6124 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -13,15 +13,15 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.OgdpSigungu; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.service.StngService; -import cokr.xit.fims.mngt.FimsSigungu; import cokr.xit.fims.mngt.Task; import cokr.xit.fims.mngt.VltnQuery; -import cokr.xit.fims.mngt.dao.OgdpMapper; -import cokr.xit.fims.mngt.service.OgdpService; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.mngt.service.bean.VltnBean; import cokr.xit.foundation.UserInfo; @@ -49,16 +49,12 @@ public class Mngt03Controller extends ApplicationController { ; } - /** 소속 정보 서비스 */ - @Resource(name = "ogdpService") - private OgdpService ogdpService; - /** 소속 정보 Bean */ - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; - @Resource(name = "ogdpMapper") - private OgdpMapper ogdpMapper; + @Resource(name="cmmnOgdpMapper") + CmmnOgdpMapper cmmnOgdpMapper; /** 설정 정보 서비스 */ @Resource(name = "stngService") @@ -88,7 +84,7 @@ public class Mngt03Controller extends ApplicationController { mav.setViewName("fims/mngt/select-sgg"); mav.addObject("pageName", "selectSgg"); - List sggList = ogdpMapper.selectAllSggList(); + List sggList = cmmnOgdpMapper.selectAllSggList(); mav.addObject("sggList", sggList); } else { @@ -100,7 +96,7 @@ public class Mngt03Controller extends ApplicationController { } else { mav.setViewName("fims/mngt/mngt03010-main"); mav.addObject("pageName", "mngt03010"); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); mav.addObject("sggCd", userInfo.getInfo().get("sggCd")); } @@ -112,9 +108,9 @@ public class Mngt03Controller extends ApplicationController { * @return jsonView */ @RequestMapping(name="시군구 조회", value=METHOD_URL.getSggInfo) - public ModelAndView getSggInfo(CmmnQuery req) { + public ModelAndView getSggInfo(OgdpQuery req) { ModelAndView mav = new ModelAndView("jsonView"); - DataObject sggInfo = ogdpService.getSggInfo(req); + DataObject sggInfo = cmmnOgdpBean.getSggInfo(req); mav.addObject("sggInfo", sggInfo); return mav; } @@ -147,7 +143,7 @@ public class Mngt03Controller extends ApplicationController { * } */ @RequestMapping(name="시군구 정보 수정", value=METHOD_URL.updateSgg) - public ModelAndView updateSgg(FimsSigungu sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) { + public ModelAndView updateSgg(OgdpSigungu sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) { ModelAndView mav = new ModelAndView("jsonView"); String sggCd = sgg.getSggID(); @@ -167,11 +163,8 @@ public class Mngt03Controller extends ApplicationController { sgg.setOfficialSealFilepath(newOffcs.get("filePath")); sgg.setOfficialSealFilename(newOffcs.get("fileName")); } - boolean saved = false; - String rtnMsg = ogdpService.updateSgg(sgg); - if(rtnMsg.contains("[S]")) { - saved = true; - } + boolean saved = cmmnOgdpBean.updateSgg(sgg); + mav.addObject("saved", saved); return mav; } diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java index eea46f4a..e76e5af2 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java @@ -8,12 +8,13 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.dao.CmmnOgdpMapper; +import cokr.xit.applib.ogdp.service.OgdpService; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.mngt.FimsDepartment; -import cokr.xit.fims.mngt.dao.OgdpMapper; -import cokr.xit.fims.mngt.service.OgdpService; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.foundation.data.DataObject; /**부서관리 서비스 웹 컨트롤러.
      @@ -37,16 +38,17 @@ public class Mngt04Controller extends ApplicationController { ; } + /** 소속 정보 서비스 */ - @Resource(name = "ogdpService") - private OgdpService ogdpService; + @Resource(name = "fimsOgdpService") + private OgdpService fimsOgdpService; + + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; - /** 소속 정보 Bean */ - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpMapper") + private CmmnOgdpMapper cmmnOgdpMapper; - @Resource(name = "ogdpMapper") - private OgdpMapper ogdpMapper; /** 부서관리 메인화면을 연다. * @return fims/mngt/mngt04010-main @@ -58,7 +60,7 @@ public class Mngt04Controller extends ApplicationController { mav.setViewName("fims/mngt/mngt04010-main"); mav.addObject("pageName", "mngt04010"); - List allSggList = ogdpMapper.selectAllSggList(); + List allSggList = cmmnOgdpMapper.selectAllSggList(); mav.addObject("sggList", allSggList); @@ -71,11 +73,11 @@ public class Mngt04Controller extends ApplicationController { * @return jsonView */ @RequestMapping(name="부서 목록 조회", value=METHOD_URL.getDeptList) - public ModelAndView getDeptList(CmmnQuery query) { + public ModelAndView getDeptList(OgdpQuery query) { setFetchSize(query); - return setCollectionInfo(new ModelAndView("jsonView"), ogdpService.getDeptList(query),"",""); + return setCollectionInfo(new ModelAndView("jsonView"), fimsOgdpService.getDeptList(query),"",""); } @@ -87,11 +89,11 @@ public class Mngt04Controller extends ApplicationController { * } */ @RequestMapping(name="부서 상세 조회", value=METHOD_URL.getDeptInfo) - public ModelAndView getDeptInfo(CmmnQuery query) { + public ModelAndView getDeptInfo(OgdpQuery query) { DataObject deptInfo = new DataObject(); if(!ifEmpty(query.getDeptCd(), ()->"").equals("")) { - deptInfo = ogdpService.getDeptInfo(query); + deptInfo = fimsOgdpService.getDeptInfo(query); } else { deptInfo = null; } @@ -114,11 +116,8 @@ public class Mngt04Controller extends ApplicationController { @RequestMapping(name="부서 삭제", value=METHOD_URL.removeDept) public ModelAndView removeDept(String... deptCds) { ModelAndView mav = new ModelAndView("jsonView"); - boolean saved = false; - String rtnMsg = ogdpService.remove(deptCds); - if(rtnMsg.contains("[S]")) { - saved = true; - } + + boolean saved = cmmnOgdpBean.remove(deptCds); mav.addObject("saved", saved); return mav; @@ -135,7 +134,7 @@ public class Mngt04Controller extends ApplicationController { public ModelAndView createDept(FimsDepartment dept) { ModelAndView mav = new ModelAndView("jsonView"); boolean saved = false; - String rtnMsg = ogdpService.create(dept); + String rtnMsg = fimsOgdpService.create(dept); if(rtnMsg.contains("[S]")) { saved = true; } @@ -155,7 +154,7 @@ public class Mngt04Controller extends ApplicationController { public ModelAndView updateDept(FimsDepartment dept) { ModelAndView mav = new ModelAndView("jsonView"); boolean saved = false; - String rtnMsg = ogdpService.update(dept); + String rtnMsg = fimsOgdpService.update(dept); if(rtnMsg.contains("[S]")) { saved = true; } diff --git a/src/main/java/cokr/xit/fims/nxrp/service/bean/NisIndivBean.java b/src/main/java/cokr/xit/fims/nxrp/service/bean/NisIndivBean.java index 40b101fc..c36167de 100644 --- a/src/main/java/cokr/xit/fims/nxrp/service/bean/NisIndivBean.java +++ b/src/main/java/cokr/xit/fims/nxrp/service/bean/NisIndivBean.java @@ -29,6 +29,7 @@ import org.springframework.stereotype.Component; import com.fasterxml.jackson.databind.ObjectMapper; +import cokr.xit.applib.ogdp.OgdpQuery; import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.service.bean.CodeBean; import cokr.xit.base.file.ZIP; @@ -42,7 +43,7 @@ import cokr.xit.fims.crdn.dao.CrdnInfoMapper; import cokr.xit.fims.crdn.dao.CrdnStngMapper; import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.mngt.dao.TaskMapper; -import cokr.xit.fims.mngt.service.bean.OgdpBean; +import cokr.xit.fims.mngt.service.bean.FimsOgdpBean; import cokr.xit.fims.nxrp.A01; import cokr.xit.fims.nxrp.A03Rqst; import cokr.xit.fims.nxrp.NisIndivQuery; @@ -110,8 +111,8 @@ public class NisIndivBean extends AbstractBean { protected StngBean stngBean; /** 부서 정보 DAO */ - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; /**지정한 조건에 따라 과태료 대장 단속 정보 등록 목록을 조회하여 반환한다. * @param req 과태료 대장 단속 정보 등록 조회 조건 @@ -144,7 +145,7 @@ public class NisIndivBean extends AbstractBean { DataObject userInfo = userBean.getUserInfo(currentUser().getId()); // 2. 부서 정보 - DataObject deptInfo = ogdpBean.getDeptInfo(new CmmnQuery().setDeptCd(userInfo.string("DEPT_CD"))); + DataObject deptInfo = fimsOgdpBean.getDeptInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD"))); // 3. 세외수입 과태료대장에 연계할 단속 정보를 조회 DataObject selectCrdnInfo = nisA01Mapper.selectCrdnInfo(req.getCrdnId()); @@ -346,7 +347,7 @@ public class NisIndivBean extends AbstractBean { DataObject userInfo = userBean.getUserInfo(currentUser().getId()); // 2. 부서 정보 - DataObject deptInfo = ogdpBean.getDeptInfo(new CmmnQuery().setDeptCd(userInfo.string("DEPT_CD"))); + DataObject deptInfo = fimsOgdpBean.getDeptInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD"))); // 3. 세외수입 과태료대장에 연계할 단속 정보를 조회 DataObject selectCrdnInfo = nisA01Mapper.selectCrdnInfo(req.getCrdnId()); diff --git a/src/main/java/cokr/xit/fims/sndb/service/bean/SvbtcServiceBean.java b/src/main/java/cokr/xit/fims/sndb/service/bean/SvbtcServiceBean.java index 17b8be59..f186b159 100644 --- a/src/main/java/cokr/xit/fims/sndb/service/bean/SvbtcServiceBean.java +++ b/src/main/java/cokr/xit/fims/sndb/service/bean/SvbtcServiceBean.java @@ -6,7 +6,6 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.sndb.SndbQuery; import cokr.xit.fims.sndb.Svbtc; import cokr.xit.fims.sndb.service.SvbtcService; @@ -30,10 +29,6 @@ public class SvbtcServiceBean extends AbstractServiceBean implements SvbtcServic @Resource(name = "svbtcBean") private SvbtcBean svbtcBean; - /* Bean */ - @Resource(name="ogdpBean") - protected OgdpBean ogdpBean; - @Override public List getSvbtcList(SndbQuery req) { return svbtcBean.getSvbtcList(req); diff --git a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java index c077fe5d..31eba02b 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import cokr.xit.applib.Print; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -36,7 +37,6 @@ import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.xls.FormatMaker; import cokr.xit.fims.cmmn.xls.StyleMaker; import cokr.xit.fims.crdn.Crdn; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.sndb.SndbQuery; import cokr.xit.fims.sndb.Sndng; @@ -153,8 +153,8 @@ public class Sndb01Controller extends ApplicationController { @Resource(name="fileBean") private FileBean fileBean; - @Resource(name="ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @Resource(name="svbtcBean") private SvbtcBean svbtcBean; @@ -1657,7 +1657,7 @@ public class Sndb01Controller extends ApplicationController { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -1866,7 +1866,7 @@ public class Sndb01Controller extends ApplicationController { Print print = new Print(); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); print.setPrintRequestUserInfo(userInfo); //출력물 기본 설정 diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java index ab4bf32e..4b0818a1 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/IntegrationSearchServiceBean.java @@ -10,7 +10,6 @@ import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.fims.cmmn.dao.OtptStngMapper; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.crdn.dao.CrdnListMapper; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.dao.IntegrationSearchMapper; import cokr.xit.fims.sprt.service.IntegrationSearchService; @@ -34,9 +33,6 @@ public class IntegrationSearchServiceBean extends AbstractServiceBean implements @Resource(name="integrationSearchBean") protected IntegrationSearchBean integrationSearchBean; - @Resource(name="ogdpBean") - protected OgdpBean ogdpBean; - @Resource(name="crdnListMapper") protected CrdnListMapper crdnListMapper; diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index 34d1da51..48bf31ae 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import cokr.xit.applib.Print; +import cokr.xit.applib.ogdp.service.bean.CmmnOgdpBean; import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -48,7 +49,6 @@ import cokr.xit.fims.cmmn.xls.StyleMaker; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.CrdnListMapper; -import cokr.xit.fims.mngt.service.bean.OgdpBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.sndb.SndbQuery; import cokr.xit.fims.sndb.Sndng; @@ -127,8 +127,8 @@ public class Sprt01Controller extends ApplicationController { @Resource(name = "taskBean") private TaskBean taskBean; - @Resource(name = "ogdpBean") - private OgdpBean ogdpBean; + @Resource(name = "cmmnOgdpBean") + private CmmnOgdpBean cmmnOgdpBean; @Resource(name = "mediaBean") private MediaBean mediaBean; @@ -457,7 +457,7 @@ public class Sprt01Controller extends ApplicationController { FimsPrintOption printOption = new FimsPrintOption(); printOption.setPrivateInfoYn(privateInfoYn); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -483,7 +483,7 @@ public class Sprt01Controller extends ApplicationController { FimsPrintOption printOption = new FimsPrintOption(); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -558,7 +558,7 @@ public class Sprt01Controller extends ApplicationController { printOption.setGlobalVariable(globalVariable); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -584,7 +584,7 @@ public class Sprt01Controller extends ApplicationController { DataObject deptStngInfo = stngBean.getStng("dept"); UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -624,7 +624,7 @@ public class Sprt01Controller extends ApplicationController { public ModelAndView makeRcvmtConfirmFileFromHwpFormat(String... crdnIds) { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -662,7 +662,7 @@ public class Sprt01Controller extends ApplicationController { @RequestMapping(name="사전통지서 pdf 파일 생성", value=METHOD_URL.makeAdvntcePdf) public ModelAndView makeAdvntcePdf(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); @@ -782,7 +782,7 @@ public class Sprt01Controller extends ApplicationController { @RequestMapping(name="사전통지서 외주 파일 생성", value=METHOD_URL.makeAdvntceOutsourcing) public ModelAndView makeAdvntceOutsourcing(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); @@ -900,7 +900,7 @@ public class Sprt01Controller extends ApplicationController { public ModelAndView makeNhtPdf(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); @@ -1022,7 +1022,7 @@ public class Sprt01Controller extends ApplicationController { @RequestMapping(name="고지서 외주 파일 생성", value=METHOD_URL.makeNhtOutsourcing) public ModelAndView makeNhtOutsourcing(String[] crdnIds, Sndng sndng, FimsPrintOption printOption) { UserInfo userInfo = currentUser(); - ogdpBean.initUserInfo(userInfo); + cmmnOgdpBean.initUserInfo(userInfo); sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); diff --git a/src/main/resources/sql/mapper/fims/mngt/ogdp-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/fims-ogdp-mapper.xml similarity index 53% rename from src/main/resources/sql/mapper/fims/mngt/ogdp-mapper.xml rename to src/main/resources/sql/mapper/fims/mngt/fims-ogdp-mapper.xml index 3a6588d1..e49da7ec 100644 --- a/src/main/resources/sql/mapper/fims/mngt/ogdp-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/fims-ogdp-mapper.xml @@ -1,202 +1,6 @@ - - - - - - - - - - - - - - -SELECT S.SGG_CD - , S.SGG_NM - , S.INST_SE_CD - , S.INST_CD - , S.INST_NM - , (CASE - WHEN S.INST_DADDR IS NULL OR S.INST_DADDR = '' - THEN S.INST_ADDR - ELSE CONCAT(S.INST_ADDR,' ',S.INST_DADDR) - END) AS INST_FULL_ADDR - , S.INST_ADDR - , S.INST_DADDR - , S.INST_ZIP - , S.SYMBOL_FILE_PATH - , S.SYMBOL_FILE_NM - , S.LOGO_FILE_PATH - , S.LOGO_FILE_NM - , S.OFFCS_FILE_PATH - , S.OFFCS_FILE_NM - FROM TB_SGG S - - - - - - - -/* 시군구 설정정보 수정 (ogdpMapper.updateSgg) */ -UPDATE TB_SGG - SET MDFCN_DT = - , MDFR = #{sgg.modifiedBy} - , INST_ZIP = #{sgg.instituteZipCode} - , INST_ADDR = #{sgg.instAddress} - , INST_DADDR = #{sgg.instDetailAddress} - - , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} - , SYMBOL_FILE_NM = #{sgg.symbolFilename} - - - , LOGO_FILE_PATH = #{sgg.logoFilepath} - , LOGO_FILE_NM = #{sgg.logoFilename} - - - , OFFCS_FILE_PATH = #{sgg.officialSealFilepath} - , OFFCS_FILE_NM = #{sgg.officialSealFilename} - - WHERE SGG_CD = #{sgg.sggID} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SELECT D.DEPT_CD @@ -238,26 +42,8 @@ UPDATE TB_SGG FROM TB_DEPT D - - + + -/* 부서 등록(ogdpMapper.insertDept) */ +/* 부서 등록(fimsOgdpMapper.insertDept) */ INSERT INTO TB_DEPT ( DEPT_CD @@ -349,7 +153,7 @@ UPDATE TB_SGG -/* 부서 수정(ogdpMapper.updateDept) */ +/* 부서 수정(fimsOgdpMapper.updateDept) */ UPDATE TB_DEPT SET SGG_CD = #{dept.sggID} , INST_CD = #{dept.instCode} @@ -383,14 +187,4 @@ UPDATE TB_SGG AND USE_YN = 'Y' - -/* 부서 사용 여부 변경(ogdpMapper.setStatus) */ - UPDATE TB_DEPT - SET USE_YN = #{useYn} - , MDFCN_DT = - , MDFR = #{currentUser.id} - WHERE DEPT_CD IN ( #{deptCd} ) - - - \ No newline at end of file diff --git a/src/main/resources/sql/mapper/ogdp/cmmn-ogdp-mapper.xml b/src/main/resources/sql/mapper/ogdp/cmmn-ogdp-mapper.xml new file mode 100644 index 00000000..964b211b --- /dev/null +++ b/src/main/resources/sql/mapper/ogdp/cmmn-ogdp-mapper.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + +SELECT S.SGG_CD + , S.SGG_NM + , S.INST_SE_CD + , S.INST_CD + , S.INST_NM + , (CASE + WHEN S.INST_DADDR IS NULL OR S.INST_DADDR = '' + THEN S.INST_ADDR + ELSE CONCAT(S.INST_ADDR,' ',S.INST_DADDR) + END) AS INST_FULL_ADDR + , S.INST_ADDR + , S.INST_DADDR + , S.INST_ZIP + , S.SYMBOL_FILE_PATH + , S.SYMBOL_FILE_NM + , S.LOGO_FILE_PATH + , S.LOGO_FILE_NM + , S.OFFCS_FILE_PATH + , S.OFFCS_FILE_NM + FROM TB_SGG S + + + + + + + +/* 시군구 설정정보 수정 (cmmnOgdpMapper.updateSgg) */ +UPDATE TB_SGG + SET MDFCN_DT = + , MDFR = #{sgg.modifiedBy} + , INST_ZIP = #{sgg.instituteZipCode} + , INST_ADDR = #{sgg.instAddress} + , INST_DADDR = #{sgg.instDetailAddress} + + , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} + , SYMBOL_FILE_NM = #{sgg.symbolFilename} + + + , LOGO_FILE_PATH = #{sgg.logoFilepath} + , LOGO_FILE_NM = #{sgg.logoFilename} + + + , OFFCS_FILE_PATH = #{sgg.officialSealFilepath} + , OFFCS_FILE_NM = #{sgg.officialSealFilename} + + WHERE SGG_CD = #{sgg.sggID} + + + +/* 부서 사용 여부 변경(cmmnOgdpMapper.setStatus) */ + UPDATE TB_DEPT + SET USE_YN = #{useYn} + , MDFCN_DT = + , MDFR = #{currentUser.id} + WHERE DEPT_CD IN ( #{deptCd} ) + + + + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/ogdp/default-ogdp-mapper.xml b/src/main/resources/sql/mapper/ogdp/default-ogdp-mapper.xml new file mode 100644 index 00000000..e374c6e0 --- /dev/null +++ b/src/main/resources/sql/mapper/ogdp/default-ogdp-mapper.xml @@ -0,0 +1,108 @@ + + + + + + + SELECT D.DEPT_CD + , D.SGG_CD + , (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = D.SGG_CD) AS SGG_NM + , D.INST_CD + , (SELECT INST_NM FROM TB_SGG WHERE INST_CD = D.INST_CD) AS INST_NM + , D.DEPT_NM + , D.DEPT_TELNO + , D.DEPT_FXNO + , D.USE_YN + , GET_CODE_NM('CMN003', D.USE_YN) AS USE_YN_NM + , D.REG_DT + , D.RGTR + , D.MDFCN_DT + , D.MDFR + FROM TB_DEPT D + + + + + + + +/* 부서 등록(defaultOgdpMapper.insertDept) */ + INSERT + INTO TB_DEPT ( + DEPT_CD + , SGG_CD + , INST_CD + , DEPT_NM + , DEPT_TELNO + , DEPT_FXNO + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + ) VALUES ( + #{dept.deptID} + , #{dept.sggID} + , #{dept.instCode} + , #{dept.name} + , #{dept.telno} + , #{dept.faxno} + , 'Y' + , + , #{dept.createdBy} + , + , #{dept.modifiedBy} + ) + + + +/* 부서 수정(defaultOgdpMapper.updateDept) */ + UPDATE TB_DEPT + SET SGG_CD = #{dept.sggID} + , INST_CD = #{dept.instCode} + , DEPT_NM = #{dept.name} + , DEPT_TELNO = #{dept.telno} + , DEPT_FXNO = #{dept.faxno} + , MDFCN_DT = + , MDFR = #{dept.modifiedBy} + WHERE DEPT_CD = #{dept.deptID} + AND USE_YN = 'Y' + + + + + \ No newline at end of file