면제차량 수정 화면 추가

main
이범준 1 year ago
parent afc95a70dc
commit a75f78c24a

@ -17,4 +17,10 @@ public interface ExmptnVhclMapper extends AbstractMapper {
*/ */
List<DataObject> selectExemptionVehicleList(CrdnQuery query); List<DataObject> selectExemptionVehicleList(CrdnQuery query);
/** .<br />
* @param exemptionVehicleId ID
* @return
*/
DataObject selectExemptionVehicleInfo(String exemptionVehicleId);
} }

@ -31,4 +31,11 @@ public interface CrdnStngService {
* @return * @return
*/ */
List<DataObject> getExemptionVehicleList(CrdnQuery query); List<DataObject> getExemptionVehicleList(CrdnQuery query);
/** .
* @param exemptionVehicleId ID
* @return
*/
DataObject getExemptionVehicleInfo(String exemptionVehicleId);
} }

@ -240,4 +240,12 @@ public class CrdnStngBean extends AbstractComponent {
return exmptnVhclMapper.selectExemptionVehicleList(query); return exmptnVhclMapper.selectExemptionVehicleList(query);
} }
/** .
* @param exemptionVehicleId ID
* @return
*/
public DataObject getExemptionVehicleInfo(String exemptionVehicleId) {
return exmptnVhclMapper.selectExemptionVehicleInfo(exemptionVehicleId);
}
} }

@ -43,4 +43,9 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng
return crdnStngBean.selectExemptionVehicleList(query); return crdnStngBean.selectExemptionVehicleList(query);
} }
@Override
public DataObject getExemptionVehicleInfo(String exemptionVehicleId) {
return crdnStngBean.getExemptionVehicleInfo(exemptionVehicleId);
}
} }

@ -14,6 +14,7 @@ import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.service.CrdnStngService; import cokr.xit.fims.crdn.service.CrdnStngService;
import cokr.xit.foundation.data.DataObject;
/** .<br /> /** .<br />
* { }/crdn/crdn08 . * { }/crdn/crdn08 .
@ -27,6 +28,7 @@ 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"
, getExemptionVehicleInfo = "/020/info.do"
; ;
} }
@ -68,4 +70,24 @@ public class Crdn08Controller extends ApplicationController {
return setCollectionInfo(new ModelAndView("jsonView"), crdnStngService.getExemptionVehicleList(query),""); return setCollectionInfo(new ModelAndView("jsonView"), crdnStngService.getExemptionVehicleList(query),"");
} }
/** .<br />
* @return fims/crdn/crdn08020-info
*/
public ModelAndView getExemptionVehicleInfo(String exmptnVhclId) {
String pageName = "crdn08020-info";
ModelAndView mav = new ModelAndView("fims/crdn/"+pageName);
mav.addObject("pageName", pageName);
DataObject info = new DataObject();
if(!ifEmpty(exmptnVhclId, () -> "").equals("")) {
info = crdnStngService.getExemptionVehicleInfo(exmptnVhclId);
}
mav.addObject("exmptnVhclInfo", toJson(info));
return mav;
}
} }

@ -318,6 +318,12 @@ public class BpvController {
return super.getExemptionVehicleList(query); return super.getExemptionVehicleList(query);
} }
@Override
@RequestMapping(name="전용차로과태료업무 면제차량 정보 조회", value=METHOD_URL.getExemptionVehicleInfo)
public ModelAndView getExemptionVehicleInfo(String exmptnVhclId) {
return super.getExemptionVehicleInfo(exmptnVhclId);
}
} }
@Controller @Controller

