면제차량 이력 등록, 이력 조회 기능 추가

main
이범준 1 year ago
parent c0f0c37d6f
commit ec9995b98d

@ -13,6 +13,11 @@ public class ExmptnVhcl extends AbstractEntity {
*/
private String exmptnVhclId;
/**
*
*/
private String hstrySn;
/**
*
*/

@ -42,5 +42,16 @@ public interface ExmptnVhclMapper extends AbstractMapper {
*/
int deleteExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
/** .
* @param exmptnVhcl
* return
*/
int insertExemptionVehicleHistory(ExmptnVhcl exmptnVhcl);
/** .<br />
* @param exemptionVehicleId ID
* @return
*/
List<DataObject> selectExemptionVehicleHistoryList(String exmptnVhclId);
}

@ -57,4 +57,10 @@ public interface CrdnStngService {
*/
boolean removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl);
/** .
* @param exemptionVehicleId ID
* @return
*/
List<DataObject> getExemptionVehicleHistoryList(String exmptnVhclId);
}

@ -257,7 +257,11 @@ public class CrdnStngBean extends AbstractComponent {
* </ul>
*/
public boolean createExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return exmptnVhclMapper.insertExemptionVehicleInfo(exmptnVhcl) == 1 ? true : false;
if(exmptnVhclMapper.insertExemptionVehicleInfo(exmptnVhcl) != 1) {
return false;
}
return exmptnVhclMapper.insertExemptionVehicleHistory(exmptnVhcl) == 1 ? true : false;
}
/** .
@ -268,7 +272,11 @@ public class CrdnStngBean extends AbstractComponent {
* </ul>
*/
public boolean updateExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
return exmptnVhclMapper.updateExemptionVehicleInfo(exmptnVhcl) == 1 ? true : false;
if(exmptnVhclMapper.updateExemptionVehicleInfo(exmptnVhcl) != 1) {
return false;
}
return exmptnVhclMapper.insertExemptionVehicleHistory(exmptnVhcl) == 1 ? true : false;
}
/** .
@ -280,7 +288,15 @@ public class CrdnStngBean extends AbstractComponent {
*/
public boolean removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl) {
exmptnVhcl.setRemovedBy(currentUser().getId());
return exmptnVhclMapper.deleteExemptionVehicleInfo(exmptnVhcl) == 1 ? true : false;
if(exmptnVhclMapper.deleteExemptionVehicleInfo(exmptnVhcl) != 1) {
return false;
}
return exmptnVhclMapper.insertExemptionVehicleHistory(exmptnVhcl) == 1 ? true : false;
}
public List<DataObject> getExemptionVehicleHistoryList(String exmptnVhclId) {
return exmptnVhclMapper.selectExemptionVehicleHistoryList(exmptnVhclId);
}
}

@ -64,4 +64,9 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng
return crdnStngBean.removeExemptionVehicleInfo(exmptnVhcl);
}
@Override
public List<DataObject> getExemptionVehicleHistoryList(String exmptnVhclId) {
return crdnStngBean.getExemptionVehicleHistoryList(exmptnVhclId);
}
}

@ -33,6 +33,7 @@ public class Crdn08Controller extends ApplicationController {
, getExemptionVehicleInfo = "/020/info.do"
, createExemptionVehicleInfo = "/020/create.do"
, updateExemptionVehicleInfo = "/020/update.do"
, getExemptionVehicleHistoryList = "/030/list.do"
;
}
@ -53,8 +54,8 @@ public class Crdn08Controller extends ApplicationController {
mav.setViewName("fims/crdn/crdn08010-main");
mav.addObject("pageName", "crdn08010-main");
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM054");
mav.addObject("FIM054List", commonCodes.get("FIM054"));
Map<String, List<CommonCode>> commonCodes = getCodesOf("NTR034");
addCodes(commonCodes, mav, "NTR034");
return mav;
}
@ -158,4 +159,24 @@ public class Crdn08Controller extends ApplicationController {
.addObject("saved", saved);
}
/** .<br />
* {@link CrdnStngService#getExemptionVehicleHistoryList(CrdnQuery)}
* @param exmptnVhclId ID
* @return jsonView
*/
public ModelAndView getExemptionVehicleHistoryList(String exmptnVhclId) {
String pageName = "crdn08030-info";
ModelAndView mav = new ModelAndView("fims/crdn/"+pageName);
mav.addObject("pageName", pageName);
List<DataObject> list = crdnStngService.getExemptionVehicleHistoryList(exmptnVhclId);
mav.addObject("list", toJson(list));
Map<String, List<CommonCode>> commonCodes = getCodesOf("NTR034");
addCodes(commonCodes, mav, "NTR034");
return mav;
}
}

