diff --git a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java index f7ff3459..403ab621 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java @@ -51,7 +51,7 @@ public interface CrdnUpdtMapper extends AbstractMapper { int updateCrdnAddition(Crdn crdn); /** 단속 자료를 삭제한다. - * @param params 삭제 요청 파라미터 + * @param map 삭제 요청 파라미터 * @return 저장된 정보수 */ int removeCrdn(Map map); diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java index c1f92cb5..2b684fe4 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java @@ -84,6 +84,6 @@ public class CrdnBean extends AbstractComponent { paramMap.put("crdnIDs", crdnIdList); paramMap.put("removedBy", UserInfo.current().getId()); - return crdnUpdtMapper.removeCrdn(paramMap) == 1 ? true : false; + return crdnUpdtMapper.removeCrdn(paramMap) >= 1 ? true : false; } } diff --git a/src/main/java/cokr/xit/fims/cvlc/dao/SaCvlcptIndviDmndMapper.java b/src/main/java/cokr/xit/fims/cvlc/dao/SaCvlcptIndviDmndMapper.java index 1da66e29..eddc054c 100644 --- a/src/main/java/cokr/xit/fims/cvlc/dao/SaCvlcptIndviDmndMapper.java +++ b/src/main/java/cokr/xit/fims/cvlc/dao/SaCvlcptIndviDmndMapper.java @@ -1,6 +1,7 @@ package cokr.xit.fims.cvlc.dao; import java.util.List; +import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; @@ -27,4 +28,10 @@ public interface SaCvlcptIndviDmndMapper extends AbstractMapper { */ int insertDmndDataInfo(CrdnCvlcpt crdnCvlcpt); + /** 새올 요청자료를 삭제한다. + * @param map 삭제 요청 파라미터 + * @return 저장된 정보 수 + */ + int deleteDmndDataInfo(Map map); + } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java index fa0c6edf..5a5a28a1 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java @@ -121,4 +121,9 @@ public interface CrdnCvlcptService { */ boolean createDmndDataInfo(CrdnCvlcpt crdnCvlcpt); + /** 새올 요청자료를 삭제한다. + * @param indivIDs 개별요청 ID + * @return 저장여부 + */ + boolean removeDmndDataInfo(String... indivIDs); } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java index cc50acb8..1fa161e8 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java @@ -1,8 +1,11 @@ package cokr.xit.fims.cvlc.service.bean; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.annotation.Resource; @@ -342,4 +345,22 @@ public class CrdnCvlcptMainBean extends AbstractComponent { return saCvlcptIndviDmndMapper.insertDmndDataInfo(crdnCvlcpt) == 1 ? true : false; } + /**새올 요청 자료를 삭제한다. + * @param indivIDs 개별요청 ID 목록 + * @return 저장 여부 + * + */ + public boolean removeDmndDataInfo(String... indivIDs) { + if (isEmpty(indivIDs)) return false; + + Map paramMap = new HashMap(); + List indivIdList = Arrays.asList(indivIDs); + paramMap.put("indivIDs", indivIdList); + paramMap.put("removedBy", UserInfo.current().getId()); + + return saCvlcptIndviDmndMapper.deleteDmndDataInfo(paramMap) >= 1 ? true : false; + } + } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java index 8fae65ab..c10ac008 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java @@ -736,4 +736,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv return crdnCvlcptMainBean.createDmndDataInfo(crdnCvlcpt); } + @Override + public boolean removeDmndDataInfo(String... indivIDs) { + return crdnCvlcptMainBean.removeDmndDataInfo(indivIDs); + } + } diff --git a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc04Controller.java b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc04Controller.java index dc2f1eab..c59c749a 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc04Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc04Controller.java @@ -26,7 +26,8 @@ public class Cvlc04Controller extends ApplicationController { public class METHOD_URL { public static final String getDmndDataList = "/010/list.do", - createDmndDataInfo = "/010/create.do" + createDmndDataInfo = "/010/create.do", + removeDmndDataInfo = "/010/remove.do" ; } @@ -88,4 +89,20 @@ public class Cvlc04Controller extends ApplicationController { .addObject("saved", saved); } + + /**새올 요청자료를 제거한다. + * @param IDs 개별요청 ID + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + public ModelAndView removeDmndDataInfo(String[] IDs) { + + boolean saved = crdnCvlcptService.removeDmndDataInfo(IDs); + + return new ModelAndView("jsonView") + .addObject("saved", saved); + } } diff --git a/src/main/java/cokr/xit/fims/task/web/BpvController.java b/src/main/java/cokr/xit/fims/task/web/BpvController.java index f26a95d7..42187e56 100644 --- a/src/main/java/cokr/xit/fims/task/web/BpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/BpvController.java @@ -130,6 +130,12 @@ public class BpvController { return super.createDmndDataInfo(crdnCvlcpt); } + @Override + @RequestMapping(name="전용차로과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo) + public ModelAndView removeDmndDataInfo(String[] IDs) { + return super.removeDmndDataInfo(IDs); + } + } @Controller diff --git a/src/main/java/cokr/xit/fims/task/web/DpvController.java b/src/main/java/cokr/xit/fims/task/web/DpvController.java index ae071f70..f3678602 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -132,6 +132,12 @@ public class DpvController { return super.createDmndDataInfo(crdnCvlcpt); } + @Override + @RequestMapping(name="장애인과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo) + public ModelAndView removeDmndDataInfo(String[] IDs) { + return super.removeDmndDataInfo(IDs); + } + } @Controller diff --git a/src/main/java/cokr/xit/fims/task/web/EcaController.java b/src/main/java/cokr/xit/fims/task/web/EcaController.java index f32a2756..f89e30f1 100644 --- a/src/main/java/cokr/xit/fims/task/web/EcaController.java +++ b/src/main/java/cokr/xit/fims/task/web/EcaController.java @@ -130,6 +130,12 @@ public class EcaController { return super.createDmndDataInfo(crdnCvlcpt); } + @Override + @RequestMapping(name="전기차과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo) + public ModelAndView removeDmndDataInfo(String[] IDs) { + return super.removeDmndDataInfo(IDs); + } + } @Controller diff --git a/src/main/java/cokr/xit/fims/task/web/PvsController.java b/src/main/java/cokr/xit/fims/task/web/PvsController.java index 040427a4..03bcc43b 100644 --- a/src/main/java/cokr/xit/fims/task/web/PvsController.java +++ b/src/main/java/cokr/xit/fims/task/web/PvsController.java @@ -135,6 +135,12 @@ public class PvsController { return super.createDmndDataInfo(crdnCvlcpt); } + @Override + @RequestMapping(name="주정차과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo) + public ModelAndView removeDmndDataInfo(String[] IDs) { + return super.removeDmndDataInfo(IDs); + } + } @Controller diff --git a/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml index 669232a1..d6d3a644 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/saCvlcptIndviDmnd-mapper.xml @@ -71,4 +71,15 @@ INSERT ) + +/* 새올요청자료 삭제(saCvlcptIndviDmndMapper.deleteDmndDataInfo) */ +UPDATE TB_SA_CVLCPT_INDIV_DMND + SET DEL_YN = 'Y' + , DEL_DT = /* 삭제일시 */ + , DLTR = #{removedBy} /* 삭제자 */ + WHERE INDIV_ID IN ( + #{indivId} + ) + + \ 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 1c1ad68e..4fcc8d18 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 @@ -449,7 +449,7 @@ $(document).ready(function(){ if(rcptYmd != null){ var ds = $P.crdnControl.dataset.getDataset(); - var crdnIds = ds.map(function(item){ + var crdnIds = ds.filter(function(item){ if(item['CVLCPT_RCPT_YMD'] == rcptYmd && !$P.holdList.includes(item['CRDN_ID'])){ return item["CRDN_ID"]; } diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp index 54b2b158..1d7ddb0c 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc04010-main.jsp @@ -251,6 +251,7 @@ $(document).ready(function(){ if (resp.saved){ $("#toastText--${pageName}").html("삭제 되었습니다."); $P.toast.show(); + $P.refreshDmndList(); } } @@ -362,17 +363,10 @@ $(document).ready(function(){ return data; } - $P.fnRemove = (allCompleteData) => { - if(allCompleteData){ - var ds = $P.dmndControl.dataset.getDataset(); - - var indivIds = ds.map(function(item){ - if(item['STTS_CD'] == '9'){ - return item["INDIV_ID"]; - } - }); - - $P.dmndControl.select(indivIds,true); + $P.fnRemove = (allCompleteDataIds) => { + + if(allCompleteDataIds != null){ + $P.dmndControl.select(allCompleteDataIds,true); } else { var cur = $P.dmndControl.getCurrent(); if(cur == null){ @@ -383,7 +377,7 @@ $(document).ready(function(){ $P.dmndControl.select(curKey,true); } - // TODO : 요청 삭제 서비스 //$P.dmndControl.remove(); + $P.dmndControl.remove(); } $P.fnRemoveAllCompleteData = () => { @@ -391,11 +385,24 @@ $(document).ready(function(){ if(cur == null){ return; } + + var ds = $P.dmndControl.dataset.getDataset(); + var indivIds = ds.filter(function(item){ + if(item['STTS_CD'] == '9'){ + return item["INDIV_ID"]; + } + }); + + if(indivIds.length == 0){ + dialog.alert("요청 완료자료가 없습니다."); + return; + } + dialog.alert({ content : "완료된 자료를 모두 삭제하시겠습니까?", onOK : () => { - $P.fnRemove(true); + $P.fnRemove(indivIds); } }); } @@ -450,7 +457,7 @@ $(document).ready(function(){ $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); }); $("#btnOpenDmndPop--${pageName}").on("click", () => $P.fnOpenDmndPop()); - $("#btnDelete--${pageName}").on("click", () => $P.fnRemove(false)); + $("#btnDelete--${pageName}").on("click", () => $P.fnRemove(null)); $("#btnDeleteAllCompleteData--${pageName}").on("click", () => $P.fnRemoveAllCompleteData()); /**************************************************************************