새올요청자료 삭제 기능 추가

main
이범준 1 year ago
parent eaa281cd4b
commit a394412c0d

@ -51,7 +51,7 @@ public interface CrdnUpdtMapper extends AbstractMapper {
int updateCrdnAddition(Crdn crdn); int updateCrdnAddition(Crdn crdn);
/** . /** .
* @param params * @param map
* @return * @return
*/ */
int removeCrdn(Map<String, Object> map); int removeCrdn(Map<String, Object> map);

@ -84,6 +84,6 @@ public class CrdnBean extends AbstractComponent {
paramMap.put("crdnIDs", crdnIdList); paramMap.put("crdnIDs", crdnIdList);
paramMap.put("removedBy", UserInfo.current().getId()); paramMap.put("removedBy", UserInfo.current().getId());
return crdnUpdtMapper.removeCrdn(paramMap) == 1 ? true : false; return crdnUpdtMapper.removeCrdn(paramMap) >= 1 ? true : false;
} }
} }

@ -1,6 +1,7 @@
package cokr.xit.fims.cvlc.dao; package cokr.xit.fims.cvlc.dao;
import java.util.List; import java.util.List;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
@ -27,4 +28,10 @@ public interface SaCvlcptIndviDmndMapper extends AbstractMapper {
*/ */
int insertDmndDataInfo(CrdnCvlcpt crdnCvlcpt); int insertDmndDataInfo(CrdnCvlcpt crdnCvlcpt);
/** .
* @param map
* @return
*/
int deleteDmndDataInfo(Map<String, Object> map);
} }

@ -121,4 +121,9 @@ public interface CrdnCvlcptService {
*/ */
boolean createDmndDataInfo(CrdnCvlcpt crdnCvlcpt); boolean createDmndDataInfo(CrdnCvlcpt crdnCvlcpt);
/** .
* @param indivIDs ID
* @return
*/
boolean removeDmndDataInfo(String... indivIDs);
} }

@ -1,8 +1,11 @@
package cokr.xit.fims.cvlc.service.bean; package cokr.xit.fims.cvlc.service.bean;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -342,4 +345,22 @@ public class CrdnCvlcptMainBean extends AbstractComponent {
return saCvlcptIndviDmndMapper.insertDmndDataInfo(crdnCvlcpt) == 1 ? true : false; return saCvlcptIndviDmndMapper.insertDmndDataInfo(crdnCvlcpt) == 1 ? true : false;
} }
/** .
* @param indivIDs ID
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean removeDmndDataInfo(String... indivIDs) {
if (isEmpty(indivIDs)) return false;
Map<String, Object> paramMap = new HashMap<String, Object>();
List<String> indivIdList = Arrays.asList(indivIDs);
paramMap.put("indivIDs", indivIdList);
paramMap.put("removedBy", UserInfo.current().getId());
return saCvlcptIndviDmndMapper.deleteDmndDataInfo(paramMap) >= 1 ? true : false;
}
} }

@ -736,4 +736,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
return crdnCvlcptMainBean.createDmndDataInfo(crdnCvlcpt); return crdnCvlcptMainBean.createDmndDataInfo(crdnCvlcpt);
} }
@Override
public boolean removeDmndDataInfo(String... indivIDs) {
return crdnCvlcptMainBean.removeDmndDataInfo(indivIDs);
}
} }

@ -26,7 +26,8 @@ public class Cvlc04Controller extends ApplicationController {
public class METHOD_URL { public class METHOD_URL {
public static final String public static final String
getDmndDataList = "/010/list.do", 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); .addObject("saved", saved);
} }
/** .
* @param IDs ID
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
public ModelAndView removeDmndDataInfo(String[] IDs) {
boolean saved = crdnCvlcptService.removeDmndDataInfo(IDs);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
} }

@ -130,6 +130,12 @@ public class BpvController {
return super.createDmndDataInfo(crdnCvlcpt); return super.createDmndDataInfo(crdnCvlcpt);
} }
@Override
@RequestMapping(name="전용차로과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo)
public ModelAndView removeDmndDataInfo(String[] IDs) {
return super.removeDmndDataInfo(IDs);
}
} }
@Controller @Controller

@ -132,6 +132,12 @@ public class DpvController {
return super.createDmndDataInfo(crdnCvlcpt); return super.createDmndDataInfo(crdnCvlcpt);
} }
@Override
@RequestMapping(name="장애인과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo)
public ModelAndView removeDmndDataInfo(String[] IDs) {
return super.removeDmndDataInfo(IDs);
}
} }
@Controller @Controller

@ -130,6 +130,12 @@ public class EcaController {
return super.createDmndDataInfo(crdnCvlcpt); return super.createDmndDataInfo(crdnCvlcpt);
} }
@Override
@RequestMapping(name="전기차과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo)
public ModelAndView removeDmndDataInfo(String[] IDs) {
return super.removeDmndDataInfo(IDs);
}
} }
@Controller @Controller

@ -135,6 +135,12 @@ public class PvsController {
return super.createDmndDataInfo(crdnCvlcpt); return super.createDmndDataInfo(crdnCvlcpt);
} }
@Override
@RequestMapping(name="주정차과태료업무 새올요청자료 삭제", value=METHOD_URL.removeDmndDataInfo)
public ModelAndView removeDmndDataInfo(String[] IDs) {
return super.removeDmndDataInfo(IDs);
}
} }
@Controller @Controller

@ -71,4 +71,15 @@ INSERT
) )
</insert> </insert>
<update id="deleteDmndDataInfo" parameterType="map">
/* 새올요청자료 삭제(saCvlcptIndviDmndMapper.deleteDmndDataInfo) */
UPDATE TB_SA_CVLCPT_INDIV_DMND
SET DEL_YN = 'Y'
, DEL_DT = <include refid="utility.now" /> /* 삭제일시 */
, DLTR = #{removedBy} /* 삭제자 */
WHERE INDIV_ID IN (
<foreach collection="indivIDs" item="indivId" separator=",">#{indivId}</foreach>
)
</update>
</mapper> </mapper>