@ -343,6 +343,12 @@ public class BpvController {
return super.removeExemptionVehicleInfo(exmptnVhcl);
}
@Override
@RequestMapping(name="전용차로과태료업무 면제차량 이력 조회", value=METHOD_URL.getExemptionVehicleHistoryList)
public ModelAndView getExemptionVehicleHistoryList(String exmptnVhclId) {
return super.getExemptionVehicleHistoryList(exmptnVhclId);
}
}
@Controller

@ -112,4 +112,76 @@ UPDATE TB_EXMPTN_VHCL
WHERE EXMPTN_VHCL_ID = #{exmptnVhclId}
</update>
<insert id="insertExemptionVehicleHistory" parameterType="cokr.xit.fims.crdn.ExmptnVhcl">
/* 면제차량 정보 등록(exmptnVhclMapper.insertExemptionVehicleHistory) */
<selectKey resultType="string" keyProperty="hstrySn" keyColumn="NEW_ID" order="BEFORE">
SELECT
LPAD(CAST(IFNULL(MAX(HSTRY_SN) + 1, 1) AS INT), 5, '0')
AS NEW_ID
FROM TB_EXMPTN_VHCL_HSTRY WHERE EXMPTN_VHCL_ID = #{exmptnVhclId}
</selectKey>
INSERT INTO TB_EXMPTN_VHCL_HSTRY (
EXMPTN_VHCL_ID <!-- 면제 차량 ID -->
, HSTRY_SN <!-- 이력 일련번호 -->
, SGG_CD <!-- 시군구 코드 -->
, VHRNO <!-- 차량 번호 -->
, EXMPTN_RSN <!-- 면제 사유 -->
, DOC_NO <!-- 문서번호 -->
, OWNR_NM <!-- 소유자명 -->
, EXMPTN_BGNG_YMD <!-- 면제 시작 일자-->
, EXMPTN_END_YMD <!-- 면제 종료 일자 -->
, DEL_YN <!-- 삭제 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, MDFCN_DT <!-- 수정 일시 -->
, MDFR <!-- 수정자 -->
, DEL_DT <!-- 삭제 일시 -->
, DLTR <!-- 삭제자 -->
, DEL_RSN <!-- 삭제 사유 -->
) SELECT
EXMPTN_VHCL_ID <!-- 면제 차량 ID -->
, #{hstrySn} <!-- 이력 일련번호 -->
, SGG_CD <!-- 시군구 코드 -->
, VHRNO <!-- 차량 번호 -->
, EXMPTN_RSN <!-- 면제 사유 -->
, DOC_NO <!-- 문서번호 -->
, OWNR_NM <!-- 소유자명 -->
, EXMPTN_BGNG_YMD <!-- 면제 시작 일자-->
, EXMPTN_END_YMD <!-- 면제 종료 일자 -->
, DEL_YN <!-- 삭제 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, MDFCN_DT <!-- 수정 일시 -->
, MDFR <!-- 수정자 -->
, DEL_DT <!-- 삭제 일시 -->
, DLTR <!-- 삭제자 -->
, DEL_RSN <!-- 삭제 사유 -->
FROM TB_EXMPTN_VHCL
WHERE EXMPTN_VHCL_ID = #{exmptnVhclId}
</insert>
<select id="selectExemptionVehicleHistoryList" parameterType="string" resultType="dataobject">
/* 면제차량 이력 정보 조회(exmptnVhclMapper.selectExemptionVehicleHistoryList) */
SELECT A.EXMPTN_VHCL_ID
, A.HSTRY_SN
, A.SGG_CD
, A.VHRNO
, A.EXMPTN_RSN
, A.DOC_NO
, A.OWNR_NM
, A.EXMPTN_BGNG_YMD
, A.EXMPTN_END_YMD
, A.DEL_YN <!-- 삭제 여부 -->
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = A.RGTR) AS RGTR_NM
, A.REG_DT
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = A.MDFR) AS MDFR_NM
, A.MDFCN_DT
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = A.DLTR) AS DLTR_NM
, A.DEL_DT
, A.DEL_RSN <!-- 삭제 사유 -->
FROM TB_EXMPTN_VHCL_HSTRY A
WHERE A.EXMPTN_VHCL_ID = #{exmptnVhclId}
ORDER BY A.HSTRY_SN
</select>
</mapper>

