면제차량 등록,수정 기능 추가

main
이범준 1 year ago
parent a75f78c24a
commit a63e76f6fb

@ -0,0 +1,91 @@
package cokr.xit.fims.crdn;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ExmptnVhcl extends AbstractEntity {
/**
* ID
*/
private String exmptnVhclId;
/**
*
*/
private String sggCd;
/**
*
*/
private String vhrno;
/**
*
*/
private String exmptnRsn;
/**
*
*/
private String docNo;
/**
*
*/
private String ownrNm;
/**
*
*/
private String exmptnBgngYmd;
/**
*
*/
private String exmptnEndYmd;
/**
*
*/
private String delYn;
/**
*
*/
private String regDt;
/**
*
*/
private String rgtr;
/**
*
*/
private String mdfcnDt;
/**
*
*/
private String mdfr;
/**
*
*/
private String delDt;
/**
*
*/
private String dltr;
/**
*
*/
private String delRsn;
}

@ -5,6 +5,7 @@ import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -23,4 +24,16 @@ public interface ExmptnVhclMapper extends AbstractMapper {
*/ */
DataObject selectExemptionVehicleInfo(String exemptionVehicleId); DataObject selectExemptionVehicleInfo(String exemptionVehicleId);
/** .
* @param exmptnVhcl
* return
*/
int insertExmptnVhclInfo(ExmptnVhcl exmptnVhcl);
/** .
* @param exmptnVhcl
* return
*/
int updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl);
} }

@ -3,6 +3,7 @@ package cokr.xit.fims.crdn.service;
import java.util.List; import java.util.List;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
import cokr.xit.fims.crdn.parsing.LayoutDescriptor; import cokr.xit.fims.crdn.parsing.LayoutDescriptor;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -38,4 +39,16 @@ public interface CrdnStngService {
*/ */
DataObject getExemptionVehicleInfo(String exemptionVehicleId); DataObject getExemptionVehicleInfo(String exemptionVehicleId);
/** .
* @param exmptnVhcl
* @return
*/
boolean createExmptnVhclInfo(ExmptnVhcl exmptnVhcl);
/** .
* @param exmptnVhcl
* @return
*/
boolean updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl);
} }

