diff --git a/src/main/java/cokr/xit/applib/SQLUtil.java b/src/main/java/cokr/xit/applib/SQLUtil.java new file mode 100644 index 00000000..352849c3 --- /dev/null +++ b/src/main/java/cokr/xit/applib/SQLUtil.java @@ -0,0 +1,39 @@ +package cokr.xit.applib; + +public class SQLUtil { + + public static final String SCRIPT_START = ""; + + public static final String now = """ + DATE_FORMAT(CURRENT_TIMESTAMP, '%Y%m%d%H%i%s') + TO_CHAR(CURRENT_TIMESTAMP, 'YYYYMMDDHH24MISS') + """; + + public static final String sortBy = """ + ORDER BY ${orderBy} + """; + + public static final String orderBy = """ + """ + +sortBy+""" + """; + + public static final String pagingPrefix = """ + + SELECT QROWS.* + FROM ( + SELECT ROW_NUMBER() OVER(""" + +sortBy+""" + ) ROW_NUM + , COUNT(*) OVER() TOT_CNT + , QBODY.* + FROM ( + """; + + public static final String pagingSuffix = """ + ) QBODY + ) QROWS + WHERE ROW_NUM BETWEEN ((#{pageNum} - 1) * #{fetchSize}) + 1 AND (#{pageNum} * #{fetchSize}) + """; +} diff --git a/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java b/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java index 91d3defe..eaff4490 100644 --- a/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java +++ b/src/main/java/cokr/xit/applib/ogdp/OgdpQuery.java @@ -5,12 +5,15 @@ 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; // 삭제 여부 + private String selectAdd; + public String getSggCd() { return ifEmpty(sggCd, () -> null); } @@ -55,4 +58,13 @@ public class OgdpQuery extends QueryRequest { this.delYn = delYn; return self(); } + + public String getSelectAdd() { + return ifEmpty(selectAdd, () -> null); + } + + public T setSelectAdd(String selectAdd) { + this.selectAdd = selectAdd; + return self(); + } } diff --git a/src/main/java/cokr/xit/applib/ogdp/dao/CmmnOgdpMapper.java b/src/main/java/cokr/xit/applib/ogdp/dao/CmmnOgdpMapper.java deleted file mode 100644 index f4668190..00000000 --- a/src/main/java/cokr/xit/applib/ogdp/dao/CmmnOgdpMapper.java +++ /dev/null @@ -1,120 +0,0 @@ -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.applib.ogdp.OgdpSigungu; -import cokr.xit.foundation.component.AbstractMapper; -import cokr.xit.foundation.data.DataObject; - -@Mapper("cmmnOgdpMapper") -public interface CmmnOgdpMapper extends AbstractMapper { - - /**모든 기관,부서 목록을 반환한다.
- * @param - * @return 기관,부서 목록 - */ - List selectAllOgdpList(); - - /**사용가능한 기관,부서 목록을 반환한다.
- * @param stringMap - * @param - * @return 기관,부서 목록 - */ - List selectAbleOgdpList(Map params); - - /**사용자의 시군구코드,시군구명,기관코드,기관명,부서코드,부서명을 반환한다.
- * @param 사용자ID - * @return 시군구코드,시군구명,기관코드,기관명,부서코드,부서명 - */ - DataObject selectOgdpInfoOfUser(String userId); - - /**모든 기관 목록을 반환한다.
- * @param - * @return 기관 목록 - */ - List selectAllInstList(); - - /**모든 시군구 목록을 반환한다.
- * @param - * @return 시군구 목록 - */ - List selectAllSggList(); - - /**부서코드에 매칭되는 시군구코드를 반환한다.
- * @param deptCd 부서코드 - * @return 시군구코드 - */ - String selectSggCdByDeptCd(String deptCd); - - /**시군구 정보를 수정한다. - * @param params 파라미터 - *
  • "sgg" - 시군구 정보
  • - *
  • "currentUser" - 현재 접속한 사용자
  • - *
- * @return 저장된 정보수 - */ - int updateSgg(Map params); - - /**시군구 정보를 수정한다. - * @param sgg 시군구 - * @return 저장 여부 - *
  • 저장됐으면 true
  • - *
  • 그렇지 않으면 false
  • - *
- */ - default boolean updateSgg(OgdpSigungu sgg) { - return sgg != null && updateSgg(params().set("sgg", sgg)) == 1; - } - - /**지정한 조건에 따라 시군구 객체들을 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 목록 - */ - List selectSggs(OgdpQuery req); - - /**지정한 조건에 따라 시군구 객체를 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 - */ - default DataObject selectSggInfo(OgdpQuery req) { - - - // 사용 여부 확인 - if (req.getUseYn() == null) { - req.setUseYn("Y"); - } - // 기본 정렬 - if (req.getOrderBy() == null) { - req.setOrderBy("S.SGG_CD DESC"); - } - - List sggs = selectSggs(req); - - return (!sggs.isEmpty() || sggs.size() == 1) ? sggs.get(0) : null; - } - - /**부서 사용여부를 변경한다. - * @param params 파라미터 - *
  • "deptCds" - 부서 코드 목록
  • - *
  • "currentUser" - 현재 접속한 사용자
  • - *
- * @return 저장된 정보수 - */ - int setStatus(Map params); - - /**부서 사용여부를 변경한다. - * @param deptCds 부서 코드 목록 - * @return 저장된 정보 수 - */ - default int setStatus(String useYn, String... deptCds) { - DataObject params = params(); - params.set("useYn", useYn); - params.set("deptCds", deptCds); - 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 deleted file mode 100644 index 605aa467..00000000 --- a/src/main/java/cokr/xit/applib/ogdp/dao/DefaultOgdpMapper.java +++ /dev/null @@ -1,96 +0,0 @@ -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/dao/OgdpMapper.java b/src/main/java/cokr/xit/applib/ogdp/dao/OgdpMapper.java new file mode 100644 index 00000000..6494a66a --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/dao/OgdpMapper.java @@ -0,0 +1,466 @@ +package cokr.xit.applib.ogdp.dao; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.applib.SQLUtil; +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.OgdpSigungu; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +@Mapper("ogdpMapper") +public interface OgdpMapper extends AbstractMapper { + + /**모든 기관,부서 목록을 반환한다.
+ * @param + * @return 기관,부서 목록 + */ + @Select(SQLUtil.SCRIPT_START+""" + /* 전체 기관,부서 목록 조회(ogdpMapper.selectAllOgdpList) */ + SELECT CONCAT(A.INST_CD,'/',B.DEPT_CD) AS OGDP_CD + , CONCAT(A.INST_NM,' / ',B.DEPT_NM) AS OGDP_NM + , A.INST_CD + , A.INST_NM + , B.DEPT_CD + , B.DEPT_NM + , A.SGG_CD + , A.SGG_NM + FROM TB_SGG A + LEFT OUTER JOIN TB_DEPT B ON (A.INST_CD = B.INST_CD) + UNION + SELECT ('default/default') AS OGDP_CD + , CONCAT('기본 기관',' / ','기본 부서') AS OGDP_NM + , 'default' AS INST_CD + , '기본 기관' AS INST_NM + , 'default' AS DEPT_CD + , '기본 부서' AS DEPT_NM + , 'default' AS SGG_CD + , '기본 시군구' AS SGG_NM + FROM DUAL + """+SQLUtil.SCRIPT_END) + List selectAllOgdpList(); + + /**사용가능한 기관,부서 목록을 반환한다.
+ * @param stringMap + * @param + * @return 기관,부서 목록 + */ + @Select(SQLUtil.SCRIPT_START+""" + /* 사용가능한 기관,부서 목록 조회(ogdpMapper.selectAbleOgdpList) */ + SELECT CONCAT(A.INST_CD,'/',B.DEPT_CD) AS OGDP_CD + , CONCAT(A.INST_NM,' / ',B.DEPT_NM) AS OGDP_NM + , A.INST_CD + , A.INST_NM + , B.DEPT_CD + , B.DEPT_NM + , A.SGG_CD + , A.SGG_NM + FROM TB_SGG A + LEFT OUTER JOIN TB_DEPT B ON (A.INST_CD = B.INST_CD) + + + WHERE A.INST_CD = #{institute} + + + + WHERE A.SGG_CD = #{currentUser.user.orgID} + + + UNION + SELECT 'default/default' AS OGDP_CD + , CONCAT('기본 기관',' / ','기본 부서') AS OGDP_NM + , 'default' AS INST_CD + , '기본 기관' AS INST_NM + , 'default' AS DEPT_CD + , '기본 부서' AS DEPT_NM + , 'default' AS SGG_CD + , '기본 시군구' AS SGG_NM + FROM DUAL + + + + """+SQLUtil.SCRIPT_END) + List selectAbleOgdpList(Map params); + + + + /**사용자의 시군구코드,시군구명,기관코드,기관명,부서코드,부서명을 반환한다.
+ * @param 사용자ID + * @return 시군구코드,시군구명,기관코드,기관명,부서코드,부서명 + */ + @Select(SQLUtil.SCRIPT_START+""" + /* 사용자의 시군구,기관,부서 조회(ogdpMapper.selectOgdpInfoOfUser) */ + SELECT S.SGG_CD + , S.SGG_NM + , U.NSTT_CD AS INST_CD + , S.INST_NM + , U.DEPT_CD + , D.DEPT_NM + FROM TB_USER U + LEFT OUTER JOIN TB_SGG S ON (U.ORG_ID = S.SGG_CD) + LEFT OUTER JOIN TB_DEPT D ON (U.DEPT_CD = D.DEPT_CD) + WHERE U.USER_ID = #{userId} + """+SQLUtil.SCRIPT_END) + DataObject selectOgdpInfoOfUser(String userId); + + + /**모든 기관 목록을 반환한다.
+ * @param + * @return 기관 목록 + */ + @Select(SQLUtil.SCRIPT_START+""" + /* 모든 기관 조회(ogdpMapper.selectAllInstList) */ + SELECT INST_CD + , INST_NM + FROM TB_SGG + WHERE USE_YN = 'Y' + """+SQLUtil.SCRIPT_END) + List selectAllInstList(); + + /**모든 시군구 목록을 반환한다.
+ * @param + * @return 시군구 목록 + */ + @Select(SQLUtil.SCRIPT_START+""" + /* 모든 시군구 조회(ogdpMapper.selectAllSggList) */ + SELECT SGG_CD + , SGG_NM + FROM TB_SGG + WHERE USE_YN = 'Y' + """+SQLUtil.SCRIPT_END) + List selectAllSggList(); + + /**부서코드에 매칭되는 시군구코드를 반환한다.
+ * @param deptCd 부서코드 + * @return 시군구코드 + */ + @Select(SQLUtil.SCRIPT_START+""" + /* 부서에 따른 시군구코드 조회(ogdpMapper.selectSggCdByDeptCd) */ + SELECT SGG_CD + FROM TB_DEPT + WHERE DEPT_CD = #{deptCd} + """+SQLUtil.SCRIPT_END) + String selectSggCdByDeptCd(String deptCd); + + /**시군구 정보를 수정한다. + * @param sgg 시군구 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + default boolean updateSgg(OgdpSigungu sgg) { + return sgg != null && updateSgg(params().set("sgg", sgg)) == 1; + } + + /**시군구 정보를 수정한다. + * @param params 파라미터 + *
  • "sgg" - 시군구 정보
  • + *
  • "currentUser" - 현재 접속한 사용자
  • + *
+ * @return 저장된 정보수 + */ + @Update(SQLUtil.SCRIPT_START+""" + /* 시군구 설정정보 수정 (ogdpMapper.updateSgg) */ + UPDATE TB_SGG + SET MDFCN_DT = + """ + +SQLUtil.now + +""" + , 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} + """+SQLUtil.SCRIPT_END) + int updateSgg(Map params); + + /**지정한 조건에 따라 시군구 객체를 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 + */ + default DataObject selectSggInfo(OgdpQuery req) { + + // 사용 여부 확인 + if (req.getUseYn() == null) { + req.setUseYn("Y"); + } + + return selectSgg(req); + } + + /**지정한 조건에 따라 시군구 객체들을 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 목록 + */ + @SelectProvider(type=OgdpMapper.class, method="selectSggProvider") + DataObject selectSgg(OgdpQuery req); + + public static String selectSggProvider() { + + String comment = " /* 시군구 객체 가져오기(ogdpMapper.selectSggs) */ "; + + String selectFrom = """ + 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 + """; + String where = """ + + + AND S.SGG_CD = #{sggCd} + + + AND S.USE_YN = #{useYn} + + + """; + + return SQLUtil.SCRIPT_START + + comment + + selectFrom + where + + SQLUtil.SCRIPT_END; + } + + + /**부서 사용여부를 변경한다. + * @param deptCds 부서 코드 목록 + * @return 저장된 정보 수 + */ + default int setStatus(String useYn, String... deptCds) { + DataObject params = params(); + params.set("useYn", useYn); + params.set("deptCds", deptCds); + int effected = setStatus(params); + return effected; + } + + /**부서 사용여부를 변경한다. + * @param params 파라미터 + *
  • "deptCds" - 부서 코드 목록
  • + *
  • "currentUser" - 현재 접속한 사용자
  • + *
+ * @return 저장된 정보수 + */ + @Update(SQLUtil.SCRIPT_START+""" + /* 부서 사용 여부 변경(ogdpMapper.setStatus) */ + UPDATE TB_DEPT + SET USE_YN = #{useYn} + , MDFCN_DT = + """ + +SQLUtil.now + +""" + + , MDFR = #{currentUser.id} + WHERE DEPT_CD IN ( #{deptCd} ) + """+SQLUtil.SCRIPT_END) + int setStatus(Map params); + + + @InsertProvider(type=OgdpMapper.class, method="insertDeptProvider") + int insertDept(Map params); + + /**부서 정보를 등록한다. + * @param params 파라미터 + *
  • "dept" - 부서 정보
  • + *
  • "currentUser" - 현재 접속한 사용자
  • + *
+ * @return 저장된 정보수 + */ + public static String insertDeptProvider(Map params) { + + String comment = "/* 부서 등록(ogdpMapper.insertDept) */ "; + + String insertInto = """ + INSERT + INTO TB_DEPT ( + DEPT_CD + , SGG_CD + , INST_CD + , DEPT_NM + , DEPT_TELNO + , DEPT_FXNO + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + """; + String values = """ + ) VALUES ( + #{dept.deptID} + , #{dept.sggID} + , #{dept.instCode} + , #{dept.name} + , #{dept.telno} + , #{dept.faxno} + , 'Y' + , + """ + +SQLUtil.now + +""" + , #{dept.createdBy} + , + """ + +SQLUtil.now + +""" + , #{dept.modifiedBy} + """; + String close = ")"; + + String insertIntoAdd = params.get("insertIntoAdd") == null ? "" : (String)params.get("insertIntoAdd"); + String valuesAdd = params.get("valuesAdd") == null ? "" : (String)params.get("valuesAdd"); + + return SQLUtil.SCRIPT_START + + comment + + insertInto + insertIntoAdd + values + valuesAdd + close + + SQLUtil.SCRIPT_END; + } + + + @UpdateProvider(type=OgdpMapper.class, method="updateDeptProvider") + int updateDept(Map params); + + + public static String updateDeptProvider(Map params) { + + + String comment = "/* 부서 수정(ogdpMapper.updateDept) */ "; + + String updateSet = """ + 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 = + """ + +SQLUtil.now + +""" + + , MDFR = #{dept.modifiedBy} + """; + String where = """ + WHERE DEPT_CD = #{dept.deptID} + AND USE_YN = 'Y' + """; + + String updateSetAdd = params.get("updateSetAdd") == null ? "" : (String)params.get("updateSetAdd"); + + return SQLUtil.SCRIPT_START + + comment + + updateSet + updateSetAdd + where + + SQLUtil.SCRIPT_END; + } + + + @SelectProvider(type=OgdpMapper.class, method="selectDeptInfoProvider") + DataObject selectDeptInfo(OgdpQuery req); + + public static String selectDeptInfoProvider(OgdpQuery req) { + + String comment = "/* 부서 객체 가져오기(ogdpMapper.selectDeptInfo) */ "; + + String selectFromWhere = selectDept(req); + + return SQLUtil.SCRIPT_START + + comment + + selectFromWhere + + SQLUtil.SCRIPT_END; + } + + @SelectProvider(type=OgdpMapper.class, method="selectDeptListProvider") + List selectDeptList(OgdpQuery query); + + public static String selectDeptListProvider(OgdpQuery req) { + + + String comment = "/* 부서 객체 목록 가져오기(ogdpMapper.selectDeptList) */ "; + + String selectFromWhere = selectDept(req); + + return SQLUtil.SCRIPT_START + + comment + + SQLUtil.pagingPrefix + + selectFromWhere + + SQLUtil.orderBy + + SQLUtil.pagingSuffix + + SQLUtil.SCRIPT_END; + } + + public static String selectDept(OgdpQuery req) { + String select = """ + 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 + , (CASE D.USE_YN WHEN 'Y' THEN '사용' WHEN 'N' THEN '미사용' ELSE '' END) AS USE_YN_NM + , D.REG_DT + , D.RGTR + , D.MDFCN_DT + , D.MDFR + """; + + String fromWhere = """ + FROM TB_DEPT D + + + AND D.SGG_CD = #{sggCd} + + + AND D.DEPT_CD = #{deptCd} + + + AND D.INST_CD = #{instCd} + + + AND D.USE_YN = #{useYn} + + + """; + return select + req.getSelectAdd() + fromWhere; + } +} diff --git a/src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java b/src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java deleted file mode 100644 index ffc2b230..00000000 --- a/src/main/java/cokr/xit/applib/ogdp/service/OgdpService.java +++ /dev/null @@ -1,41 +0,0 @@ -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/AbstractOgdpBean.java b/src/main/java/cokr/xit/applib/ogdp/service/bean/AbstractOgdpBean.java new file mode 100644 index 00000000..a15c3a70 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/service/bean/AbstractOgdpBean.java @@ -0,0 +1,133 @@ +package cokr.xit.applib.ogdp.service.bean; + +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import cokr.xit.applib.ogdp.OgdpQuery; +import cokr.xit.applib.ogdp.OgdpSigungu; +import cokr.xit.applib.ogdp.dao.OgdpMapper; +import cokr.xit.base.user.Department; +import cokr.xit.foundation.UserInfo; +import cokr.xit.foundation.component.AbstractBean; +import cokr.xit.foundation.data.DataObject; + +public abstract class AbstractOgdpBean extends AbstractBean { + + @Resource(name="ogdpMapper") + private OgdpMapper ogdpMapper; + + public Object selectAllOgdpList() { + return ogdpMapper.selectAllOgdpList(); + } + + public List selectAbleOgdpList(DataObject params) { + return ogdpMapper.selectAbleOgdpList(params); + } + + public List selectAllInstList() { + return ogdpMapper.selectAllInstList(); + } + + public List selectAllSggList(){ + return ogdpMapper.selectAllSggList(); + } + + public DataObject selectOgdpInfoOfUser(String userId){ + return ogdpMapper.selectOgdpInfoOfUser(userId); + } + + public String selectSggCdByDeptCd(String deptCd) { + return ogdpMapper.selectSggCdByDeptCd(deptCd); + } + + /**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(OgdpSigungu sgg) { + return ogdpMapper.updateSgg(sgg); + } + + /**지정한 조건에 따라 시군구 객체를 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 + */ + public DataObject getSggInfo(OgdpQuery req) { + return ogdpMapper.selectSggInfo(req); + } + + /**부서 정보를 삭제한다. + * @param deptCds 부서 코드 목록 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public boolean remove(String... deptCds) { + return ogdpMapper.setStatus("N", deptCds) > 0 ? true : false; + } + + + /**지정한 조건에 따라 부서 목록을 조회하여 반환한다. + * @param req 부서 정보 조회 조건 + * @return 부서 목록 + */ + public abstract List getDeptList(OgdpQuery req); + + /**지정한 조건에 따라 부서 객체를 반환한다. + * @param req 부서 조회 조건 + * @return 부서 객체 + */ + public abstract DataObject getDeptInfo(OgdpQuery req); + + /**부서 정보를 등록한다. + * @param dept 부서 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public abstract boolean createDept(Department dept); + + /**부서 정보를 수정한다. + * @param dept 부서 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public abstract boolean updateDept(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 deleted file mode 100644 index af5c1db8..00000000 --- a/src/main/java/cokr/xit/applib/ogdp/service/bean/CmmnOgdpBean.java +++ /dev/null @@ -1,82 +0,0 @@ -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..bb2df004 --- /dev/null +++ b/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpBean.java @@ -0,0 +1,63 @@ +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.OgdpMapper; +import cokr.xit.base.user.Department; +import cokr.xit.foundation.data.DataObject; + +@Component("defaultOgdpBean") +public class DefaultOgdpBean extends AbstractOgdpBean { + + + @Resource(name = "ogdpMapper") + private OgdpMapper ogdpMapper; + + @Override + public List getDeptList(OgdpQuery query) { + // 기본 정렬 + if (query.getOrderBy() == null) { + if(query.getFetchSize() > 0) { + query.setOrderBy("QBODY.DEPT_CD DESC"); + } else { + query.setOrderBy("D.DEPT_CD DESC"); + } + } + + return ogdpMapper.selectDeptList(query); + } + + @Override + public DataObject getDeptInfo(OgdpQuery query) { + + return ogdpMapper.selectDeptInfo(query); + } + + @Override + public boolean createDept(Department dept) { + + boolean result = dept != null && ogdpMapper.insertDept( + new DataObject() + .set("currentUser", currentUser()) + .set("dept", dept)) == 1; + + return result; + } + + @Override + public boolean updateDept(Department dept) { + boolean result = dept != null && ogdpMapper.updateDept( + new DataObject() + .set("currentUser", currentUser()) + .set("dept", dept)) == 1; + + return result; + } + + +} 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 deleted file mode 100644 index 999e3676..00000000 --- a/src/main/java/cokr/xit/applib/ogdp/service/bean/DefaultOgdpServiceBean.java +++ /dev/null @@ -1,43 +0,0 @@ -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.dao.DefaultOgdpMapper; -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 = "defaultOgdpMapper") - private DefaultOgdpMapper defaultOgdpMapper; - - @Override - public List getDeptList(OgdpQuery req) { - return defaultOgdpMapper.selectDeptList(req); - } - - @Override - public DataObject getDeptInfo(OgdpQuery req) { - return defaultOgdpMapper.selectDeptInfo(req); - } - - @Override - public String create(Department dept) { - return defaultOgdpMapper.insert(dept) ? "[S]" : "[F]"; - } - - @Override - public String update(Department dept) { - return defaultOgdpMapper.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 0a76a324..209e24c8 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.service.bean.FimsOgdpBean; 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="cmmnOgdpMapper") - CmmnOgdpMapper cmmnOgdpMapper; + @Resource(name="fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @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", cmmnOgdpMapper.selectAllOgdpList()); + mav.addObject("allOgdpList", fimsOgdpBean.selectAllOgdpList()); DataObject params = new DataObject(); params.set("anonymous", "Y"); params.set("institute", institute); - List ableOgdpList = cmmnOgdpMapper.selectAbleOgdpList(params); + List ableOgdpList = fimsOgdpBean.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 = cmmnOgdpMapper.selectAllInstList(); + List instList = fimsOgdpBean.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 356edfab..799063b1 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @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 { - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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 d0fbfbfb..0d9abacb 100644 --- a/src/main/java/cokr/xit/fims/base/UserController.java +++ b/src/main/java/cokr/xit/fims/base/UserController.java @@ -8,14 +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.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.service.bean.FimsOgdpBean; import cokr.xit.foundation.data.DataObject; @Controller @@ -30,11 +29,8 @@ public class UserController extends cokr.xit.base.user.web.UserController ableOgdpList = cmmnOgdpMapper.selectAbleOgdpList(params); + List ableOgdpList = fimsOgdpBean.selectAbleOgdpList(params); mav.addObject("ableOgdpList", ableOgdpList); return mav; @@ -65,7 +61,7 @@ public class UserController extends cokr.xit.base.user.web.UserController ableOgdpList = cmmnOgdpMapper.selectAbleOgdpList(params); + List ableOgdpList = fimsOgdpBean.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 bfb33c51..7355b6ae 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,7 +9,6 @@ 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; @@ -17,6 +16,7 @@ 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @Resource(name = "stngMapper") private StngMapper stngMapper; @@ -49,14 +49,14 @@ public class StngBean extends AbstractBean { if(userInfo.getInstitute().equals("default")) { return new DataObject(); } - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); } - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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("")) { - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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("")) { - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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 ea3c2cc6..89f1f7be 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @Resource(name = "extrStngMapper") private ExtrStngMapper extrStngMapper; @@ -36,7 +36,7 @@ public class LinkController extends AbstractController { boolean saved = false; UserInfo userInfo = currentUser(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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 e6b605f5..d25666c5 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -18,7 +18,6 @@ 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; @@ -43,6 +42,7 @@ 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @Resource(name = "stngBean") private StngBean stngBean; @@ -481,7 +481,7 @@ public class Crdn05Controller extends ApplicationController { boolean saved = false; UserInfo userInfo = currentUser(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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 ce3121c0..d750b600 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc01Controller.java @@ -15,7 +15,6 @@ 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; @@ -38,6 +37,7 @@ 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @Resource(name = "crdnCvlcptMainBean") private CrdnCvlcptMainBean crdnCvlcptMainBean; @@ -221,7 +221,7 @@ public class Cvlc01Controller extends ApplicationController { FimsPrintOption printOption = new FimsPrintOption(); UserInfo userInfo = currentUser(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); 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 e6895517..298ad770 100644 --- a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java +++ b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java @@ -16,7 +16,6 @@ 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; @@ -37,6 +36,7 @@ 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.FimsOgdpBean; import cokr.xit.fims.task.Task; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -90,8 +90,8 @@ public class Excl02Controller extends ApplicationController { @Resource(name="stngBean") private StngBean stngBean; - @Resource(name = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; /**의견제출 대장 관리 메인화면(fims/excl/excl02/010-main)을 연다. * @@ -377,7 +377,7 @@ public class Excl02Controller extends ApplicationController { @RequestMapping(name="의견제출 심의의결서 출력", value=METHOD_URL.makeDlbrDecsnFileFromHwpFormat) public ModelAndView makeDlbrDecsnFileFromHwpFormat(LevyExclQuery req) { UserInfo userInfo = currentUser(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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 deleted file mode 100644 index bda5b87e..00000000 --- a/src/main/java/cokr/xit/fims/mngt/dao/FimsOgdpMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -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/bean/FimsOgdpBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java index 378cb780..aa00ee6f 100644 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpBean.java @@ -1,5 +1,6 @@ package cokr.xit.fims.mngt.service.bean; + import java.util.List; import javax.annotation.Resource; @@ -7,32 +8,174 @@ 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.applib.ogdp.dao.OgdpMapper; +import cokr.xit.applib.ogdp.service.bean.AbstractOgdpBean; +import cokr.xit.base.user.Department; 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 { +public class FimsOgdpBean extends AbstractOgdpBean { - @Resource(name = "fimsOgdpMapper") - private FimsOgdpMapper fimsOgdpMapper; + public static String selectAdd = """ + , D.CVLCPT_LINK_SE_CD + , D.VRBACNT_LINK_SE_CD + , D.PSTOFC_NM + , D.RG_NO_HEADER + , D.SNDNG_LINK_SE_CD + , D.EGP_CON_ORG + , D.EGP_RCEPT_ID + , D.EGP_APVL_NB + , D.EGP_ESB_PATH + , D.EGP_POST_INST_ID + , D.EGP_CERT_CN + , D.ENS_INTERFACE_ID + , D.ENS_SOURCE_CD + , D.ENS_TARGET_CD + , D.ENS_URL + , D.NXRP_LINK_YN + , D.NXRP_LINK_SRVC_URL + , D.NXRP_RGN_SE_CD + , D.DTBN_BANK_NM + , D.DTBN_ACTNO + , D.DOC_HEADER + , D.SRVR_OS + """; - public DataObject getDeptInfo(OgdpQuery query) { - return fimsOgdpMapper.selectDeptInfo(query); - } + @Resource(name="ogdpMapper") + private OgdpMapper ogdpMapper; + @Override public List getDeptList(OgdpQuery query) { - return fimsOgdpMapper.selectDeptList(query); + // 기본 정렬 + if (query.getOrderBy() == null) { + if(query.getFetchSize() > 0) { + query.setOrderBy("QBODY.DEPT_CD DESC"); + } else { + query.setOrderBy("D.DEPT_CD DESC"); + } + } + + query.setSelectAdd(selectAdd); + + return ogdpMapper.selectDeptList(query); + } + + @Override + public DataObject getDeptInfo(OgdpQuery query) { + + query.setSelectAdd(selectAdd); + + return ogdpMapper.selectDeptInfo(query); } - public boolean createFimsDept(FimsDepartment dept) { - return fimsOgdpMapper.insertDept(dept); + @Override + public boolean createDept(Department dept) { + if(dept != null && dept instanceof FimsDepartment fimsDept) { + + String insertIntoAdd = """ + , CVLCPT_LINK_SE_CD + , VRBACNT_LINK_SE_CD + , PSTOFC_NM + , RG_NO_HEADER + , SNDNG_LINK_SE_CD + , EGP_CON_ORG + , EGP_RCEPT_ID + , EGP_APVL_NB + , EGP_ESB_PATH + , EGP_POST_INST_ID + , EGP_CERT_CN + , ENS_INTERFACE_ID + , ENS_SOURCE_CD + , ENS_TARGET_CD + , ENS_URL + , NXRP_LINK_YN + , NXRP_RGN_SE_CD + , DTBN_BANK_NM + , DTBN_ACTNO + , DOC_HEADER + , SRVR_OS + """; + String valuesAdd = """ + , #{dept.cvlcptLinkSeCd} + , #{dept.vrbacntLinkSeCd} + , #{dept.pstofcNm} + , #{dept.rgNoHeader} + , #{dept.sndngLinkSeCd} + , #{dept.egpConOrg} + , #{dept.egpRceptId} + , #{dept.egpApvlNb} + , #{dept.egpEsbPath} + , #{dept.egpPostInstId} + , #{dept.egpCertCn} + , #{dept.ensInterfaceId} + , #{dept.ensSourceCd} + , #{dept.ensTargetCd} + , #{dept.ensUrl} + , #{dept.nxrpLinkYn} + , #{dept.nxrpRgnSeCd} + , #{dept.dtbnBankNm} + , #{dept.dtbnActno} + , #{dept.docHeader} + , #{dept.srvrOs} + """; + + boolean result = ogdpMapper.insertDept( + new DataObject() + .set("currentUser", currentUser()) + .set("dept", fimsDept) + .set("insertIntoAdd", insertIntoAdd) + .set("valuesAdd",valuesAdd)) == 1; + + return result; + } + return false; } - public boolean updateFimsDept(FimsDepartment dept) { - return fimsOgdpMapper.updateDept(dept); + @Override + public boolean updateDept(Department dept) { + if(dept != null && dept instanceof FimsDepartment fimsDept) { + String updateSetAdd = """ + , CVLCPT_LINK_SE_CD = #{dept.cvlcptLinkSeCd} + , VRBACNT_LINK_SE_CD = #{dept.vrbacntLinkSeCd} + , PSTOFC_NM = #{dept.pstofcNm} + , RG_NO_HEADER = #{dept.rgNoHeader} + , SNDNG_LINK_SE_CD = #{dept.sndngLinkSeCd} + , EGP_CON_ORG = #{dept.egpConOrg} + , EGP_RCEPT_ID = #{dept.egpRceptId} + , EGP_APVL_NB = #{dept.egpApvlNb} + , EGP_ESB_PATH = #{dept.egpEsbPath} + , EGP_POST_INST_ID = #{dept.egpPostInstId} + , EGP_CERT_CN = #{dept.egpCertCn} + , ENS_INTERFACE_ID = #{dept.ensInterfaceId} + , ENS_SOURCE_CD = #{dept.ensSourceCd} + , ENS_TARGET_CD = #{dept.ensTargetCd} + , ENS_URL = #{dept.ensUrl} + , NXRP_LINK_YN = #{dept.nxrpLinkYn} + , NXRP_RGN_SE_CD = #{dept.nxrpRgnSeCd} + , DTBN_BANK_NM = #{dept.dtbnBankNm} + , DTBN_ACTNO = #{dept.dtbnActno} + , DOC_HEADER = #{dept.docHeader} + , SRVR_OS = #{dept.srvrOs} + """; + + boolean result = ogdpMapper.updateDept( + new DataObject() + .set("currentUser", currentUser()) + .set("dept", fimsDept) + .set("updateSetAdd", updateSetAdd)) == 1; + + return result; + } + return false; } + + + + + + } 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 deleted file mode 100644 index fbda5d92..00000000 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/FimsOgdpServiceBean.java +++ /dev/null @@ -1,51 +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.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 fdept) { - return fimsOgdpBean.createFimsDept(fdept) ? "[S]" : "[F]"; - } - return "[F]"; - } - - @Override - public String update(Department dept) { - if(dept instanceof FimsDepartment fdept) { - return fimsOgdpBean.updateFimsDept(fdept) ? "[S]" : "[F]"; - } - 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 894a02fd..099c8fa1 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt01Controller.java @@ -8,13 +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.service.NtcService; +import cokr.xit.fims.mngt.service.bean.FimsOgdpBean; import cokr.xit.foundation.data.DataObject; /**공지사항 서비스 웹 컨트롤러.
@@ -41,11 +40,8 @@ public class Mngt01Controller extends ApplicationController { @Resource(name="ntcService") private NtcService ntcService; - @Resource(name="cmmnOgdpMapper") - CmmnOgdpMapper cmmnOgdpMapper; - - @Resource(name = "defaultOgdpMapper") - private DefaultOgdpMapper defaultOgdpMapper; + @Resource(name="fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; /** 공지사항 메인화면을 연다. * @return fims/mngt/mngt01010-main @@ -100,7 +96,7 @@ public class Mngt01Controller extends ApplicationController { } mav.addObject("ntcInfo", json ? info : toJson(info)); - List allSggList = cmmnOgdpMapper.selectAllSggList(); + List allSggList = fimsOgdpBean.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 613e6124..4ca711e1 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -15,13 +15,12 @@ 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.Task; import cokr.xit.fims.mngt.VltnQuery; +import cokr.xit.fims.mngt.service.bean.FimsOgdpBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.mngt.service.bean.VltnBean; import cokr.xit.foundation.UserInfo; @@ -49,12 +48,8 @@ public class Mngt03Controller extends ApplicationController { ; } - - @Resource(name = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; - - @Resource(name="cmmnOgdpMapper") - CmmnOgdpMapper cmmnOgdpMapper; + @Resource(name="fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; /** 설정 정보 서비스 */ @Resource(name = "stngService") @@ -84,7 +79,7 @@ public class Mngt03Controller extends ApplicationController { mav.setViewName("fims/mngt/select-sgg"); mav.addObject("pageName", "selectSgg"); - List sggList = cmmnOgdpMapper.selectAllSggList(); + List sggList = fimsOgdpBean.selectAllSggList(); mav.addObject("sggList", sggList); } else { @@ -96,7 +91,7 @@ public class Mngt03Controller extends ApplicationController { } else { mav.setViewName("fims/mngt/mngt03010-main"); mav.addObject("pageName", "mngt03010"); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.initUserInfo(userInfo); mav.addObject("sggCd", userInfo.getInfo().get("sggCd")); } @@ -110,7 +105,7 @@ public class Mngt03Controller extends ApplicationController { @RequestMapping(name="시군구 조회", value=METHOD_URL.getSggInfo) public ModelAndView getSggInfo(OgdpQuery req) { ModelAndView mav = new ModelAndView("jsonView"); - DataObject sggInfo = cmmnOgdpBean.getSggInfo(req); + DataObject sggInfo = fimsOgdpBean.getSggInfo(req); mav.addObject("sggInfo", sggInfo); return mav; } @@ -163,7 +158,7 @@ public class Mngt03Controller extends ApplicationController { sgg.setOfficialSealFilepath(newOffcs.get("filePath")); sgg.setOfficialSealFilename(newOffcs.get("fileName")); } - boolean saved = cmmnOgdpBean.updateSgg(sgg); + boolean saved = fimsOgdpBean.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 e76e5af2..206c1119 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java @@ -9,12 +9,10 @@ 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.service.bean.FimsOgdpBean; import cokr.xit.foundation.data.DataObject; /**부서관리 서비스 웹 컨트롤러.
@@ -40,14 +38,8 @@ public class Mngt04Controller extends ApplicationController { /** 소속 정보 서비스 */ - @Resource(name = "fimsOgdpService") - private OgdpService fimsOgdpService; - - @Resource(name = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; - - @Resource(name = "cmmnOgdpMapper") - private CmmnOgdpMapper cmmnOgdpMapper; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; /** 부서관리 메인화면을 연다. @@ -60,7 +52,7 @@ public class Mngt04Controller extends ApplicationController { mav.setViewName("fims/mngt/mngt04010-main"); mav.addObject("pageName", "mngt04010"); - List allSggList = cmmnOgdpMapper.selectAllSggList(); + List allSggList = fimsOgdpBean.selectAllSggList(); mav.addObject("sggList", allSggList); @@ -77,7 +69,7 @@ public class Mngt04Controller extends ApplicationController { setFetchSize(query); - return setCollectionInfo(new ModelAndView("jsonView"), fimsOgdpService.getDeptList(query),"",""); + return setCollectionInfo(new ModelAndView("jsonView"), fimsOgdpBean.getDeptList(query),"",""); } @@ -93,7 +85,7 @@ public class Mngt04Controller extends ApplicationController { DataObject deptInfo = new DataObject(); if(!ifEmpty(query.getDeptCd(), ()->"").equals("")) { - deptInfo = fimsOgdpService.getDeptInfo(query); + deptInfo = fimsOgdpBean.getDeptInfo(query); } else { deptInfo = null; } @@ -117,7 +109,7 @@ public class Mngt04Controller extends ApplicationController { public ModelAndView removeDept(String... deptCds) { ModelAndView mav = new ModelAndView("jsonView"); - boolean saved = cmmnOgdpBean.remove(deptCds); + boolean saved = fimsOgdpBean.remove(deptCds); mav.addObject("saved", saved); return mav; @@ -133,11 +125,7 @@ public class Mngt04Controller extends ApplicationController { @RequestMapping(name="부서 등록", value=METHOD_URL.createDept) public ModelAndView createDept(FimsDepartment dept) { ModelAndView mav = new ModelAndView("jsonView"); - boolean saved = false; - String rtnMsg = fimsOgdpService.create(dept); - if(rtnMsg.contains("[S]")) { - saved = true; - } + boolean saved = fimsOgdpBean.createDept(dept); mav.addObject("saved", saved); return mav; @@ -153,11 +141,7 @@ public class Mngt04Controller extends ApplicationController { @RequestMapping(name="부서 수정", value=METHOD_URL.updateDept) public ModelAndView updateDept(FimsDepartment dept) { ModelAndView mav = new ModelAndView("jsonView"); - boolean saved = false; - String rtnMsg = fimsOgdpService.update(dept); - if(rtnMsg.contains("[S]")) { - saved = true; - } + boolean saved = fimsOgdpBean.updateDept(dept); mav.addObject("saved", saved); return mav; 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 c36167de..488a104b 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 @@ -112,7 +112,7 @@ public class NisIndivBean extends AbstractBean { /** 부서 정보 DAO */ @Resource(name = "fimsOgdpBean") - private FimsOgdpBean fimsOgdpBean; + private FimsOgdpBean FimsOgdpBean; /**지정한 조건에 따라 과태료 대장 단속 정보 등록 목록을 조회하여 반환한다. * @param req 과태료 대장 단속 정보 등록 조회 조건 @@ -145,7 +145,7 @@ public class NisIndivBean extends AbstractBean { DataObject userInfo = userBean.getUserInfo(currentUser().getId()); // 2. 부서 정보 - DataObject deptInfo = fimsOgdpBean.getDeptInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD"))); + DataObject deptInfo = FimsOgdpBean.getDeptInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD"))); // 3. 세외수입 과태료대장에 연계할 단속 정보를 조회 DataObject selectCrdnInfo = nisA01Mapper.selectCrdnInfo(req.getCrdnId()); @@ -347,7 +347,7 @@ public class NisIndivBean extends AbstractBean { DataObject userInfo = userBean.getUserInfo(currentUser().getId()); // 2. 부서 정보 - DataObject deptInfo = fimsOgdpBean.getDeptInfo(new OgdpQuery().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/web/Sndb01Controller.java b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java index 31eba02b..fe71468a 100644 --- a/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java +++ b/src/main/java/cokr/xit/fims/sndb/web/Sndb01Controller.java @@ -14,7 +14,6 @@ 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,6 +36,7 @@ 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @Resource(name="svbtcBean") private SvbtcBean svbtcBean; @@ -1657,7 +1657,7 @@ public class Sndb01Controller extends ApplicationController { UserInfo userInfo = currentUser(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.initUserInfo(userInfo); print.setPrintRequestUserInfo(userInfo); //출력물 기본 설정 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 48bf31ae..e8f87c5f 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -17,7 +17,6 @@ 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; @@ -49,6 +48,7 @@ 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.FimsOgdpBean; 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 = "cmmnOgdpBean") - private CmmnOgdpBean cmmnOgdpBean; + @Resource(name = "fimsOgdpBean") + private FimsOgdpBean fimsOgdpBean; @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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.initUserInfo(userInfo); Print print = new Print(); print.setPrintRequestUserInfo(userInfo); @@ -558,7 +558,7 @@ public class Sprt01Controller extends ApplicationController { printOption.setGlobalVariable(globalVariable); UserInfo userInfo = currentUser(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.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(); - cmmnOgdpBean.initUserInfo(userInfo); + fimsOgdpBean.initUserInfo(userInfo); sndng.setSggCd((String)userInfo.getInfo().get("sggCd")); diff --git a/src/main/resources/sql/mapper/fims/mngt/fims-ogdp-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/fims-ogdp-mapper.xml deleted file mode 100644 index e49da7ec..00000000 --- a/src/main/resources/sql/mapper/fims/mngt/fims-ogdp-mapper.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - 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.CVLCPT_LINK_SE_CD - , D.VRBACNT_LINK_SE_CD - , D.PSTOFC_NM - , D.RG_NO_HEADER - , D.SNDNG_LINK_SE_CD - , D.EGP_CON_ORG - , D.EGP_RCEPT_ID - , D.EGP_APVL_NB - , D.EGP_ESB_PATH - , D.EGP_POST_INST_ID - , D.EGP_CERT_CN - , D.ENS_INTERFACE_ID - , D.ENS_SOURCE_CD - , D.ENS_TARGET_CD - , D.ENS_URL - , D.NXRP_LINK_YN - , D.NXRP_LINK_SRVC_URL - , D.NXRP_RGN_SE_CD - , D.DTBN_BANK_NM - , D.DTBN_ACTNO - , D.DOC_HEADER - , D.SRVR_OS - , 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 - - - - - - - -/* 부서 등록(fimsOgdpMapper.insertDept) */ - INSERT - INTO TB_DEPT ( - DEPT_CD - , SGG_CD - , INST_CD - , DEPT_NM - , DEPT_TELNO - , DEPT_FXNO - , CVLCPT_LINK_SE_CD - , VRBACNT_LINK_SE_CD - , PSTOFC_NM - , RG_NO_HEADER - , SNDNG_LINK_SE_CD - , EGP_CON_ORG - , EGP_RCEPT_ID - , EGP_APVL_NB - , EGP_ESB_PATH - , EGP_POST_INST_ID - , EGP_CERT_CN - , ENS_INTERFACE_ID - , ENS_SOURCE_CD - , ENS_TARGET_CD - , ENS_URL - , NXRP_LINK_YN - , NXRP_RGN_SE_CD - , DTBN_BANK_NM - , DTBN_ACTNO - , DOC_HEADER - , SRVR_OS - , USE_YN - , REG_DT - , RGTR - , MDFCN_DT - , MDFR - ) VALUES ( - #{dept.deptID} - , #{dept.sggID} - , #{dept.instCode} - , #{dept.name} - , #{dept.telno} - , #{dept.faxno} - , #{dept.cvlcptLinkSeCd} - , #{dept.vrbacntLinkSeCd} - , #{dept.pstofcNm} - , #{dept.rgNoHeader} - , #{dept.sndngLinkSeCd} - , #{dept.egpConOrg} - , #{dept.egpRceptId} - , #{dept.egpApvlNb} - , #{dept.egpEsbPath} - , #{dept.egpPostInstId} - , #{dept.egpCertCn} - , #{dept.ensInterfaceId} - , #{dept.ensSourceCd} - , #{dept.ensTargetCd} - , #{dept.ensUrl} - , #{dept.nxrpLinkYn} - , #{dept.nxrpRgnSeCd} - , #{dept.dtbnBankNm} - , #{dept.dtbnActno} - , #{dept.docHeader} - , #{dept.srvrOs} - , 'Y' - , - , #{dept.createdBy} - , - , #{dept.modifiedBy} - ) - - - -/* 부서 수정(fimsOgdpMapper.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} - , CVLCPT_LINK_SE_CD = #{dept.cvlcptLinkSeCd} - , VRBACNT_LINK_SE_CD = #{dept.vrbacntLinkSeCd} - , PSTOFC_NM = #{dept.pstofcNm} - , RG_NO_HEADER = #{dept.rgNoHeader} - , SNDNG_LINK_SE_CD = #{dept.sndngLinkSeCd} - , EGP_CON_ORG = #{dept.egpConOrg} - , EGP_RCEPT_ID = #{dept.egpRceptId} - , EGP_APVL_NB = #{dept.egpApvlNb} - , EGP_ESB_PATH = #{dept.egpEsbPath} - , EGP_POST_INST_ID = #{dept.egpPostInstId} - , EGP_CERT_CN = #{dept.egpCertCn} - , ENS_INTERFACE_ID = #{dept.ensInterfaceId} - , ENS_SOURCE_CD = #{dept.ensSourceCd} - , ENS_TARGET_CD = #{dept.ensTargetCd} - , ENS_URL = #{dept.ensUrl} - , NXRP_LINK_YN = #{dept.nxrpLinkYn} - , NXRP_RGN_SE_CD = #{dept.nxrpRgnSeCd} - , DTBN_BANK_NM = #{dept.dtbnBankNm} - , DTBN_ACTNO = #{dept.dtbnActno} - , DOC_HEADER = #{dept.docHeader} - , SRVR_OS = #{dept.srvrOs} - , MDFCN_DT = - , MDFR = #{dept.modifiedBy} - WHERE DEPT_CD = #{dept.deptID} - AND USE_YN = 'Y' - - - \ 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 deleted file mode 100644 index 964b211b..00000000 --- a/src/main/resources/sql/mapper/ogdp/cmmn-ogdp-mapper.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - -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 deleted file mode 100644 index e374c6e0..00000000 --- a/src/main/resources/sql/mapper/ogdp/default-ogdp-mapper.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - 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 diff --git a/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04020-info.jsp index bcf233c0..63f9fb3f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04020-info.jsp @@ -202,6 +202,9 @@ $(document).ready(function(){ $("#deptID--${pageName}").attr("disabled","disabled"); $("#name--${pageName}").attr("disabled","disabled"); $P.deptControl.dataset.setData([deptInfo]); + if(deptInfo.USE_YN == "N"){ + $("#btnSave--${pageName}").attr("disabled","disabled"); + } } else { $P.deptControl.dataset.setData([]); $("#sggID--${pageName}").val(MY_INFO.info.sggCd);