@ -19,6 +19,7 @@ SELECT A.EXMPTN_VHCL_ID
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = A.DLTR) AS DLTR_NM , (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = A.DLTR) AS DLTR_NM
, A.DEL_RSN , A.DEL_RSN
, A.DEL_DT , A.DEL_DT
, A.DEL_YN
FROM TB_EXMPTN_VHCL A FROM TB_EXMPTN_VHCL A
WHERE A.SGG_CD = #{sggCd} WHERE A.SGG_CD = #{sggCd}
<if test="vhrno != null and vhrno != ''"> <if test="vhrno != null and vhrno != ''">
@ -35,4 +36,18 @@ SELECT A.EXMPTN_VHCL_ID
<include refid="utility.paging-suffix"/> <include refid="utility.paging-suffix"/>
</select> </select>
<select id="selectExemptionVehicleInfo" parameterType="string" resultType="dataobject">
/* 면제차량 정보 조회(exmptnVhclMapper.selectExemptionVehicleInfo) */
SELECT A.EXMPTN_VHCL_ID
, A.SGG_CD
, A.VHRNO
, A.EXMPTN_RSN
, A.DOC_NO
, A.OWNR_NM
, A.EXMPTN_BGNG_YMD
, A.EXMPTN_END_YMD
FROM TB_EXMPTN_VHCL A
WHERE A.EXMPTN_VHCL_ID = #{exmptnVhclId}
</select>
</mapper> </mapper>