@ -9,6 +9,7 @@ import org.springframework.stereotype.Component;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
import cokr.xit.fims.crdn.dao.CrdnTeamMapper; import cokr.xit.fims.crdn.dao.CrdnTeamMapper;
import cokr.xit.fims.crdn.dao.ExmptnVhclMapper; import cokr.xit.fims.crdn.dao.ExmptnVhclMapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
@ -248,4 +249,26 @@ public class CrdnStngBean extends AbstractComponent {
return exmptnVhclMapper.selectExemptionVehicleInfo(exemptionVehicleId); return exmptnVhclMapper.selectExemptionVehicleInfo(exemptionVehicleId);
} }
/** .
* @param exmptnVhcl
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
return exmptnVhclMapper.insertExmptnVhclInfo(exmptnVhcl) == 1 ? true : false;
}
/** .
* @param exmptnVhcl
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
return exmptnVhclMapper.updateExmptnVhclInfo(exmptnVhcl) == 1 ? true : false;
}
} }

@ -7,6 +7,7 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
import cokr.xit.fims.crdn.parsing.LayoutDescriptor; import cokr.xit.fims.crdn.parsing.LayoutDescriptor;
import cokr.xit.fims.crdn.service.CrdnStngService; import cokr.xit.fims.crdn.service.CrdnStngService;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
@ -48,4 +49,14 @@ public class CrdnStngServiceBean extends AbstractServiceBean implements CrdnStng
return crdnStngBean.getExemptionVehicleInfo(exemptionVehicleId); return crdnStngBean.getExemptionVehicleInfo(exemptionVehicleId);
} }
@Override
public boolean createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
return crdnStngBean.createExmptnVhclInfo(exmptnVhcl);
}
@Override
public boolean updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
return crdnStngBean.updateExmptnVhclInfo(exmptnVhcl);
}
} }

@ -12,6 +12,7 @@ import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.user.dao.UserMapper;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
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; import cokr.xit.foundation.data.DataObject;
@ -29,6 +30,8 @@ public class Crdn08Controller extends ApplicationController {
exemptionVehicleManagementMain = "/010/main.do" exemptionVehicleManagementMain = "/010/main.do"
, getExemptionVehicleList = "/010/list.do" , getExemptionVehicleList = "/010/list.do"
, getExemptionVehicleInfo = "/020/info.do" , getExemptionVehicleInfo = "/020/info.do"
, createExmptnVhclInfo = "/020/create.do"
, updateExmptnVhclInfo = "/020/update.do"
; ;
} }
@ -90,4 +93,50 @@ public class Crdn08Controller extends ApplicationController {
return mav; return mav;
} }
/** .
* {@link CrdnStngService#createExmptnVhclInfo(exmptnVhcl)}
* @param exmptnVhcl
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
String deptCd = currentUser.getDeptCode();
exmptnVhcl.setSggCd(globalStngMapper.selectSggCd(deptCd));
boolean saved = false;
saved = crdnStngService.createExmptnVhclInfo(exmptnVhcl);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* {@link CrdnStngService#updateExmptnVhclInfo(exmptnVhcl)}
* @param exmptnVhcl
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
String deptCd = currentUser.getDeptCode();
exmptnVhcl.setSggCd(globalStngMapper.selectSggCd(deptCd));
boolean saved = false;
saved = crdnStngService.updateExmptnVhclInfo(exmptnVhcl);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
} }

@ -9,6 +9,7 @@ import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.ExmptnVhcl;
import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.excl.CrdnReReg; import cokr.xit.fims.excl.CrdnReReg;
import cokr.xit.fims.excl.ExclQuery; import cokr.xit.fims.excl.ExclQuery;
@ -324,6 +325,17 @@ public class BpvController {
return super.getExemptionVehicleInfo(exmptnVhclId); return super.getExemptionVehicleInfo(exmptnVhclId);
} }
@Override
@RequestMapping(name="전용차로과태료업무 면제차량 정보 등록", value=METHOD_URL.createExmptnVhclInfo)
public ModelAndView createExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
return super.createExmptnVhclInfo(exmptnVhcl);
}
@Override
@RequestMapping(name="전용차로과태료업무 면제차량 정보 수정", value=METHOD_URL.updateExmptnVhclInfo)
public ModelAndView updateExmptnVhclInfo(ExmptnVhcl exmptnVhcl) {
return super.updateExmptnVhclInfo(exmptnVhcl);
}
} }
@Controller @Controller

@ -50,4 +50,56 @@ 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">
/* 면제차량 정보 등록(exmptnVhclMapper.insertExmptnVhclInfo) */
<selectKey resultType="string" keyProperty="exmptnVhclId" keyColumn="NEW_ID" order="BEFORE">
SELECT
LPAD(CAST(IFNULL(MAX(EXMPTN_VHCL_ID) + 1, 1) AS INT), 10, '0')
AS NEW_ID
FROM TB_EXMPTN_VHCL
</selectKey>
INSERT INTO TB_EXMPTN_VHCL (
EXMPTN_VHCL_ID <!-- 면제 차량 ID -->
, SGG_CD <!-- 시군구 코드 -->
, VHRNO <!-- 차량 번호 -->
, EXMPTN_RSN <!-- 면제 사유 -->
, DOC_NO <!-- 문서번호 -->
, OWNR_NM <!-- 소유자명 -->
, EXMPTN_BGNG_YMD <!-- 면제 시작 일자-->
, EXMPTN_END_YMD <!-- 면제 종료 일자 -->
, DEL_YN <!-- 삭제 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, MDFCN_DT <!-- 수정 일시 -->
, MDFR <!-- 수정자 -->
) VALUES (
#{exmptnVhclId} <!-- 면제 차량 ID -->
, #{sggCd} <!-- 시군구 코드 -->
, #{vhrno} <!-- 차량 번호 -->
, #{exmptnRsn} <!-- 면제 사유 -->
, #{docNo} <!-- 문서번호 -->
, #{ownrNm} <!-- 소유자명 -->
, #{exmptnBgngYmd} <!-- 면제 시작 일자-->
, #{exmptnEndYmd} <!-- 면제 종료 일자 -->
, 'N' <!-- 삭제 여부 -->
, #{createdAt} <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
, #{lastModified} <!-- 수정 일시 -->
, #{modifiedBy} <!-- 수정자 -->
)
</insert>
<update id="updateExmptnVhclInfo" parameterType="cokr.xit.fims.crdn.ExmptnVhcl">
/* 면제차량 정보 수정(exmptnVhclMapper.updateExmptnVhclInfo) */
UPDATE TB_EXMPTN_VHCL
SET EXMPTN_RSN = #{exmptnRsn} <!-- 면제 사유 -->
, DOC_NO = #{docNo} <!-- 문서번호 -->
, OWNR_NM = #{ownrNm} <!-- 소유자명 -->
, EXMPTN_BGNG_YMD = #{exmptnBgngYmd} <!-- 면제 시작 일자 -->
, EXMPTN_END_YMD = #{exmptnEndYmd} <!-- 면제 종료 일자 -->
, MDFCN_DT = #{lastModified} <!-- 수정 일시 -->
, MDFR = #{modifiedBy} <!-- 수정자 -->
WHERE EXMPTN_VHCL_ID = #{exmptnVhclId}
</update>
</mapper> </mapper>

