diff --git a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java index 07d822c9..f80923fb 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java @@ -74,4 +74,10 @@ public interface CrdnUpdtMapper extends AbstractMapper { */ int deleteCrdnAdi(Map map); + /** 단속 정보의 납부자 ID를 삭제한다. + * @param map 삭제 요청 파라미터 + * @return 저장된 정보수 + */ + int deleteCrdnPayer(Crdn crdn); + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java index ff41dcc2..babf03ca 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java +++ b/src/main/java/cokr/xit/fims/crdn/service/CrdnService.java @@ -67,6 +67,12 @@ public interface CrdnService { */ String removeCrackdown(Crdn crdn); + /** 단속 자료의 납부자 ID를 삭제한다. + * @param crdn 단속정보 + * @return 저장 메시지 + */ + String removeCrackdownPayer(Crdn crdn); + /** 단속 자료의 처리 상태 코드를 수정한다. * @param crdn 단속정보 * @return 저장 메시지 diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java index 0e4a9c17..bad3f9e2 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnBean.java @@ -329,6 +329,30 @@ public class CrdnBean extends AbstractComponent { return rtnMsg; } + /**단속 자료의 납부자 ID를 삭제한다. + * @param crdn 단속 + * @return 저장 여부 + * + */ + public String removeCrackdownPayer(Crdn crdn) { + // 변수 선언 + String rtnMsg = ""; // 처리 결과 메시지 + int effected = 0; + + // 단속(TB_CRDN) 대장에 납부자 ID를 삭제 한다. + effected = crdnUpdtMapper.deleteCrdnPayer(crdn); + if (effected != 1) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("단속 자료의 납부자 정보가 없습니다."); + } + + rtnMsg = "[S] 작업이 정상 처리 되었습니다."; + + return rtnMsg; + } + /**단속 자료의 처리 상태 코드를 수정한다. * @param crdn 단속 * @return 저장 여부 diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java index ac2df297..acdbdfb1 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java @@ -267,6 +267,11 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService return crdnBean.removeCrackdown(crdn); } + @Override + public String removeCrackdownPayer(Crdn crdn) { + return crdnBean.removeCrackdownPayer(crdn); + } + @Override public String updateCrackdownStatus(Crdn crdn) { return crdnBean.updateCrackdownStatus(crdn); diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java index f9177592..200846af 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java @@ -40,6 +40,7 @@ public class Crdn06Controller extends ApplicationController { crackdownManagementMain = "/010/main.do" , getCrackdownList = "/010/list.do" , removeCrackdown = "/010/remove.do" + , removeCrackdownPayer = "/010/removeCrdnPayer.do" , countCrdn = "/010/nocs.do" , getCrackdownInfo = "/020/info.do" , updateCrackdown = "/020/update.do" @@ -160,6 +161,29 @@ public class Crdn06Controller extends ApplicationController { .addObject("rtnMsg", rtnMsg); } + /**지정한 단속 ID에 해당하는 납부자 ID를 제거한다. + * @param crdnID 단속 ID + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + public ModelAndView removeCrackdownPayer(Crdn crdn) { + boolean saved = false; + String rtnMsg = crdnService.removeCrackdownPayer(crdn); + + if (rtnMsg.contains("[S]")) { + saved = true; + } else { + saved = false; + } + + return new ModelAndView("jsonView") + .addObject("saved", saved) + .addObject("rtnMsg", rtnMsg); + } + /**지정한 조회조건으로 단속 건수를 반환한다. * @param CrdnQuery 조회조건 * @return jsonView 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 febe8c36..a8080cdd 100644 --- a/src/main/java/cokr/xit/fims/task/web/BpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/BpvController.java @@ -11,6 +11,7 @@ import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.ExmptnVhcl; import cokr.xit.fims.crdn.Team; +import cokr.xit.fims.crdn.web.Crdn06Controller.METHOD_URL; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.excl.CrdnReReg; import cokr.xit.fims.excl.LevyExcl; @@ -285,6 +286,12 @@ public class BpvController { return super.removeCrackdown(crdn); } + @Override + @RequestMapping(name="전용차로과태료업무 단속자료 납부자 삭제", value=METHOD_URL.removeCrackdownPayer) + public ModelAndView removeCrackdownPayer(Crdn crdn) { + return super.removeCrackdownPayer(crdn); + } + @Override @RequestMapping(name="전용차로과태료업무 단속 건수 조회", value=METHOD_URL.countCrdn) public ModelAndView countCrdn(CrdnQuery query) { diff --git a/src/main/java/cokr/xit/fims/task/web/DpvController.java b/src/main/java/cokr/xit/fims/task/web/DpvController.java index b29f9c6b..131171d3 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -325,6 +325,12 @@ public class DpvController { return super.removeCrackdown(crdn); } + @Override + @RequestMapping(name="장애인과태료업무 단속자료 납부자 삭제", value=METHOD_URL.removeCrackdownPayer) + public ModelAndView removeCrackdownPayer(Crdn crdn) { + return super.removeCrackdownPayer(crdn); + } + @Override @RequestMapping(name="장애인과태료업무 단속 건수 조회", value=METHOD_URL.countCrdn) public ModelAndView countCrdn(CrdnQuery query) { diff --git a/src/main/java/cokr/xit/fims/task/web/EcaController.java b/src/main/java/cokr/xit/fims/task/web/EcaController.java index 46d53f33..221a4555 100644 --- a/src/main/java/cokr/xit/fims/task/web/EcaController.java +++ b/src/main/java/cokr/xit/fims/task/web/EcaController.java @@ -9,6 +9,7 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; +import cokr.xit.fims.crdn.web.Crdn06Controller.METHOD_URL; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.excl.CrdnReReg; import cokr.xit.fims.excl.LevyExcl; @@ -284,6 +285,12 @@ public class EcaController { return super.removeCrackdown(crdn); } + @Override + @RequestMapping(name="전기차과태료업무 단속자료 납부자 삭제", value=METHOD_URL.removeCrackdownPayer) + public ModelAndView removeCrackdownPayer(Crdn crdn) { + return super.removeCrackdownPayer(crdn); + } + @Override @RequestMapping(name="전기차과태료업무 단속 건수 조회", value=METHOD_URL.countCrdn) public ModelAndView countCrdn(CrdnQuery query) { diff --git a/src/main/java/cokr/xit/fims/task/web/PvsController.java b/src/main/java/cokr/xit/fims/task/web/PvsController.java index f0b0619c..f7afb861 100644 --- a/src/main/java/cokr/xit/fims/task/web/PvsController.java +++ b/src/main/java/cokr/xit/fims/task/web/PvsController.java @@ -10,6 +10,7 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.Team; +import cokr.xit.fims.crdn.web.Crdn06Controller.METHOD_URL; import cokr.xit.fims.cvlc.CrdnCvlcpt; import cokr.xit.fims.excl.CrdnReReg; import cokr.xit.fims.excl.LevyExcl; @@ -297,6 +298,12 @@ public class PvsController { return super.removeCrackdown(crdn); } + @Override + @RequestMapping(name="주정차과태료업무 단속자료 납부자 삭제", value=METHOD_URL.removeCrackdownPayer) + public ModelAndView removeCrackdownPayer(Crdn crdn) { + return super.removeCrackdownPayer(crdn); + } + @Override @RequestMapping(name="주정차과태료업무 단속 건수 조회", value=METHOD_URL.countCrdn) public ModelAndView countCrdn(CrdnQuery query) { diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml index 6ec037d5..2af4cbec 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml @@ -80,7 +80,7 @@ , CRDN_SN = #{crdnSn} , TOWNG_YN = #{towngYn} - WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + WHERE CRDN_ID = #{crdnId} @@ -123,51 +123,60 @@ /* 단속 정보 수정(crdnUpdtMapper.updateEditCrdn) */ UPDATE TB_CRDN - SET CRDN_YMD = #{crdnYmd} /* 단속 일자 */ - , CRDN_TM = #{crdnTm} /* 단속 시각 */ - , VHRNO = #{vhrno} /* 차량번호 */ - , CRDN_STDG_NM = #{crdnStdgNm} /* 단속 법정동 명 */ - , CRDN_ROAD_NM = #{crdnRoadNm} /* 단속 도로 명 */ - , CRDN_PLC = #{crdnPlc} /* 단속 장소 */ - , VLTN_ID = (SELECT X.VLTN_ID - FROM TB_VLTN X - WHERE X.SGG_CD = #{sggCd} - AND X.TASK_SE_CD = #{taskSeCd} - AND X.VLTN_CD = #{vltnCd}) /* 위반 ID */ - , GPS_X = #{gpsX} /* GPS X */ - , GPS_Y = #{gpsY} /* GPS Y */ - , VIN = #{vin} /* 차대번호 */ - , VHCL_NM = #{vhclNm} /* 차량 명 */ - , VHCL_COLOR = #{vhclColor} /* 차량 색상 */ - , ETC_CN = #{etcCn} /* 기타 내용 */ - , MDFCN_DT = /* 수정일시 */ - , MDFR = #{modifiedBy} /* 수정자 */ - WHERE CRDN_ID = #{crdnId} /* 단속 ID */ - AND DEL_YN = 'N' /* 삭제 여부 */ + SET CRDN_YMD = #{crdnYmd} + , CRDN_TM = #{crdnTm} + , VHRNO = #{vhrno} + , CRDN_STDG_NM = #{crdnStdgNm} + , CRDN_ROAD_NM = #{crdnRoadNm} + , CRDN_PLC = #{crdnPlc} + , VLTN_ID = (SELECT X.VLTN_ID + FROM TB_VLTN X + WHERE X.SGG_CD = #{sggCd} AND X.TASK_SE_CD = #{taskSeCd} + AND X.VLTN_CD = #{vltnCd}) + , GPS_X = #{gpsX} + , GPS_Y = #{gpsY} + , VIN = #{vin} + , VHCL_NM = #{vhclNm} + , VHCL_COLOR = #{vhclColor} + , ETC_CN = #{etcCn} + , MDFCN_DT = + , MDFR = #{modifiedBy} + WHERE CRDN_ID = #{crdnId} + AND DEL_YN = 'N' /* 단속 정보 삭제(crdnUpdtMapper.deleteCrdn) */ UPDATE TB_CRDN - SET DEL_YN = 'Y' - , DEL_DT = /* 삭제일시 */ - , DLTR = #{removedBy} /* 삭제자 */ - , DEL_RSN = #{delRsn} /* 삭제 사유 */ + SET DEL_YN = 'Y' + , DEL_DT = + , DLTR = #{removedBy} + , DEL_RSN = #{delRsn} WHERE CRDN_ID IN ( #{crdnId} ) - AND DEL_YN = 'N' /* 삭제 여부 */ + AND DEL_YN = 'N' /* 단속 부가 정보 삭제(crdnUpdtMapper.deleteCrdn) */ UPDATE TB_CRDN_ADI - SET DEL_YN = 'Y' - , DEL_DT = /* 삭제일시 */ - , DLTR = #{removedBy} /* 삭제자 */ - , DEL_RSN = #{delRsn} /* 삭제 사유 */ + SET DEL_YN = 'Y' + , DEL_DT = + , DLTR = #{removedBy} + , DEL_RSN = #{delRsn} WHERE CRDN_ID IN ( #{crdnId} ) - AND DEL_YN = 'N' /* 삭제 여부 */ + AND DEL_YN = 'N' + + + /* 단속 정보 삭제(crdnUpdtMapper.deleteCrdn) */ + UPDATE TB_CRDN + SET RTPYR_ID = NULL + , MDFCN_DT = + , MDFR = #{modifiedBy} + WHERE CRDN_ID = #{crdnId} + AND RTPYR_ID = #{rtpyrId} + AND DEL_YN = 'N' \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml b/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml index 2780512d..593c3976 100644 --- a/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/crdnReReg-mapper.xml @@ -221,12 +221,12 @@ /* 단속 재등록 삭제(crdnReRegMapper.deleteCrdnReReg) */ UPDATE TB_CRDN_RE_REG - SET DEL_YN = 'Y' - , DEL_DT = - , DLTR = #{crdnReReg.modifiedBy} - , DEL_RSN = #{crdnReReg.delRsn} - WHERE RE_REG_ID = #{crdnReReg.reRegId} - AND DEL_YN = 'N' + SET DEL_YN = 'Y' + , DEL_DT = + , DLTR = #{crdnReReg.modifiedBy} + , DEL_RSN = #{crdnReReg.delRsn} + WHERE RE_REG_ID = #{crdnReReg.reRegId} + AND DEL_YN = 'N'