@ -130,11 +130,14 @@ $(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"),
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")
}, },
dataGetter : obj => obj["List"], appendData:true, dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.EXMPTN_VHCL_ID : "", keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
formats: { formats: {
EXMPTN_BGNG_YMD : dateFormat,
EXMPTN_END_YMD : dateFormat,
REG_DT : datetimeFormat, REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat, MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat DEL_DT : datetimeFormat
@ -153,9 +156,25 @@ $(document).ready(function(){
success:resp => { success:resp => {
dialog.open({ dialog.open({
id: "exmptnvhcldialog", id: "exmptnvhcldialog",
title: "면제차량등록", title: "면제차량 등록",
content:resp, content:resp,
size: "xl", size: "lg",
init:() => {}
});
}
});
};
$P.exmptnVhclControl.getInfo = (param) => {
ajax.get({
url : $P.exmptnVhclControl.urls.getInfo,
data: param,
success:resp => {
dialog.open({
id: "exmptnvhcldialog",
title: "면제차량 수정",
content:resp,
size: "lg",
init:() => {} init:() => {}
}); });
} }
@ -253,8 +272,12 @@ $(document).ready(function(){
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
var data = $P.exmptnVhclControl.dataset.getData(dataKey);
// TODO : if(data.DEL_YN == "Y"){
dialog.alert("삭제된 자료입니다.");
return;
}
$P.exmptnVhclControl.getInfo({"exmptnVhclId" : dataKey});
} }
$P.renderExmptnVhclList = (total) => { $P.renderExmptnVhclList = (total) => {
@ -301,7 +324,7 @@ $(document).ready(function(){
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); $('#btnReset--${pageName}').on('click', () => $P.fnReset());
$("#btnSearch--${pageName}").on("click", () => $P.searchExmptnVhclList()); $("#btnSearch--${pageName}").on("click", () => $P.searchExmptnVhclList());
//$("#btnCreate--${pageName}").on('click', () => { ; }); $("#btnCreate--${pageName}").on('click', () => { $P.exmptnVhclControl.newInfo(); });
//$("#btnRemove--${pageName}").on('click', () => { ; }); //$("#btnRemove--${pageName}").on('click', () => { ; });
//$("#btnHistory--${pageName}").on('click', () => { ; }); //$("#btnHistory--${pageName}").on('click', () => { ; });

@ -0,0 +1,173 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<div class="card">
<form id="frmEdit--${pageName}">
<input type="hidden" id="exmptnVhclId--${pageName}" name="exmptnVhclId" data-map="EXMPTN_VHCL_ID" />
<input type="hidden" id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" />
<div class="row g-1">
<div class="col-md-12">
<label for="vhrno--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end required">
차량번호
</label>
<input type="text" id="vhrno--${pageName}" name="vhrno" data-map="VHRNO" class="form-control"
data-maxlengthb="30" required />
</div>
<div class="col-md-12">
<label class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
면제기간
</label>
<input type="text" id="exmptnBgngYmd--${pageName}" name="exmptnBgngYmd" data-map="EXMPTN_BGNG_YMD"
class="form-control form-date" data-fmt-type="day" title="시작 날짜 선택" />
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
~
<input type="text" id="exmptnEndYmd--${pageName}" name="exmptnEndYmd" data-map="EXMPTN_END_YMD"
class="form-control form-date" data-fmt-type="day" title="종료 날짜 선택">
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
</div>
<div class="col-md-12">
<label for="exmptnRsn--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
면제 사유
</label>
<input type="text" id="exmptnRsn--${pageName}" name="exmptnRsn" data-map="EXMPTN_RSN"
class="form-control w-px-300" data-maxlengthb="1000" />
</div>
<div class="col-md-12">
<label for="docNo--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
공문번호
</label>
<input type="text" id="docNo--${pageName}" name="docNo" data-map="DOC_NO"
class="form-control w-px-300" data-maxlengthb="100" />
</div>
<div class="col-md-12">
<label for="ownrNm--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
소유주명
</label>
<input type="text" id="ownrNm--${pageName}" name="ownrNm" data-map="OWNR_NM"
class="form-control w-px-300" data-maxlengthb="200" />
</div>
</div>
<div class="row mt-4 justify-content-end mb-3">
<div class="col-md-6">
<div class="row justify-content-end">
<div class="col-sm-3">
<button type="button" id="btnSave--${pageName}" class="btn btn-primary">저장</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.exmptnVhclControl = new DatasetControl({
urls : {
load : "",
create : wctx.url("/BPV/crdn/crdn08/020/create.do"),
update : wctx.url("/BPV/crdn/crdn08/020/update.do")
},
keymapper : info => info ? info.EXMPTN_VHCL_ID : "",
dataGetter : obj => obj.exmptnVhclInfo,
formats : {
}
});
$P.exmptnVhclControl.setInfo = (item) => {
$P.formFields.set(item);
var create = isEmpty(item.EXMPTN_VHCL_ID);
$("#vhrno--${pageName}").prop("readonly", !create);
}
$P.exmptnVhclControl.save = (info) => {
if (!info) return;
var item = $P.exmptnVhclControl.getCurrent("item"),
create = "added" == item.state;
ajax.post({
url : !create ? $P.exmptnVhclControl.urls.update : $P.exmptnVhclControl.urls.create,
data : info,
success : resp => $P.exmptnVhclControl.onSave(resp)
});
};
/**************************************************************************
* DatasetControl.on, Dataset.on
**************************************************************************/
$P.exmptnVhclControl.onSave = (resp) => {
if (resp.saved) {
dialog.alert("저장됐습니다.");
dialog.close("exmptnvhcldialog");
}
};
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnSave = () => {
if(!customValidate($("#frmEdit--${pageName} input"))) return;
if(confirm("면제 차량 정보를 저장하시겠습니까?")){
$P.exmptnVhclControl.save($P.formFields.get());
}
};
/**************************************************************************
* element.on
**************************************************************************/
$("#btnSave--${pageName}").on('click', () => $P.fnSave());
/**************************************************************************
* 초기화
**************************************************************************/
initDatepicker("frmEdit--${pageName}"); //달력 초기화
$("#frmEdit--${pageName}").find(".form-date").each(function(){
$(this).on("input",function(){
var value = this.value.replaceAll("-","");
if(value.length > 7){
this.value = value.substring(0,4)+"-"+value.substring(4,6)+"-"+value.substring(6);
} else if(value.length > 5){
this.value = value.substring(0,4)+"-"+value.substring(4);
}
});
});
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
var exmptnVhclInfo = ${exmptnVhclInfo};
$P.exmptnVhclControl.setInfo(exmptnVhclInfo);
});
</script>
Loading…
Cancel
Save