면제차량 삭제 기능 추가

main
이범준 1 year ago
parent 2690d7aff0
commit c0f0c37d6f

@ -28,12 +28,19 @@ public interface ExmptnVhclMapper extends AbstractMapper {
* @param exmptnVhcl * @param exmptnVhcl
* return * return
*/ */
int insertExmptnVhclInfo(ExmptnVhcl exmptnVhcl); int insertExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
/** . /** .
* @param exmptnVhcl * @param exmptnVhcl
* return * return
*/ */
int updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl); int updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
/** .
* @param exmptnVhcl
* return
*/
int deleteExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
} }

@ -43,12 +43,18 @@ public interface CrdnStngService {
* @param exmptnVhcl * @param exmptnVhcl
* @return * @return
*/ */
boolean createExmptnVhclInfo(ExmptnVhcl exmptnVhcl); boolean createExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
/** . /** .
* @param exmptnVhcl * @param exmptnVhcl
* @return * @return
*/ */
boolean updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl); boolean updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
/** .
* @param exmptnVhcl
* @return
*/
boolean removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
} }

@ -256,8 +256,8 @@ public class CrdnStngBean extends AbstractComponent {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public boolean createExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return exmptnVhclMapper.insertExmptnVhclInfo(exmptnVhcl) == 1 ? true : false; return exmptnVhclMapper.insertExemptionVehicleInfo(exmptnVhcl) == 1 ? true : false;
} }
/** . /** .
@ -267,8 +267,20 @@ public class CrdnStngBean extends AbstractComponent {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public boolean updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return exmptnVhclMapper.updateExmptnVhclInfo(exmptnVhcl) == 1 ? true : false; return exmptnVhclMapper.updateExemptionVehicleInfo(exmptnVhcl) == 1 ? true : false;
}
/** .
* @param exmptnVhcl
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
exmptnVhcl.setRemovedBy(currentUser().getId());
return exmptnVhclMapper.deleteExemptionVehicleInfo(exmptnVhcl) == 1 ? true : false;
} }
} }

@ -50,13 +50,18 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng
} }
@Override @Override
public boolean createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public boolean createExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return crdnStngBean.createExmptnVhclInfo(exmptnVhcl); return crdnStngBean.createExemptionVehicleInfo(exmptnVhcl);
} }
@Override @Override
public boolean updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public boolean updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return crdnStngBean.updateExmptnVhclInfo(exmptnVhcl); return crdnStngBean.updateExemptionVehicleInfo(exmptnVhcl);
}
@Override
public boolean removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return crdnStngBean.removeExemptionVehicleInfo(exmptnVhcl);
} }
} }

@ -29,9 +29,10 @@ public class Crdn08Controller extends ApplicationController {
public static final String public static final String
exemptionVehicleManagementMain = "/010/main.do" exemptionVehicleManagementMain = "/010/main.do"
, getExemptionVehicleList = "/010/list.do" , getExemptionVehicleList = "/010/list.do"
, removeExemptionVehicleInfo = "/010/remove.do"
, getExemptionVehicleInfo = "/020/info.do" , getExemptionVehicleInfo = "/020/info.do"
, createExmptnVhclInfo = "/020/create.do" , createExemptionVehicleInfo = "/020/create.do"
, updateExmptnVhclInfo = "/020/update.do" , updateExemptionVehicleInfo = "/020/update.do"
; ;
} }
@ -94,14 +95,14 @@ public class Crdn08Controller extends ApplicationController {
} }
/** . /** .
* {@link CrdnStngService#createExmptnVhclInfo(exmptnVhcl)} * {@link CrdnStngService#createExemptionVehicleInfo(exmptnVhcl)}
* @param exmptnVhcl * @param exmptnVhcl
* @return jsonView * @return jsonView
* <pre><code> { * <pre><code> {
* "saved": true, false * "saved": true, false
* }</code></pre> * }</code></pre>
*/ */
public ModelAndView createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public ModelAndView createExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute()); ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
String deptCd = currentUser.getDeptCode(); String deptCd = currentUser.getDeptCode();
@ -109,7 +110,7 @@ public class Crdn08Controller extends ApplicationController {
boolean saved = false; boolean saved = false;
saved = crdnStngService.createExmptnVhclInfo(exmptnVhcl); saved = crdnStngService.createExemptionVehicleInfo(exmptnVhcl);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
@ -117,14 +118,14 @@ public class Crdn08Controller extends ApplicationController {
} }
/** . /** .
* {@link CrdnStngService#updateExmptnVhclInfo(exmptnVhcl)} * {@link CrdnStngService#updateExemptionVehicleInfo(exmptnVhcl)}
* @param exmptnVhcl * @param exmptnVhcl
* @return jsonView * @return jsonView
* <pre><code> { * <pre><code> {
* "saved": true, false * "saved": true, false
* }</code></pre> * }</code></pre>
*/ */
public ModelAndView updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public ModelAndView updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute()); ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
String deptCd = currentUser.getDeptCode(); String deptCd = currentUser.getDeptCode();
@ -132,11 +133,29 @@ public class Crdn08Controller extends ApplicationController {
boolean saved = false; boolean saved = false;
saved = crdnStngService.updateExmptnVhclInfo(exmptnVhcl); saved = crdnStngService.updateExemptionVehicleInfo(exmptnVhcl);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
} }
/** .
* {@link CrdnStngService#removeExemptionVehicleInfo(exmptnVhclId)}
* @param exmptnVhcl
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
boolean saved = false;
saved = crdnStngService.removeExemptionVehicleInfo(exmptnVhcl);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
} }

@ -326,16 +326,23 @@ public class BpvController {
} }
@Override @Override
@RequestMapping(name="전용차로과태료업무 면제차량 정보 등록", value=METHOD_URL.createExmptnVhclInfo) @RequestMapping(name="전용차로과태료업무 면제차량 정보 등록", value=METHOD_URL.createExemptionVehicleInfo)
public ModelAndView createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public ModelAndView createExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return super.createExmptnVhclInfo(exmptnVhcl); return super.createExemptionVehicleInfo(exmptnVhcl);
} }
@Override @Override
@RequestMapping(name="전용차로과태료업무 면제차량 정보 수정", value=METHOD_URL.updateExmptnVhclInfo) @RequestMapping(name="전용차로과태료업무 면제차량 정보 수정", value=METHOD_URL.updateExemptionVehicleInfo)
public ModelAndView updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) { public ModelAndView updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return super.updateExmptnVhclInfo(exmptnVhcl); return super.updateExemptionVehicleInfo(exmptnVhcl);
} }
@Override
@RequestMapping(name="전용차로과태료업무 면제차량 정보 삭제", value=METHOD_URL.removeExemptionVehicleInfo)
public ModelAndView removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return super.removeExemptionVehicleInfo(exmptnVhcl);
}
} }
@Controller @Controller

@ -50,8 +50,8 @@ SELECT A.EXMPTN_VHCL_ID
WHERE A.EXMPTN_VHCL_ID = #{exmptnVhclId} WHERE A.EXMPTN_VHCL_ID = #{exmptnVhclId}
</select> </select>
<insert id="insertExmptnVhclInfo" parameterType="cokr.xit.fims.crdn.ExmptnVhcl"> <insert id="insertExemptionVehicleInfo" parameterType="cokr.xit.fims.crdn.ExmptnVhcl">
/* 면제차량 정보 등록(exmptnVhclMapper.insertExmptnVhclInfo) */ /* 면제차량 정보 등록(exmptnVhclMapper.insertExemptionVehicleInfo) */
<selectKey resultType="string" keyProperty="exmptnVhclId" keyColumn="NEW_ID" order="BEFORE"> <selectKey resultType="string" keyProperty="exmptnVhclId" keyColumn="NEW_ID" order="BEFORE">
SELECT SELECT
LPAD(CAST(IFNULL(MAX(EXMPTN_VHCL_ID) + 1, 1) AS INT), 10, '0') LPAD(CAST(IFNULL(MAX(EXMPTN_VHCL_ID) + 1, 1) AS INT), 10, '0')
@ -82,23 +82,33 @@ INSERT INTO TB_EXMPTN_VHCL (
, #{exmptnBgngYmd} <!-- 면제 시작 일자--> , #{exmptnBgngYmd} <!-- 면제 시작 일자-->
, #{exmptnEndYmd} <!-- 면제 종료 일자 --> , #{exmptnEndYmd} <!-- 면제 종료 일자 -->
, 'N' <!-- 삭제 여부 --> , 'N' <!-- 삭제 여부 -->
, #{createdAt} <!-- 등록 일시 --> , <include refid="utility.now" /> <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 --> , #{createdBy} <!-- 등록자 -->
, #{lastModified} <!-- 수정 일시 --> , <include refid="utility.now" /> <!-- 수정 일시 -->
, #{modifiedBy} <!-- 수정자 --> , #{modifiedBy} <!-- 수정자 -->
) )
</insert> </insert>
<update id="updateExmptnVhclInfo" parameterType="cokr.xit.fims.crdn.ExmptnVhcl"> <update id="updateExemptionVehicleInfo" parameterType="cokr.xit.fims.crdn.ExmptnVhcl">
/* 면제차량 정보 수정(exmptnVhclMapper.updateExmptnVhclInfo) */ /* 면제차량 정보 수정(exmptnVhclMapper.updateExemptionVehicleInfo) */
UPDATE TB_EXMPTN_VHCL UPDATE TB_EXMPTN_VHCL
SET EXMPTN_RSN = #{exmptnRsn} <!-- 면제 사유 --> SET EXMPTN_RSN = #{exmptnRsn} <!-- 면제 사유 -->
, DOC_NO = #{docNo} <!-- 문서번호 --> , DOC_NO = #{docNo} <!-- 문서번호 -->
, OWNR_NM = #{ownrNm} <!-- 소유자명 --> , OWNR_NM = #{ownrNm} <!-- 소유자명 -->
, EXMPTN_BGNG_YMD = #{exmptnBgngYmd} <!-- 면제 시작 일자 --> , EXMPTN_BGNG_YMD = #{exmptnBgngYmd} <!-- 면제 시작 일자 -->
, EXMPTN_END_YMD = #{exmptnEndYmd} <!-- 면제 종료 일자 --> , EXMPTN_END_YMD = #{exmptnEndYmd} <!-- 면제 종료 일자 -->
, MDFCN_DT = #{lastModified} <!-- 수정 일시 --> , MDFCN_DT = <include refid="utility.now" /> <!-- 수정 일시 -->
, MDFR = #{modifiedBy} <!-- 수정자 --> , MDFR = #{modifiedBy} <!-- 수정자 -->
WHERE EXMPTN_VHCL_ID = #{exmptnVhclId}
</update>
<update id="deleteExemptionVehicleInfo" parameterType="cokr.xit.fims.crdn.ExmptnVhcl">
/* 면제차량 정보 삭제(exmptnVhclMapper.deleteExemptionVehicleInfo) */
UPDATE TB_EXMPTN_VHCL
SET DEL_YN = 'Y'
, DEL_RSN = #{delRsn} <!-- 삭제 사유 -->
, DEL_DT = <include refid="utility.now" /> <!-- 삭제 일시 -->
, DLTR = #{removedBy} <!-- 삭제자 -->
WHERE EXMPTN_VHCL_ID = #{exmptnVhclId} WHERE EXMPTN_VHCL_ID = #{exmptnVhclId}
</update> </update>