@ -24,8 +24,8 @@
<label class="form-label fw-bold form-search-title" for="delYn--${pageName}">삭제여부</label>
<select id="delYn--${pageName}" name="denYn" class="form-select">
<option value="">전체</option>
<option value="N">정상자료</option>
<option value="Y">삭제자료</option>
<option value="N">사용</option>
<option value="Y">삭제</option>
</select>
</div>
</div>
@ -413,6 +413,27 @@ $(document).ready(function(){
});
};
$P.fnOpenHistory = () => {
var dataKey = $P.exmptnVhclControl.getCurrent()["EXMPTN_VHCL_ID"];
ajax.get({
url : wctx.url("/BPV/crdn/crdn08/030/list.do"),
data: { "exmptnVhclId" : dataKey },
success:resp => {
dialog.open({
id: "exmptnvhclHistorydialog",
title: "면제차량 이력",
content : resp,
size: "xxl",
init:() => {
}
});
}
});
}
$P.provide = {
"refreshList" : function(){
$P.refreshExmptnVhclList();
@ -427,7 +448,7 @@ $(document).ready(function(){
$("#btnCreate--${pageName}").on('click', () => { $P.exmptnVhclControl.newInfo(); });
$("#btnOpenDelRsn--${pageName}").on('click', () => { $P.fnOpenDelRsnDialog(); });
//$("#btnHistory--${pageName}").on('click', () => { ; });
$("#btnHistory--${pageName}").on('click', () => { $P.fnOpenHistory(); });
$("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });
$("#DataTables_Table_0--${pageName}").find("th").resizable({handles : "e"});

@ -0,0 +1,109 @@
<%@ 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">
<div class="card-datatable text-nowrap">
<div id="DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="table-responsive--${pageName}" class="table-responsive"
style="overflow-x: scroll;height:550px;overflow-y: scroll;">
<table id="DataTables_Table_0--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr id="exmptnVhclTheadTr--${pageName}">
<th style="width: 80px;">No.</th>
<th style="width: 140px;">차량번호</th>
<th style="width: 300px;">면제사유</th>
<th style="width: 200px;">공문번호</th>
<th style="width: 160px;">소유주명</th>
<th style="width: 160px;">면제시작일</th>
<th style="width: 160px;">면제종료일</th>
<th style="width: 100px;">삭제 여부</th>
<th style="width: 200px;">삭제사유</th>
<th style="width: 160px;">입력자</th>
<th style="width: 200px;">입력일시</th>
<th style="width: 160px;">수정자</th>
<th style="width: 200px;">수정일시</th>
<th style="width: 160px;">삭제자</th>
<th style="width: 200px;">삭제일시</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="exmptnVhclTbody--${pageName}"></tbody>
<template id="exmptnVhclRow--${pageName}">
<tr data-key="{HSTRY_SN}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{HSTRY_SN}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{VHRNO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{EXMPTN_RSN}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{DOC_NO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{OWNR_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{EXMPTN_BGNG_YMD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{EXMPTN_END_YMD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DEL_YN}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{DEL_RSN}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{RGTR_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{REG_DT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{MDFR_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{MDFCN_DT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{DLTR_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DEL_DT}</td>
<td class="dummy-td"></td>
</tr>
</template>
<template id="exmptnVhclNotFound--${pageName}">
<tr>
<td valign="top" colspan="15" class="dataTables_empty text-center">면제차량 이력 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
</div>
<script>
pageObject["${pageName}"] = {};
var NTR034 = new CommonCodes(${NTR034});
$(document).ready(function(){
var list = ${list};
console.log(list);
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.exmptnVhclControl = new DatasetControl({
urls : { },
dataGetter : obj => obj, appendData:false,
keymapper : info => info ? info.HSTRY_SN : "",
formats: {
EXMPTN_BGNG_YMD : dateFormat,
EXMPTN_END_YMD : dateFormat,
REG_DT : datetimeFormat,
MDFCN_DT : datetimeFormat,
DEL_DT : datetimeFormat,
DEL_YN : NTR034
}
});
$P.exmptnVhclControl.onDatasetChange = (obj) => {
var exmptnVhclList = $P.exmptnVhclControl.dataset;
var empty = exmptnVhclList.empty;
var notFound = [document.getElementById("exmptnVhclNotFound--${pageName}").innerHTML];
var found = document.getElementById("exmptnVhclRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "")
.replace(/{ondblclick}/gi, "");
var trs = empty ? notFound : exmptnVhclList.inStrings(found,replacer);
$("#exmptnVhclTbody--${pageName}").html(trs.join());
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
$P.exmptnVhclControl.setData(list);
});
</script>
Loading…
Cancel
Save