@ -119,7 +119,6 @@
pageObject["${pageName}"] = {}; pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
@ -159,7 +158,20 @@ $(document).ready(function(){
title: "면제차량 등록", title: "면제차량 등록",
content:resp, content:resp,
size: "lg", size: "lg",
init:() => {} init:() => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if($P.provide[reqKey]){
parentRes[reqKey] = $P.provide[reqKey];
} else {
parentRes[reqKey] = function(){};
}
}
pageObject.parentRes.push(parentRes);
}
}); });
} }
}); });
@ -175,7 +187,20 @@ $(document).ready(function(){
title: "면제차량 수정", title: "면제차량 수정",
content:resp, content:resp,
size: "lg", size: "lg",
init:() => {} init:() => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if($P.provide[reqKey]){
parentRes[reqKey] = $P.provide[reqKey];
} else {
parentRes[reqKey] = function(){};
}
}
pageObject.parentRes.push(parentRes);
}
}); });
} }
}); });
@ -318,6 +343,12 @@ $(document).ready(function(){
return data; return data;
} }
$P.provide = {
"refreshList" : function(){
$P.refreshExmptnVhclList();
}
}
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/

@ -72,11 +72,22 @@
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = {}; pageObject["${pageName}"] = {};
pageObject["${pageName}"].provided = {};
pageObject.childReq = [];
pageObject.childReq.push({
refreshList : function(){}
});
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
if(pageObject.parentRes.length > 0){
$P.provided = pageObject.parentRes.pop();
} else {
$P.provided = pageObject.childReq.pop();
}
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, Dataset, FormFields
@ -105,8 +116,8 @@ $(document).ready(function(){
$P.exmptnVhclControl.save = (info) => { $P.exmptnVhclControl.save = (info) => {
if (!info) return; if (!info) return;
var item = $P.exmptnVhclControl.getCurrent("item"),
create = "added" == item.state; var create = isEmpty(info.exmptnVhclId);
ajax.post({ ajax.post({
url : !create ? $P.exmptnVhclControl.urls.update : $P.exmptnVhclControl.urls.create, url : !create ? $P.exmptnVhclControl.urls.update : $P.exmptnVhclControl.urls.create,
@ -122,6 +133,7 @@ $(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");
} }
}; };

Loading…
Cancel
Save