diff --git a/src/main/java/cokr/xit/fims/crdn/ExmptnVhcl.java b/src/main/java/cokr/xit/fims/crdn/ExmptnVhcl.java index a58109db..d3bbc0ef 100644 --- a/src/main/java/cokr/xit/fims/crdn/ExmptnVhcl.java +++ b/src/main/java/cokr/xit/fims/crdn/ExmptnVhcl.java @@ -13,6 +13,11 @@ public class ExmptnVhcl extends AbstractEntity { */ private String exmptnVhclId; + /** + * 이력 일련번호 + */ + private String hstrySn; + /** * 시군구 코드 */ diff --git a/src/main/java/cokr/xit/fims/crdn/dao/ExmptnVhclMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/ExmptnVhclMapper.java index 572e07ca..1cb77dbb 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/ExmptnVhclMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/ExmptnVhclMapper.java @@ -42,5 +42,16 @@ public interface ExmptnVhclMapper extends AbstractMapper { */ int deleteExemptionVehicleInfo(ExmptnVhcl exmptnVhcl); + /**면제차량 이력을 등록한다. + * @param exmptnVhcl 면제차량 정보 + * return 저장된 정보 수 + */ + int insertExemptionVehicleHistory(ExmptnVhcl exmptnVhcl); + + /**면제차량 이력을 조회한다.
+ * @param exemptionVehicleId 면제차량 ID + * @return 면제차량 이력 + */ + List selectExemptionVehicleHistoryList(String exmptnVhclId); } diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnStngService.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnStngService.java index f0958d8a..299fc67e 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnStngService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnStngService.java @@ -57,4 +57,10 @@ public interface CrdnStngService { */ boolean removeExemptionVehicleInfo(ExmptnVhcl exmptnVhcl); + /** 면제차량 이력을 조회한다. + * @param exemptionVehicleId 면제차량 ID + * @return 면제차량 이력 + */ + List getExemptionVehicleHistoryList(String exmptnVhclId); + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java index 32bf2bd5..3451e136 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngBean.java @@ -257,7 +257,11 @@ public class CrdnStngBean extends AbstractComponent { * */ 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 { * */ 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 getExemptionVehicleHistoryList(String exmptnVhclId) { + return exmptnVhclMapper.selectExemptionVehicleHistoryList(exmptnVhclId); } } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java index a053e88c..1344bb55 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnStngServiceBean.java @@ -64,4 +64,9 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng return crdnStngBean.removeExemptionVehicleInfo(exmptnVhcl); } + @Override + public List getExemptionVehicleHistoryList(String exmptnVhclId) { + return crdnStngBean.getExemptionVehicleHistoryList(exmptnVhclId); + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn08Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn08Controller.java index 361e0401..49d5484b 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn08Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn08Controller.java @@ -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> commonCodes = getCodesOf("FIM054"); - mav.addObject("FIM054List", commonCodes.get("FIM054")); + Map> commonCodes = getCodesOf("NTR034"); + addCodes(commonCodes, mav, "NTR034"); return mav; } @@ -158,4 +159,24 @@ public class Crdn08Controller extends ApplicationController { .addObject("saved", saved); } + + /**면제차량 이력을 조회한다.
+ * {@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 list = crdnStngService.getExemptionVehicleHistoryList(exmptnVhclId); + + mav.addObject("list", toJson(list)); + + Map> commonCodes = getCodesOf("NTR034"); + addCodes(commonCodes, mav, "NTR034"); + return mav; + } } 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 aa1ca4d2..e6c46226 100644 --- a/src/main/java/cokr/xit/fims/task/web/BpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/BpvController.java @@ -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 diff --git a/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml index 6a18a88b..bb7c151e 100644 --- a/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/exmptn-vhcl-mapper.xml @@ -112,4 +112,76 @@ UPDATE TB_EXMPTN_VHCL WHERE EXMPTN_VHCL_ID = #{exmptnVhclId} + +/* 면제차량 정보 등록(exmptnVhclMapper.insertExemptionVehicleHistory) */ + +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} + +INSERT INTO TB_EXMPTN_VHCL_HSTRY ( + EXMPTN_VHCL_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 + , #{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} + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08010-main.jsp index 90331b98..c7eac889 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08010-main.jsp @@ -24,8 +24,8 @@ @@ -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"}); diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08030-info.jsp new file mode 100644 index 00000000..7df19c3f --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn08030-info.jsp @@ -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"%> +
+
+ +
+
+ \ No newline at end of file