From ffc4d7b8550a5fcc8280979a57d8b30d979f052d Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Wed, 16 Aug 2023 18:51:06 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/crdn/dao/CrdnUpdtMapper.java | 12 ++++- .../xit/fims/crdn/service/bean/CrdnBean.java | 9 ++-- .../crdn/service/bean/CrdnServiceBean.java | 6 ++- .../cokr/xit/fims/task/web/DpvController.java | 2 +- .../sql/mapper/fims/crdn/crdn-updt-mapper.xml | 53 +++++++++++++++---- 5 files changed, 67 insertions(+), 15 deletions(-) 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 e408e09b..97c03eb5 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java @@ -17,7 +17,7 @@ public interface CrdnUpdtMapper extends AbstractMapper { * @param crdn 단속 대장 * @return 저장된 정보수 */ - int updateTagInformation(Crdn crdn); + int updateTagInfo(Crdn crdn); /**단속정보를 변경한다.
* {@link cokr.xit.fims.crdn.service.bean.CrdnBean#update(Crdn)} 참고 @@ -26,9 +26,19 @@ public interface CrdnUpdtMapper extends AbstractMapper { */ int updateCrdn(Crdn crdn); + /**단속 부가 정보를 변경한다.
+ * {@link cokr.xit.fims.crdn.service.bean.CrdnBean#update(Crdn)} 참고 + * @param crdn 단속정보 + * @return 저장된 정보수 + */ + int updateCrdnAddition(Crdn crdn); + /** 단속 자료를 삭제한다. * @param params 삭제 요청 파라미터 * @return 저장된 정보수 */ int removeCrdn(Map map); + + + } 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 1cf6f047..8666e4a7 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 @@ -58,12 +58,15 @@ public class CrdnBean extends AbstractComponent { * */ public boolean update(Map nonQueryRequest, Crdn crdn) { - String updateInfomation = (String)ifEmpty(nonQueryRequest.get("updateInfomation"), "") ; + String updateInfomationType = (String)ifEmpty(nonQueryRequest.get("updateInfomationType"), "") ; - switch (ifEmpty(updateInfomation, () -> "")) { + switch (ifEmpty(updateInfomationType, () -> "")) { case "tagInformationUndefinedData": - return crdnUpdtMapper.updateTagInformation(crdn) == 1 ? true : false; + return crdnUpdtMapper.updateTagInfo(crdn) == 1 ? true : false; default: + if(crdnUpdtMapper.updateCrdnAddition(crdn) != 1) { + return false; + } return crdnUpdtMapper.updateCrdn(crdn) == 1 ? true : false; } } 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 ec81c920..9b70086a 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 @@ -226,7 +226,11 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Override public boolean update(Map nonQueryRequest, Crdn crdn, List newFileInfoList) { - return crdnBean.update(nonQueryRequest, crdn); + if(crdnBean.update(nonQueryRequest, crdn) == false) { + throw new RuntimeException("단속 정보 수정 중 오류가 발생하였습니다."); + } + return true; + } 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 831635ca..5e1f3ddd 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -63,7 +63,7 @@ public class DpvController { @PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do") public ModelAndView update(Crdn crdn) { Map nonQueryRequest = new HashMap(); - nonQueryRequest.put("updateInfomation", "tagInformationUndefinedData"); + nonQueryRequest.put("updateInfomationType", "tagInformationUndefinedData"); boolean saved = crdnService.update(nonQueryRequest, crdn, null); return new ModelAndView("jsonView") .addObject("saved", saved); 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 c899f33d..49883b1b 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 @@ -2,15 +2,6 @@ - - /* 표지정보확인 수정(crdnUpdtMapper.updateTagInformation) */ - UPDATE TB_CRDN_ADI - SET PARKNG_PSBLTY_RSLT_CD = '1' - , MDFCN_DT = /* 수정일시 */ - , MDFR = #{modifiedBy} /* 수정자 */ - WHERE CRDN_ID = #{crdnId} /* 단속 ID */ - - /* 단속정보 수정(crdnUpdtMapper.updateCrdn) */ UPDATE TB_CRDN @@ -46,6 +37,50 @@ WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + +/* 단속 부가정보 수정(crdnUpdtMapper.updateCrdnAddition) */ + UPDATE TB_CRDN_ADI + SET MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + + , OVTIME_YN = #{ovtimeYn} + , CRDN_SPAREA_CD = #{crdnSpareaCd} + + + , DTL_CRDN_PLC = #{dtlCrdnPlc} + , MOSC_X = #{moscX} + , MOSC_Y = #{moscY} + + + , USE_FUEL_CD = #{useFuelCd} + + + , PARKNG_PSBLTY_RSLT_CD = #{parkngBsbltyRsltCd} + + + , VLTN_NMTM = #{vltnNmtm} + + + , CRDN_SE_CD = #{crdnSeCd} + , CRDN_BGNG_TM = #{crdnBgngTm} + , CRDN_END_TM = #{crdnEndTm} + , FFNLG_CARMDL_CD = #{ffnlglCarmdlCd} + + + , CRDN_SN = #{crdnSn} + , TOWNG_YN = #{towngYn} + + WHERE CRDN_ID = #{crdn.crdnId} /* 단속 ID */ + + + + /* 표지정보확인 수정(crdnUpdtMapper.updateTagInfo) */ + UPDATE TB_CRDN_ADI + SET PARKNG_PSBLTY_RSLT_CD = '1' + , MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + /* 단속자료 삭제(crdnUpdtMapper.removeCrdn) */ UPDATE TB_CRDN