diff --git a/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java b/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java
index 9f509753..97ae690f 100644
--- a/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java
+++ b/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java
@@ -176,24 +176,25 @@ public interface FactionMapper extends AbstractMapper {
return dept != null && updateDept(params().set("dept", dept)) == 1;
}
- /**지정한 부서 정보를 삭제한다.
+ /**부서 사용여부를 변경한다.
* @param params 파라미터
- *
- "dept" - 부서 정보
+ * - "deptCds" - 부서 코드 목록
* - "currentUser" - 현재 접속한 사용자
*
* @return 저장된 정보수
*/
- int deleteDept(Map params);
+ int setStatus(Map params);
- /**부서 정보를 삭제한다.
- * @param dept 부서
- * @return 저장 여부
- * - 저장됐으면 true
- * - 그렇지 않으면 false
- *
+ /**부서 사용여부를 변경한다.
+ * @param deptCds 부서 코드 목록
+ * @return 저장된 정보 수
*/
- default boolean delete(FineIntegrationDepartment dept) {
- return dept != null && deleteDept(params().set("dept", dept)) == 1;
+ 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/fims/mngt/service/FactionService.java b/src/main/java/cokr/xit/fims/mngt/service/FactionService.java
index e36e51ff..464a85c6 100644
--- a/src/main/java/cokr/xit/fims/mngt/service/FactionService.java
+++ b/src/main/java/cokr/xit/fims/mngt/service/FactionService.java
@@ -51,11 +51,11 @@ public interface FactionService {
boolean update(FineIntegrationDepartment dept);
/**부서 정보를 삭제한다.
- * @param dept 부서
+ * @param deptCds 부서 코드 목록
* @return 저장 여부
* - 저장됐으면 true
* - 그렇지 않으면 false
*
*/
- boolean remove(FineIntegrationDepartment dept);
+ boolean remove(String... deptCds);
}
diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java
index 24d69a62..01f1d366 100644
--- a/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java
+++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java
@@ -125,13 +125,13 @@ public class FactionBean extends AbstractComponent {
}
/**부서 정보를 삭제한다.
- * @param dept 부서
+ * @param deptCds 부서 코드 목록
* @return 저장 여부
* - 저장됐으면 true
* - 그렇지 않으면 false
*
*/
- public boolean remove(FineIntegrationDepartment dept) {
- return factionMapper.delete(dept);
+ public boolean remove(String... deptCds) {
+ return factionMapper.setStatus("N", deptCds) > 0 ? true : false;
}
}
diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java
index d72e9dc8..73c8d926 100644
--- a/src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java
+++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java
@@ -56,7 +56,7 @@ public class FactionServiceBean extends AbstractServiceBean implements FactionSe
}
@Override
- public boolean remove(FineIntegrationDepartment dept) {
- return factionBean.remove(dept);
+ public boolean remove(String... deptCds) {
+ return factionBean.remove(deptCds);
}
}
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 3dd32bab..f395bcdd 100644
--- a/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java
+++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java
@@ -26,6 +26,7 @@ public class Mngt04Controller extends ApplicationController {
deptMngtMain = "/010/main.do"
, getDeptList = "/010/list.do"
, getDeptInfo = "/020/info.do"
+ , removeDept = "/010/remove.do"
;
}
@@ -87,4 +88,20 @@ public class Mngt04Controller extends ApplicationController {
mav.addObject("deptInfo", json ? deptInfo : toJson(deptInfo));
return mav;
}
+
+ /**부서 정보를 삭제한다.
+ * @param deptCds 부서 코드 목록
+ * @return jsonView
+ * {
+ * "saved": 저장되었으면 true, 그렇지 않으면 false
+ * }
+ */
+ public ModelAndView removeDept(String... deptCds) {
+ ModelAndView mav = new ModelAndView("jsonView");
+
+ boolean saved = factionService.remove(deptCds);
+
+ mav.addObject("saved", saved);
+ return mav;
+ }
}
diff --git a/src/main/java/cokr/xit/fims/task/web/CmnController.java b/src/main/java/cokr/xit/fims/task/web/CmnController.java
index 85c5aff0..95ad795f 100644
--- a/src/main/java/cokr/xit/fims/task/web/CmnController.java
+++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java
@@ -661,6 +661,11 @@ public class CmnController {
return super.getDeptInfo(query);
}
+ @Override
+ @RequestMapping(name="부서 삭제", value=METHOD_URL.removeDept)
+ public ModelAndView removeDept(String... deptCds) {
+ return super.removeDept(deptCds);
+ }
}
@Controller
diff --git a/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml
index 494cc48b..57a5df5b 100644
--- a/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml
+++ b/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml
@@ -155,205 +155,208 @@ UPDATE TB_SGG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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.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_POST_INST_ID
+ , D.ENS_INTERFACE_ID
+ , D.ENS_SOURCE_CD
+ , D.ENS_TARGET_CD
+ , D.ENS_URL
+ , 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
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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.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_POST_INST_ID
- , D.ENS_INTERFACE_ID
- , D.ENS_SOURCE_CD
- , D.ENS_TARGET_CD
- , D.ENS_URL
- , D.DTBN_BANK_NM
- , D.DTBN_ACTNO
- , D.DOC_HEADER
- , D.SRVR_OS
- , D.USE_YN
- , D.REG_DT
- , D.RGTR
- , D.MDFCN_DT
- , D.MDFR
- FROM TB_DEPT D
-
+
-
- /* 부서 등록(factionMapper.insertDept) */
- INSERT
- INTO TB_DEPT (
- DEPT_CD
- , SGG_CD
- , INST_CD
- , DEPT_NM
- , DEPT_TELNO
- , DEPT_FXNO
- , VRBACNT_LINK_SE_CD
- , PSTOFC_NM
- , RG_NO_HEADER
- , SNDNG_LINK_SE_CD
- , EGP_CON_ORG
- , EGP_RCEPT_ID
- , EGP_APVL_NB
- , EGP_POST_INST_ID
- , ENS_INTERFACE_ID
- , ENS_SOURCE_CD
- , ENS_TARGET_CD
- , ENS_URL
- , DTBN_BANK_NM
- , DTBN_ACTNO
- , DOC_HEADER
- , SRVR_OS
- , USE_YN
- , REG_DT
- , RGTR
- , MDFCN_DT
- , MDFR
- ) VALUES (
- #{dept.deptCd}
- , #{dept.sggCd}
- , #{dept.instCd}
- , #{dept.deptNm}
- , #{dept.deptTelno}
- , #{dept.deptFxno}
- , #{dept.vrbacntLinkSeCd}
- , #{dept.pstofcNm}
- , #{dept.rgNoHeader}
- , #{dept.sndngLinkSeCd}
- , #{dept.egpConOrg}
- , #{dept.egpRceptId}
- , #{dept.egpApvlNb}
- , #{dept.egpPostInstId}
- , #{dept.ensInterfaceId}
- , #{dept.ensSourceCd}
- , #{dept.ensTargetCd}
- , #{dept.ensUrl}
- , #{dept.dtbnBankNm}
- , #{dept.dtbnActno}
- , #{dept.docHeader}
- , #{dept.srvrOs}
- , 'Y'
- ,
- , #{dept.createdBy}
- ,
- , #{dept.modifiedBy}
- )
-
+
+/* 부서 등록(factionMapper.insertDept) */
+ INSERT
+ INTO TB_DEPT (
+ DEPT_CD
+ , SGG_CD
+ , INST_CD
+ , DEPT_NM
+ , DEPT_TELNO
+ , DEPT_FXNO
+ , VRBACNT_LINK_SE_CD
+ , PSTOFC_NM
+ , RG_NO_HEADER
+ , SNDNG_LINK_SE_CD
+ , EGP_CON_ORG
+ , EGP_RCEPT_ID
+ , EGP_APVL_NB
+ , EGP_POST_INST_ID
+ , ENS_INTERFACE_ID
+ , ENS_SOURCE_CD
+ , ENS_TARGET_CD
+ , ENS_URL
+ , DTBN_BANK_NM
+ , DTBN_ACTNO
+ , DOC_HEADER
+ , SRVR_OS
+ , USE_YN
+ , REG_DT
+ , RGTR
+ , MDFCN_DT
+ , MDFR
+ ) VALUES (
+ #{dept.deptCd}
+ , #{dept.sggCd}
+ , #{dept.instCd}
+ , #{dept.deptNm}
+ , #{dept.deptTelno}
+ , #{dept.deptFxno}
+ , #{dept.vrbacntLinkSeCd}
+ , #{dept.pstofcNm}
+ , #{dept.rgNoHeader}
+ , #{dept.sndngLinkSeCd}
+ , #{dept.egpConOrg}
+ , #{dept.egpRceptId}
+ , #{dept.egpApvlNb}
+ , #{dept.egpPostInstId}
+ , #{dept.ensInterfaceId}
+ , #{dept.ensSourceCd}
+ , #{dept.ensTargetCd}
+ , #{dept.ensUrl}
+ , #{dept.dtbnBankNm}
+ , #{dept.dtbnActno}
+ , #{dept.docHeader}
+ , #{dept.srvrOs}
+ , 'Y'
+ ,
+ , #{dept.createdBy}
+ ,
+ , #{dept.modifiedBy}
+ )
+
- /* 부서 수정(factionMapper.updateDept) */
- UPDATE TB_DEPT
- SET SGG_CD = #{dept.sggCd}
- , INST_CD = #{dept.instCd}
- , DEPT_NM = #{dept.deptNm}
- , DEPT_TELNO = #{dept.deptTelno}
- , DEPT_FXNO = #{dept.deptFxno}
- , 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_POST_INST_ID = #{dept.egpPostInstId}
- , ENS_INTERFACE_ID = #{dept.ensInterfaceId}
- , ENS_SOURCE_CD = #{dept.ensSourceCd}
- , ENS_TARGET_CD = #{dept.ensTargetCd}
- , ENS_URL = #{dept.ensUrl}
- , 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.deptCd}
- AND USE_YN = 'Y'
-
+
+/* 부서 수정(factionMapper.updateDept) */
+ UPDATE TB_DEPT
+ SET SGG_CD = #{dept.sggCd}
+ , INST_CD = #{dept.instCd}
+ , DEPT_NM = #{dept.deptNm}
+ , DEPT_TELNO = #{dept.deptTelno}
+ , DEPT_FXNO = #{dept.deptFxno}
+ , 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_POST_INST_ID = #{dept.egpPostInstId}
+ , ENS_INTERFACE_ID = #{dept.ensInterfaceId}
+ , ENS_SOURCE_CD = #{dept.ensSourceCd}
+ , ENS_TARGET_CD = #{dept.ensTargetCd}
+ , ENS_URL = #{dept.ensUrl}
+ , 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.deptCd}
+ AND USE_YN = 'Y'
+
- /* 부서 삭제(factionMapper.deleteDept) */
- UPDATE TB_DEPT
- SET USE_YN = 'N'
- , MDFCN_DT =
- , MDFR = #{currentUser.id}
- WHERE DEPT_CD = #{dept.deptCd}
- AND USE_YN = 'Y'
-
+
+/* 부서 사용 여부 변경(factionMapper.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/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp
index 5b3aead1..36e496c1 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01010-main.jsp
@@ -548,12 +548,12 @@ $(document).ready(function(){
url : $P.crdnControl.urls.remove,
data : params,
success : (resp) => {
- $P.removeCallback(selected, resp);
+ $P.removeCallback(resp);
}
});
}
- $P.removeCallback = (selected, resp) => {
+ $P.removeCallback = (resp) => {
if (resp.saved){
$P.toast.show();
sleep(1000).then(() => $P.refreshCrdnList());
diff --git a/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04010-main.jsp
index 029762b8..dded9838 100644
--- a/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04010-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt04010-main.jsp
@@ -95,6 +95,7 @@
기관코드 |
부서명 |
부서코드 |
+ 사용여부 |
|
@@ -113,6 +114,7 @@
{INST_CD} |
{DEPT_NM} |
{DEPT_CD} |
+ {USE_YN_NM} |
|
@@ -128,6 +130,13 @@
+
@@ -148,6 +157,12 @@ $(document).ready(function(){
var $P = pageObject["${pageName}"];
+ $P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), {
+ animation: true,
+ autohide: true,
+ delay: 2000
+ });
+
/**************************************************************************
* DatasetControl
**************************************************************************/
@@ -156,7 +171,8 @@ $(document).ready(function(){
keymapper : info => info ? info.DEPT_CD : "",
urls : {
load : wctx.url("/mngt/mngt04/010/list.do"),
- getInfo : wctx.url("/mngt/mngt04/020/info.do")
+ getInfo : wctx.url("/mngt/mngt04/020/info.do"),
+ remove : wctx.url("/mngt/mngt04/010/remove.do")
},
formats: {
REG_DT : datetimeFormat,
@@ -300,11 +316,29 @@ $(document).ready(function(){
}
$P.removeDept = () => {
- //$P.deptControl.dataset.getKeys("selected");
+ var selected = $P.deptControl.dataset.getKeys("selected");
+ if (selected.length < 1) {
+ return;
+ }
+
+ var params = {
+ "deptCds" : selected.join(",")
+ };
+
+ ajax.post({
+ url : $P.deptControl.urls.remove,
+ data : params,
+ success : (resp) => {
+ $P.removeCallback(resp);
+ }
+ });
}
$P.removeCallback = (resp) => {
- //
+ if (resp.saved){
+ $P.toast.show();
+ sleep(1000).then(() => $P.refreshDeptList());
+ }
}
/**************************************************************************