@ -449,7 +449,7 @@ $(document).ready(function(){
if(rcptYmd != null){ if(rcptYmd != null){
var ds = $P.crdnControl.dataset.getDataset(); 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'])){ if(item['CVLCPT_RCPT_YMD'] == rcptYmd && !$P.holdList.includes(item['CRDN_ID'])){
return item["CRDN_ID"]; return item["CRDN_ID"];
} }

@ -251,6 +251,7 @@ $(document).ready(function(){
if (resp.saved){ if (resp.saved){
$("#toastText--${pageName}").html("삭제 되었습니다."); $("#toastText--${pageName}").html("삭제 되었습니다.");
$P.toast.show(); $P.toast.show();
$P.refreshDmndList(); $P.refreshDmndList();
} }
} }
@ -362,17 +363,10 @@ $(document).ready(function(){
return data; return data;
} }
$P.fnRemove = (allCompleteData) => { $P.fnRemove = (allCompleteDataIds) => {
if(allCompleteData){
var ds = $P.dmndControl.dataset.getDataset(); if(allCompleteDataIds != null){
$P.dmndControl.select(allCompleteDataIds,true);
var indivIds = ds.map(function(item){
if(item['STTS_CD'] == '9'){
return item["INDIV_ID"];
}
});
$P.dmndControl.select(indivIds,true);
} else { } else {
var cur = $P.dmndControl.getCurrent(); var cur = $P.dmndControl.getCurrent();
if(cur == null){ if(cur == null){
@ -383,7 +377,7 @@ $(document).ready(function(){
$P.dmndControl.select(curKey,true); $P.dmndControl.select(curKey,true);
} }
// TODO : 요청 삭제 서비스 //$P.dmndControl.remove(); $P.dmndControl.remove();
} }
$P.fnRemoveAllCompleteData = () => { $P.fnRemoveAllCompleteData = () => {
@ -391,11 +385,24 @@ $(document).ready(function(){
if(cur == null){ if(cur == null){
return; 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({ dialog.alert({
content : "완료된 자료를 모두 삭제하시겠습니까?", content : "완료된 자료를 모두 삭제하시겠습니까?",
onOK : () => { onOK : () => {
$P.fnRemove(true); $P.fnRemove(indivIds);
} }
}); });
} }
@ -450,7 +457,7 @@ $(document).ready(function(){
$("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); }); $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
$("#btnOpenDmndPop--${pageName}").on("click", () => $P.fnOpenDmndPop()); $("#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()); $("#btnDeleteAllCompleteData--${pageName}").on("click", () => $P.fnRemoveAllCompleteData());
/************************************************************************** /**************************************************************************

Loading…
Cancel
Save