@ -42,7 +42,7 @@
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" id="btnCreate--${pageName}" <button type="button" id="btnCreate--${pageName}"
class="btn btn-primary" title="면제차량 등록">면제차량 등록</button> class="btn btn-primary" title="면제차량 등록">면제차량 등록</button>
<button type="button" id="btnRemove--${pageName}" <button type="button" id="btnOpenDelRsn--${pageName}"
class="btn btn-primary" title="면제차량 삭제">면제차량 삭제</button> class="btn btn-primary" title="면제차량 삭제">면제차량 삭제</button>
<button type="button" id="btnHistory--${pageName}" <button type="button" id="btnHistory--${pageName}"
class="btn btn-primary" title="면제차량 수정이력">면제차량 수정이력</button> class="btn btn-primary" title="면제차량 수정이력">면제차량 수정이력</button>
@ -112,6 +112,29 @@
<div class="content-backdrop fade"></div> <div class="content-backdrop fade"></div>
</div> </div>
<template id="delRsnDialogTemplate--${pageName}">
<form id="frmEdit--${pageName}">
<div class="card">
<div class="row g-1">
<div class="col-md-12">
<label for="delRsn--${pageName}"
class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">삭제사유</label>
<input type="text" id="delRsn--${pageName}" name="delRsn"
class="form-control w-80" type="text" maxlength="1000" data-maxlengthb="1000" />
</div>
</div>
</div>
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<button type="button" class="btn btn-primary" id="btnRemove--${pageName}" title="확인">확인</button>
</span>
</span>
</div>
</form>
</template>
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
@ -129,6 +152,7 @@ $(document).ready(function(){
$P.exmptnVhclControl = new DatasetControl({ $P.exmptnVhclControl = new DatasetControl({
urls : { urls : {
load : wctx.url("/BPV/crdn/crdn08/010/list.do"), load : wctx.url("/BPV/crdn/crdn08/010/list.do"),
remove : wctx.url("/BPV/crdn/crdn08/010/remove.do"),
newInfo : wctx.url("/BPV/crdn/crdn08/020/info.do"), newInfo : wctx.url("/BPV/crdn/crdn08/020/info.do"),
getInfo : wctx.url("/BPV/crdn/crdn08/020/info.do") getInfo : wctx.url("/BPV/crdn/crdn08/020/info.do")
}, },
@ -233,6 +257,7 @@ $(document).ready(function(){
} }
$P.exmptnVhclControl.tableRenderComplete = false; $P.exmptnVhclControl.tableRenderComplete = false;
if(!item){ if(!item){
$P.clickExmptnVhclList("", true); $P.clickExmptnVhclList("", true);
} else { } else {
@ -252,7 +277,10 @@ $(document).ready(function(){
} }
$P.refreshExmptnVhclList = () => { $P.refreshExmptnVhclList = () => {
$P.exmptnVhclControl.untilPageNum = $P.exmptnVhclControl.query.pageNum; if($P.exmptnVhclControl.query.pageNum == null){
$P.exmptnVhclControl.query.pageNum = 1;
}
$P.exmptnVhclControl.untilPageNum = $P.exmptnVhclControl.query.pageNum;
$P.exmptnVhclControl.query.fetchSize = $P.exmptnVhclControl.defaultFetchSize * $P.exmptnVhclControl.query.pageNum; $P.exmptnVhclControl.query.fetchSize = $P.exmptnVhclControl.defaultFetchSize * $P.exmptnVhclControl.query.pageNum;
$P.exmptnVhclControl.load(1); $P.exmptnVhclControl.load(1);
} }
@ -284,8 +312,18 @@ $(document).ready(function(){
$P.clickExmptnVhclList = (dataKey, auto) => { $P.clickExmptnVhclList = (dataKey, auto) => {
if(dataKey == ""){ if(dataKey == ""){
$("#btnOpenDelRsn--${pageName}").prop("disabled", true);
$("#btnHistory--${pageName}").prop("disabled", true);
return; return;
} }
if($P.exmptnVhclControl.dataset.getData(dataKey)["DEL_YN"] == "N"){
$("#btnOpenDelRsn--${pageName}").prop("disabled", false);
} else {
$("#btnOpenDelRsn--${pageName}").prop("disabled", true);
}
$("#btnHistory--${pageName}").prop("disabled", false);
$("#exmptnVhclTbody--${pageName}").setCurrentRow(dataKey); $("#exmptnVhclTbody--${pageName}").setCurrentRow(dataKey);
if(!auto) { if(!auto) {
@ -343,6 +381,38 @@ $(document).ready(function(){
return data; return data;
} }
$P.fnOpenDelRsnDialog = () => {
dialog.open({
id : "delRsnDialog--${pageName}",
title : "삭제사유입력다이얼로그",
content : document.getElementById("delRsnDialogTemplate--${pageName}").innerHTML,
size : "xl",
init : () => {
$("#delRsnDialog--${pageName} .modal-content").css("min-width","700px");
$('#btnRemove--${pageName}').on("click", () => $P.fnRemove());
},
onClose : () => {}
});
}
$P.fnRemove = () => {
var dataKey = $P.exmptnVhclControl.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({
url : $P.exmptnVhclControl.urls.remove,
data : {
"exmptnVhclId" : dataKey,
"delRsn" : $("#delRsn--${pageName}").val()
},
success : resp => {
if(resp.saved){
dialog.close("delRsnDialog--${pageName}");
$P.refreshExmptnVhclList();
}
}
});
};
$P.provide = { $P.provide = {
"refreshList" : function(){ "refreshList" : function(){
$P.refreshExmptnVhclList(); $P.refreshExmptnVhclList();
@ -356,7 +426,7 @@ $(document).ready(function(){
$("#btnSearch--${pageName}").on("click", () => $P.searchExmptnVhclList()); $("#btnSearch--${pageName}").on("click", () => $P.searchExmptnVhclList());
$("#btnCreate--${pageName}").on('click', () => { $P.exmptnVhclControl.newInfo(); }); $("#btnCreate--${pageName}").on('click', () => { $P.exmptnVhclControl.newInfo(); });
//$("#btnRemove--${pageName}").on('click', () => { ; }); $("#btnOpenDelRsn--${pageName}").on('click', () => { $P.fnOpenDelRsnDialog(); });
//$("#btnHistory--${pageName}").on('click', () => { ; }); //$("#btnHistory--${pageName}").on('click', () => { ; });
$("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); }); $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });

@ -133,8 +133,8 @@ $(document).ready(function(){
$P.exmptnVhclControl.onSave = (resp) => { $P.exmptnVhclControl.onSave = (resp) => {
if (resp.saved) { if (resp.saved) {
dialog.alert("저장됐습니다."); dialog.alert("저장됐습니다.");
$P.provided.refreshList();
dialog.close("exmptnvhcldialog"); dialog.close("exmptnvhcldialog");
$P.provided.refreshList();
} }
}; };
/************************************************************************** /**************************************************************************

Loading…
Cancel
Save